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
|
@@ -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.
|
|
@@ -35,29 +35,29 @@ var authenticator_1 = require("./authenticator");
|
|
|
35
35
|
var token_managers_1 = require("../token-managers");
|
|
36
36
|
var token_request_based_authenticator_1 = require("./token-request-based-authenticator");
|
|
37
37
|
/**
|
|
38
|
-
* The
|
|
38
|
+
* The CloudPakForDataAuthenticator will either use a username/password pair or a username/apikey pair to obtain
|
|
39
39
|
* a bearer token from a token server. When the bearer token expires, a new token is obtained from the token server.
|
|
40
40
|
*
|
|
41
41
|
* The bearer token will be sent as an Authorization header in the form:
|
|
42
42
|
*
|
|
43
|
-
* Authorization: Bearer
|
|
43
|
+
* Authorization: Bearer \<bearer-token\>
|
|
44
44
|
*/
|
|
45
45
|
var CloudPakForDataAuthenticator = /** @class */ (function (_super) {
|
|
46
46
|
__extends(CloudPakForDataAuthenticator, _super);
|
|
47
47
|
/**
|
|
48
|
-
* Create a new
|
|
48
|
+
* Create a new CloudPakForDataAuthenticator instance.
|
|
49
49
|
*
|
|
50
|
-
* @param
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
50
|
+
* @param options - Configuration options for CloudPakForData authentication.
|
|
51
|
+
* This should be an object containing these fields:
|
|
52
|
+
* - url: (required) the endpoint URL for the CloudPakForData token service
|
|
53
|
+
* - username: (required) the username used to obtain a bearer token
|
|
54
|
+
* - password: (optional) the password used to obtain a bearer token (required if apikey is not specified)
|
|
55
|
+
* - apikey: (optional) the API key used to obtain a bearer token (required if password is not specified)
|
|
56
|
+
* - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
|
|
57
|
+
* should be disabled or not
|
|
58
|
+
* - headers: (optional) a set of HTTP headers to be sent with each request to the token service
|
|
59
|
+
*
|
|
60
|
+
* @throws Error: the username, password, and/or url are not valid, or unspecified, for Cloud Pak For Data token requests.
|
|
61
61
|
*/
|
|
62
62
|
function CloudPakForDataAuthenticator(options) {
|
|
63
63
|
var _this = _super.call(this, options) || this;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2021 IBM Corp. All Rights Reserved.
|
|
2
|
+
* Copyright 2021, 2022 IBM Corp. All Rights Reserved.
|
|
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.
|
|
@@ -25,13 +25,13 @@ export interface Options extends IamRequestOptions {
|
|
|
25
25
|
iamProfileId?: string;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* The
|
|
28
|
+
* The ContainerAuthenticator will read a compute resource token from the file system
|
|
29
29
|
* and use this value to obtain a bearer token from the IAM token server. When the bearer
|
|
30
30
|
* token expires, a new token is obtained from the token server.
|
|
31
31
|
*
|
|
32
32
|
* The bearer token will be sent as an Authorization header in the form:
|
|
33
33
|
*
|
|
34
|
-
* Authorization: Bearer
|
|
34
|
+
* Authorization: Bearer \<bearer-token\>
|
|
35
35
|
*/
|
|
36
36
|
export declare class ContainerAuthenticator extends IamRequestBasedAuthenticator {
|
|
37
37
|
protected tokenManager: ContainerTokenManager;
|
|
@@ -40,39 +40,39 @@ export declare class ContainerAuthenticator extends IamRequestBasedAuthenticator
|
|
|
40
40
|
private iamProfileId;
|
|
41
41
|
/**
|
|
42
42
|
*
|
|
43
|
-
* Create a new
|
|
43
|
+
* Create a new ContainerAuthenticator instance.
|
|
44
44
|
*
|
|
45
|
-
* @param
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* @throws
|
|
45
|
+
* @param options - Configuration options for IAM authentication.
|
|
46
|
+
* This should be an object containing these fields:
|
|
47
|
+
* - url: (optional) the endpoint URL for the token service
|
|
48
|
+
* - crTokenFilename: (optional) the file containing the compute resource token
|
|
49
|
+
* - iamProfileName: (optional) the name of the IAM trusted profile associated with the compute resource token (required if iamProfileId is not specified)
|
|
50
|
+
* - iamProfileId]: (optional) the ID of the IAM trusted profile associated with the compute resource token (required if iamProfileName is not specified)
|
|
51
|
+
* - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
|
|
52
|
+
* should be disabled or not
|
|
53
|
+
* - headers: (optional) a set of HTTP headers to be sent with each request to the token service
|
|
54
|
+
* - clientId: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
|
|
55
|
+
* Authorization header to be included in each request to the token service
|
|
56
|
+
* - clientSecret: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
|
|
57
|
+
* Authorization header to be included in each request to the token service
|
|
58
|
+
* - scope: (optional) the "scope" parameter to use when fetching the bearer token from the token service
|
|
59
|
+
*
|
|
60
|
+
* @throws Error: the configuration options are not valid.
|
|
61
61
|
*/
|
|
62
62
|
constructor(options: Options);
|
|
63
63
|
/**
|
|
64
64
|
* Setter for the filename of the compute resource token.
|
|
65
|
-
* @param
|
|
65
|
+
* @param crTokenFilename - A string containing a path to the CR token file
|
|
66
66
|
*/
|
|
67
67
|
setCrTokenFilename(crTokenFilename: string): void;
|
|
68
68
|
/**
|
|
69
69
|
* Setter for the "profile_name" parameter to use when fetching the bearer token from the IAM token server.
|
|
70
|
-
* @param
|
|
70
|
+
* @param iamProfileName - the name of the IAM trusted profile
|
|
71
71
|
*/
|
|
72
72
|
setIamProfileName(iamProfileName: string): void;
|
|
73
73
|
/**
|
|
74
74
|
* Setter for the "profile_id" parameter to use when fetching the bearer token from the IAM token server.
|
|
75
|
-
* @param
|
|
75
|
+
* @param iamProfileId - the ID of the IAM trusted profile
|
|
76
76
|
*/
|
|
77
77
|
setIamProfileId(iamProfileId: string): void;
|
|
78
78
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright 2021 IBM Corp. All Rights Reserved.
|
|
3
|
+
* Copyright 2021, 2022 IBM Corp. All Rights Reserved.
|
|
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.
|
|
@@ -35,36 +35,36 @@ var authenticator_1 = require("./authenticator");
|
|
|
35
35
|
var token_managers_1 = require("../token-managers");
|
|
36
36
|
var iam_request_based_authenticator_1 = require("./iam-request-based-authenticator");
|
|
37
37
|
/**
|
|
38
|
-
* The
|
|
38
|
+
* The ContainerAuthenticator will read a compute resource token from the file system
|
|
39
39
|
* and use this value to obtain a bearer token from the IAM token server. When the bearer
|
|
40
40
|
* token expires, a new token is obtained from the token server.
|
|
41
41
|
*
|
|
42
42
|
* The bearer token will be sent as an Authorization header in the form:
|
|
43
43
|
*
|
|
44
|
-
* Authorization: Bearer
|
|
44
|
+
* Authorization: Bearer \<bearer-token\>
|
|
45
45
|
*/
|
|
46
46
|
var ContainerAuthenticator = /** @class */ (function (_super) {
|
|
47
47
|
__extends(ContainerAuthenticator, _super);
|
|
48
48
|
/**
|
|
49
49
|
*
|
|
50
|
-
* Create a new
|
|
50
|
+
* Create a new ContainerAuthenticator instance.
|
|
51
51
|
*
|
|
52
|
-
* @param
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* @throws
|
|
52
|
+
* @param options - Configuration options for IAM authentication.
|
|
53
|
+
* This should be an object containing these fields:
|
|
54
|
+
* - url: (optional) the endpoint URL for the token service
|
|
55
|
+
* - crTokenFilename: (optional) the file containing the compute resource token
|
|
56
|
+
* - iamProfileName: (optional) the name of the IAM trusted profile associated with the compute resource token (required if iamProfileId is not specified)
|
|
57
|
+
* - iamProfileId]: (optional) the ID of the IAM trusted profile associated with the compute resource token (required if iamProfileName is not specified)
|
|
58
|
+
* - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
|
|
59
|
+
* should be disabled or not
|
|
60
|
+
* - headers: (optional) a set of HTTP headers to be sent with each request to the token service
|
|
61
|
+
* - clientId: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
|
|
62
|
+
* Authorization header to be included in each request to the token service
|
|
63
|
+
* - clientSecret: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
|
|
64
|
+
* Authorization header to be included in each request to the token service
|
|
65
|
+
* - scope: (optional) the "scope" parameter to use when fetching the bearer token from the token service
|
|
66
|
+
*
|
|
67
|
+
* @throws Error: the configuration options are not valid.
|
|
68
68
|
*/
|
|
69
69
|
function ContainerAuthenticator(options) {
|
|
70
70
|
var _this = _super.call(this, options) || this;
|
|
@@ -79,7 +79,7 @@ var ContainerAuthenticator = /** @class */ (function (_super) {
|
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
* Setter for the filename of the compute resource token.
|
|
82
|
-
* @param
|
|
82
|
+
* @param crTokenFilename - A string containing a path to the CR token file
|
|
83
83
|
*/
|
|
84
84
|
ContainerAuthenticator.prototype.setCrTokenFilename = function (crTokenFilename) {
|
|
85
85
|
this.crTokenFilename = crTokenFilename;
|
|
@@ -88,7 +88,7 @@ var ContainerAuthenticator = /** @class */ (function (_super) {
|
|
|
88
88
|
};
|
|
89
89
|
/**
|
|
90
90
|
* Setter for the "profile_name" parameter to use when fetching the bearer token from the IAM token server.
|
|
91
|
-
* @param
|
|
91
|
+
* @param iamProfileName - the name of the IAM trusted profile
|
|
92
92
|
*/
|
|
93
93
|
ContainerAuthenticator.prototype.setIamProfileName = function (iamProfileName) {
|
|
94
94
|
this.iamProfileName = iamProfileName;
|
|
@@ -97,7 +97,7 @@ var ContainerAuthenticator = /** @class */ (function (_super) {
|
|
|
97
97
|
};
|
|
98
98
|
/**
|
|
99
99
|
* Setter for the "profile_id" parameter to use when fetching the bearer token from the IAM token server.
|
|
100
|
-
* @param
|
|
100
|
+
* @param iamProfileId - the ID of the IAM trusted profile
|
|
101
101
|
*/
|
|
102
102
|
ContainerAuthenticator.prototype.setIamProfileId = function (iamProfileId) {
|
|
103
103
|
this.iamProfileId = iamProfileId;
|
|
@@ -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.
|
|
@@ -21,15 +21,15 @@ export interface Options extends IamRequestOptions {
|
|
|
21
21
|
apikey: string;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* The
|
|
25
|
-
*
|
|
24
|
+
* The IamAuthenticator will use the user-supplied `apikey`
|
|
25
|
+
* value to obtain a bearer token from a token server. When the bearer token
|
|
26
26
|
* expires, a new token is obtained from the token server. If specified, the
|
|
27
|
-
* optional, mutually inclusive
|
|
27
|
+
* optional, mutually inclusive "clientId" and "clientSecret" pair can be used to
|
|
28
28
|
* influence rate-limiting for requests to the IAM token server.
|
|
29
29
|
*
|
|
30
30
|
* The bearer token will be sent as an Authorization header in the form:
|
|
31
31
|
*
|
|
32
|
-
* Authorization: Bearer
|
|
32
|
+
* Authorization: Bearer \<bearer-token\>
|
|
33
33
|
*/
|
|
34
34
|
export declare class IamAuthenticator extends IamRequestBasedAuthenticator {
|
|
35
35
|
protected requiredOptions: string[];
|
|
@@ -37,22 +37,22 @@ export declare class IamAuthenticator extends IamRequestBasedAuthenticator {
|
|
|
37
37
|
private apikey;
|
|
38
38
|
/**
|
|
39
39
|
*
|
|
40
|
-
* Create a new
|
|
40
|
+
* Create a new IamAuthenticator instance.
|
|
41
41
|
*
|
|
42
|
-
* @param
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* @throws
|
|
42
|
+
* @param options - Configuration options for IAM authentication.
|
|
43
|
+
* This should be an object containing these fields:
|
|
44
|
+
* - url: (optional) the endpoint URL for the token service
|
|
45
|
+
* - apikey: (required) the IAM api key
|
|
46
|
+
* - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
|
|
47
|
+
* should be disabled or not
|
|
48
|
+
* - headers: (optional) a set of HTTP headers to be sent with each request to the token service
|
|
49
|
+
* - clientId: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
|
|
50
|
+
* Authorization header to be included in each request to the token service
|
|
51
|
+
* - clientSecret: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
|
|
52
|
+
* Authorization header to be included in each request to the token service
|
|
53
|
+
* - scope: (optional) the "scope" parameter to use when fetching the bearer token from the token service
|
|
54
|
+
*
|
|
55
|
+
* @throws Error: the configuration options are not valid.
|
|
56
56
|
*/
|
|
57
57
|
constructor(options: Options);
|
|
58
58
|
/**
|
|
@@ -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.
|
|
@@ -36,36 +36,36 @@ var token_managers_1 = require("../token-managers");
|
|
|
36
36
|
var utils_1 = require("../utils");
|
|
37
37
|
var iam_request_based_authenticator_1 = require("./iam-request-based-authenticator");
|
|
38
38
|
/**
|
|
39
|
-
* The
|
|
40
|
-
*
|
|
39
|
+
* The IamAuthenticator will use the user-supplied `apikey`
|
|
40
|
+
* value to obtain a bearer token from a token server. When the bearer token
|
|
41
41
|
* expires, a new token is obtained from the token server. If specified, the
|
|
42
|
-
* optional, mutually inclusive
|
|
42
|
+
* optional, mutually inclusive "clientId" and "clientSecret" pair can be used to
|
|
43
43
|
* influence rate-limiting for requests to the IAM token server.
|
|
44
44
|
*
|
|
45
45
|
* The bearer token will be sent as an Authorization header in the form:
|
|
46
46
|
*
|
|
47
|
-
* Authorization: Bearer
|
|
47
|
+
* Authorization: Bearer \<bearer-token\>
|
|
48
48
|
*/
|
|
49
49
|
var IamAuthenticator = /** @class */ (function (_super) {
|
|
50
50
|
__extends(IamAuthenticator, _super);
|
|
51
51
|
/**
|
|
52
52
|
*
|
|
53
|
-
* Create a new
|
|
53
|
+
* Create a new IamAuthenticator instance.
|
|
54
54
|
*
|
|
55
|
-
* @param
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* @throws
|
|
55
|
+
* @param options - Configuration options for IAM authentication.
|
|
56
|
+
* This should be an object containing these fields:
|
|
57
|
+
* - url: (optional) the endpoint URL for the token service
|
|
58
|
+
* - apikey: (required) the IAM api key
|
|
59
|
+
* - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
|
|
60
|
+
* should be disabled or not
|
|
61
|
+
* - headers: (optional) a set of HTTP headers to be sent with each request to the token service
|
|
62
|
+
* - clientId: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
|
|
63
|
+
* Authorization header to be included in each request to the token service
|
|
64
|
+
* - clientSecret: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
|
|
65
|
+
* Authorization header to be included in each request to the token service
|
|
66
|
+
* - scope: (optional) the "scope" parameter to use when fetching the bearer token from the token service
|
|
67
|
+
*
|
|
68
|
+
* @throws Error: the configuration options are not valid.
|
|
69
69
|
*/
|
|
70
70
|
function IamAuthenticator(options) {
|
|
71
71
|
var _this = _super.call(this, options) || 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.
|
|
@@ -33,8 +33,8 @@ export interface IamRequestOptions extends BaseOptions {
|
|
|
33
33
|
scope?: string;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
* The
|
|
37
|
-
* for authenticators that interact with the IAM service
|
|
36
|
+
* The IamRequestBasedAuthenticator provides shared configuration and functionality
|
|
37
|
+
* for authenticators that interact with the IAM token service. This authenticator
|
|
38
38
|
* is not meant for use on its own.
|
|
39
39
|
*/
|
|
40
40
|
export declare class IamRequestBasedAuthenticator extends TokenRequestBasedAuthenticator {
|
|
@@ -44,41 +44,39 @@ export declare class IamRequestBasedAuthenticator extends TokenRequestBasedAuthe
|
|
|
44
44
|
protected scope: string;
|
|
45
45
|
/**
|
|
46
46
|
*
|
|
47
|
-
* Create a new
|
|
47
|
+
* Create a new IamRequestBasedAuthenticator instance.
|
|
48
48
|
*
|
|
49
|
-
* @param
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* @throws
|
|
49
|
+
* @param options - Configuration options for IAM authentication.
|
|
50
|
+
* This should be an object containing these fields:
|
|
51
|
+
* - url: (optional) the endpoint URL for the token service
|
|
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
|
+
* - clientId: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
|
|
56
|
+
* Authorization header to be included in each request to the token service
|
|
57
|
+
* - clientSecret: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
|
|
58
|
+
* Authorization header to be included in each request to the token service
|
|
59
|
+
* - scope: (optional) the "scope" parameter to use when fetching the bearer token from the token service
|
|
60
|
+
*
|
|
61
|
+
* @throws Error: the configuration options are not valid.
|
|
62
62
|
*/
|
|
63
63
|
constructor(options: IamRequestOptions);
|
|
64
64
|
/**
|
|
65
|
-
* Setter for the mutually inclusive
|
|
66
|
-
* @param
|
|
67
|
-
*
|
|
68
|
-
* @param {string} clientSecret The `clientId` and `clientSecret` fields are used to form a "basic"
|
|
69
|
-
* authorization header for IAM token requests.
|
|
65
|
+
* Setter for the mutually inclusive "clientId" and the "clientSecret" fields.
|
|
66
|
+
* @param clientId - the "clientId" value used to form a Basic Authorization header for IAM token requests
|
|
67
|
+
* @param clientSecret - the "clientSecret" value used to form a Basic Authorization header for IAM token requests
|
|
70
68
|
*/
|
|
71
69
|
setClientIdAndSecret(clientId: string, clientSecret: string): void;
|
|
72
70
|
/**
|
|
73
71
|
* Setter for the "scope" parameter to use when fetching the bearer token from the IAM token server.
|
|
74
|
-
* @param
|
|
72
|
+
* @param scope - (optional) a space-separated string that specifies one or more scopes to be
|
|
73
|
+
* associated with IAM token requests
|
|
75
74
|
*/
|
|
76
75
|
setScope(scope: string): void;
|
|
77
76
|
/**
|
|
78
77
|
* Return the most recently stored refresh token.
|
|
79
78
|
*
|
|
80
|
-
* @
|
|
81
|
-
* @returns {string}
|
|
79
|
+
* @returns the refresh token string
|
|
82
80
|
*/
|
|
83
81
|
getRefreshToken(): string;
|
|
84
82
|
}
|
|
@@ -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.
|
|
@@ -34,29 +34,29 @@ exports.IamRequestBasedAuthenticator = void 0;
|
|
|
34
34
|
var token_managers_1 = require("../token-managers");
|
|
35
35
|
var token_request_based_authenticator_1 = require("./token-request-based-authenticator");
|
|
36
36
|
/**
|
|
37
|
-
* The
|
|
38
|
-
* for authenticators that interact with the IAM service
|
|
37
|
+
* The IamRequestBasedAuthenticator provides shared configuration and functionality
|
|
38
|
+
* for authenticators that interact with the IAM token service. This authenticator
|
|
39
39
|
* is not meant for use on its own.
|
|
40
40
|
*/
|
|
41
41
|
var IamRequestBasedAuthenticator = /** @class */ (function (_super) {
|
|
42
42
|
__extends(IamRequestBasedAuthenticator, _super);
|
|
43
43
|
/**
|
|
44
44
|
*
|
|
45
|
-
* Create a new
|
|
45
|
+
* Create a new IamRequestBasedAuthenticator instance.
|
|
46
46
|
*
|
|
47
|
-
* @param
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* @throws
|
|
47
|
+
* @param options - Configuration options for IAM authentication.
|
|
48
|
+
* This should be an object containing these fields:
|
|
49
|
+
* - url: (optional) the endpoint URL for the token service
|
|
50
|
+
* - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
|
|
51
|
+
* should be disabled or not
|
|
52
|
+
* - headers: (optional) a set of HTTP headers to be sent with each request to the token service
|
|
53
|
+
* - clientId: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
|
|
54
|
+
* Authorization header to be included in each request to the token service
|
|
55
|
+
* - clientSecret: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
|
|
56
|
+
* Authorization header to be included in each request to the token service
|
|
57
|
+
* - scope: (optional) the "scope" parameter to use when fetching the bearer token from the token service
|
|
58
|
+
*
|
|
59
|
+
* @throws Error: the configuration options are not valid.
|
|
60
60
|
*/
|
|
61
61
|
function IamRequestBasedAuthenticator(options) {
|
|
62
62
|
var _this = this;
|
|
@@ -70,11 +70,9 @@ var IamRequestBasedAuthenticator = /** @class */ (function (_super) {
|
|
|
70
70
|
return _this;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
|
-
* Setter for the mutually inclusive
|
|
74
|
-
* @param
|
|
75
|
-
*
|
|
76
|
-
* @param {string} clientSecret The `clientId` and `clientSecret` fields are used to form a "basic"
|
|
77
|
-
* authorization header for IAM token requests.
|
|
73
|
+
* Setter for the mutually inclusive "clientId" and the "clientSecret" fields.
|
|
74
|
+
* @param clientId - the "clientId" value used to form a Basic Authorization header for IAM token requests
|
|
75
|
+
* @param clientSecret - the "clientSecret" value used to form a Basic Authorization header for IAM token requests
|
|
78
76
|
*/
|
|
79
77
|
IamRequestBasedAuthenticator.prototype.setClientIdAndSecret = function (clientId, clientSecret) {
|
|
80
78
|
this.clientId = clientId;
|
|
@@ -84,7 +82,8 @@ var IamRequestBasedAuthenticator = /** @class */ (function (_super) {
|
|
|
84
82
|
};
|
|
85
83
|
/**
|
|
86
84
|
* Setter for the "scope" parameter to use when fetching the bearer token from the IAM token server.
|
|
87
|
-
* @param
|
|
85
|
+
* @param scope - (optional) a space-separated string that specifies one or more scopes to be
|
|
86
|
+
* associated with IAM token requests
|
|
88
87
|
*/
|
|
89
88
|
IamRequestBasedAuthenticator.prototype.setScope = function (scope) {
|
|
90
89
|
this.scope = scope;
|
|
@@ -94,8 +93,7 @@ var IamRequestBasedAuthenticator = /** @class */ (function (_super) {
|
|
|
94
93
|
/**
|
|
95
94
|
* Return the most recently stored refresh token.
|
|
96
95
|
*
|
|
97
|
-
* @
|
|
98
|
-
* @returns {string}
|
|
96
|
+
* @returns the refresh token string
|
|
99
97
|
*/
|
|
100
98
|
IamRequestBasedAuthenticator.prototype.getRefreshToken = function () {
|
|
101
99
|
return this.tokenManager.getRefreshToken();
|
|
@@ -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,14 +34,14 @@ export type BaseOptions = {
|
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
36
|
* Class for common functionality shared by token-request authenticators.
|
|
37
|
-
*
|
|
37
|
+
* TokenRequestBasedAuthenticators use token managers to retrieve, store,
|
|
38
38
|
* and refresh tokens. Not intended to be used as stand-alone authenticator,
|
|
39
|
-
* but as
|
|
39
|
+
* but as base class to authenticators that have their own token manager
|
|
40
40
|
* implementations.
|
|
41
41
|
*
|
|
42
|
-
* The
|
|
42
|
+
* The token will be added as an Authorization header in the form:
|
|
43
43
|
*
|
|
44
|
-
* Authorization: Bearer
|
|
44
|
+
* Authorization: Bearer \<bearer-token\>
|
|
45
45
|
*/
|
|
46
46
|
export declare class TokenRequestBasedAuthenticator extends Authenticator {
|
|
47
47
|
protected tokenManager: JwtTokenManager;
|
|
@@ -49,43 +49,38 @@ export declare class TokenRequestBasedAuthenticator extends Authenticator {
|
|
|
49
49
|
protected headers: OutgoingHttpHeaders;
|
|
50
50
|
protected disableSslVerification: boolean;
|
|
51
51
|
/**
|
|
52
|
-
* Create a new
|
|
52
|
+
* Create a new TokenRequestBasedAuthenticator instance with an internal JwtTokenManager.
|
|
53
53
|
*
|
|
54
|
-
* @param
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* outbound HTTP requests to token services.
|
|
54
|
+
* @param options - Configuration options.
|
|
55
|
+
* This should be an object containing these fields:
|
|
56
|
+
* - url: (optional) the endpoint URL for the token service
|
|
57
|
+
* - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
|
|
58
|
+
* should be disabled or not
|
|
59
|
+
* - headers: (optional) a set of HTTP headers to be sent with each request to the token service
|
|
61
60
|
*/
|
|
62
61
|
constructor(options: BaseOptions);
|
|
63
62
|
/**
|
|
64
63
|
* Set the flag that indicates whether verification of the server's SSL
|
|
65
64
|
* certificate should be disabled or not.
|
|
66
65
|
*
|
|
67
|
-
* @param
|
|
66
|
+
* @param value - a flag that indicates whether verification of the
|
|
68
67
|
* token server's SSL certificate should be disabled or not.
|
|
69
68
|
*/
|
|
70
69
|
setDisableSslVerification(value: boolean): void;
|
|
71
70
|
/**
|
|
72
71
|
* Set headers.
|
|
73
72
|
*
|
|
74
|
-
* @param
|
|
75
|
-
*
|
|
73
|
+
* @param headers - a set of HTTP headers to be sent with each outbound token server request.
|
|
74
|
+
* Overwrites previous default headers.
|
|
76
75
|
*/
|
|
77
76
|
setHeaders(headers: OutgoingHttpHeaders): void;
|
|
78
77
|
/**
|
|
79
|
-
* Adds bearer token information to
|
|
80
|
-
* will be set in the Authorization property of
|
|
78
|
+
* Adds bearer token information to "requestOptions". The bearer token information
|
|
79
|
+
* will be set in the Authorization property of "requestOptions.headers" in the form:
|
|
81
80
|
*
|
|
82
|
-
* Authorization: Bearer
|
|
81
|
+
* Authorization: Bearer \<bearer-token\>
|
|
83
82
|
*
|
|
84
|
-
* @param
|
|
85
|
-
* information.
|
|
86
|
-
* @param {object.<string, string>} requestOptions.headers - The headers the
|
|
87
|
-
* authentication information will be added too. Overrides default headers
|
|
88
|
-
* where there's conflict.
|
|
83
|
+
* @param requestOptions - The request to augment with authentication information.
|
|
89
84
|
*/
|
|
90
85
|
authenticate(requestOptions: AuthenticateOptions): Promise<void>;
|
|
91
86
|
}
|