IBM-Cloud / bluemix-go

Go library for accessing the Bluemix API
Apache License 2.0
37 stars 89 forks source link

add ingress secret field support #393

Closed theodoracheng closed 1 year ago

theodoracheng commented 1 year ago
theodoracheng commented 1 year ago
go run examples/container/V2containers/IngressV2/main.go --field-crn crn:v1:staging:public:secrets-manager:eu-gb:a/8c18c7b678fb46db900ea9f5815ac2e2:d151bd36-2815-45e5-92b8-5b70dcdad684:secret:e1bd1187-c418-4765-5868-bcc06e0c6c3f --instance-crn crn:v1:staging:public:secrets-manager:eu-gb:a/8c18c7b678fb46db900ea9f5815ac2e2:0470669d-9873-4bab-9f33-df67387335ef:: --clusterNameOrID chrlmpl20n0bn1v97b0g
[DEBUG] REQUEST: [2023-05-31T16:47:20-05:00] POST /identity/token HTTP/1.1
Host: iam.test.cloud.ibm.com
Accept: application/json
Accept-Language: en
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/x-www-form-urlencoded
User-Agent: Bluemix-go SDK 0.1 / darwin
X-Original-User-Agent: 

apikey=[PRIVATE DATA HIDDEN]&grant_type=urn%3Aibm%3Aparams%3Aoauth%3Agrant-type%3Aapikey&response_type=cloud_iam
[DEBUG] RESPONSE: [2023-05-31T16:47:21-05:00] Elapsed: 282ms HTTP/1.1 200 OK
Content-Length: 3402
Akamai-Grn: 0.0a931ab8.1685569641.5acffec4
Cache-Control: no-cache, no-store, must-revalidate
Connection: keep-alive
Content-Language: en-US
Content-Type: application/json
Date: Wed, 31 May 2023 21:47:21 GMT
Expires: 0
Pragma: no-cache
Strict-Transport-Security: max-age=31536000; includeSubDomains
Transaction-Id: d3FzajI-abff0f2bbb744ee188483090efd2c9bc
X-Content-Type-Options: nosniff
X-Correlation-Id: d3FzajI-abff0f2bbb744ee188483090efd2c9bc
X-Proxy-Upstream-Service-Time: 55
X-Request-Id: 4902f777-803f-47c4-b24f-b3c95585226e

{"access_token":"[PRIVATE DATA HIDDEN]","refresh_token":"[PRIVATE DATA HIDDEN]","token_type":"[PRIVATE DATA HIDDEN]","expires_in":1200,"expiration":1685570838,"refresh_token_expiration":1685656041,"scope":"ibm openid","session_id":"C-fc559322-0efc-431d-85f8-4eface9585cd"}
[DEBUG] REQUEST: [2023-05-31T16:47:21-05:00] POST /ingress/v2/secret/registerInstance HTTP/1.1
Host: origin.containers.test.cloud.ibm.com
Accept: application/json
Accept-Language: en
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
User-Agent: Bluemix-go SDK 0.1 / darwin
X-Auth-Refresh-Token: [PRIVATE DATA HIDDEN]
X-Original-User-Agent: 

{"cluster":"chrlmpl20n0bn1v97b0g","crn":"crn:v1:staging:public:secrets-manager:eu-gb:a/8c18c7b678fb46db900ea9f5815ac2e2:0470669d-9873-4bab-9f33-df67387335ef::","isDefault":false,"secretGroupID":""}
[DEBUG] RESPONSE: [2023-05-31T16:47:23-05:00] Elapsed: 1804ms HTTP/1.1 200 OK
Content-Length: 328
Cache-Control: max-age=0, no-cache, no-store
Connection: keep-alive
Content-Security-Policy: default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self'
Content-Type: application/json; charset=utf-8
Date: Wed, 31 May 2023 21:47:22 GMT
Expires: Wed, 31 May 2023 21:47:22 GMT
Pragma: no-cache
Server-Timing: cdn-cache; desc=MISS
Server-Timing: edge; dur=35
Server-Timing: origin; dur=1623
Server-Timing: ak_p; desc="468213_388971387_668547088_165762_2632_24_-";dur=1
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Hostname: armada-ingress-secret-mgr-6f7649ffb6-rj4mv
X-Permitted-Cross-Domain-Policies: master-only
X-Request-Id: 92903527-f9d9-492f-bb44-5d155e04d38f
X-Xss-Protection: 1; mode=block

