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
package/Authentication.md
CHANGED
|
@@ -252,7 +252,8 @@ The IAM access token is added to each outbound request in the `Authorization` he
|
|
|
252
252
|
### Properties
|
|
253
253
|
|
|
254
254
|
- crTokenFilename: (optional) the name of the file containing the injected CR token value.
|
|
255
|
-
If not specified, then `/var/run/secrets/tokens/vault-token`
|
|
255
|
+
If not specified, then the authenticator will first try `/var/run/secrets/tokens/vault-token`
|
|
256
|
+
and then `/var/run/secrets/tokens/sa-token` as the default value (first file found is used).
|
|
256
257
|
The application must have `read` permissions on the file containing the CR token value.
|
|
257
258
|
|
|
258
259
|
- iamProfileName: (optional) the name of the linked trusted IAM profile to be used when obtaining the
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [4.0.8](https://github.com/IBM/node-sdk-core/compare/v4.0.7...v4.0.8) (2023-05-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* refresh dependencies and address import cycles ([#244](https://github.com/IBM/node-sdk-core/issues/244)) ([72aa8d5](https://github.com/IBM/node-sdk-core/commit/72aa8d5f8308ea0e7d092e79b45743fc3f273506))
|
|
7
|
+
|
|
8
|
+
## [4.0.7](https://github.com/IBM/node-sdk-core/compare/v4.0.6...v4.0.7) (2023-05-22)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **ContainerAuthenticator:** add sa-token as default CR token filename ([#241](https://github.com/IBM/node-sdk-core/issues/241)) ([91f9932](https://github.com/IBM/node-sdk-core/commit/91f9932ab0a74c11e1de5aecb46481dee3058018))
|
|
14
|
+
|
|
1
15
|
## [4.0.6](https://github.com/IBM/node-sdk-core/compare/v4.0.5...v4.0.6) (2023-05-18)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* (C) Copyright IBM Corp. 2019,
|
|
3
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.BasicAuthenticator = void 0;
|
|
37
37
|
var extend_1 = __importDefault(require("extend"));
|
|
38
|
-
var
|
|
38
|
+
var helpers_1 = require("../utils/helpers");
|
|
39
39
|
var authenticator_1 = require("./authenticator");
|
|
40
40
|
/**
|
|
41
41
|
* The BasicAuthenticator is used to add basic authentication information to
|
|
@@ -61,9 +61,9 @@ var BasicAuthenticator = /** @class */ (function (_super) {
|
|
|
61
61
|
function BasicAuthenticator(options) {
|
|
62
62
|
var _this = _super.call(this) || this;
|
|
63
63
|
_this.requiredOptions = ['username', 'password'];
|
|
64
|
-
(0,
|
|
64
|
+
(0, helpers_1.validateInput)(options, _this.requiredOptions);
|
|
65
65
|
var username = options.username, password = options.password;
|
|
66
|
-
var authHeaderString = (0,
|
|
66
|
+
var authHeaderString = (0, helpers_1.computeBasicAuthHeader)(username, password);
|
|
67
67
|
_this.authHeader = { Authorization: authHeaderString };
|
|
68
68
|
return _this;
|
|
69
69
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* (C) Copyright IBM Corp. 2019,
|
|
3
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.BearerTokenAuthenticator = void 0;
|
|
37
37
|
var extend_1 = __importDefault(require("extend"));
|
|
38
|
-
var
|
|
38
|
+
var helpers_1 = require("../utils/helpers");
|
|
39
39
|
var authenticator_1 = require("./authenticator");
|
|
40
40
|
/**
|
|
41
41
|
* The BearerTokenAuthenticator will set a user-provided bearer token
|
|
@@ -58,7 +58,7 @@ var BearerTokenAuthenticator = /** @class */ (function (_super) {
|
|
|
58
58
|
function BearerTokenAuthenticator(options) {
|
|
59
59
|
var _this = _super.call(this) || this;
|
|
60
60
|
_this.requiredOptions = ['bearerToken'];
|
|
61
|
-
(0,
|
|
61
|
+
(0, helpers_1.validateInput)(options, _this.requiredOptions);
|
|
62
62
|
_this.bearerToken = options.bearerToken;
|
|
63
63
|
return _this;
|
|
64
64
|
}
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* (C) Copyright IBM Corp. 2019,
|
|
3
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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.
|
|
@@ -32,7 +32,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.CloudPakForDataAuthenticator = void 0;
|
|
34
34
|
var authenticator_1 = require("./authenticator");
|
|
35
|
-
var
|
|
35
|
+
var cp4d_token_manager_1 = require("../token-managers/cp4d-token-manager");
|
|
36
36
|
var token_request_based_authenticator_1 = require("./token-request-based-authenticator");
|
|
37
37
|
/**
|
|
38
38
|
* The CloudPakForDataAuthenticator will either use a username/password pair or a username/apikey pair to obtain
|
|
@@ -68,7 +68,7 @@ var CloudPakForDataAuthenticator = /** @class */ (function (_super) {
|
|
|
68
68
|
// the param names are shared between the authenticator and the token
|
|
69
69
|
// manager so we can just pass along the options object.
|
|
70
70
|
// also, the token manager will handle input validation
|
|
71
|
-
_this.tokenManager = new
|
|
71
|
+
_this.tokenManager = new cp4d_token_manager_1.Cp4dTokenManager(options);
|
|
72
72
|
return _this;
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright 2021,
|
|
3
|
+
* Copyright 2021, 202e 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.
|
|
@@ -32,7 +32,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.ContainerAuthenticator = void 0;
|
|
34
34
|
var authenticator_1 = require("./authenticator");
|
|
35
|
-
var
|
|
35
|
+
var container_token_manager_1 = require("../token-managers/container-token-manager");
|
|
36
36
|
var iam_request_based_authenticator_1 = require("./iam-request-based-authenticator");
|
|
37
37
|
/**
|
|
38
38
|
* The ContainerAuthenticator will read a compute resource token from the file system
|
|
@@ -71,7 +71,7 @@ var ContainerAuthenticator = /** @class */ (function (_super) {
|
|
|
71
71
|
// the param names are shared between the authenticator and the token
|
|
72
72
|
// manager so we can just pass along the options object
|
|
73
73
|
// the token manager will also handle the validation of required options
|
|
74
|
-
_this.tokenManager = new
|
|
74
|
+
_this.tokenManager = new container_token_manager_1.ContainerTokenManager(options);
|
|
75
75
|
_this.crTokenFilename = options.crTokenFilename;
|
|
76
76
|
_this.iamProfileName = options.iamProfileName;
|
|
77
77
|
_this.iamProfileId = options.iamProfileId;
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* (C) Copyright IBM Corp. 2019,
|
|
3
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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.
|
|
@@ -32,8 +32,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.IamAuthenticator = void 0;
|
|
34
34
|
var authenticator_1 = require("./authenticator");
|
|
35
|
-
var
|
|
36
|
-
var
|
|
35
|
+
var iam_token_manager_1 = require("../token-managers/iam-token-manager");
|
|
36
|
+
var helpers_1 = require("../utils/helpers");
|
|
37
37
|
var iam_request_based_authenticator_1 = require("./iam-request-based-authenticator");
|
|
38
38
|
/**
|
|
39
39
|
* The IamAuthenticator will use the user-supplied `apikey`
|
|
@@ -70,11 +70,11 @@ var IamAuthenticator = /** @class */ (function (_super) {
|
|
|
70
70
|
function IamAuthenticator(options) {
|
|
71
71
|
var _this = _super.call(this, options) || this;
|
|
72
72
|
_this.requiredOptions = ['apikey'];
|
|
73
|
-
(0,
|
|
73
|
+
(0, helpers_1.validateInput)(options, _this.requiredOptions);
|
|
74
74
|
_this.apikey = options.apikey;
|
|
75
75
|
// the param names are shared between the authenticator and the token
|
|
76
76
|
// manager so we can just pass along the options object
|
|
77
|
-
_this.tokenManager = new
|
|
77
|
+
_this.tokenManager = new iam_token_manager_1.IamTokenManager(options);
|
|
78
78
|
return _this;
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* (C) Copyright IBM Corp. 2019,
|
|
3
|
+
* (C) Copyright IBM Corp. 2019, 202e.
|
|
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.
|
|
@@ -31,7 +31,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
31
31
|
})();
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.IamRequestBasedAuthenticator = void 0;
|
|
34
|
-
var
|
|
34
|
+
var iam_request_based_token_manager_1 = require("../token-managers/iam-request-based-token-manager");
|
|
35
35
|
var token_request_based_authenticator_1 = require("./token-request-based-authenticator");
|
|
36
36
|
/**
|
|
37
37
|
* The IamRequestBasedAuthenticator provides shared configuration and functionality
|
|
@@ -66,7 +66,7 @@ var IamRequestBasedAuthenticator = /** @class */ (function (_super) {
|
|
|
66
66
|
_this.clientId = options.clientId;
|
|
67
67
|
_this.clientSecret = options.clientSecret;
|
|
68
68
|
_this.scope = options.scope;
|
|
69
|
-
_this.tokenManager = new
|
|
69
|
+
_this.tokenManager = new iam_request_based_token_manager_1.IamRequestBasedTokenManager(options);
|
|
70
70
|
return _this;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* (C) Copyright IBM Corp. 2019,
|
|
3
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.TokenRequestBasedAuthenticator = void 0;
|
|
37
37
|
var extend_1 = __importDefault(require("extend"));
|
|
38
|
-
var
|
|
38
|
+
var jwt_token_manager_1 = require("../token-managers/jwt-token-manager");
|
|
39
39
|
var authenticator_1 = require("./authenticator");
|
|
40
40
|
/**
|
|
41
41
|
* Class for common functionality shared by token-request authenticators.
|
|
@@ -66,7 +66,7 @@ var TokenRequestBasedAuthenticator = /** @class */ (function (_super) {
|
|
|
66
66
|
_this.url = options.url;
|
|
67
67
|
// default to empty object
|
|
68
68
|
_this.headers = options.headers || {};
|
|
69
|
-
_this.tokenManager = new
|
|
69
|
+
_this.tokenManager = new jwt_token_manager_1.JwtTokenManager(options);
|
|
70
70
|
return _this;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* (C) Copyright IBM Corp. 2021,
|
|
3
|
+
* (C) Copyright IBM Corp. 2021, 2023.
|
|
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.
|
|
@@ -32,7 +32,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.VpcInstanceAuthenticator = void 0;
|
|
34
34
|
var authenticator_1 = require("./authenticator");
|
|
35
|
-
var
|
|
35
|
+
var vpc_instance_token_manager_1 = require("../token-managers/vpc-instance-token-manager");
|
|
36
36
|
var token_request_based_authenticator_1 = require("./token-request-based-authenticator");
|
|
37
37
|
/**
|
|
38
38
|
* The VpcInstanceAuthenticator implements an authentication scheme in which it retrieves an "instance identity token"
|
|
@@ -73,7 +73,7 @@ var VpcInstanceAuthenticator = /** @class */ (function (_super) {
|
|
|
73
73
|
// the param names are shared between the authenticator and the token
|
|
74
74
|
// manager so we can just pass along the options object.
|
|
75
75
|
// also, the token manager will handle input validation
|
|
76
|
-
_this.tokenManager = new
|
|
76
|
+
_this.tokenManager = new vpc_instance_token_manager_1.VpcInstanceTokenManager(options);
|
|
77
77
|
return _this;
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright 2021,
|
|
3
|
+
* Copyright 2021, 2023 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.
|
|
@@ -65,15 +65,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
65
65
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
69
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
70
|
-
};
|
|
71
68
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
72
69
|
exports.ContainerTokenManager = void 0;
|
|
73
|
-
var
|
|
74
|
-
var
|
|
70
|
+
var helpers_1 = require("../utils/helpers");
|
|
71
|
+
var file_reading_helpers_1 = require("../utils/file-reading-helpers");
|
|
75
72
|
var iam_request_based_token_manager_1 = require("./iam-request-based-token-manager");
|
|
76
|
-
var
|
|
73
|
+
var DEFAULT_CR_TOKEN_FILEPATH1 = '/var/run/secrets/tokens/vault-token';
|
|
74
|
+
var DEFAULT_CR_TOKEN_FILEPATH2 = '/var/run/secrets/tokens/sa-token';
|
|
77
75
|
/**
|
|
78
76
|
* The ContainerTokenManager retrieves a compute resource token from a file on the container. This token
|
|
79
77
|
* is used to perform the necessary interactions with the IAM token service to obtain and store a suitable
|
|
@@ -106,10 +104,12 @@ var ContainerTokenManager = /** @class */ (function (_super) {
|
|
|
106
104
|
// all parameters are optional
|
|
107
105
|
options = options || {};
|
|
108
106
|
_this = _super.call(this, options) || this;
|
|
109
|
-
if (!(0,
|
|
107
|
+
if (!(0, helpers_1.atLeastOne)(options.iamProfileId, options.iamProfileName)) {
|
|
110
108
|
throw new Error('At least one of `iamProfileName` or `iamProfileId` must be specified.');
|
|
111
109
|
}
|
|
112
|
-
|
|
110
|
+
if (options.crTokenFilename) {
|
|
111
|
+
_this.crTokenFilename = options.crTokenFilename;
|
|
112
|
+
}
|
|
113
113
|
if (options.iamProfileName) {
|
|
114
114
|
_this.iamProfileName = options.iamProfileName;
|
|
115
115
|
}
|
|
@@ -146,10 +146,8 @@ var ContainerTokenManager = /** @class */ (function (_super) {
|
|
|
146
146
|
*/
|
|
147
147
|
ContainerTokenManager.prototype.requestToken = function () {
|
|
148
148
|
return __awaiter(this, void 0, void 0, function () {
|
|
149
|
-
var crToken;
|
|
150
149
|
return __generator(this, function (_a) {
|
|
151
|
-
|
|
152
|
-
this.formData.cr_token = crToken;
|
|
150
|
+
this.formData.cr_token = this.getCrToken();
|
|
153
151
|
// these member variables can be reset, set them in the form data right
|
|
154
152
|
// before making the request to ensure they're up to date
|
|
155
153
|
if (this.iamProfileName) {
|
|
@@ -162,11 +160,37 @@ var ContainerTokenManager = /** @class */ (function (_super) {
|
|
|
162
160
|
});
|
|
163
161
|
});
|
|
164
162
|
};
|
|
163
|
+
/**
|
|
164
|
+
* Retrieves the CR token from a file using this search order:
|
|
165
|
+
* 1. User-specified filename (if specified)
|
|
166
|
+
* 2. Default file #1 (/var/run/secrets/tokens/vault-token)
|
|
167
|
+
* 3. Default file #2 (/var/run/secrets/tokens/sa-token)
|
|
168
|
+
* First one found wins.
|
|
169
|
+
*
|
|
170
|
+
* @returns the CR token value as a string
|
|
171
|
+
*/
|
|
172
|
+
ContainerTokenManager.prototype.getCrToken = function () {
|
|
173
|
+
try {
|
|
174
|
+
var crToken = null;
|
|
175
|
+
if (this.crTokenFilename) {
|
|
176
|
+
// If the user specified a filename, then try to read from that.
|
|
177
|
+
crToken = (0, file_reading_helpers_1.readCrTokenFile)(this.crTokenFilename);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
// If no filename was specified, then try our two default filenames.
|
|
181
|
+
try {
|
|
182
|
+
crToken = (0, file_reading_helpers_1.readCrTokenFile)(DEFAULT_CR_TOKEN_FILEPATH1);
|
|
183
|
+
}
|
|
184
|
+
catch (err) {
|
|
185
|
+
crToken = (0, file_reading_helpers_1.readCrTokenFile)(DEFAULT_CR_TOKEN_FILEPATH2);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return crToken;
|
|
189
|
+
}
|
|
190
|
+
catch (err) {
|
|
191
|
+
throw new Error("Error reading CR token file: ".concat(err.toString()));
|
|
192
|
+
}
|
|
193
|
+
};
|
|
165
194
|
return ContainerTokenManager;
|
|
166
195
|
}(iam_request_based_token_manager_1.IamRequestBasedTokenManager));
|
|
167
196
|
exports.ContainerTokenManager = ContainerTokenManager;
|
|
168
|
-
function getCrToken(filename) {
|
|
169
|
-
logger_1.default.debug("Attempting to read CR token from file: ".concat(filename));
|
|
170
|
-
// moving the actual read to another file to isolate usage of node-only packages like `fs`
|
|
171
|
-
return (0, utils_1.readCrTokenFile)(filename);
|
|
172
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* (C) Copyright IBM Corp. 2019,
|
|
3
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.Cp4dTokenManager = void 0;
|
|
37
37
|
var extend_1 = __importDefault(require("extend"));
|
|
38
|
-
var
|
|
38
|
+
var helpers_1 = require("../utils/helpers");
|
|
39
39
|
var jwt_token_manager_1 = require("./jwt-token-manager");
|
|
40
40
|
/**
|
|
41
41
|
* Token Manager of CloudPak for data.
|
|
@@ -67,7 +67,7 @@ var Cp4dTokenManager = /** @class */ (function (_super) {
|
|
|
67
67
|
if ((!options.password && !options.apikey) || (options.password && options.apikey)) {
|
|
68
68
|
throw new Error('Exactly one of `apikey` or `password` must be specified.');
|
|
69
69
|
}
|
|
70
|
-
(0,
|
|
70
|
+
(0, helpers_1.validateInput)(options, _this.requiredOptions);
|
|
71
71
|
var tokenApiPath = '/v1/authorize';
|
|
72
72
|
// do not append the path if user already has
|
|
73
73
|
if (_this.url && !_this.url.endsWith(tokenApiPath)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* (C) Copyright IBM Corp. 2019,
|
|
3
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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,7 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.IamRequestBasedTokenManager = void 0;
|
|
37
37
|
var extend_1 = __importDefault(require("extend"));
|
|
38
38
|
var logger_1 = __importDefault(require("../../lib/logger"));
|
|
39
|
-
var
|
|
39
|
+
var helpers_1 = require("../utils/helpers");
|
|
40
40
|
var jwt_token_manager_1 = require("./jwt-token-manager");
|
|
41
41
|
var CLIENT_ID_SECRET_WARNING = 'Warning: Client ID and Secret must BOTH be given, or the header will not be included.';
|
|
42
42
|
var DEFAULT_IAM_URL = 'https://iam.cloud.ibm.com';
|
|
@@ -74,7 +74,7 @@ var IamRequestBasedTokenManager = /** @class */ (function (_super) {
|
|
|
74
74
|
options = options || {};
|
|
75
75
|
_this = _super.call(this, options) || this;
|
|
76
76
|
// Canonicalize the URL by removing the operation path if it was specified by the user.
|
|
77
|
-
_this.url = _this.url ? (0,
|
|
77
|
+
_this.url = _this.url ? (0, helpers_1.removeSuffix)(_this.url, OPERATION_PATH) : DEFAULT_IAM_URL;
|
|
78
78
|
if (options.clientId) {
|
|
79
79
|
_this.clientId = options.clientId;
|
|
80
80
|
}
|
|
@@ -84,7 +84,7 @@ var IamRequestBasedTokenManager = /** @class */ (function (_super) {
|
|
|
84
84
|
if (options.scope) {
|
|
85
85
|
_this.scope = options.scope;
|
|
86
86
|
}
|
|
87
|
-
if ((0,
|
|
87
|
+
if ((0, helpers_1.onlyOne)(options.clientId, options.clientSecret)) {
|
|
88
88
|
// tslint:disable-next-line
|
|
89
89
|
logger_1.default.warn(CLIENT_ID_SECRET_WARNING);
|
|
90
90
|
}
|
|
@@ -114,7 +114,7 @@ var IamRequestBasedTokenManager = /** @class */ (function (_super) {
|
|
|
114
114
|
IamRequestBasedTokenManager.prototype.setClientIdAndSecret = function (clientId, clientSecret) {
|
|
115
115
|
this.clientId = clientId;
|
|
116
116
|
this.clientSecret = clientSecret;
|
|
117
|
-
if ((0,
|
|
117
|
+
if ((0, helpers_1.onlyOne)(clientId, clientSecret)) {
|
|
118
118
|
// tslint:disable-next-line
|
|
119
119
|
logger_1.default.warn(CLIENT_ID_SECRET_WARNING);
|
|
120
120
|
}
|
|
@@ -152,7 +152,7 @@ var IamRequestBasedTokenManager = /** @class */ (function (_super) {
|
|
|
152
152
|
};
|
|
153
153
|
// If both the clientId and secret were specified by the user, then use them.
|
|
154
154
|
if (this.clientId && this.clientSecret) {
|
|
155
|
-
requiredHeaders.Authorization = (0,
|
|
155
|
+
requiredHeaders.Authorization = (0, helpers_1.computeBasicAuthHeader)(this.clientId, this.clientSecret);
|
|
156
156
|
}
|
|
157
157
|
if (this.scope) {
|
|
158
158
|
this.formData.scope = this.scope;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* (C) Copyright IBM Corp. 2019,
|
|
3
|
+
* (C) Copyright IBM Corp. 2019, 2023.
|
|
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.
|
|
@@ -31,7 +31,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
31
31
|
})();
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.IamTokenManager = void 0;
|
|
34
|
-
var
|
|
34
|
+
var helpers_1 = require("../utils/helpers");
|
|
35
35
|
var iam_request_based_token_manager_1 = require("./iam-request-based-token-manager");
|
|
36
36
|
/**
|
|
37
37
|
* The IAMTokenManager takes an api key and performs the necessary interactions with
|
|
@@ -62,7 +62,7 @@ var IamTokenManager = /** @class */ (function (_super) {
|
|
|
62
62
|
function IamTokenManager(options) {
|
|
63
63
|
var _this = _super.call(this, options) || this;
|
|
64
64
|
_this.requiredOptions = ['apikey'];
|
|
65
|
-
(0,
|
|
65
|
+
(0, helpers_1.validateInput)(options, _this.requiredOptions);
|
|
66
66
|
_this.apikey = options.apikey;
|
|
67
67
|
// construct form data for the apikey use case of iam token management
|
|
68
68
|
_this.formData.apikey = _this.apikey;
|