ibm-cloud-sdk-core 4.0.6 → 4.0.8
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/Authentication.md +2 -1
- package/CHANGELOG.md +14 -0
- package/auth/authenticators/basic-authenticator.d.ts +1 -1
- package/auth/authenticators/basic-authenticator.js +4 -4
- package/auth/authenticators/bearer-token-authenticator.d.ts +1 -1
- package/auth/authenticators/bearer-token-authenticator.js +3 -3
- package/auth/authenticators/cloud-pak-for-data-authenticator.d.ts +2 -2
- package/auth/authenticators/cloud-pak-for-data-authenticator.js +3 -3
- package/auth/authenticators/container-authenticator.d.ts +2 -2
- package/auth/authenticators/container-authenticator.js +3 -3
- package/auth/authenticators/iam-authenticator.d.ts +2 -2
- package/auth/authenticators/iam-authenticator.js +5 -5
- package/auth/authenticators/iam-request-based-authenticator.d.ts +2 -2
- package/auth/authenticators/iam-request-based-authenticator.js +3 -3
- package/auth/authenticators/index.d.ts +2 -2
- package/auth/authenticators/index.js +1 -1
- package/auth/authenticators/token-request-based-authenticator.d.ts +2 -2
- package/auth/authenticators/token-request-based-authenticator.js +3 -3
- package/auth/authenticators/vpc-instance-authenticator.d.ts +2 -2
- package/auth/authenticators/vpc-instance-authenticator.js +3 -3
- package/auth/token-managers/container-token-manager.d.ts +11 -1
- package/auth/token-managers/container-token-manager.js +41 -17
- package/auth/token-managers/cp4d-token-manager.d.ts +1 -1
- package/auth/token-managers/cp4d-token-manager.js +3 -3
- package/auth/token-managers/iam-request-based-token-manager.d.ts +1 -1
- package/auth/token-managers/iam-request-based-token-manager.js +6 -6
- package/auth/token-managers/iam-token-manager.d.ts +1 -1
- package/auth/token-managers/iam-token-manager.js +3 -3
- package/auth/token-managers/token-manager.d.ts +1 -1
- package/auth/token-managers/token-manager.js +4 -4
- package/auth/token-managers/vpc-instance-token-manager.js +2 -2
- package/auth/utils/file-reading-helpers.d.ts +1 -1
- package/auth/utils/file-reading-helpers.js +9 -13
- package/build/docs/ibm-cloud-sdk-core.atleastone.md +2 -2
- 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 +2 -2
- package/build/docs/ibm-cloud-sdk-core.authenticator.authenticationtype.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_basic.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_bearertoken.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_container.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_cp4d.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_iam.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_noauth.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_unknown.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_vpc.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.authenticator.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.authenticate.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.authenticationtype.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.baseservice._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.baseservice.baseoptions.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.baseservice.configureservice.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.baseservice.createrequest.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.baseservice.default_service_name.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.baseservice.default_service_url.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.baseservice.disableretries.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.baseservice.enableretries.md +3 -3
- package/build/docs/ibm-cloud-sdk-core.baseservice.getauthenticator.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.baseservice.gethttpclient.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.baseservice.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.baseservice.setdefaultheaders.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.baseservice.setenablegzipcompression.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.baseservice.setserviceurl.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.basicauthenticator._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authenticate.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authenticationtype.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authheader.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.basicauthenticator.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.basicauthenticator.requiredoptions.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.authenticate.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.authenticationtype.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.requiredoptions.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.setbearertoken.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.buildrequestfileobject.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.checkcredentials.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.authenticationtype.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.requiredoptions.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.tokenmanager.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.computebasicauthheader.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.constructfilepath.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.constructserviceurl.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.containerauthenticator._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.containerauthenticator.authenticationtype.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.containerauthenticator.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setcrtokenfilename.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setiamprofileid.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setiamprofilename.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.containerauthenticator.tokenmanager.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.containertokenmanager._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.containertokenmanager.getcrtoken.md +19 -0
- package/build/docs/ibm-cloud-sdk-core.containertokenmanager.md +3 -2
- package/build/docs/ibm-cloud-sdk-core.containertokenmanager.requesttoken.md +2 -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.contenttype.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager.requesttoken.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager.requiredoptions.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.fileexistsatpath.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.fileobject.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.fileobject.options.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.fileobject.value.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.fileoptions.contenttype.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.fileoptions.filename.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.fileoptions.md +3 -3
- package/build/docs/ibm-cloud-sdk-core.filestream.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.filestream.path.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.filewithmetadata.contenttype.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.filewithmetadata.data.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.filewithmetadata.filename.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.filewithmetadata.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.getauthenticatorfromenvironment.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.getcontenttype.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.getcurrenttime.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.getformat.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.getmissingparams.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.getnewlogger.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.getqueryparam.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamauthenticator._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamauthenticator.authenticationtype.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamauthenticator.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamauthenticator.requiredoptions.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamauthenticator.tokenmanager.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.clientid.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.clientsecret.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.getrefreshtoken.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.scope.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setclientidandsecret.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setscope.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.tokenmanager.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.formdata.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.getrefreshtoken.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.refreshtoken.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.requesttoken.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.savetokeninfo.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.setclientidandsecret.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.setscope.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.clientid.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.clientsecret.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.md +5 -5
- package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.scope.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamtokenmanager._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.iamtokenmanager.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.iamtokenmanager.requiredoptions.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.isemptyobject.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.isfiledata.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.isfilewithmetadata.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.ishtml.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.isjsonmimetype.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.jwttokenmanager._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.requesttoken.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.savetokeninfo.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.tokeninfo.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.tokenname.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.jwttokenmanageroptions.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.noauthauthenticator.authenticate.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.noauthauthenticator.authenticationtype.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.noauthauthenticator.md +2 -2
- 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.readcredentialsfile.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.readcrtokenfile.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.readexternalsources.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.removesuffix.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.sdklogger.debug.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.sdklogger.error.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.sdklogger.info.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.sdklogger.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.sdklogger.verbose.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.sdklogger.warn.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.streamtopromise.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.striptrailingslash.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.tokenmanager._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.accesstoken.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.disablesslverification.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.expiretime.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.gettoken.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.headers.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.pacedrequesttoken.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.refreshtime.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.requesttoken.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.requestwrapperinstance.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.savetokeninfo.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.setdisablesslverification.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.setheaders.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.tokenmanager.url.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenmanageroptions.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.authenticate.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.disablesslverification.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.headers.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.setdisablesslverification.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.setheaders.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.tokenmanager.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.url.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.tolowerkeys.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.unittestutils.checkforsuccessfulexecution.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.unittestutils.checkmediaheaders.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.unittestutils.checkurlandmethod.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.unittestutils.checkuserheader.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.unittestutils.expecttobepromise.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.unittestutils.getoptions.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.useroptions.authenticator.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.useroptions.disablesslverification.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.useroptions.headers.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.useroptions.jar.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.useroptions.md +8 -8
- package/build/docs/ibm-cloud-sdk-core.useroptions.serviceurl.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.useroptions.url.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.useroptions.version.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.validateinput.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.validateparams.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.authenticationtype.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.md +2 -2
- 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.vpcinstanceauthenticator.tokenmanager.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager._constructor_.md +1 -1
- package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.md +2 -2
- package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.requesttoken.md +2 -2
- 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 +187 -43
- package/es/auth/authenticators/basic-authenticator.d.ts +1 -1
- package/es/auth/authenticators/basic-authenticator.js +2 -2
- package/es/auth/authenticators/bearer-token-authenticator.d.ts +1 -1
- package/es/auth/authenticators/bearer-token-authenticator.js +2 -2
- package/es/auth/authenticators/cloud-pak-for-data-authenticator.d.ts +2 -2
- package/es/auth/authenticators/cloud-pak-for-data-authenticator.js +2 -2
- package/es/auth/authenticators/container-authenticator.d.ts +2 -2
- package/es/auth/authenticators/container-authenticator.js +2 -2
- package/es/auth/authenticators/iam-authenticator.d.ts +2 -2
- package/es/auth/authenticators/iam-authenticator.js +3 -3
- package/es/auth/authenticators/iam-request-based-authenticator.d.ts +2 -2
- package/es/auth/authenticators/iam-request-based-authenticator.js +2 -2
- package/es/auth/authenticators/index.d.ts +2 -2
- package/es/auth/authenticators/index.js +1 -1
- package/es/auth/authenticators/token-request-based-authenticator.d.ts +2 -2
- package/es/auth/authenticators/token-request-based-authenticator.js +2 -2
- package/es/auth/authenticators/vpc-instance-authenticator.d.ts +2 -2
- package/es/auth/authenticators/vpc-instance-authenticator.js +2 -2
- package/es/auth/token-managers/container-token-manager.d.ts +11 -1
- package/es/auth/token-managers/container-token-manager.js +40 -12
- package/es/auth/token-managers/cp4d-token-manager.d.ts +1 -1
- package/es/auth/token-managers/cp4d-token-manager.js +2 -2
- package/es/auth/token-managers/iam-request-based-token-manager.d.ts +1 -1
- package/es/auth/token-managers/iam-request-based-token-manager.js +2 -2
- package/es/auth/token-managers/iam-token-manager.d.ts +1 -1
- package/es/auth/token-managers/iam-token-manager.js +2 -2
- package/es/auth/token-managers/token-manager.d.ts +1 -1
- package/es/auth/token-managers/token-manager.js +1 -1
- package/es/auth/token-managers/vpc-instance-token-manager.js +1 -1
- package/es/auth/utils/file-reading-helpers.d.ts +1 -1
- package/es/auth/utils/file-reading-helpers.js +9 -13
- package/es/tsdoc-metadata.json +1 -1
- package/etc/ibm-cloud-sdk-core.api.md +1 -0
- package/ibm-cloud-sdk-core.d.ts +11 -1
- package/package.json +1 -1
- package/temp/ibm-cloud-sdk-core.api.json +187 -43
- package/temp/ibm-cloud-sdk-core.api.md +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import extend from 'extend';
|
|
17
|
-
import { computeBasicAuthHeader, validateInput } from '../utils';
|
|
17
|
+
import { computeBasicAuthHeader, validateInput } from '../utils/helpers';
|
|
18
18
|
import { Authenticator } from './authenticator';
|
|
19
19
|
/**
|
|
20
20
|
* The BasicAuthenticator is used to add basic authentication information to
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import extend from 'extend';
|
|
17
|
-
import { validateInput } from '../utils';
|
|
17
|
+
import { validateInput } from '../utils/helpers';
|
|
18
18
|
import { Authenticator } from './authenticator';
|
|
19
19
|
/**
|
|
20
20
|
* The BearerTokenAuthenticator will set a user-provided bearer token
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { Cp4dTokenManager } from '../token-managers';
|
|
16
|
+
import { Cp4dTokenManager } from '../token-managers/cp4d-token-manager';
|
|
17
17
|
import { BaseOptions, TokenRequestBasedAuthenticator } from './token-request-based-authenticator';
|
|
18
18
|
/** Configuration options for CloudPakForData authentication. */
|
|
19
19
|
export interface Options extends BaseOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Authenticator } from './authenticator';
|
|
17
|
-
import { Cp4dTokenManager } from '../token-managers';
|
|
17
|
+
import { Cp4dTokenManager } from '../token-managers/cp4d-token-manager';
|
|
18
18
|
import { TokenRequestBasedAuthenticator } from './token-request-based-authenticator';
|
|
19
19
|
/**
|
|
20
20
|
* The CloudPakForDataAuthenticator will either use a username/password pair or a username/apikey pair to obtain
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2021,
|
|
2
|
+
* Copyright 2021, 202e 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.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ContainerTokenManager } from '../token-managers';
|
|
16
|
+
import { ContainerTokenManager } from '../token-managers/container-token-manager';
|
|
17
17
|
import { IamRequestOptions, IamRequestBasedAuthenticator } from './iam-request-based-authenticator';
|
|
18
18
|
/** Configuration options for IAM authentication. */
|
|
19
19
|
export interface Options extends IamRequestOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2021,
|
|
2
|
+
* Copyright 2021, 202e 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.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Authenticator } from './authenticator';
|
|
17
|
-
import { ContainerTokenManager } from '../token-managers';
|
|
17
|
+
import { ContainerTokenManager } from '../token-managers/container-token-manager';
|
|
18
18
|
import { IamRequestBasedAuthenticator } from './iam-request-based-authenticator';
|
|
19
19
|
/**
|
|
20
20
|
* The ContainerAuthenticator will read a compute resource token from the file system
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { IamTokenManager } from '../token-managers';
|
|
16
|
+
import { IamTokenManager } from '../token-managers/iam-token-manager';
|
|
17
17
|
import { IamRequestOptions, IamRequestBasedAuthenticator } from './iam-request-based-authenticator';
|
|
18
18
|
/** Configuration options for IAM authentication. */
|
|
19
19
|
export interface Options extends IamRequestOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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.
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Authenticator } from './authenticator';
|
|
17
|
-
import { IamTokenManager } from '../token-managers';
|
|
18
|
-
import { validateInput } from '../utils';
|
|
17
|
+
import { IamTokenManager } from '../token-managers/iam-token-manager';
|
|
18
|
+
import { validateInput } from '../utils/helpers';
|
|
19
19
|
import { IamRequestBasedAuthenticator } from './iam-request-based-authenticator';
|
|
20
20
|
/**
|
|
21
21
|
* The IamAuthenticator will use the user-supplied `apikey`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 202e.
|
|
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.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { IamRequestBasedTokenManager } from '../token-managers';
|
|
16
|
+
import { IamRequestBasedTokenManager } from '../token-managers/iam-request-based-token-manager';
|
|
17
17
|
import { BaseOptions, TokenRequestBasedAuthenticator } from './token-request-based-authenticator';
|
|
18
18
|
/** Configuration options for IAM Request based authentication. */
|
|
19
19
|
export interface IamRequestOptions extends BaseOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 202e.
|
|
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.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { IamRequestBasedTokenManager } from '../token-managers';
|
|
16
|
+
import { IamRequestBasedTokenManager } from '../token-managers/iam-request-based-token-manager';
|
|
17
17
|
import { TokenRequestBasedAuthenticator } from './token-request-based-authenticator';
|
|
18
18
|
/**
|
|
19
19
|
* The IamRequestBasedAuthenticator provides shared configuration and functionality
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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.
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* authentication type is implemented as an Authenticator for consumption by a service.
|
|
30
30
|
*
|
|
31
31
|
* classes:
|
|
32
|
-
* AuthenticatorInterface: Implement this
|
|
32
|
+
* AuthenticatorInterface: Implement this interface to provide custom authentication schemes to services.
|
|
33
33
|
* Authenticator: Extend this class to provide custom authentication schemes to services.
|
|
34
34
|
* BasicAuthenticator: Authenticator for passing supplied basic authentication information to service endpoint.
|
|
35
35
|
* BearerTokenAuthenticator: Authenticator for passing supplied bearer token to service endpoint.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
/// <reference types="node" />
|
|
17
17
|
import { OutgoingHttpHeaders } from 'http';
|
|
18
|
-
import { JwtTokenManager } from '../token-managers';
|
|
18
|
+
import { JwtTokenManager } from '../token-managers/jwt-token-manager';
|
|
19
19
|
import { Authenticator } from './authenticator';
|
|
20
20
|
import { AuthenticateOptions } from './authenticator-interface';
|
|
21
21
|
/** Configuration options for token-based authentication. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import extend from 'extend';
|
|
17
|
-
import { JwtTokenManager } from '../token-managers';
|
|
17
|
+
import { JwtTokenManager } from '../token-managers/jwt-token-manager';
|
|
18
18
|
import { Authenticator } from './authenticator';
|
|
19
19
|
/**
|
|
20
20
|
* Class for common functionality shared by token-request authenticators.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2021,
|
|
2
|
+
* (C) Copyright IBM Corp. 2021, 2023.
|
|
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.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { VpcInstanceTokenManager } from '../token-managers';
|
|
16
|
+
import { VpcInstanceTokenManager } from '../token-managers/vpc-instance-token-manager';
|
|
17
17
|
import { BaseOptions, TokenRequestBasedAuthenticator } from './token-request-based-authenticator';
|
|
18
18
|
/** Configuration options for VpcInstance authentication. */
|
|
19
19
|
export interface Options extends BaseOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2021,
|
|
2
|
+
* (C) Copyright IBM Corp. 2021, 2023.
|
|
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.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Authenticator } from './authenticator';
|
|
17
|
-
import { VpcInstanceTokenManager } from '../token-managers';
|
|
17
|
+
import { VpcInstanceTokenManager } from '../token-managers/vpc-instance-token-manager';
|
|
18
18
|
import { TokenRequestBasedAuthenticator } from './token-request-based-authenticator';
|
|
19
19
|
/**
|
|
20
20
|
* The VpcInstanceAuthenticator implements an authentication scheme in which it retrieves an "instance identity token"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2021,
|
|
2
|
+
* Copyright 2021, 2023 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.
|
|
@@ -69,5 +69,15 @@ export declare class ContainerTokenManager extends IamRequestBasedTokenManager {
|
|
|
69
69
|
* Request an IAM token using a compute resource token.
|
|
70
70
|
*/
|
|
71
71
|
protected requestToken(): Promise<any>;
|
|
72
|
+
/**
|
|
73
|
+
* Retrieves the CR token from a file using this search order:
|
|
74
|
+
* 1. User-specified filename (if specified)
|
|
75
|
+
* 2. Default file #1 (/var/run/secrets/tokens/vault-token)
|
|
76
|
+
* 3. Default file #2 (/var/run/secrets/tokens/sa-token)
|
|
77
|
+
* First one found wins.
|
|
78
|
+
*
|
|
79
|
+
* @returns the CR token value as a string
|
|
80
|
+
*/
|
|
81
|
+
protected getCrToken(): string;
|
|
72
82
|
}
|
|
73
83
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2021,
|
|
2
|
+
* Copyright 2021, 2023 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.
|
|
@@ -22,10 +22,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
22
22
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
25
|
+
import { atLeastOne } from '../utils/helpers';
|
|
26
|
+
import { readCrTokenFile } from '../utils/file-reading-helpers';
|
|
27
27
|
import { IamRequestBasedTokenManager } from './iam-request-based-token-manager';
|
|
28
|
-
const
|
|
28
|
+
const DEFAULT_CR_TOKEN_FILEPATH1 = '/var/run/secrets/tokens/vault-token';
|
|
29
|
+
const DEFAULT_CR_TOKEN_FILEPATH2 = '/var/run/secrets/tokens/sa-token';
|
|
29
30
|
/**
|
|
30
31
|
* The ContainerTokenManager retrieves a compute resource token from a file on the container. This token
|
|
31
32
|
* is used to perform the necessary interactions with the IAM token service to obtain and store a suitable
|
|
@@ -59,7 +60,9 @@ export class ContainerTokenManager extends IamRequestBasedTokenManager {
|
|
|
59
60
|
if (!atLeastOne(options.iamProfileId, options.iamProfileName)) {
|
|
60
61
|
throw new Error('At least one of `iamProfileName` or `iamProfileId` must be specified.');
|
|
61
62
|
}
|
|
62
|
-
|
|
63
|
+
if (options.crTokenFilename) {
|
|
64
|
+
this.crTokenFilename = options.crTokenFilename;
|
|
65
|
+
}
|
|
63
66
|
if (options.iamProfileName) {
|
|
64
67
|
this.iamProfileName = options.iamProfileName;
|
|
65
68
|
}
|
|
@@ -98,8 +101,7 @@ export class ContainerTokenManager extends IamRequestBasedTokenManager {
|
|
|
98
101
|
requestToken: { get: () => super.requestToken }
|
|
99
102
|
});
|
|
100
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
-
|
|
102
|
-
this.formData.cr_token = crToken;
|
|
104
|
+
this.formData.cr_token = this.getCrToken();
|
|
103
105
|
// these member variables can be reset, set them in the form data right
|
|
104
106
|
// before making the request to ensure they're up to date
|
|
105
107
|
if (this.iamProfileName) {
|
|
@@ -111,9 +113,35 @@ export class ContainerTokenManager extends IamRequestBasedTokenManager {
|
|
|
111
113
|
return _super.requestToken.call(this);
|
|
112
114
|
});
|
|
113
115
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Retrieves the CR token from a file using this search order:
|
|
118
|
+
* 1. User-specified filename (if specified)
|
|
119
|
+
* 2. Default file #1 (/var/run/secrets/tokens/vault-token)
|
|
120
|
+
* 3. Default file #2 (/var/run/secrets/tokens/sa-token)
|
|
121
|
+
* First one found wins.
|
|
122
|
+
*
|
|
123
|
+
* @returns the CR token value as a string
|
|
124
|
+
*/
|
|
125
|
+
getCrToken() {
|
|
126
|
+
try {
|
|
127
|
+
let crToken = null;
|
|
128
|
+
if (this.crTokenFilename) {
|
|
129
|
+
// If the user specified a filename, then try to read from that.
|
|
130
|
+
crToken = readCrTokenFile(this.crTokenFilename);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
// If no filename was specified, then try our two default filenames.
|
|
134
|
+
try {
|
|
135
|
+
crToken = readCrTokenFile(DEFAULT_CR_TOKEN_FILEPATH1);
|
|
136
|
+
}
|
|
137
|
+
catch (err) {
|
|
138
|
+
crToken = readCrTokenFile(DEFAULT_CR_TOKEN_FILEPATH2);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return crToken;
|
|
142
|
+
}
|
|
143
|
+
catch (err) {
|
|
144
|
+
throw new Error(`Error reading CR token file: ${err.toString()}`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
119
147
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import extend from 'extend';
|
|
17
|
-
import { validateInput } from '../utils';
|
|
17
|
+
import { validateInput } from '../utils/helpers';
|
|
18
18
|
import { JwtTokenManager } from './jwt-token-manager';
|
|
19
19
|
/**
|
|
20
20
|
* Token Manager of CloudPak for data.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import extend from 'extend';
|
|
17
17
|
import logger from '../../lib/logger';
|
|
18
|
-
import { computeBasicAuthHeader, onlyOne, removeSuffix } from '../utils';
|
|
18
|
+
import { computeBasicAuthHeader, onlyOne, removeSuffix } from '../utils/helpers';
|
|
19
19
|
import { JwtTokenManager } from './jwt-token-manager';
|
|
20
20
|
const CLIENT_ID_SECRET_WARNING = 'Warning: Client ID and Secret must BOTH be given, or the header will not be included.';
|
|
21
21
|
const DEFAULT_IAM_URL = 'https://iam.cloud.ibm.com';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* (C) Copyright IBM Corp. 2019,
|
|
2
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { validateInput } from '../utils';
|
|
16
|
+
import { validateInput } from '../utils/helpers';
|
|
17
17
|
import { IamRequestBasedTokenManager } from './iam-request-based-token-manager';
|
|
18
18
|
/**
|
|
19
19
|
* The IAMTokenManager takes an api key and performs the necessary interactions with
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { stripTrailingSlash } from '../../lib/helper';
|
|
3
3
|
import logger from '../../lib/logger';
|
|
4
4
|
import { RequestWrapper } from '../../lib/request-wrapper';
|
|
5
|
-
import { getCurrentTime } from '../utils';
|
|
5
|
+
import { getCurrentTime } from '../utils/helpers';
|
|
6
6
|
/**
|
|
7
7
|
* A class for shared functionality for storing, and requesting tokens.
|
|
8
8
|
* Intended to be used as a parent to be extended for token request management.
|
|
@@ -23,7 +23,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
import logger from '../../lib/logger';
|
|
26
|
-
import { atMostOne } from '../utils';
|
|
26
|
+
import { atMostOne } from '../utils/helpers';
|
|
27
27
|
import { JwtTokenManager } from './jwt-token-manager';
|
|
28
28
|
const DEFAULT_IMS_ENDPOINT = 'http://169.254.169.254';
|
|
29
29
|
const METADATA_SERVICE_VERSION = '2022-03-01';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2021 IBM Corp. All Rights Reserved.
|
|
2
|
+
* Copyright 2021, 2023 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.
|
|
@@ -79,20 +79,16 @@ export function readCrTokenFile(filepath) {
|
|
|
79
79
|
if (!existsSync) {
|
|
80
80
|
return '';
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
try {
|
|
83
|
+
let token = '';
|
|
84
|
+
logger.debug(`Attempting to read CR token from file: ${filepath}`);
|
|
85
85
|
token = readFileSync(filepath, 'utf8');
|
|
86
86
|
logger.debug(`Successfully read CR token from file: ${filepath}`);
|
|
87
|
+
return token;
|
|
87
88
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
else {
|
|
93
|
-
logger.error(`Expected to find CR token file but the file does not exist: ${filepath}`);
|
|
94
|
-
}
|
|
95
|
-
throw new Error(`Unable to retrieve the CR token value from file: ${filepath}`);
|
|
89
|
+
catch (err) {
|
|
90
|
+
const msg = `Error reading CR token: ${err.toString()}`;
|
|
91
|
+
logger.debug(msg);
|
|
92
|
+
throw new Error(msg);
|
|
96
93
|
}
|
|
97
|
-
return token;
|
|
98
94
|
}
|
package/es/tsdoc-metadata.json
CHANGED
|
@@ -149,6 +149,7 @@ export class ContainerAuthenticator extends IamRequestBasedAuthenticator {
|
|
|
149
149
|
export class ContainerTokenManager extends IamRequestBasedTokenManager {
|
|
150
150
|
// Warning: (ae-forgotten-export) The symbol "Options_7" needs to be exported by the entry point index.d.ts
|
|
151
151
|
constructor(options: Options_7);
|
|
152
|
+
protected getCrToken(): string;
|
|
152
153
|
protected requestToken(): Promise<any>;
|
|
153
154
|
setCrTokenFilename(crTokenFilename: string): void;
|
|
154
155
|
setIamProfileId(iamProfileId: string): void;
|
package/ibm-cloud-sdk-core.d.ts
CHANGED
|
@@ -567,6 +567,16 @@ export declare class ContainerTokenManager extends IamRequestBasedTokenManager {
|
|
|
567
567
|
* Request an IAM token using a compute resource token.
|
|
568
568
|
*/
|
|
569
569
|
protected requestToken(): Promise<any>;
|
|
570
|
+
/**
|
|
571
|
+
* Retrieves the CR token from a file using this search order:
|
|
572
|
+
* 1. User-specified filename (if specified)
|
|
573
|
+
* 2. Default file #1 (/var/run/secrets/tokens/vault-token)
|
|
574
|
+
* 3. Default file #2 (/var/run/secrets/tokens/sa-token)
|
|
575
|
+
* First one found wins.
|
|
576
|
+
*
|
|
577
|
+
* @returns the CR token value as a string
|
|
578
|
+
*/
|
|
579
|
+
protected getCrToken(): string;
|
|
570
580
|
}
|
|
571
581
|
|
|
572
582
|
export declare const contentType: {
|
|
@@ -1138,7 +1148,7 @@ export declare const qs: {
|
|
|
1138
1148
|
};
|
|
1139
1149
|
|
|
1140
1150
|
/**
|
|
1141
|
-
* Copyright 2021 IBM Corp. All Rights Reserved.
|
|
1151
|
+
* Copyright 2021, 2023 IBM Corp. All Rights Reserved.
|
|
1142
1152
|
*
|
|
1143
1153
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1144
1154
|
* you may not use this file except in compliance with the License.
|