{"cluster":"chrlmpl20n0bn1v97b0g","name":"fvt-ingress-sm-2","crn":"crn:v1:staging:public:secrets-manager:eu-gb:a/8c18c7b678fb46db900ea9f5815ac2e2:0470669d-9873-4bab-9f33-df67387335ef::","secretGroupID":"","secretGroupName":"","callbackChannel":"","userManaged":true,"isDefault":false,"type":"secrets-manager","status":"created"}
[DEBUG] REQUEST: [2023-05-31T16:47:23-05:00] GET /ingress/v2/secret/getInstance?cluster=chrlmpl20n0bn1v97b0g&name=fvt-ingress-sm-2 HTTP/1.1
Host: origin.containers.test.cloud.ibm.com
Accept: application/json
Accept-Language: en
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
User-Agent: Bluemix-go SDK 0.1 / darwin
X-Auth-Refresh-Token: [PRIVATE DATA HIDDEN]
X-Original-User-Agent: 

[DEBUG] RESPONSE: [2023-05-31T16:47:23-05:00] Elapsed: 179ms HTTP/1.1 200 OK
Content-Length: 328
Cache-Control: max-age=0, no-cache, no-store
Connection: keep-alive
Content-Security-Policy: default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self'
Content-Type: application/json; charset=utf-8
Date: Wed, 31 May 2023 21:47:23 GMT
Expires: Wed, 31 May 2023 21:47:23 GMT
Pragma: no-cache
Server-Timing: cdn-cache; desc=MISS
Server-Timing: edge; dur=14
Server-Timing: origin; dur=135
Server-Timing: ak_p; desc="468213_388971387_668549625_15238_3094_32_-";dur=1
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Hostname: armada-ingress-secret-mgr-6f7649ffb6-v6kbf
X-Permitted-Cross-Domain-Policies: master-only
X-Request-Id: ca412a3e-7b49-4a6b-8dd9-c70b481d5556
X-Xss-Protection: 1; mode=block

{"cluster":"chrlmpl20n0bn1v97b0g","name":"fvt-ingress-sm-2","crn":"crn:v1:staging:public:secrets-manager:eu-gb:a/8c18c7b678fb46db900ea9f5815ac2e2:0470669d-9873-4bab-9f33-df67387335ef::","secretGroupID":"","secretGroupName":"","callbackChannel":"","userManaged":true,"isDefault":false,"type":"secrets-manager","status":"created"}
[DEBUG] REQUEST: [2023-05-31T16:47:23-05:00] POST /ingress/v2/secret/unregisterInstance HTTP/1.1
Host: origin.containers.test.cloud.ibm.com
Accept: application/json
Accept-Language: en
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
User-Agent: Bluemix-go SDK 0.1 / darwin
X-Auth-Refresh-Token: [PRIVATE DATA HIDDEN]
X-Original-User-Agent: 

{"cluster":"chrlmpl20n0bn1v97b0g","name":"fvt-ingress-sm-2"}
[DEBUG] RESPONSE: [2023-05-31T16:47:24-05:00] Elapsed: 945ms HTTP/1.1 200 OK
Content-Length: 314
Cache-Control: max-age=0, no-cache, no-store
Connection: keep-alive
Content-Security-Policy: default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self'
Content-Type: application/json; charset=utf-8
Date: Wed, 31 May 2023 21:47:24 GMT
Expires: Wed, 31 May 2023 21:47:24 GMT
Pragma: no-cache
Server-Timing: cdn-cache; desc=MISS
Server-Timing: edge; dur=11
Server-Timing: origin; dur=893
Server-Timing: ak_p; desc="468213_388971387_668550023_91507_2070_30_-";dur=1
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Hostname: armada-ingress-secret-mgr-6f7649ffb6-wdxld
X-Permitted-Cross-Domain-Policies: master-only
X-Request-Id: 80b9b879-4098-49f1-b9ff-19afec7c33de
X-Xss-Protection: 1; mode=block

