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.
Files changed (275) hide show
  1. package/Authentication.md +2 -1
  2. package/CHANGELOG.md +14 -0
  3. package/auth/authenticators/basic-authenticator.d.ts +1 -1
  4. package/auth/authenticators/basic-authenticator.js +4 -4
  5. package/auth/authenticators/bearer-token-authenticator.d.ts +1 -1
  6. package/auth/authenticators/bearer-token-authenticator.js +3 -3
  7. package/auth/authenticators/cloud-pak-for-data-authenticator.d.ts +2 -2
  8. package/auth/authenticators/cloud-pak-for-data-authenticator.js +3 -3
  9. package/auth/authenticators/container-authenticator.d.ts +2 -2
  10. package/auth/authenticators/container-authenticator.js +3 -3
  11. package/auth/authenticators/iam-authenticator.d.ts +2 -2
  12. package/auth/authenticators/iam-authenticator.js +5 -5
  13. package/auth/authenticators/iam-request-based-authenticator.d.ts +2 -2
  14. package/auth/authenticators/iam-request-based-authenticator.js +3 -3
  15. package/auth/authenticators/index.d.ts +2 -2
  16. package/auth/authenticators/index.js +1 -1
  17. package/auth/authenticators/token-request-based-authenticator.d.ts +2 -2
  18. package/auth/authenticators/token-request-based-authenticator.js +3 -3
  19. package/auth/authenticators/vpc-instance-authenticator.d.ts +2 -2
  20. package/auth/authenticators/vpc-instance-authenticator.js +3 -3
  21. package/auth/token-managers/container-token-manager.d.ts +11 -1
  22. package/auth/token-managers/container-token-manager.js +41 -17
  23. package/auth/token-managers/cp4d-token-manager.d.ts +1 -1
  24. package/auth/token-managers/cp4d-token-manager.js +3 -3
  25. package/auth/token-managers/iam-request-based-token-manager.d.ts +1 -1
  26. package/auth/token-managers/iam-request-based-token-manager.js +6 -6
  27. package/auth/token-managers/iam-token-manager.d.ts +1 -1
  28. package/auth/token-managers/iam-token-manager.js +3 -3
  29. package/auth/token-managers/token-manager.d.ts +1 -1
  30. package/auth/token-managers/token-manager.js +4 -4
  31. package/auth/token-managers/vpc-instance-token-manager.js +2 -2
  32. package/auth/utils/file-reading-helpers.d.ts +1 -1
  33. package/auth/utils/file-reading-helpers.js +9 -13
  34. package/build/docs/ibm-cloud-sdk-core.atleastone.md +2 -2
  35. package/build/docs/ibm-cloud-sdk-core.atmostone.md +2 -2
  36. package/build/docs/ibm-cloud-sdk-core.authenticator._constructor_.md +1 -1
  37. package/build/docs/ibm-cloud-sdk-core.authenticator.authenticate.md +2 -2
  38. package/build/docs/ibm-cloud-sdk-core.authenticator.authenticationtype.md +2 -2
  39. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_basic.md +1 -1
  40. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_bearertoken.md +1 -1
  41. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_container.md +1 -1
  42. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_cp4d.md +1 -1
  43. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_iam.md +1 -1
  44. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_noauth.md +1 -1
  45. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_unknown.md +1 -1
  46. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_vpc.md +1 -1
  47. package/build/docs/ibm-cloud-sdk-core.authenticator.md +2 -2
  48. package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.authenticate.md +2 -2
  49. package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.authenticationtype.md +2 -2
  50. package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.md +1 -1
  51. package/build/docs/ibm-cloud-sdk-core.baseservice._constructor_.md +1 -1
  52. package/build/docs/ibm-cloud-sdk-core.baseservice.baseoptions.md +1 -1
  53. package/build/docs/ibm-cloud-sdk-core.baseservice.configureservice.md +2 -2
  54. package/build/docs/ibm-cloud-sdk-core.baseservice.createrequest.md +2 -2
  55. package/build/docs/ibm-cloud-sdk-core.baseservice.default_service_name.md +1 -1
  56. package/build/docs/ibm-cloud-sdk-core.baseservice.default_service_url.md +1 -1
  57. package/build/docs/ibm-cloud-sdk-core.baseservice.disableretries.md +2 -2
  58. package/build/docs/ibm-cloud-sdk-core.baseservice.enableretries.md +3 -3
  59. package/build/docs/ibm-cloud-sdk-core.baseservice.getauthenticator.md +2 -2
  60. package/build/docs/ibm-cloud-sdk-core.baseservice.gethttpclient.md +2 -2
  61. package/build/docs/ibm-cloud-sdk-core.baseservice.md +1 -1
  62. package/build/docs/ibm-cloud-sdk-core.baseservice.setdefaultheaders.md +2 -2
  63. package/build/docs/ibm-cloud-sdk-core.baseservice.setenablegzipcompression.md +2 -2
  64. package/build/docs/ibm-cloud-sdk-core.baseservice.setserviceurl.md +2 -2
  65. package/build/docs/ibm-cloud-sdk-core.basicauthenticator._constructor_.md +1 -1
  66. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authenticate.md +2 -2
  67. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authenticationtype.md +2 -2
  68. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authheader.md +1 -1
  69. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.md +2 -2
  70. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.requiredoptions.md +1 -1
  71. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator._constructor_.md +1 -1
  72. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.authenticate.md +2 -2
  73. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.authenticationtype.md +2 -2
  74. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.md +2 -2
  75. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.requiredoptions.md +1 -1
  76. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.setbearertoken.md +2 -2
  77. package/build/docs/ibm-cloud-sdk-core.buildrequestfileobject.md +2 -2
  78. package/build/docs/ibm-cloud-sdk-core.checkcredentials.md +2 -2
  79. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator._constructor_.md +1 -1
  80. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.authenticationtype.md +2 -2
  81. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.md +2 -2
  82. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.requiredoptions.md +1 -1
  83. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.tokenmanager.md +1 -1
  84. package/build/docs/ibm-cloud-sdk-core.computebasicauthheader.md +2 -2
  85. package/build/docs/ibm-cloud-sdk-core.constructfilepath.md +2 -2
  86. package/build/docs/ibm-cloud-sdk-core.constructserviceurl.md +2 -2
  87. package/build/docs/ibm-cloud-sdk-core.containerauthenticator._constructor_.md +1 -1
  88. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.authenticationtype.md +2 -2
  89. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.md +2 -2
  90. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setcrtokenfilename.md +2 -2
  91. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setiamprofileid.md +2 -2
  92. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setiamprofilename.md +2 -2
  93. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.tokenmanager.md +1 -1
  94. package/build/docs/ibm-cloud-sdk-core.containertokenmanager._constructor_.md +1 -1
  95. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.getcrtoken.md +19 -0
  96. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.md +3 -2
  97. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.requesttoken.md +2 -2
  98. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setcrtokenfilename.md +2 -2
  99. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setiamprofileid.md +2 -2
  100. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setiamprofilename.md +2 -2
  101. package/build/docs/ibm-cloud-sdk-core.contenttype.md +1 -1
  102. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager._constructor_.md +1 -1
  103. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager.md +2 -2
  104. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager.requesttoken.md +2 -2
  105. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager.requiredoptions.md +1 -1
  106. package/build/docs/ibm-cloud-sdk-core.fileexistsatpath.md +2 -2
  107. package/build/docs/ibm-cloud-sdk-core.fileobject.md +2 -2
  108. package/build/docs/ibm-cloud-sdk-core.fileobject.options.md +1 -1
  109. package/build/docs/ibm-cloud-sdk-core.fileobject.value.md +1 -1
  110. package/build/docs/ibm-cloud-sdk-core.fileoptions.contenttype.md +1 -1
  111. package/build/docs/ibm-cloud-sdk-core.fileoptions.filename.md +1 -1
  112. package/build/docs/ibm-cloud-sdk-core.fileoptions.md +3 -3
  113. package/build/docs/ibm-cloud-sdk-core.filestream.md +2 -2
  114. package/build/docs/ibm-cloud-sdk-core.filestream.path.md +1 -1
  115. package/build/docs/ibm-cloud-sdk-core.filewithmetadata.contenttype.md +1 -1
  116. package/build/docs/ibm-cloud-sdk-core.filewithmetadata.data.md +1 -1
  117. package/build/docs/ibm-cloud-sdk-core.filewithmetadata.filename.md +1 -1
  118. package/build/docs/ibm-cloud-sdk-core.filewithmetadata.md +1 -1
  119. package/build/docs/ibm-cloud-sdk-core.getauthenticatorfromenvironment.md +2 -2
  120. package/build/docs/ibm-cloud-sdk-core.getcontenttype.md +2 -2
  121. package/build/docs/ibm-cloud-sdk-core.getcurrenttime.md +2 -2
  122. package/build/docs/ibm-cloud-sdk-core.getformat.md +2 -2
  123. package/build/docs/ibm-cloud-sdk-core.getmissingparams.md +2 -2
  124. package/build/docs/ibm-cloud-sdk-core.getnewlogger.md +2 -2
  125. package/build/docs/ibm-cloud-sdk-core.getqueryparam.md +2 -2
  126. package/build/docs/ibm-cloud-sdk-core.iamauthenticator._constructor_.md +1 -1
  127. package/build/docs/ibm-cloud-sdk-core.iamauthenticator.authenticationtype.md +2 -2
  128. package/build/docs/ibm-cloud-sdk-core.iamauthenticator.md +2 -2
  129. package/build/docs/ibm-cloud-sdk-core.iamauthenticator.requiredoptions.md +1 -1
  130. package/build/docs/ibm-cloud-sdk-core.iamauthenticator.tokenmanager.md +1 -1
  131. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator._constructor_.md +1 -1
  132. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.clientid.md +1 -1
  133. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.clientsecret.md +1 -1
  134. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.getrefreshtoken.md +2 -2
  135. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.md +2 -2
  136. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.scope.md +1 -1
  137. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setclientidandsecret.md +2 -2
  138. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setscope.md +2 -2
  139. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.tokenmanager.md +1 -1
  140. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager._constructor_.md +1 -1
  141. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.formdata.md +1 -1
  142. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.getrefreshtoken.md +2 -2
  143. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.md +2 -2
  144. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.refreshtoken.md +1 -1
  145. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.requesttoken.md +2 -2
  146. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.savetokeninfo.md +2 -2
  147. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.setclientidandsecret.md +2 -2
  148. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.setscope.md +2 -2
  149. package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.clientid.md +1 -1
  150. package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.clientsecret.md +1 -1
  151. package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.md +5 -5
  152. package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.scope.md +1 -1
  153. package/build/docs/ibm-cloud-sdk-core.iamtokenmanager._constructor_.md +1 -1
  154. package/build/docs/ibm-cloud-sdk-core.iamtokenmanager.md +2 -2
  155. package/build/docs/ibm-cloud-sdk-core.iamtokenmanager.requiredoptions.md +1 -1
  156. package/build/docs/ibm-cloud-sdk-core.isemptyobject.md +2 -2
  157. package/build/docs/ibm-cloud-sdk-core.isfiledata.md +2 -2
  158. package/build/docs/ibm-cloud-sdk-core.isfilewithmetadata.md +2 -2
  159. package/build/docs/ibm-cloud-sdk-core.ishtml.md +2 -2
  160. package/build/docs/ibm-cloud-sdk-core.isjsonmimetype.md +2 -2
  161. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager._constructor_.md +1 -1
  162. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.md +2 -2
  163. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.requesttoken.md +2 -2
  164. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.savetokeninfo.md +2 -2
  165. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.tokeninfo.md +1 -1
  166. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.tokenname.md +1 -1
  167. package/build/docs/ibm-cloud-sdk-core.jwttokenmanageroptions.md +2 -2
  168. package/build/docs/ibm-cloud-sdk-core.noauthauthenticator.authenticate.md +2 -2
  169. package/build/docs/ibm-cloud-sdk-core.noauthauthenticator.authenticationtype.md +2 -2
  170. package/build/docs/ibm-cloud-sdk-core.noauthauthenticator.md +2 -2
  171. package/build/docs/ibm-cloud-sdk-core.onlyone.md +2 -2
  172. package/build/docs/ibm-cloud-sdk-core.qs.md +1 -1
  173. package/build/docs/ibm-cloud-sdk-core.readcredentialsfile.md +2 -2
  174. package/build/docs/ibm-cloud-sdk-core.readcrtokenfile.md +2 -2
  175. package/build/docs/ibm-cloud-sdk-core.readexternalsources.md +2 -2
  176. package/build/docs/ibm-cloud-sdk-core.removesuffix.md +2 -2
  177. package/build/docs/ibm-cloud-sdk-core.sdklogger.debug.md +1 -1
  178. package/build/docs/ibm-cloud-sdk-core.sdklogger.error.md +1 -1
  179. package/build/docs/ibm-cloud-sdk-core.sdklogger.info.md +1 -1
  180. package/build/docs/ibm-cloud-sdk-core.sdklogger.md +1 -1
  181. package/build/docs/ibm-cloud-sdk-core.sdklogger.verbose.md +1 -1
  182. package/build/docs/ibm-cloud-sdk-core.sdklogger.warn.md +1 -1
  183. package/build/docs/ibm-cloud-sdk-core.streamtopromise.md +2 -2
  184. package/build/docs/ibm-cloud-sdk-core.striptrailingslash.md +2 -2
  185. package/build/docs/ibm-cloud-sdk-core.tokenmanager._constructor_.md +1 -1
  186. package/build/docs/ibm-cloud-sdk-core.tokenmanager.accesstoken.md +1 -1
  187. package/build/docs/ibm-cloud-sdk-core.tokenmanager.disablesslverification.md +1 -1
  188. package/build/docs/ibm-cloud-sdk-core.tokenmanager.expiretime.md +1 -1
  189. package/build/docs/ibm-cloud-sdk-core.tokenmanager.gettoken.md +2 -2
  190. package/build/docs/ibm-cloud-sdk-core.tokenmanager.headers.md +1 -1
  191. package/build/docs/ibm-cloud-sdk-core.tokenmanager.md +1 -1
  192. package/build/docs/ibm-cloud-sdk-core.tokenmanager.pacedrequesttoken.md +2 -2
  193. package/build/docs/ibm-cloud-sdk-core.tokenmanager.refreshtime.md +1 -1
  194. package/build/docs/ibm-cloud-sdk-core.tokenmanager.requesttoken.md +2 -2
  195. package/build/docs/ibm-cloud-sdk-core.tokenmanager.requestwrapperinstance.md +1 -1
  196. package/build/docs/ibm-cloud-sdk-core.tokenmanager.savetokeninfo.md +2 -2
  197. package/build/docs/ibm-cloud-sdk-core.tokenmanager.setdisablesslverification.md +2 -2
  198. package/build/docs/ibm-cloud-sdk-core.tokenmanager.setheaders.md +2 -2
  199. package/build/docs/ibm-cloud-sdk-core.tokenmanager.url.md +1 -1
  200. package/build/docs/ibm-cloud-sdk-core.tokenmanageroptions.md +1 -1
  201. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator._constructor_.md +1 -1
  202. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.authenticate.md +2 -2
  203. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.disablesslverification.md +1 -1
  204. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.headers.md +1 -1
  205. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.md +2 -2
  206. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.setdisablesslverification.md +2 -2
  207. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.setheaders.md +2 -2
  208. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.tokenmanager.md +1 -1
  209. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.url.md +1 -1
  210. package/build/docs/ibm-cloud-sdk-core.tolowerkeys.md +2 -2
  211. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkforsuccessfulexecution.md +2 -2
  212. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkmediaheaders.md +2 -2
  213. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkurlandmethod.md +2 -2
  214. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkuserheader.md +2 -2
  215. package/build/docs/ibm-cloud-sdk-core.unittestutils.expecttobepromise.md +2 -2
  216. package/build/docs/ibm-cloud-sdk-core.unittestutils.getoptions.md +2 -2
  217. package/build/docs/ibm-cloud-sdk-core.useroptions.authenticator.md +1 -1
  218. package/build/docs/ibm-cloud-sdk-core.useroptions.disablesslverification.md +1 -1
  219. package/build/docs/ibm-cloud-sdk-core.useroptions.headers.md +1 -1
  220. package/build/docs/ibm-cloud-sdk-core.useroptions.jar.md +1 -1
  221. package/build/docs/ibm-cloud-sdk-core.useroptions.md +8 -8
  222. package/build/docs/ibm-cloud-sdk-core.useroptions.serviceurl.md +1 -1
  223. package/build/docs/ibm-cloud-sdk-core.useroptions.url.md +1 -1
  224. package/build/docs/ibm-cloud-sdk-core.useroptions.version.md +1 -1
  225. package/build/docs/ibm-cloud-sdk-core.validateinput.md +2 -2
  226. package/build/docs/ibm-cloud-sdk-core.validateparams.md +2 -2
  227. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator._constructor_.md +1 -1
  228. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.authenticationtype.md +2 -2
  229. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.md +2 -2
  230. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.setiamprofilecrn.md +2 -2
  231. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.setiamprofileid.md +2 -2
  232. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.tokenmanager.md +1 -1
  233. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager._constructor_.md +1 -1
  234. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.md +2 -2
  235. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.requesttoken.md +2 -2
  236. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.setiamprofilecrn.md +2 -2
  237. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.setiamprofileid.md +2 -2
  238. package/docs/ibm-cloud-sdk-core.api.json +187 -43
  239. package/es/auth/authenticators/basic-authenticator.d.ts +1 -1
  240. package/es/auth/authenticators/basic-authenticator.js +2 -2
  241. package/es/auth/authenticators/bearer-token-authenticator.d.ts +1 -1
  242. package/es/auth/authenticators/bearer-token-authenticator.js +2 -2
  243. package/es/auth/authenticators/cloud-pak-for-data-authenticator.d.ts +2 -2
  244. package/es/auth/authenticators/cloud-pak-for-data-authenticator.js +2 -2
  245. package/es/auth/authenticators/container-authenticator.d.ts +2 -2
  246. package/es/auth/authenticators/container-authenticator.js +2 -2
  247. package/es/auth/authenticators/iam-authenticator.d.ts +2 -2
  248. package/es/auth/authenticators/iam-authenticator.js +3 -3
  249. package/es/auth/authenticators/iam-request-based-authenticator.d.ts +2 -2
  250. package/es/auth/authenticators/iam-request-based-authenticator.js +2 -2
  251. package/es/auth/authenticators/index.d.ts +2 -2
  252. package/es/auth/authenticators/index.js +1 -1
  253. package/es/auth/authenticators/token-request-based-authenticator.d.ts +2 -2
  254. package/es/auth/authenticators/token-request-based-authenticator.js +2 -2
  255. package/es/auth/authenticators/vpc-instance-authenticator.d.ts +2 -2
  256. package/es/auth/authenticators/vpc-instance-authenticator.js +2 -2
  257. package/es/auth/token-managers/container-token-manager.d.ts +11 -1
  258. package/es/auth/token-managers/container-token-manager.js +40 -12
  259. package/es/auth/token-managers/cp4d-token-manager.d.ts +1 -1
  260. package/es/auth/token-managers/cp4d-token-manager.js +2 -2
  261. package/es/auth/token-managers/iam-request-based-token-manager.d.ts +1 -1
  262. package/es/auth/token-managers/iam-request-based-token-manager.js +2 -2
  263. package/es/auth/token-managers/iam-token-manager.d.ts +1 -1
  264. package/es/auth/token-managers/iam-token-manager.js +2 -2
  265. package/es/auth/token-managers/token-manager.d.ts +1 -1
  266. package/es/auth/token-managers/token-manager.js +1 -1
  267. package/es/auth/token-managers/vpc-instance-token-manager.js +1 -1
  268. package/es/auth/utils/file-reading-helpers.d.ts +1 -1
  269. package/es/auth/utils/file-reading-helpers.js +9 -13
  270. package/es/tsdoc-metadata.json +1 -1
  271. package/etc/ibm-cloud-sdk-core.api.md +1 -0
  272. package/ibm-cloud-sdk-core.d.ts +11 -1
  273. package/package.json +1 -1
  274. package/temp/ibm-cloud-sdk-core.api.json +187 -43
  275. package/temp/ibm-cloud-sdk-core.api.md +1 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2022.
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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2022.
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, 2022.
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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2022.
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, 2022.
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, 2022.
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, 2022 IBM Corp. All Rights Reserved.
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, 2022 IBM Corp. All Rights Reserved.
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, 2022.
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, 2022.
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, 2022.
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, 2022.
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, 2021.
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 class to provide custom authentication schemes to services.
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, 2021.
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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2022.
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, 2022.
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, 2022.
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, 2022.
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, 2022 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.
@@ -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, 2022 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.
@@ -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 logger from '../../lib/logger';
26
- import { atLeastOne, readCrTokenFile } from '../utils';
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 DEFAULT_CR_TOKEN_FILEPATH = '/var/run/secrets/tokens/vault-token';
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
- this.crTokenFilename = options.crTokenFilename || DEFAULT_CR_TOKEN_FILEPATH;
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
- const crToken = getCrToken(this.crTokenFilename);
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
- function getCrToken(filename) {
116
- logger.debug(`Attempting to read CR token from file: ${filename}`);
117
- // moving the actual read to another file to isolate usage of node-only packages like `fs`
118
- return readCrTokenFile(filename);
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, 2022.
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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2022.
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, 2022.
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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2022.
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, 2022.
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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2022.
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
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  /**
3
- * (C) Copyright IBM Corp. 2020, 2022.
3
+ * (C) Copyright IBM Corp. 2020, 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.
@@ -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.
@@ -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
- let token = '';
83
- const fileExists = fileExistsAtPath(filepath);
84
- if (fileExists) {
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
- if (token === '') {
89
- if (fileExists) {
90
- logger.error(`Expected to read CR token from file but the file is empty: ${filepath}`);
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
  }
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.33.7"
8
+ "packageVersion": "7.34.9"
9
9
  }
10
10
  ]
11
11
  }
@@ -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;
@@ -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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ibm-cloud-sdk-core",
3
- "version": "4.0.6",
3
+ "version": "4.0.8",
4
4
  "description": "Core functionality to support SDKs generated with IBM's OpenAPI SDK Generator.",
5
5
  "main": "index.js",
6
6
  "typings": "./es/index.d.ts",