ibm-cloud-sdk-core 4.0.0 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.secrets.baseline +20 -30
- package/CHANGELOG.md +16 -4
- package/MIGRATION-V4.md +54 -0
- package/auth/authenticators/authenticator-interface.d.ts +3 -4
- package/auth/authenticators/authenticator-interface.js +1 -1
- package/auth/authenticators/authenticator.d.ts +5 -9
- package/auth/authenticators/authenticator.js +4 -8
- package/auth/authenticators/basic-authenticator.d.ts +12 -12
- package/auth/authenticators/basic-authenticator.js +12 -12
- package/auth/authenticators/bearer-token-authenticator.d.ts +11 -14
- package/auth/authenticators/bearer-token-authenticator.js +11 -14
- package/auth/authenticators/cloud-pak-for-data-authenticator.d.ts +15 -15
- package/auth/authenticators/cloud-pak-for-data-authenticator.js +15 -15
- package/auth/authenticators/container-authenticator.d.ts +23 -23
- package/auth/authenticators/container-authenticator.js +23 -23
- package/auth/authenticators/iam-authenticator.d.ts +20 -20
- package/auth/authenticators/iam-authenticator.js +20 -20
- package/auth/authenticators/iam-request-based-authenticator.d.ts +23 -25
- package/auth/authenticators/iam-request-based-authenticator.js +23 -25
- package/auth/authenticators/token-request-based-authenticator.d.ts +19 -24
- package/auth/authenticators/token-request-based-authenticator.js +19 -24
- package/auth/authenticators/vpc-instance-authenticator.d.ts +17 -16
- package/auth/authenticators/vpc-instance-authenticator.js +17 -16
- package/auth/token-managers/container-token-manager.d.ts +23 -25
- package/auth/token-managers/container-token-manager.js +23 -25
- package/auth/token-managers/cp4d-token-manager.d.ts +13 -13
- package/auth/token-managers/cp4d-token-manager.js +13 -13
- package/auth/token-managers/iam-request-based-token-manager.d.ts +26 -31
- package/auth/token-managers/iam-request-based-token-manager.js +26 -31
- package/auth/token-managers/iam-token-manager.d.ts +17 -16
- package/auth/token-managers/iam-token-manager.js +17 -16
- package/auth/token-managers/jwt-token-manager.d.ts +10 -13
- package/auth/token-managers/jwt-token-manager.js +13 -16
- package/auth/token-managers/token-manager.d.ts +23 -35
- package/auth/token-managers/token-manager.js +22 -34
- package/auth/token-managers/vpc-instance-token-manager.d.ts +15 -15
- package/auth/token-managers/vpc-instance-token-manager.js +15 -15
- package/auth/utils/get-authenticator-from-environment.d.ts +2 -2
- package/auth/utils/get-authenticator-from-environment.js +2 -2
- package/auth/utils/helpers.d.ts +34 -32
- package/auth/utils/helpers.js +34 -32
- package/auth/utils/read-external-sources.d.ts +2 -1
- package/auth/utils/read-external-sources.js +5 -4
- package/build/docs/ibm-cloud-sdk-core.atleastone.md +4 -4
- package/build/docs/ibm-cloud-sdk-core.atmostone.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.authenticator._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.authenticator.authenticate.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.authenticator.authenticationtype.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.authenticator.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.authenticate.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.baseservice._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.baseservice.configureservice.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.baseservice.createrequest.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.baseservice.enableretries.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.baseservice.getauthenticator.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.baseservice.md +3 -3
- package/build/docs/ibm-cloud-sdk-core.baseservice.setdefaultheaders.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.baseservice.setserviceurl.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.basicauthenticator._constructor_.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authenticate.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.basicauthenticator.md +3 -3
- package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator._constructor_.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.authenticate.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.md +3 -3
- package/build/docs/ibm-cloud-sdk-core.buildrequestfileobject.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.checkcredentials.md +3 -3
- package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator._constructor_.md +3 -3
- package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.md +5 -5
- package/build/docs/ibm-cloud-sdk-core.computebasicauthheader.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.constructserviceurl.md +4 -4
- package/build/docs/ibm-cloud-sdk-core.containerauthenticator._constructor_.md +3 -3
- package/build/docs/ibm-cloud-sdk-core.containerauthenticator.md +4 -4
- package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setcrtokenfilename.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setiamprofileid.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setiamprofilename.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.containertokenmanager._constructor_.md +6 -2
- package/build/docs/ibm-cloud-sdk-core.containertokenmanager.md +5 -5
- package/build/docs/ibm-cloud-sdk-core.containertokenmanager.requesttoken.md +0 -2
- package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setcrtokenfilename.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setiamprofileid.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setiamprofilename.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager._constructor_.md +6 -2
- package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager.md +3 -3
- package/build/docs/ibm-cloud-sdk-core.fileobject.md +5 -5
- package/build/docs/ibm-cloud-sdk-core.fileoptions.md +4 -4
- package/build/docs/ibm-cloud-sdk-core.filestream.md +3 -3
- package/build/docs/ibm-cloud-sdk-core.filewithmetadata.md +5 -5
- package/build/docs/ibm-cloud-sdk-core.getauthenticatorfromenvironment.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.getcontenttype.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.getcurrenttime.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.getformat.md +0 -2
- package/build/docs/ibm-cloud-sdk-core.getmissingparams.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.getnewlogger.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.getqueryparam.md +1 -5
- package/build/docs/ibm-cloud-sdk-core.iamauthenticator._constructor_.md +3 -3
- package/build/docs/ibm-cloud-sdk-core.iamauthenticator.md +5 -5
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator._constructor_.md +3 -3
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.getrefreshtoken.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.md +7 -7
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setclientidandsecret.md +3 -3
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setscope.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager._constructor_.md +6 -2
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.getrefreshtoken.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.md +8 -8
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.requesttoken.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.savetokeninfo.md +1 -3
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.setclientidandsecret.md +3 -5
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.setscope.md +2 -4
- package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.md +5 -5
- package/build/docs/ibm-cloud-sdk-core.iamtokenmanager._constructor_.md +6 -2
- package/build/docs/ibm-cloud-sdk-core.iamtokenmanager.md +3 -3
- package/build/docs/ibm-cloud-sdk-core.ishtml.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.jwttokenmanager._constructor_.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.md +5 -5
- package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.requesttoken.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.savetokeninfo.md +1 -3
- package/build/docs/ibm-cloud-sdk-core.md +24 -24
- package/build/docs/ibm-cloud-sdk-core.onlyone.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.qs.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.readexternalsources.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.removesuffix.md +4 -4
- package/build/docs/ibm-cloud-sdk-core.sdklogger.md +7 -7
- package/build/docs/ibm-cloud-sdk-core.streamtopromise.md +3 -1
- package/build/docs/ibm-cloud-sdk-core.striptrailingslash.md +4 -2
- package/build/docs/ibm-cloud-sdk-core.tokenmanager._constructor_.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.gettoken.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.md +15 -15
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.pacedrequesttoken.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.requesttoken.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.savetokeninfo.md +1 -3
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.setdisablesslverification.md +1 -3
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.setheaders.md +2 -4
- package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator._constructor_.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.authenticate.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.md +9 -9
- package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.setdisablesslverification.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.setheaders.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tolowerkeys.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.unittestutils.checkforsuccessfulexecution.md +0 -2
- package/build/docs/ibm-cloud-sdk-core.unittestutils.checkmediaheaders.md +0 -2
- package/build/docs/ibm-cloud-sdk-core.unittestutils.checkurlandmethod.md +1 -3
- package/build/docs/ibm-cloud-sdk-core.unittestutils.checkuserheader.md +0 -2
- package/build/docs/ibm-cloud-sdk-core.unittestutils.expecttobepromise.md +0 -2
- package/build/docs/ibm-cloud-sdk-core.unittestutils.getoptions.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.useroptions.md +9 -9
- package/build/docs/ibm-cloud-sdk-core.validateinput.md +8 -2
- package/build/docs/ibm-cloud-sdk-core.validateparams.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator._constructor_.md +6 -2
- package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.md +6 -6
- package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.setiamprofilecrn.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.setiamprofileid.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager._constructor_.md +6 -2
- package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.md +4 -4
- package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.setiamprofilecrn.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.setiamprofileid.md +2 -2
- package/docs/ibm-cloud-sdk-core.api.json +516 -241
- package/es/auth/authenticators/authenticator-interface.d.ts +3 -4
- package/es/auth/authenticators/authenticator-interface.js +1 -1
- package/es/auth/authenticators/authenticator.d.ts +5 -9
- package/es/auth/authenticators/authenticator.js +4 -8
- package/es/auth/authenticators/basic-authenticator.d.ts +12 -12
- package/es/auth/authenticators/basic-authenticator.js +12 -12
- package/es/auth/authenticators/bearer-token-authenticator.d.ts +11 -14
- package/es/auth/authenticators/bearer-token-authenticator.js +11 -14
- package/es/auth/authenticators/cloud-pak-for-data-authenticator.d.ts +15 -15
- package/es/auth/authenticators/cloud-pak-for-data-authenticator.js +15 -15
- package/es/auth/authenticators/container-authenticator.d.ts +23 -23
- package/es/auth/authenticators/container-authenticator.js +23 -23
- package/es/auth/authenticators/iam-authenticator.d.ts +20 -20
- package/es/auth/authenticators/iam-authenticator.js +20 -20
- package/es/auth/authenticators/iam-request-based-authenticator.d.ts +23 -25
- package/es/auth/authenticators/iam-request-based-authenticator.js +23 -25
- package/es/auth/authenticators/token-request-based-authenticator.d.ts +19 -24
- package/es/auth/authenticators/token-request-based-authenticator.js +19 -24
- package/es/auth/authenticators/vpc-instance-authenticator.d.ts +17 -16
- package/es/auth/authenticators/vpc-instance-authenticator.js +17 -16
- package/es/auth/token-managers/container-token-manager.d.ts +23 -25
- package/es/auth/token-managers/container-token-manager.js +23 -25
- package/es/auth/token-managers/cp4d-token-manager.d.ts +13 -13
- package/es/auth/token-managers/cp4d-token-manager.js +13 -13
- package/es/auth/token-managers/iam-request-based-token-manager.d.ts +26 -31
- package/es/auth/token-managers/iam-request-based-token-manager.js +26 -31
- package/es/auth/token-managers/iam-token-manager.d.ts +17 -16
- package/es/auth/token-managers/iam-token-manager.js +17 -16
- package/es/auth/token-managers/jwt-token-manager.d.ts +10 -13
- package/es/auth/token-managers/jwt-token-manager.js +13 -16
- package/es/auth/token-managers/token-manager.d.ts +23 -35
- package/es/auth/token-managers/token-manager.js +22 -34
- package/es/auth/token-managers/vpc-instance-token-manager.d.ts +15 -15
- package/es/auth/token-managers/vpc-instance-token-manager.js +15 -15
- package/es/auth/utils/get-authenticator-from-environment.d.ts +2 -2
- package/es/auth/utils/get-authenticator-from-environment.js +2 -2
- package/es/auth/utils/helpers.d.ts +34 -32
- package/es/auth/utils/helpers.js +34 -32
- package/es/auth/utils/read-external-sources.d.ts +2 -1
- package/es/auth/utils/read-external-sources.js +5 -4
- package/es/lib/base-service.d.ts +31 -32
- package/es/lib/base-service.js +31 -32
- package/es/lib/content-type.js +5 -5
- package/es/lib/get-new-logger.d.ts +2 -2
- package/es/lib/get-new-logger.js +2 -2
- package/es/lib/helper.d.ts +24 -31
- package/es/lib/helper.js +25 -32
- package/es/lib/querystring.d.ts +1 -1
- package/es/lib/querystring.js +3 -3
- package/es/lib/request-wrapper.d.ts +4 -6
- package/es/lib/request-wrapper.js +17 -23
- package/es/lib/sdk-test-helpers.d.ts +14 -19
- package/es/lib/sdk-test-helpers.js +14 -19
- package/es/lib/stream-to-promise.d.ts +3 -3
- package/es/lib/stream-to-promise.js +3 -3
- package/es/tsdoc-metadata.json +1 -1
- package/etc/ibm-cloud-sdk-core.api.md +12 -12
- package/ibm-cloud-sdk-core.d.ts +1402 -1449
- package/lib/base-service.d.ts +31 -32
- package/lib/base-service.js +31 -32
- package/lib/content-type.js +5 -5
- package/lib/get-new-logger.d.ts +2 -2
- package/lib/get-new-logger.js +2 -2
- package/lib/helper.d.ts +24 -31
- package/lib/helper.js +25 -32
- package/lib/querystring.d.ts +1 -1
- package/lib/querystring.js +3 -3
- package/lib/request-wrapper.d.ts +4 -6
- package/lib/request-wrapper.js +17 -23
- package/lib/sdk-test-helpers.d.ts +14 -19
- package/lib/sdk-test-helpers.js +14 -19
- package/lib/stream-to-promise.d.ts +3 -3
- package/lib/stream-to-promise.js +3 -3
- package/package.json +2 -2
- package/temp/ibm-cloud-sdk-core.api.json +516 -241
- package/temp/ibm-cloud-sdk-core.api.md +12 -12
- package/MIGRATION-V1.md +0 -42
package/.secrets.baseline
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"files": "package-lock.json|^.secrets.baseline$",
|
|
4
4
|
"lines": null
|
|
5
5
|
},
|
|
6
|
-
"generated_at": "2022-
|
|
6
|
+
"generated_at": "2022-12-20T17:56:56Z",
|
|
7
7
|
"plugins_used": [
|
|
8
8
|
{
|
|
9
9
|
"name": "AWSKeyDetector"
|
|
@@ -91,32 +91,32 @@
|
|
|
91
91
|
"verified_result": null
|
|
92
92
|
}
|
|
93
93
|
],
|
|
94
|
-
"
|
|
94
|
+
"README.md": [
|
|
95
95
|
{
|
|
96
|
-
"hashed_secret": "
|
|
96
|
+
"hashed_secret": "32e8612d8ca77c7ea8374aa7918db8e5df9252ed",
|
|
97
97
|
"is_secret": false,
|
|
98
98
|
"is_verified": false,
|
|
99
|
-
"line_number":
|
|
99
|
+
"line_number": 61,
|
|
100
100
|
"type": "Secret Keyword",
|
|
101
101
|
"verified_result": null
|
|
102
102
|
}
|
|
103
103
|
],
|
|
104
|
-
"
|
|
104
|
+
"auth/authenticators/authenticator.ts": [
|
|
105
105
|
{
|
|
106
|
-
"hashed_secret": "
|
|
106
|
+
"hashed_secret": "fdee05598fdd57ff8e9ae29e92c25a04f2c52fa6",
|
|
107
107
|
"is_secret": false,
|
|
108
108
|
"is_verified": false,
|
|
109
|
-
"line_number":
|
|
109
|
+
"line_number": 39,
|
|
110
110
|
"type": "Secret Keyword",
|
|
111
111
|
"verified_result": null
|
|
112
112
|
}
|
|
113
113
|
],
|
|
114
|
-
"auth/authenticators/authenticator.ts": [
|
|
114
|
+
"auth/authenticators/basic-authenticator.ts": [
|
|
115
115
|
{
|
|
116
|
-
"hashed_secret": "
|
|
116
|
+
"hashed_secret": "bbccdf2efb33b52e6c9d0a14dd70b2d415fbea6e",
|
|
117
117
|
"is_secret": false,
|
|
118
118
|
"is_verified": false,
|
|
119
|
-
"line_number":
|
|
119
|
+
"line_number": 52,
|
|
120
120
|
"type": "Secret Keyword",
|
|
121
121
|
"verified_result": null
|
|
122
122
|
}
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
"hashed_secret": "45c43fe97e3a06ab078b0eeff6fbe622cc417a25",
|
|
163
163
|
"is_secret": false,
|
|
164
164
|
"is_verified": false,
|
|
165
|
-
"line_number":
|
|
165
|
+
"line_number": 89,
|
|
166
166
|
"type": "Secret Keyword",
|
|
167
167
|
"verified_result": null
|
|
168
168
|
},
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
"hashed_secret": "99833a8b234b57b886a9aef1dba187fdd7ceece8",
|
|
171
171
|
"is_secret": false,
|
|
172
172
|
"is_verified": false,
|
|
173
|
-
"line_number":
|
|
173
|
+
"line_number": 91,
|
|
174
174
|
"type": "Secret Keyword",
|
|
175
175
|
"verified_result": null
|
|
176
176
|
}
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
"hashed_secret": "f84f793e0af9ade37c8b927bc5091e98f35bf821",
|
|
225
225
|
"is_secret": false,
|
|
226
226
|
"is_verified": false,
|
|
227
|
-
"line_number":
|
|
227
|
+
"line_number": 84,
|
|
228
228
|
"type": "Secret Keyword",
|
|
229
229
|
"verified_result": null
|
|
230
230
|
},
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
"hashed_secret": "45c43fe97e3a06ab078b0eeff6fbe622cc417a25",
|
|
233
233
|
"is_secret": false,
|
|
234
234
|
"is_verified": false,
|
|
235
|
-
"line_number":
|
|
235
|
+
"line_number": 118,
|
|
236
236
|
"type": "Secret Keyword",
|
|
237
237
|
"verified_result": null
|
|
238
238
|
},
|
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
"hashed_secret": "99833a8b234b57b886a9aef1dba187fdd7ceece8",
|
|
241
241
|
"is_secret": false,
|
|
242
242
|
"is_verified": false,
|
|
243
|
-
"line_number":
|
|
243
|
+
"line_number": 120,
|
|
244
244
|
"type": "Secret Keyword",
|
|
245
245
|
"verified_result": null
|
|
246
246
|
}
|
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
"hashed_secret": "8f4bfc22c4fd7cb884f94ec175ff4a3284a174a1",
|
|
251
251
|
"is_secret": false,
|
|
252
252
|
"is_verified": false,
|
|
253
|
-
"line_number":
|
|
253
|
+
"line_number": 59,
|
|
254
254
|
"type": "Secret Keyword",
|
|
255
255
|
"verified_result": null
|
|
256
256
|
},
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
"hashed_secret": "0358c67856fb6a21c4767daf02fcb8fe4dc0a318",
|
|
259
259
|
"is_secret": false,
|
|
260
260
|
"is_verified": false,
|
|
261
|
-
"line_number":
|
|
261
|
+
"line_number": 62,
|
|
262
262
|
"type": "Secret Keyword",
|
|
263
263
|
"verified_result": null
|
|
264
264
|
},
|
|
@@ -266,7 +266,7 @@
|
|
|
266
266
|
"hashed_secret": "dbb19b8ae3b78f908e1467721fe4c9f0b0529d9b",
|
|
267
267
|
"is_secret": false,
|
|
268
268
|
"is_verified": false,
|
|
269
|
-
"line_number":
|
|
269
|
+
"line_number": 63,
|
|
270
270
|
"type": "Secret Keyword",
|
|
271
271
|
"verified_result": null
|
|
272
272
|
}
|
|
@@ -296,21 +296,11 @@
|
|
|
296
296
|
"hashed_secret": "45c43fe97e3a06ab078b0eeff6fbe622cc417a25",
|
|
297
297
|
"is_secret": false,
|
|
298
298
|
"is_verified": false,
|
|
299
|
-
"line_number":
|
|
299
|
+
"line_number": 278,
|
|
300
300
|
"type": "Secret Keyword",
|
|
301
301
|
"verified_result": null
|
|
302
302
|
}
|
|
303
303
|
],
|
|
304
|
-
"scripts/jsdoc/generate_index_html.sh": [
|
|
305
|
-
{
|
|
306
|
-
"hashed_secret": "973f71aa51bf4dcef6aa10f52089747a85c64a73",
|
|
307
|
-
"is_secret": false,
|
|
308
|
-
"is_verified": false,
|
|
309
|
-
"line_number": 19,
|
|
310
|
-
"type": "Base64 High Entropy String",
|
|
311
|
-
"verified_result": null
|
|
312
|
-
}
|
|
313
|
-
],
|
|
314
304
|
"test/resources/ibm-credentials.env": [
|
|
315
305
|
{
|
|
316
306
|
"hashed_secret": "5c5a15a8b0b3e154d77746945e563ba40100681b",
|
|
@@ -534,7 +524,7 @@
|
|
|
534
524
|
}
|
|
535
525
|
]
|
|
536
526
|
},
|
|
537
|
-
"version": "0.13.1+ibm.
|
|
527
|
+
"version": "0.13.1+ibm.55.dss",
|
|
538
528
|
"word_list": {
|
|
539
529
|
"file": null,
|
|
540
530
|
"hash": null
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [4.0.2](https://github.com/IBM/node-sdk-core/compare/v4.0.1...v4.0.2) (2022-12-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **auth:** revert to using decode instead verify for jwt ([#227](https://github.com/IBM/node-sdk-core/issues/227)) ([cf3d641](https://github.com/IBM/node-sdk-core/commit/cf3d64106f35943c34f2a9c5d1b4de63994aed2a))
|
|
7
|
+
|
|
8
|
+
## [4.0.1](https://github.com/IBM/node-sdk-core/compare/v4.0.0...v4.0.1) (2022-12-29)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **auth:** migrate to secure usage of jwt for token authentication ([#225](https://github.com/IBM/node-sdk-core/issues/225)) ([10e0728](https://github.com/IBM/node-sdk-core/commit/10e07283cec2205eb6bda5723e63e5403d9b23f6))
|
|
14
|
+
|
|
1
15
|
# [4.0.0](https://github.com/IBM/node-sdk-core/compare/v3.2.1...v4.0.0) (2022-12-20)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -19,15 +33,13 @@
|
|
|
19
33
|
### BREAKING CHANGES
|
|
20
34
|
|
|
21
35
|
* **deps-dev:** Minimum typescript version is 4.
|
|
22
|
-
|
|
23
36
|
Upgrade to typescript 4.x.
|
|
24
37
|
|
|
25
|
-
Signed-off-by: Rich Ellis <ricellis@users.noreply.github.com>
|
|
26
38
|
* Minimum Node.js version is 14.
|
|
27
|
-
|
|
28
39
|
Upgrade to at least Node.js 14.
|
|
29
40
|
|
|
30
|
-
|
|
41
|
+
* **For assistance migrating to v4** - see the [migration guide](https://github.com/IBM/node-sdk-core/blob/main/MIGRATION-V4.md).
|
|
42
|
+
|
|
31
43
|
|
|
32
44
|
## [3.2.1](https://github.com/IBM/node-sdk-core/compare/v3.2.0...v3.2.1) (2022-10-21)
|
|
33
45
|
|
package/MIGRATION-V4.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Migration Guide for v4
|
|
2
|
+
|
|
3
|
+
## Breaking Changes
|
|
4
|
+
|
|
5
|
+
### Node Version
|
|
6
|
+
Node versions 12 is longer supported - 14 is the minimum version supported.
|
|
7
|
+
|
|
8
|
+
### TypeScript Version
|
|
9
|
+
The `typescript` development dependnecy is now required to be at least version 4.
|
|
10
|
+
|
|
11
|
+
Run `npm install -D typescript@4` to upgrade to version 4.
|
|
12
|
+
|
|
13
|
+
Code produced by the IBM OpenAPI SDK Generator should already be compliant with TypeScript v4.
|
|
14
|
+
|
|
15
|
+
Additionally, you may need to upgrade `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` to
|
|
16
|
+
v5 to be compatible with the new version of TypeScript. This upgrade should be safe and compatible.
|
|
17
|
+
|
|
18
|
+
Run `npm i -D '@typescript-eslint/eslint-plugin@latest' '@typescript-eslint/parser@latest'` to upgrade.
|
|
19
|
+
|
|
20
|
+
### Jest Version
|
|
21
|
+
The `jest` development dependency is now required to be at least version 29.
|
|
22
|
+
|
|
23
|
+
Run `npm install -D jest@29` to upgrade to version 29.
|
|
24
|
+
|
|
25
|
+
Code produced by the IBM OpenAPI Generator should already be compliant with Jest v29.
|
|
26
|
+
|
|
27
|
+
Note: Ensure your test code does not contain the anti-pattern of using a `done` callback with an `async` function.
|
|
28
|
+
This is no longer permitted in Jest 29, whereas it was discouraged but permitted in previous versions. An old version of the IBM OpenAPI SDK Generator included a bug that generated this pattern. If your generated test code has not been updated since then, you may run into this issue.
|
|
29
|
+
|
|
30
|
+
Example diff showing proper resolution:
|
|
31
|
+
```
|
|
32
|
+
diff --git a/test/integration/example.v1.test.js b/test/integration/example.v1.test.js
|
|
33
|
+
index be0bec3..62f03f8 100644
|
|
34
|
+
--- a/test/integration/example.v1.test.js
|
|
35
|
+
+++ b/test/integration/example.v1.test.js
|
|
36
|
+
@@ -38,7 +38,7 @@ describe('ExampleV1_integration', () => {
|
|
37
|
+
jest.setTimeout(timeout);
|
|
38
|
+
let example;
|
|
39
|
+
|
|
40
|
+
- beforeAll(async (done) => {
|
|
41
|
+
+ beforeAll(async () => {
|
|
42
|
+
example = ExampleV1.newInstance({});
|
|
43
|
+
|
|
44
|
+
const config = readExternalSources(ExampleV1.DEFAULT_SERVICE_NAME);
|
|
45
|
+
@@ -58,8 +58,6 @@ describe('ExampleV1_integration', () => {
|
|
46
|
+
|
|
47
|
+
log(`Service URL: ${example.baseOptions.serviceUrl}`);
|
|
48
|
+
log('Finished setup.');
|
|
49
|
+
-
|
|
50
|
+
- done();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('getSomething()', async () => {
|
|
54
|
+
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2022.
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -34,9 +34,8 @@ export interface AuthenticatorInterface {
|
|
|
34
34
|
/**
|
|
35
35
|
* Add authentication information to the specified request.
|
|
36
36
|
*
|
|
37
|
-
* @param
|
|
38
|
-
*
|
|
39
|
-
* authentication information will be added to.
|
|
37
|
+
* @param requestOptions - The request to which authentication information is added
|
|
38
|
+
* (in the headers field).
|
|
40
39
|
*/
|
|
41
40
|
authenticate(requestOptions: AuthenticateOptions): Promise<void>;
|
|
42
41
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2022.
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -33,25 +33,21 @@ export declare class Authenticator implements AuthenticatorInterface {
|
|
|
33
33
|
/**
|
|
34
34
|
* Create a new Authenticator instance.
|
|
35
35
|
*
|
|
36
|
-
* @throws
|
|
37
|
-
* authenticator.
|
|
36
|
+
* @throws Error: the "new" keyword was not used to construct the authenticator.
|
|
38
37
|
*/
|
|
39
38
|
constructor();
|
|
40
39
|
/**
|
|
41
40
|
* Augment the request with authentication information.
|
|
42
41
|
*
|
|
43
|
-
* @param
|
|
44
|
-
* @
|
|
45
|
-
* authentication information will be added too.
|
|
46
|
-
* @throws {Error} - The authenticate method was not implemented by a
|
|
47
|
-
* subclass.
|
|
42
|
+
* @param requestOptions - The request to augment with authentication information.
|
|
43
|
+
* @throws Error: The authenticate method was not implemented by a subclass.
|
|
48
44
|
*/
|
|
49
45
|
authenticate(requestOptions: AuthenticateOptions): Promise<void>;
|
|
50
46
|
/**
|
|
51
47
|
* Retrieves the authenticator's type.
|
|
52
48
|
* The returned value will be the same string that is used
|
|
53
49
|
* when configuring an instance of the authenticator with the
|
|
54
|
-
*
|
|
50
|
+
* \<service_name\>_AUTH_TYPE configuration property
|
|
55
51
|
* (e.g. "basic", "iam", etc.).
|
|
56
52
|
* This function should be overridden in each authenticator
|
|
57
53
|
* implementation class that extends this class.
|
|
@@ -10,8 +10,7 @@ var Authenticator = /** @class */ (function () {
|
|
|
10
10
|
/**
|
|
11
11
|
* Create a new Authenticator instance.
|
|
12
12
|
*
|
|
13
|
-
* @throws
|
|
14
|
-
* authenticator.
|
|
13
|
+
* @throws Error: the "new" keyword was not used to construct the authenticator.
|
|
15
14
|
*/
|
|
16
15
|
function Authenticator() {
|
|
17
16
|
if (!(this instanceof Authenticator)) {
|
|
@@ -21,11 +20,8 @@ var Authenticator = /** @class */ (function () {
|
|
|
21
20
|
/**
|
|
22
21
|
* Augment the request with authentication information.
|
|
23
22
|
*
|
|
24
|
-
* @param
|
|
25
|
-
* @
|
|
26
|
-
* authentication information will be added too.
|
|
27
|
-
* @throws {Error} - The authenticate method was not implemented by a
|
|
28
|
-
* subclass.
|
|
23
|
+
* @param requestOptions - The request to augment with authentication information.
|
|
24
|
+
* @throws Error: The authenticate method was not implemented by a subclass.
|
|
29
25
|
*/
|
|
30
26
|
Authenticator.prototype.authenticate = function (requestOptions) {
|
|
31
27
|
var error = new Error('Should be implemented by subclass!');
|
|
@@ -35,7 +31,7 @@ var Authenticator = /** @class */ (function () {
|
|
|
35
31
|
* Retrieves the authenticator's type.
|
|
36
32
|
* The returned value will be the same string that is used
|
|
37
33
|
* when configuring an instance of the authenticator with the
|
|
38
|
-
*
|
|
34
|
+
* \<service_name\>_AUTH_TYPE configuration property
|
|
39
35
|
* (e.g. "basic", "iam", etc.).
|
|
40
36
|
* This function should be overridden in each authenticator
|
|
41
37
|
* implementation class that extends this class.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2022.
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -28,7 +28,7 @@ export type Options = {
|
|
|
28
28
|
*
|
|
29
29
|
* Basic Authorization will be sent as an Authorization header in the form:
|
|
30
30
|
*
|
|
31
|
-
* Authorization: Basic
|
|
31
|
+
* Authorization: Basic \<encoded username and password\>
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
34
34
|
export declare class BasicAuthenticator extends Authenticator {
|
|
@@ -39,21 +39,21 @@ export declare class BasicAuthenticator extends Authenticator {
|
|
|
39
39
|
/**
|
|
40
40
|
* Create a new BasicAuthenticator instance.
|
|
41
41
|
*
|
|
42
|
-
* @param
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
42
|
+
* @param options - Configuration options for basic authentication.
|
|
43
|
+
* This should be an object containing these fields:
|
|
44
|
+
* - username: the username portion of basic authentication
|
|
45
|
+
* - password: the password portion of basic authentication
|
|
46
|
+
*
|
|
47
|
+
* @throws Error: the configuration options are not valid.
|
|
46
48
|
*/
|
|
47
49
|
constructor(options: Options);
|
|
48
50
|
/**
|
|
49
|
-
* Add basic authentication information to `
|
|
50
|
-
* will be set in the Authorization property of`
|
|
51
|
+
* Add basic authentication information to `requestOptions`. The basic authentication information
|
|
52
|
+
* will be set in the Authorization property of `requestOptions.headers` in the form:
|
|
51
53
|
*
|
|
52
|
-
* Authorization: Basic
|
|
54
|
+
* Authorization: Basic \<encoded username and password\>
|
|
53
55
|
*
|
|
54
|
-
* @param
|
|
55
|
-
* @param {object.<string, string>} requestOptions.headers - The headers the
|
|
56
|
-
* authentication information will be added too.
|
|
56
|
+
* @param requestOptions - The request to augment with authentication information.
|
|
57
57
|
*/
|
|
58
58
|
authenticate(requestOptions: AuthenticateOptions): Promise<void>;
|
|
59
59
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* (C) Copyright IBM Corp. 2019,
|
|
3
|
+
* (C) Copyright IBM Corp. 2019, 2022.
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -43,7 +43,7 @@ var authenticator_1 = require("./authenticator");
|
|
|
43
43
|
*
|
|
44
44
|
* Basic Authorization will be sent as an Authorization header in the form:
|
|
45
45
|
*
|
|
46
|
-
* Authorization: Basic
|
|
46
|
+
* Authorization: Basic \<encoded username and password\>
|
|
47
47
|
*
|
|
48
48
|
*/
|
|
49
49
|
var BasicAuthenticator = /** @class */ (function (_super) {
|
|
@@ -51,10 +51,12 @@ var BasicAuthenticator = /** @class */ (function (_super) {
|
|
|
51
51
|
/**
|
|
52
52
|
* Create a new BasicAuthenticator instance.
|
|
53
53
|
*
|
|
54
|
-
* @param
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
54
|
+
* @param options - Configuration options for basic authentication.
|
|
55
|
+
* This should be an object containing these fields:
|
|
56
|
+
* - username: the username portion of basic authentication
|
|
57
|
+
* - password: the password portion of basic authentication
|
|
58
|
+
*
|
|
59
|
+
* @throws Error: the configuration options are not valid.
|
|
58
60
|
*/
|
|
59
61
|
function BasicAuthenticator(options) {
|
|
60
62
|
var _this = _super.call(this) || this;
|
|
@@ -66,14 +68,12 @@ var BasicAuthenticator = /** @class */ (function (_super) {
|
|
|
66
68
|
return _this;
|
|
67
69
|
}
|
|
68
70
|
/**
|
|
69
|
-
* Add basic authentication information to `
|
|
70
|
-
* will be set in the Authorization property of`
|
|
71
|
+
* Add basic authentication information to `requestOptions`. The basic authentication information
|
|
72
|
+
* will be set in the Authorization property of `requestOptions.headers` in the form:
|
|
71
73
|
*
|
|
72
|
-
* Authorization: Basic
|
|
74
|
+
* Authorization: Basic \<encoded username and password\>
|
|
73
75
|
*
|
|
74
|
-
* @param
|
|
75
|
-
* @param {object.<string, string>} requestOptions.headers - The headers the
|
|
76
|
-
* authentication information will be added too.
|
|
76
|
+
* @param requestOptions - The request to augment with authentication information.
|
|
77
77
|
*/
|
|
78
78
|
BasicAuthenticator.prototype.authenticate = function (requestOptions) {
|
|
79
79
|
var _this = this;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2022.
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -26,7 +26,7 @@ export type Options = {
|
|
|
26
26
|
*
|
|
27
27
|
* The bearer token will be sent as an Authorization header in the form:
|
|
28
28
|
*
|
|
29
|
-
* Authorization: Bearer
|
|
29
|
+
* Authorization: Bearer \<bearer-token\>
|
|
30
30
|
*/
|
|
31
31
|
export declare class BearerTokenAuthenticator extends Authenticator {
|
|
32
32
|
protected requiredOptions: string[];
|
|
@@ -34,29 +34,26 @@ export declare class BearerTokenAuthenticator extends Authenticator {
|
|
|
34
34
|
/**
|
|
35
35
|
* Create a new BearerTokenAuthenticator instance.
|
|
36
36
|
*
|
|
37
|
-
* @param
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* @throws
|
|
37
|
+
* @param options - Configuration options for bearer authentication.
|
|
38
|
+
* This should be an object containing the "bearerToken" field.
|
|
39
|
+
*
|
|
40
|
+
* @throws Error: the options.bearerToken field is not valid, or unspecified
|
|
41
41
|
*/
|
|
42
42
|
constructor(options: Options);
|
|
43
43
|
/**
|
|
44
44
|
* Set a new bearer token to be sent in subsequent requests.
|
|
45
45
|
*
|
|
46
|
-
* @param
|
|
46
|
+
* @param bearerToken - The bearer token that will be sent in service
|
|
47
47
|
* requests.
|
|
48
48
|
*/
|
|
49
49
|
setBearerToken(bearerToken: string): void;
|
|
50
50
|
/**
|
|
51
|
-
* Add a bearer token to
|
|
52
|
-
* will be set in the Authorization property of
|
|
51
|
+
* Add a bearer token to `requestOptions`. The bearer token information
|
|
52
|
+
* will be set in the Authorization property of "requestOptions.headers" in the form:
|
|
53
53
|
*
|
|
54
|
-
* Authorization: Bearer
|
|
54
|
+
* Authorization: Bearer \<bearer-token\>
|
|
55
55
|
*
|
|
56
|
-
* @param
|
|
57
|
-
* information.
|
|
58
|
-
* @param {object.<string, string>} requestOptions.headers - The headers the
|
|
59
|
-
* authentication information will be added to.
|
|
56
|
+
* @param requestOptions - The request to augment with authentication information.
|
|
60
57
|
*/
|
|
61
58
|
authenticate(requestOptions: AuthenticateOptions): Promise<void>;
|
|
62
59
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* (C) Copyright IBM Corp. 2019,
|
|
3
|
+
* (C) Copyright IBM Corp. 2019, 2022.
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -43,17 +43,17 @@ var authenticator_1 = require("./authenticator");
|
|
|
43
43
|
*
|
|
44
44
|
* The bearer token will be sent as an Authorization header in the form:
|
|
45
45
|
*
|
|
46
|
-
* Authorization: Bearer
|
|
46
|
+
* Authorization: Bearer \<bearer-token\>
|
|
47
47
|
*/
|
|
48
48
|
var BearerTokenAuthenticator = /** @class */ (function (_super) {
|
|
49
49
|
__extends(BearerTokenAuthenticator, _super);
|
|
50
50
|
/**
|
|
51
51
|
* Create a new BearerTokenAuthenticator instance.
|
|
52
52
|
*
|
|
53
|
-
* @param
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* @throws
|
|
53
|
+
* @param options - Configuration options for bearer authentication.
|
|
54
|
+
* This should be an object containing the "bearerToken" field.
|
|
55
|
+
*
|
|
56
|
+
* @throws Error: the options.bearerToken field is not valid, or unspecified
|
|
57
57
|
*/
|
|
58
58
|
function BearerTokenAuthenticator(options) {
|
|
59
59
|
var _this = _super.call(this) || this;
|
|
@@ -65,22 +65,19 @@ var BearerTokenAuthenticator = /** @class */ (function (_super) {
|
|
|
65
65
|
/**
|
|
66
66
|
* Set a new bearer token to be sent in subsequent requests.
|
|
67
67
|
*
|
|
68
|
-
* @param
|
|
68
|
+
* @param bearerToken - The bearer token that will be sent in service
|
|
69
69
|
* requests.
|
|
70
70
|
*/
|
|
71
71
|
BearerTokenAuthenticator.prototype.setBearerToken = function (bearerToken) {
|
|
72
72
|
this.bearerToken = bearerToken;
|
|
73
73
|
};
|
|
74
74
|
/**
|
|
75
|
-
* Add a bearer token to
|
|
76
|
-
* will be set in the Authorization property of
|
|
75
|
+
* Add a bearer token to `requestOptions`. The bearer token information
|
|
76
|
+
* will be set in the Authorization property of "requestOptions.headers" in the form:
|
|
77
77
|
*
|
|
78
|
-
* Authorization: Bearer
|
|
78
|
+
* Authorization: Bearer \<bearer-token\>
|
|
79
79
|
*
|
|
80
|
-
* @param
|
|
81
|
-
* information.
|
|
82
|
-
* @param {object.<string, string>} requestOptions.headers - The headers the
|
|
83
|
-
* authentication information will be added to.
|
|
80
|
+
* @param requestOptions - The request to augment with authentication information.
|
|
84
81
|
*/
|
|
85
82
|
BearerTokenAuthenticator.prototype.authenticate = function (requestOptions) {
|
|
86
83
|
var _this = this;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2022.
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -27,12 +27,12 @@ export interface Options extends BaseOptions {
|
|
|
27
27
|
url: string;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* The
|
|
30
|
+
* The CloudPakForDataAuthenticator will either use a username/password pair or a username/apikey pair to obtain
|
|
31
31
|
* a bearer token from a token server. When the bearer token expires, a new token is obtained from the token server.
|
|
32
32
|
*
|
|
33
33
|
* The bearer token will be sent as an Authorization header in the form:
|
|
34
34
|
*
|
|
35
|
-
* Authorization: Bearer
|
|
35
|
+
* Authorization: Bearer \<bearer-token\>
|
|
36
36
|
*/
|
|
37
37
|
export declare class CloudPakForDataAuthenticator extends TokenRequestBasedAuthenticator {
|
|
38
38
|
protected requiredOptions: string[];
|
|
@@ -41,19 +41,19 @@ export declare class CloudPakForDataAuthenticator extends TokenRequestBasedAuthe
|
|
|
41
41
|
private password;
|
|
42
42
|
private apikey;
|
|
43
43
|
/**
|
|
44
|
-
* Create a new
|
|
44
|
+
* Create a new CloudPakForDataAuthenticator instance.
|
|
45
45
|
*
|
|
46
|
-
* @param
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
46
|
+
* @param options - Configuration options for CloudPakForData authentication.
|
|
47
|
+
* This should be an object containing these fields:
|
|
48
|
+
* - url: (required) the endpoint URL for the CloudPakForData token service
|
|
49
|
+
* - username: (required) the username used to obtain a bearer token
|
|
50
|
+
* - password: (optional) the password used to obtain a bearer token (required if apikey is not specified)
|
|
51
|
+
* - apikey: (optional) the API key used to obtain a bearer token (required if password is not specified)
|
|
52
|
+
* - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
|
|
53
|
+
* should be disabled or not
|
|
54
|
+
* - headers: (optional) a set of HTTP headers to be sent with each request to the token service
|
|
55
|
+
*
|
|
56
|
+
* @throws Error: the username, password, and/or url are not valid, or unspecified, for Cloud Pak For Data token requests.
|
|
57
57
|
*/
|
|
58
58
|
constructor(options: Options);
|
|
59
59
|
/**
|