{"cluster":"chrlmpl20n0bn1v97b0g","name":"fvt-ingress-sm-2","crn":"crn:v1:staging:public:secrets-manager:eu-gb:a/8c18c7b678fb46db900ea9f5815ac2e2:0470669d-9873-4bab-9f33-df67387335ef::","secretGroupID":"","secretGroupName":"","callbackChannel":"","userManaged":false,"isDefault":false,"type":"","status":"deleted"}
[DEBUG] REQUEST: [2023-05-31T16:47:24-05:00] POST /ingress/v2/secret/createSecret HTTP/1.1
Host: origin.containers.test.cloud.ibm.com
Accept: application/json
Accept-Language: en
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
User-Agent: Bluemix-go SDK 0.1 / darwin
X-Auth-Refresh-Token: [PRIVATE DATA HIDDEN]
X-Original-User-Agent: 

{"cluster":"chrlmpl20n0bn1v97b0g","name":"testabc123","namespace":"","crn":"","persistence":true,"type":"Opaque","add":[{"name":"","crn":"crn:v1:staging:public:secrets-manager:eu-gb:a/8c18c7b678fb46db900ea9f5815ac2e2:d151bd36-2815-45e5-92b8-5b70dcdad684:secret:e1bd1187-c418-4765-5868-bcc06e0c6c3f","append_prefix":false}]}
[DEBUG] RESPONSE: [2023-05-31T16:47:27-05:00] Elapsed: 2962ms HTTP/1.1 200 OK
Content-Length: 511
Cache-Control: max-age=0, no-cache, no-store
Connection: keep-alive
Content-Security-Policy: default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self'
Content-Type: application/json; charset=utf-8
Date: Wed, 31 May 2023 21:47:27 GMT
Expires: Wed, 31 May 2023 21:47:27 GMT
Pragma: no-cache
Server-Timing: cdn-cache; desc=MISS
Server-Timing: edge; dur=145
Server-Timing: origin; dur=2773
Server-Timing: ak_p; desc="468213_388971387_668551536_293642_2053_28_-";dur=1
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Hostname: armada-ingress-secret-mgr-6f7649ffb6-rj4mv
X-Permitted-Cross-Domain-Policies: master-only
X-Request-Id: fad724a3-8048-4bfe-b27a-c90bf3ef2472
X-Xss-Protection: 1; mode=block

{"cluster":"chrlmpl20n0bn1v97b0g","name":"testabc123","namespace":"ibm-cert-store","domain":"","crn":"","expiresOn":"","status":"created","userManaged":true,"persistence":true,"type":"Opaque","secretType":"","lastUpdatedTimestamp":"","fields":[{"name":"key","crn":"crn:v1:staging:public:secrets-manager:eu-gb:a/8c18c7b678fb46db900ea9f5815ac2e2:d151bd36-2815-45e5-92b8-5b70dcdad684:secret:e1bd1187-c418-4765-5868-bcc06e0c6c3f","expiresOn":"","secretType":"kv","lastUpdatedTimestamp":"2023-05-31T21:47:26+0000"}]}
[DEBUG] REQUEST: [2023-05-31T16:47:27-05:00] GET /ingress/v2/secret/getSecret?cluster=chrlmpl20n0bn1v97b0g&name=testabc123&namespace=ibm-cert-store HTTP/1.1
Host: origin.containers.test.cloud.ibm.com
Accept: application/json
Accept-Language: en
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
User-Agent: Bluemix-go SDK 0.1 / darwin
X-Auth-Refresh-Token: [PRIVATE DATA HIDDEN]
X-Original-User-Agent: 

[DEBUG] RESPONSE: [2023-05-31T16:47:27-05:00] Elapsed: 747ms HTTP/1.1 200 OK
Content-Length: 511
Cache-Control: max-age=0, no-cache, no-store
Connection: keep-alive
Content-Security-Policy: default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self'
Content-Type: application/json; charset=utf-8
Date: Wed, 31 May 2023 21:47:27 GMT
Expires: Wed, 31 May 2023 21:47:27 GMT
Pragma: no-cache
Server-Timing: cdn-cache; desc=MISS
Server-Timing: edge; dur=149
Server-Timing: origin; dur=551
Server-Timing: ak_p; desc="468213_388971387_668555983_73351_2719_27_-";dur=1
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Hostname: armada-ingress-secret-mgr-6f7649ffb6-599kl
X-Permitted-Cross-Domain-Policies: master-only
X-Request-Id: ae211732-b58b-4545-9819-7f87aa4418cb
X-Xss-Protection: 1; mode=block

