Skip to content

Commit b776b68

Browse files
chore: add wget example and cross-reference to ´ocm get credentials` docs (#1880)
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> <!-- markdownlint-disable MD041 --> #### What this PR does / why we need it Adds cross reference from wget access method to credential mapping and add an example for wget in ocmconfig. #### Which issue(s) this PR is related to Related to #1821 Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com> Co-authored-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
1 parent b821149 commit b776b68

8 files changed

Lines changed: 53 additions & 0 deletions

File tree

api/ocm/extensions/accessmethods/wget/cli.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package wget
22

33
import (
44
"ocm.software/ocm/api/ocm/extensions/accessmethods/options"
5+
"ocm.software/ocm/api/tech/wget/identity"
56
"ocm.software/ocm/api/utils/cobrautils/flagsets"
67
"ocm.software/ocm/api/utils/mime"
78
)
@@ -68,4 +69,7 @@ This OPTIONAL property describes the http body to be included in the request.
6869
6970
This OPTIONAL property describes whether http redirects should be disabled. If omitted,
7071
it is defaulted to false (so, per default, redirects are enabled).
72+
73+
It uses the consumer identity type ` + identity.CONSUMER_TYPE + ` with the fields
74+
for a hostpath identity matcher (see <CMD>ocm get credentials</CMD>).
7175
`

cmds/ocm/topics/common/config/topic.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,28 @@ configurations:
2222
- type: attributes.config.ocm.software
2323
attributes: # map of attribute settings
2424
compat: true
25+
# Scripts configuration example
2526
# - type: scripts.ocm.config.ocm.software
2627
# scripts:
2728
# "default":
2829
# script:
2930
# process: true
31+
# wget credential configuration example
32+
# - type: credentials.config.ocm.software
33+
# consumers:
34+
# - identity:
35+
# type: wget
36+
# hostname: example.com
37+
# # scheme: https (optional)
38+
# # port: 443 (optional)
39+
# # pathprefix: /api (optional)
40+
# credentials:
41+
# - type: Credentials
42+
# properties:
43+
# username: myuser
44+
# password: mypassword
45+
# # or identityToken: bearer‑token
46+
# # or certificate, privateKey, certificateAuthority for mTLS
3047
`,
3148
Annotations: map[string]string{"ExampleCodeStyle": "yaml"},
3249
Long: `

docs/reference/ocm_add_resource-configuration.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,9 @@ shown below.
10061006
This OPTIONAL property describes whether http redirects should be disabled. If omitted,
10071007
it is defaulted to false (so, per default, redirects are enabled).
10081008

1009+
It uses the consumer identity type wget with the fields
1010+
for a hostpath identity matcher (see [ocm get credentials](ocm_get_credentials.md)).
1011+
10091012
Options used to configure fields: <code>--body</code>, <code>--header</code>, <code>--mediaType</code>, <code>--noredirect</code>, <code>--url</code>, <code>--verb</code>
10101013

10111014

docs/reference/ocm_add_resources.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,9 @@ shown below.
10181018
This OPTIONAL property describes whether http redirects should be disabled. If omitted,
10191019
it is defaulted to false (so, per default, redirects are enabled).
10201020

1021+
It uses the consumer identity type wget with the fields
1022+
for a hostpath identity matcher (see [ocm get credentials](ocm_get_credentials.md)).
1023+
10211024
Options used to configure fields: <code>--body</code>, <code>--header</code>, <code>--mediaType</code>, <code>--noredirect</code>, <code>--url</code>, <code>--verb</code>
10221025

10231026

docs/reference/ocm_add_source-configuration.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,9 @@ shown below.
10061006
This OPTIONAL property describes whether http redirects should be disabled. If omitted,
10071007
it is defaulted to false (so, per default, redirects are enabled).
10081008

1009+
It uses the consumer identity type wget with the fields
1010+
for a hostpath identity matcher (see [ocm get credentials](ocm_get_credentials.md)).
1011+
10091012
Options used to configure fields: <code>--body</code>, <code>--header</code>, <code>--mediaType</code>, <code>--noredirect</code>, <code>--url</code>, <code>--verb</code>
10101013

10111014

docs/reference/ocm_add_sources.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,9 @@ shown below.
10161016
This OPTIONAL property describes whether http redirects should be disabled. If omitted,
10171017
it is defaulted to false (so, per default, redirects are enabled).
10181018

1019+
It uses the consumer identity type wget with the fields
1020+
for a hostpath identity matcher (see [ocm get credentials](ocm_get_credentials.md)).
1021+
10191022
Options used to configure fields: <code>--body</code>, <code>--header</code>, <code>--mediaType</code>, <code>--noredirect</code>, <code>--url</code>, <code>--verb</code>
10201023

10211024

docs/reference/ocm_configfile.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,28 @@ configurations:
389389
- type: attributes.config.ocm.software
390390
attributes: # map of attribute settings
391391
compat: true
392+
# Scripts configuration example
392393
# - type: scripts.ocm.config.ocm.software
393394
# scripts:
394395
# "default":
395396
# script:
396397
# process: true
398+
# wget credential configuration example
399+
# - type: credentials.config.ocm.software
400+
# consumers:
401+
# - identity:
402+
# type: wget
403+
# hostname: example.com
404+
# # scheme: https (optional)
405+
# # port: 443 (optional)
406+
# # pathprefix: /api (optional)
407+
# credentials:
408+
# - type: Credentials
409+
# properties:
410+
# username: myuser
411+
# password: mypassword
412+
# # or identityToken: bearer‑token
413+
# # or certificate, privateKey, certificateAuthority for mTLS
397414
```
398415

399416
### SEE ALSO

docs/reference/ocm_ocm-accessmethods.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ shown below.
391391
This OPTIONAL property describes whether http redirects should be disabled. If omitted,
392392
it is defaulted to false (so, per default, redirects are enabled).
393393

394+
It uses the consumer identity type wget with the fields
395+
for a hostpath identity matcher (see [ocm get credentials](ocm_get_credentials.md)).
396+
394397
Options used to configure fields: <code>--body</code>, <code>--header</code>, <code>--mediaType</code>, <code>--noredirect</code>, <code>--url</code>, <code>--verb</code>
395398

396399
### SEE ALSO

0 commit comments

Comments
 (0)