{"cluster":"chrlmpl20n0bn1v97b0g","name":"testabc123","namespace":"ibm-cert-store","domain":"","crn":"","expiresOn":"","status":"created","userManaged":true,"persistence":true,"type":"Opaque","secretType":"","lastUpdatedTimestamp":"","fields":[{"name":"key","crn":"crn:v1:staging:public:secrets-manager:eu-gb:a/8c18c7b678fb46db900ea9f5815ac2e2:d151bd36-2815-45e5-92b8-5b70dcdad684:secret:e1bd1187-c418-4765-5868-bcc06e0c6c3f","expiresOn":"","secretType":"kv","lastUpdatedTimestamp":"2023-05-31T21:47:26+0000"}]}
[DEBUG] REQUEST: [2023-05-31T16:47:27-05:00] POST /ingress/v2/secret/removeField HTTP/1.1
Host: origin.containers.test.cloud.ibm.com
Accept: application/json
Accept-Language: en
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
User-Agent: Bluemix-go SDK 0.1 / darwin
X-Auth-Refresh-Token: [PRIVATE DATA HIDDEN]
X-Original-User-Agent: 

{"cluster":"chrlmpl20n0bn1v97b0g","name":"testabc123","namespace":"ibm-cert-store","crn":"","add":null,"remove":[{"name":"key"}]}
[DEBUG] RESPONSE: [2023-05-31T16:47:29-05:00] Elapsed: 1842ms HTTP/1.1 200 OK
Content-Length: 242
Cache-Control: max-age=0, no-cache, no-store
Connection: keep-alive
Content-Security-Policy: default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self'
Content-Type: application/json; charset=utf-8
Date: Wed, 31 May 2023 21:47:29 GMT
Expires: Wed, 31 May 2023 21:47:29 GMT
Pragma: no-cache
Server-Timing: cdn-cache; desc=MISS
Server-Timing: edge; dur=110
Server-Timing: origin; dur=1676
Server-Timing: ak_p; desc="468213_388971387_668557181_182126_2085_26_-";dur=1
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Hostname: armada-ingress-secret-mgr-6f7649ffb6-zjzbw
X-Permitted-Cross-Domain-Policies: master-only
X-Request-Id: 78e205dd-b699-4b39-bba7-28b4cf080128
X-Xss-Protection: 1; mode=block

{"cluster":"chrlmpl20n0bn1v97b0g","name":"testabc123","namespace":"ibm-cert-store","domain":"","crn":"","expiresOn":"","status":"created","userManaged":true,"persistence":true,"type":"","secretType":"","lastUpdatedTimestamp":"","fields":null}
[DEBUG] REQUEST: [2023-05-31T16:47:29-05:00] POST /ingress/v2/secret/deleteSecret HTTP/1.1
Host: origin.containers.test.cloud.ibm.com
Accept: application/json
Accept-Language: en
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
User-Agent: Bluemix-go SDK 0.1 / darwin
X-Auth-Refresh-Token: [PRIVATE DATA HIDDEN]
X-Original-User-Agent: 

{"cluster":"chrlmpl20n0bn1v97b0g","name":"testabc123","namespace":"ibm-cert-store"}
[DEBUG] RESPONSE: [2023-05-31T16:47:31-05:00] Elapsed: 2239ms HTTP/1.1 204 No Content
Content-Length: 0
Cache-Control: max-age=0, no-cache, no-store
Connection: keep-alive
Content-Security-Policy: default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self'
Date: Wed, 31 May 2023 21:47:31 GMT
Expires: Wed, 31 May 2023 21:47:31 GMT
Pragma: no-cache
Server-Timing: cdn-cache; desc=MISS
Server-Timing: edge; dur=14
Server-Timing: origin; dur=2140
Server-Timing: ak_p; desc="468213_388971387_668560047_220705_2170_25_-";dur=1
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Hostname: armada-ingress-secret-mgr-6f7649ffb6-mwxxd
X-Permitted-Cross-Domain-Policies: master-only
X-Request-Id: e482ded6-c5bf-4535-8539-8863abcaad41
X-Xss-Protection: 1; mode=block