ibm-cloud-sdk-core 5.0.2 → 5.1.1

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 (299) hide show
  1. package/.secrets.baseline +118 -14
  2. package/Authentication.md +146 -21
  3. package/CHANGELOG.md +14 -0
  4. package/README.md +4 -3
  5. package/auth/authenticators/authenticator.d.ts +1 -0
  6. package/auth/authenticators/authenticator.js +1 -0
  7. package/auth/authenticators/container-authenticator.d.ts +6 -0
  8. package/auth/authenticators/container-authenticator.js +8 -0
  9. package/auth/authenticators/iam-assume-authenticator.d.ts +82 -0
  10. package/auth/authenticators/iam-assume-authenticator.js +92 -0
  11. package/auth/authenticators/iam-authenticator.d.ts +6 -0
  12. package/auth/authenticators/iam-authenticator.js +8 -0
  13. package/auth/authenticators/iam-request-based-authenticator-immutable.d.ts +64 -0
  14. package/auth/authenticators/iam-request-based-authenticator-immutable.js +74 -0
  15. package/auth/authenticators/iam-request-based-authenticator.d.ts +19 -47
  16. package/auth/authenticators/iam-request-based-authenticator.js +28 -36
  17. package/auth/authenticators/index.d.ts +4 -1
  18. package/auth/authenticators/index.js +3 -1
  19. package/auth/authenticators/token-request-based-authenticator-immutable.d.ts +71 -0
  20. package/auth/authenticators/token-request-based-authenticator-immutable.js +91 -0
  21. package/auth/authenticators/token-request-based-authenticator.d.ts +4 -42
  22. package/auth/authenticators/token-request-based-authenticator.js +5 -43
  23. package/auth/token-managers/container-token-manager.d.ts +6 -0
  24. package/auth/token-managers/container-token-manager.js +18 -50
  25. package/auth/token-managers/iam-assume-token-manager.d.ts +101 -0
  26. package/auth/token-managers/iam-assume-token-manager.js +220 -0
  27. package/auth/token-managers/iam-request-based-token-manager.d.ts +3 -9
  28. package/auth/token-managers/iam-request-based-token-manager.js +0 -8
  29. package/auth/token-managers/iam-token-manager.d.ts +8 -2
  30. package/auth/token-managers/iam-token-manager.js +10 -2
  31. package/auth/token-managers/index.d.ts +4 -2
  32. package/auth/token-managers/index.js +6 -3
  33. package/auth/utils/get-authenticator-from-environment.js +3 -0
  34. package/auth/utils/helpers.d.ts +18 -23
  35. package/auth/utils/helpers.js +50 -30
  36. package/build/docs/ibm-cloud-sdk-core.atleastone.md +55 -0
  37. package/build/docs/ibm-cloud-sdk-core.atmostone.md +55 -0
  38. package/build/docs/ibm-cloud-sdk-core.authenticator._constructor_.md +18 -0
  39. package/build/docs/ibm-cloud-sdk-core.authenticator.authenticate.md +57 -0
  40. package/build/docs/ibm-cloud-sdk-core.authenticator.authenticationtype.md +19 -0
  41. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_basic.md +13 -0
  42. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_bearertoken.md +11 -0
  43. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_container.md +11 -0
  44. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_cp4d.md +11 -0
  45. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_iam.md +11 -0
  46. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_iam_assume.md +11 -0
  47. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_mcsp.md +11 -0
  48. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_noauth.md +11 -0
  49. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_unknown.md +11 -0
  50. package/build/docs/ibm-cloud-sdk-core.authenticator.authtype_vpc.md +11 -0
  51. package/build/docs/ibm-cloud-sdk-core.authenticator.md +313 -0
  52. package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.authenticate.md +53 -0
  53. package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.authenticationtype.md +17 -0
  54. package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.md +50 -0
  55. package/build/docs/ibm-cloud-sdk-core.baseservice._constructor_.md +49 -0
  56. package/build/docs/ibm-cloud-sdk-core.baseservice.baseoptions.md +11 -0
  57. package/build/docs/ibm-cloud-sdk-core.baseservice.configureservice.md +53 -0
  58. package/build/docs/ibm-cloud-sdk-core.baseservice.convertmodel.md +85 -0
  59. package/build/docs/ibm-cloud-sdk-core.baseservice.createrequest.md +55 -0
  60. package/build/docs/ibm-cloud-sdk-core.baseservice.createrequestanddeserializeresponse.md +87 -0
  61. package/build/docs/ibm-cloud-sdk-core.baseservice.default_service_name.md +11 -0
  62. package/build/docs/ibm-cloud-sdk-core.baseservice.default_service_url.md +11 -0
  63. package/build/docs/ibm-cloud-sdk-core.baseservice.disableretries.md +17 -0
  64. package/build/docs/ibm-cloud-sdk-core.baseservice.enableretries.md +53 -0
  65. package/build/docs/ibm-cloud-sdk-core.baseservice.getauthenticator.md +19 -0
  66. package/build/docs/ibm-cloud-sdk-core.baseservice.gethttpclient.md +17 -0
  67. package/build/docs/ibm-cloud-sdk-core.baseservice.md +313 -0
  68. package/build/docs/ibm-cloud-sdk-core.baseservice.setdefaultheaders.md +53 -0
  69. package/build/docs/ibm-cloud-sdk-core.baseservice.setenablegzipcompression.md +53 -0
  70. package/build/docs/ibm-cloud-sdk-core.baseservice.setserviceurl.md +53 -0
  71. package/build/docs/ibm-cloud-sdk-core.basicauthenticator._constructor_.md +54 -0
  72. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authenticate.md +55 -0
  73. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authenticationtype.md +19 -0
  74. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authheader.md +13 -0
  75. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.md +165 -0
  76. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.requiredoptions.md +11 -0
  77. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator._constructor_.md +54 -0
  78. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.authenticate.md +55 -0
  79. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.authenticationtype.md +19 -0
  80. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.md +160 -0
  81. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.requiredoptions.md +11 -0
  82. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.setbearertoken.md +53 -0
  83. package/build/docs/ibm-cloud-sdk-core.buildrequestfileobject.md +55 -0
  84. package/build/docs/ibm-cloud-sdk-core.checkcredentials.md +71 -0
  85. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator._constructor_.md +54 -0
  86. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.authenticationtype.md +19 -0
  87. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.md +149 -0
  88. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.requiredoptions.md +11 -0
  89. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.tokenmanager.md +11 -0
  90. package/build/docs/ibm-cloud-sdk-core.computebasicauthheader.md +71 -0
  91. package/build/docs/ibm-cloud-sdk-core.constructfilepath.md +49 -0
  92. package/build/docs/ibm-cloud-sdk-core.constructserviceurl.md +87 -0
  93. package/build/docs/ibm-cloud-sdk-core.containerauthenticator._constructor_.md +54 -0
  94. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.authenticationtype.md +19 -0
  95. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.getrefreshtoken.md +19 -0
  96. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.md +186 -0
  97. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setcrtokenfilename.md +53 -0
  98. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setiamprofileid.md +53 -0
  99. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setiamprofilename.md +53 -0
  100. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.tokenmanager.md +11 -0
  101. package/build/docs/ibm-cloud-sdk-core.containertokenmanager._constructor_.md +54 -0
  102. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.getcrtoken.md +19 -0
  103. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.getrefreshtoken.md +19 -0
  104. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.md +156 -0
  105. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.requesttoken.md +17 -0
  106. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setcrtokenfilename.md +53 -0
  107. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setiamprofileid.md +53 -0
  108. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setiamprofilename.md +53 -0
  109. package/build/docs/ibm-cloud-sdk-core.contenttype.md +14 -0
  110. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager._constructor_.md +54 -0
  111. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager.md +128 -0
  112. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager.requesttoken.md +15 -0
  113. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager.requiredoptions.md +11 -0
  114. package/build/docs/ibm-cloud-sdk-core.fileexistsatpath.md +49 -0
  115. package/build/docs/ibm-cloud-sdk-core.fileobject.md +80 -0
  116. package/build/docs/ibm-cloud-sdk-core.fileobject.options.md +11 -0
  117. package/build/docs/ibm-cloud-sdk-core.fileobject.value.md +11 -0
  118. package/build/docs/ibm-cloud-sdk-core.fileoptions.contenttype.md +11 -0
  119. package/build/docs/ibm-cloud-sdk-core.fileoptions.filename.md +11 -0
  120. package/build/docs/ibm-cloud-sdk-core.fileoptions.md +74 -0
  121. package/build/docs/ibm-cloud-sdk-core.filestream.md +54 -0
  122. package/build/docs/ibm-cloud-sdk-core.filestream.path.md +11 -0
  123. package/build/docs/ibm-cloud-sdk-core.filewithmetadata.contenttype.md +11 -0
  124. package/build/docs/ibm-cloud-sdk-core.filewithmetadata.data.md +11 -0
  125. package/build/docs/ibm-cloud-sdk-core.filewithmetadata.filename.md +11 -0
  126. package/build/docs/ibm-cloud-sdk-core.filewithmetadata.md +87 -0
  127. package/build/docs/ibm-cloud-sdk-core.getauthenticatorfromenvironment.md +55 -0
  128. package/build/docs/ibm-cloud-sdk-core.getcontenttype.md +55 -0
  129. package/build/docs/ibm-cloud-sdk-core.getcurrenttime.md +19 -0
  130. package/build/docs/ibm-cloud-sdk-core.getformat.md +69 -0
  131. package/build/docs/ibm-cloud-sdk-core.getmissingparams.md +73 -0
  132. package/build/docs/ibm-cloud-sdk-core.getnewlogger.md +59 -0
  133. package/build/docs/ibm-cloud-sdk-core.getqueryparam.md +71 -0
  134. package/build/docs/ibm-cloud-sdk-core.iamassumeauthenticator._constructor_.md +54 -0
  135. package/build/docs/ibm-cloud-sdk-core.iamassumeauthenticator.authenticationtype.md +19 -0
  136. package/build/docs/ibm-cloud-sdk-core.iamassumeauthenticator.md +130 -0
  137. package/build/docs/ibm-cloud-sdk-core.iamassumeauthenticator.tokenmanager.md +11 -0
  138. package/build/docs/ibm-cloud-sdk-core.iamassumetokenmanager._constructor_.md +54 -0
  139. package/build/docs/ibm-cloud-sdk-core.iamassumetokenmanager.md +200 -0
  140. package/build/docs/ibm-cloud-sdk-core.iamassumetokenmanager.requesttoken.md +17 -0
  141. package/build/docs/ibm-cloud-sdk-core.iamassumetokenmanager.requiredoptions.md +11 -0
  142. package/build/docs/ibm-cloud-sdk-core.iamassumetokenmanager.savetokeninfo.md +53 -0
  143. package/build/docs/ibm-cloud-sdk-core.iamassumetokenmanager.setclientidandsecret.md +69 -0
  144. package/build/docs/ibm-cloud-sdk-core.iamassumetokenmanager.setdisablesslverification.md +53 -0
  145. package/build/docs/ibm-cloud-sdk-core.iamassumetokenmanager.setheaders.md +53 -0
  146. package/build/docs/ibm-cloud-sdk-core.iamassumetokenmanager.setscope.md +53 -0
  147. package/build/docs/ibm-cloud-sdk-core.iamauthenticator._constructor_.md +54 -0
  148. package/build/docs/ibm-cloud-sdk-core.iamauthenticator.authenticationtype.md +19 -0
  149. package/build/docs/ibm-cloud-sdk-core.iamauthenticator.getrefreshtoken.md +19 -0
  150. package/build/docs/ibm-cloud-sdk-core.iamauthenticator.md +163 -0
  151. package/build/docs/ibm-cloud-sdk-core.iamauthenticator.requiredoptions.md +11 -0
  152. package/build/docs/ibm-cloud-sdk-core.iamauthenticator.tokenmanager.md +11 -0
  153. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.md +90 -0
  154. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setclientidandsecret.md +69 -0
  155. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setdisablesslverification.md +53 -0
  156. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setheaders.md +53 -0
  157. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setscope.md +53 -0
  158. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager._constructor_.md +54 -0
  159. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.clientid.md +11 -0
  160. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.clientsecret.md +11 -0
  161. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.formdata.md +11 -0
  162. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.istokenexpired.md +19 -0
  163. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.md +264 -0
  164. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.refreshtoken.md +11 -0
  165. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.requesttoken.md +19 -0
  166. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.savetokeninfo.md +53 -0
  167. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.scope.md +11 -0
  168. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.setclientidandsecret.md +69 -0
  169. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.setscope.md +53 -0
  170. package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.clientid.md +11 -0
  171. package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.clientsecret.md +11 -0
  172. package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.md +96 -0
  173. package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.scope.md +11 -0
  174. package/build/docs/ibm-cloud-sdk-core.iamtokenmanager._constructor_.md +54 -0
  175. package/build/docs/ibm-cloud-sdk-core.iamtokenmanager.getrefreshtoken.md +19 -0
  176. package/build/docs/ibm-cloud-sdk-core.iamtokenmanager.md +126 -0
  177. package/build/docs/ibm-cloud-sdk-core.iamtokenmanager.requiredoptions.md +11 -0
  178. package/build/docs/ibm-cloud-sdk-core.isemptyobject.md +49 -0
  179. package/build/docs/ibm-cloud-sdk-core.isfiledata.md +49 -0
  180. package/build/docs/ibm-cloud-sdk-core.isfilewithmetadata.md +49 -0
  181. package/build/docs/ibm-cloud-sdk-core.ishtml.md +55 -0
  182. package/build/docs/ibm-cloud-sdk-core.isjsonmimetype.md +55 -0
  183. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager._constructor_.md +49 -0
  184. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.md +163 -0
  185. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.requesttoken.md +19 -0
  186. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.savetokeninfo.md +53 -0
  187. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.tokeninfo.md +11 -0
  188. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.tokenname.md +11 -0
  189. package/build/docs/ibm-cloud-sdk-core.jwttokenmanageroptions.md +15 -0
  190. package/build/docs/ibm-cloud-sdk-core.mcspauthenticator._constructor_.md +54 -0
  191. package/build/docs/ibm-cloud-sdk-core.mcspauthenticator.authenticationtype.md +19 -0
  192. package/build/docs/ibm-cloud-sdk-core.mcspauthenticator.md +145 -0
  193. package/build/docs/ibm-cloud-sdk-core.mcspauthenticator.requiredoptions.md +11 -0
  194. package/build/docs/ibm-cloud-sdk-core.mcspauthenticator.tokenmanager.md +11 -0
  195. package/build/docs/ibm-cloud-sdk-core.mcsptokenmanager._constructor_.md +54 -0
  196. package/build/docs/ibm-cloud-sdk-core.mcsptokenmanager.md +128 -0
  197. package/build/docs/ibm-cloud-sdk-core.mcsptokenmanager.requesttoken.md +15 -0
  198. package/build/docs/ibm-cloud-sdk-core.mcsptokenmanager.requiredoptions.md +11 -0
  199. package/build/docs/ibm-cloud-sdk-core.md +820 -0
  200. package/build/docs/ibm-cloud-sdk-core.noauthauthenticator.authenticate.md +49 -0
  201. package/build/docs/ibm-cloud-sdk-core.noauthauthenticator.authenticationtype.md +19 -0
  202. package/build/docs/ibm-cloud-sdk-core.noauthauthenticator.md +60 -0
  203. package/build/docs/ibm-cloud-sdk-core.onlyone.md +55 -0
  204. package/build/docs/ibm-cloud-sdk-core.qs.md +21 -0
  205. package/build/docs/ibm-cloud-sdk-core.readcredentialsfile.md +17 -0
  206. package/build/docs/ibm-cloud-sdk-core.readcrtokenfile.md +49 -0
  207. package/build/docs/ibm-cloud-sdk-core.readexternalsources.md +55 -0
  208. package/build/docs/ibm-cloud-sdk-core.removesuffix.md +71 -0
  209. package/build/docs/ibm-cloud-sdk-core.sdklogger.debug.md +11 -0
  210. package/build/docs/ibm-cloud-sdk-core.sdklogger.error.md +11 -0
  211. package/build/docs/ibm-cloud-sdk-core.sdklogger.info.md +11 -0
  212. package/build/docs/ibm-cloud-sdk-core.sdklogger.md +121 -0
  213. package/build/docs/ibm-cloud-sdk-core.sdklogger.verbose.md +11 -0
  214. package/build/docs/ibm-cloud-sdk-core.sdklogger.warn.md +11 -0
  215. package/build/docs/ibm-cloud-sdk-core.streamtopromise.md +55 -0
  216. package/build/docs/ibm-cloud-sdk-core.striptrailingslash.md +55 -0
  217. package/build/docs/ibm-cloud-sdk-core.tokenmanager._constructor_.md +49 -0
  218. package/build/docs/ibm-cloud-sdk-core.tokenmanager.accesstoken.md +11 -0
  219. package/build/docs/ibm-cloud-sdk-core.tokenmanager.disablesslverification.md +11 -0
  220. package/build/docs/ibm-cloud-sdk-core.tokenmanager.expiretime.md +11 -0
  221. package/build/docs/ibm-cloud-sdk-core.tokenmanager.gettoken.md +17 -0
  222. package/build/docs/ibm-cloud-sdk-core.tokenmanager.headers.md +11 -0
  223. package/build/docs/ibm-cloud-sdk-core.tokenmanager.istokenexpired.md +17 -0
  224. package/build/docs/ibm-cloud-sdk-core.tokenmanager.md +352 -0
  225. package/build/docs/ibm-cloud-sdk-core.tokenmanager.pacedrequesttoken.md +19 -0
  226. package/build/docs/ibm-cloud-sdk-core.tokenmanager.refreshtime.md +11 -0
  227. package/build/docs/ibm-cloud-sdk-core.tokenmanager.requesttoken.md +19 -0
  228. package/build/docs/ibm-cloud-sdk-core.tokenmanager.requestwrapperinstance.md +11 -0
  229. package/build/docs/ibm-cloud-sdk-core.tokenmanager.savetokeninfo.md +53 -0
  230. package/build/docs/ibm-cloud-sdk-core.tokenmanager.setdisablesslverification.md +53 -0
  231. package/build/docs/ibm-cloud-sdk-core.tokenmanager.setheaders.md +53 -0
  232. package/build/docs/ibm-cloud-sdk-core.tokenmanager.url.md +11 -0
  233. package/build/docs/ibm-cloud-sdk-core.tokenmanager.useragent.md +11 -0
  234. package/build/docs/ibm-cloud-sdk-core.tokenmanageroptions.md +18 -0
  235. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.md +66 -0
  236. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.setdisablesslverification.md +53 -0
  237. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.setheaders.md +53 -0
  238. package/build/docs/ibm-cloud-sdk-core.tolowerkeys.md +55 -0
  239. package/build/docs/ibm-cloud-sdk-core.useroptions.authenticator.md +13 -0
  240. package/build/docs/ibm-cloud-sdk-core.useroptions.disablesslverification.md +13 -0
  241. package/build/docs/ibm-cloud-sdk-core.useroptions.headers.md +13 -0
  242. package/build/docs/ibm-cloud-sdk-core.useroptions.jar.md +13 -0
  243. package/build/docs/ibm-cloud-sdk-core.useroptions.md +171 -0
  244. package/build/docs/ibm-cloud-sdk-core.useroptions.serviceurl.md +13 -0
  245. package/build/docs/ibm-cloud-sdk-core.useroptions.url.md +13 -0
  246. package/build/docs/ibm-cloud-sdk-core.useroptions.version.md +13 -0
  247. package/build/docs/ibm-cloud-sdk-core.validateinput.md +73 -0
  248. package/build/docs/ibm-cloud-sdk-core.validateparams.md +89 -0
  249. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator._constructor_.md +54 -0
  250. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.authenticationtype.md +19 -0
  251. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.md +158 -0
  252. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.setiamprofilecrn.md +53 -0
  253. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.setiamprofileid.md +53 -0
  254. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.tokenmanager.md +11 -0
  255. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager._constructor_.md +54 -0
  256. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.istokenexpired.md +19 -0
  257. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.md +126 -0
  258. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.requesttoken.md +15 -0
  259. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.setiamprofilecrn.md +53 -0
  260. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.setiamprofileid.md +53 -0
  261. package/build/docs/index.md +29 -0
  262. package/docs/ibm-cloud-sdk-core.api.json +787 -404
  263. package/es/auth/authenticators/authenticator.d.ts +1 -0
  264. package/es/auth/authenticators/authenticator.js +1 -0
  265. package/es/auth/authenticators/container-authenticator.d.ts +6 -0
  266. package/es/auth/authenticators/container-authenticator.js +8 -0
  267. package/es/auth/authenticators/iam-assume-authenticator.d.ts +82 -0
  268. package/es/auth/authenticators/iam-assume-authenticator.js +70 -0
  269. package/es/auth/authenticators/iam-authenticator.d.ts +6 -0
  270. package/es/auth/authenticators/iam-authenticator.js +8 -0
  271. package/es/auth/authenticators/iam-request-based-authenticator-immutable.d.ts +64 -0
  272. package/es/auth/authenticators/iam-request-based-authenticator-immutable.js +51 -0
  273. package/es/auth/authenticators/iam-request-based-authenticator.d.ts +19 -47
  274. package/es/auth/authenticators/iam-request-based-authenticator.js +26 -35
  275. package/es/auth/authenticators/index.d.ts +4 -1
  276. package/es/auth/authenticators/index.js +1 -0
  277. package/es/auth/authenticators/token-request-based-authenticator-immutable.d.ts +71 -0
  278. package/es/auth/authenticators/token-request-based-authenticator-immutable.js +65 -0
  279. package/es/auth/authenticators/token-request-based-authenticator.d.ts +4 -42
  280. package/es/auth/authenticators/token-request-based-authenticator.js +3 -39
  281. package/es/auth/token-managers/container-token-manager.d.ts +6 -0
  282. package/es/auth/token-managers/container-token-manager.js +18 -24
  283. package/es/auth/token-managers/iam-assume-token-manager.d.ts +101 -0
  284. package/es/auth/token-managers/iam-assume-token-manager.js +164 -0
  285. package/es/auth/token-managers/iam-request-based-token-manager.d.ts +3 -9
  286. package/es/auth/token-managers/iam-request-based-token-manager.js +0 -8
  287. package/es/auth/token-managers/iam-token-manager.d.ts +8 -2
  288. package/es/auth/token-managers/iam-token-manager.js +10 -2
  289. package/es/auth/token-managers/index.d.ts +4 -2
  290. package/es/auth/token-managers/index.js +4 -2
  291. package/es/auth/utils/get-authenticator-from-environment.js +4 -1
  292. package/es/auth/utils/helpers.d.ts +18 -23
  293. package/es/auth/utils/helpers.js +35 -27
  294. package/es/tsdoc-metadata.json +11 -0
  295. package/etc/ibm-cloud-sdk-core.api.md +46 -28
  296. package/ibm-cloud-sdk-core.d.ts +264 -68
  297. package/package.json +2 -2
  298. package/temp/ibm-cloud-sdk-core.api.json +8646 -0
  299. package/temp/ibm-cloud-sdk-core.api.md +505 -0
@@ -25,6 +25,7 @@ export declare class Authenticator implements AuthenticatorInterface {
25
25
  static AUTHTYPE_BASIC: string;
26
26
  static AUTHTYPE_BEARERTOKEN: string;
27
27
  static AUTHTYPE_IAM: string;
28
+ static AUTHTYPE_IAM_ASSUME: string;
28
29
  static AUTHTYPE_CONTAINER: string;
29
30
  static AUTHTYPE_CP4D: string;
30
31
  static AUTHTYPE_NOAUTH: string;
@@ -45,6 +45,7 @@ export class Authenticator {
45
45
  Authenticator.AUTHTYPE_BASIC = 'basic';
46
46
  Authenticator.AUTHTYPE_BEARERTOKEN = 'bearerToken';
47
47
  Authenticator.AUTHTYPE_IAM = 'iam';
48
+ Authenticator.AUTHTYPE_IAM_ASSUME = 'iamAssume';
48
49
  Authenticator.AUTHTYPE_CONTAINER = 'container';
49
50
  Authenticator.AUTHTYPE_CP4D = 'cp4d';
50
51
  Authenticator.AUTHTYPE_NOAUTH = 'noAuth';
@@ -81,4 +81,10 @@ export declare class ContainerAuthenticator extends IamRequestBasedAuthenticator
81
81
  * @returns a string that indicates the authenticator's type
82
82
  */
83
83
  authenticationType(): string;
84
+ /**
85
+ * Return the most recently stored refresh token.
86
+ *
87
+ * @returns the refresh token string
88
+ */
89
+ getRefreshToken(): string;
84
90
  }
@@ -93,4 +93,12 @@ export class ContainerAuthenticator extends IamRequestBasedAuthenticator {
93
93
  authenticationType() {
94
94
  return Authenticator.AUTHTYPE_CONTAINER;
95
95
  }
96
+ /**
97
+ * Return the most recently stored refresh token.
98
+ *
99
+ * @returns the refresh token string
100
+ */
101
+ getRefreshToken() {
102
+ return this.tokenManager.getRefreshToken();
103
+ }
96
104
  }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * (C) Copyright IBM Corp. 2024.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { IamAssumeTokenManager } from '../token-managers';
17
+ import { IamRequestOptions, IamRequestBasedAuthenticatorImmutable } from './iam-request-based-authenticator-immutable';
18
+ /** Configuration options for IAM Assume authentication. */
19
+ export interface Options extends IamRequestOptions {
20
+ /** The IAM api key */
21
+ apikey: string;
22
+ /**
23
+ * Specify exactly one of [iamProfileId, iamProfileCrn, or iamProfileName] to
24
+ * identify the trusted profile whose identity should be used. If iamProfileId
25
+ * or iamProfileCrn is used, the trusted profile must exist in the same account.
26
+ * If and only if iamProfileName is used, then iamAccountId must also be
27
+ * specified to indicate the account that contains the trusted profile.
28
+ */
29
+ iamProfileId?: string;
30
+ iamProfileCrn?: string;
31
+ iamProfileName?: string;
32
+ /**
33
+ * If and only if iamProfileName is used to specify the trusted profile, then
34
+ * iamAccountId must also be specified to indicate the account that contains
35
+ * the trusted profile.
36
+ */
37
+ iamAccountId?: string;
38
+ }
39
+ /**
40
+ * The IamAssumeAuthenticator obtains an IAM access token using the IAM "get-token"
41
+ * operation's "assume" grant type. The authenticator obtains an initial IAM access
42
+ * token from a user-supplied apikey, then exchanges this initial IAM access token
43
+ * for another IAM access token that has "assumed the identity" of the specified
44
+ * trusted profile.
45
+ *
46
+ * The bearer token will be sent as an Authorization header in the form:
47
+ *
48
+ * Authorization: Bearer \<bearer-token\>
49
+ */
50
+ export declare class IamAssumeAuthenticator extends IamRequestBasedAuthenticatorImmutable {
51
+ protected tokenManager: IamAssumeTokenManager;
52
+ /**
53
+ *
54
+ * Create a new IamAssumeAuthenticator instance.
55
+ *
56
+ * @param options - Configuration options for IAM authentication.
57
+ * This should be an object containing these fields:
58
+ * - apikey: (required) the IAM api key for initial token request
59
+ * - iamProfileId: (optional) the ID of the trusted profile to use
60
+ * - iamProfileCrn: (optional) the CRN of the trusted profile to use
61
+ * - iamProfileName: (optional) the name of the trusted profile to use (must be specified with iamAccountId)
62
+ * - iamAccountId: (optional) the ID of the account the trusted profile is in (must be specified with iamProfileName)
63
+ * - url: (optional) the endpoint URL for the token service
64
+ * - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
65
+ * should be disabled or not
66
+ * - headers: (optional) a set of HTTP headers to be sent with each request to the token service
67
+ * - clientId: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
68
+ * Authorization header to be included in each request to the token service
69
+ * - clientSecret: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
70
+ * Authorization header to be included in each request to the token service
71
+ * - scope: (optional) the "scope" parameter to use when fetching the bearer token from the token service
72
+ *
73
+ * @throws Error: the configuration options are not valid.
74
+ */
75
+ constructor(options: Options);
76
+ /**
77
+ * Returns the authenticator's type ('iamAssume').
78
+ *
79
+ * @returns a string that indicates the authenticator's type
80
+ */
81
+ authenticationType(): string;
82
+ }
@@ -0,0 +1,70 @@
1
+ /**
2
+ * (C) Copyright IBM Corp. 2024.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Authenticator } from './authenticator';
17
+ import { IamAssumeTokenManager } from '../token-managers';
18
+ import { IamRequestBasedAuthenticatorImmutable, } from './iam-request-based-authenticator-immutable';
19
+ /**
20
+ * The IamAssumeAuthenticator obtains an IAM access token using the IAM "get-token"
21
+ * operation's "assume" grant type. The authenticator obtains an initial IAM access
22
+ * token from a user-supplied apikey, then exchanges this initial IAM access token
23
+ * for another IAM access token that has "assumed the identity" of the specified
24
+ * trusted profile.
25
+ *
26
+ * The bearer token will be sent as an Authorization header in the form:
27
+ *
28
+ * Authorization: Bearer \<bearer-token\>
29
+ */
30
+ export class IamAssumeAuthenticator extends IamRequestBasedAuthenticatorImmutable {
31
+ /**
32
+ *
33
+ * Create a new IamAssumeAuthenticator instance.
34
+ *
35
+ * @param options - Configuration options for IAM authentication.
36
+ * This should be an object containing these fields:
37
+ * - apikey: (required) the IAM api key for initial token request
38
+ * - iamProfileId: (optional) the ID of the trusted profile to use
39
+ * - iamProfileCrn: (optional) the CRN of the trusted profile to use
40
+ * - iamProfileName: (optional) the name of the trusted profile to use (must be specified with iamAccountId)
41
+ * - iamAccountId: (optional) the ID of the account the trusted profile is in (must be specified with iamProfileName)
42
+ * - url: (optional) the endpoint URL for the token service
43
+ * - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
44
+ * should be disabled or not
45
+ * - headers: (optional) a set of HTTP headers to be sent with each request to the token service
46
+ * - clientId: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
47
+ * Authorization header to be included in each request to the token service
48
+ * - clientSecret: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
49
+ * Authorization header to be included in each request to the token service
50
+ * - scope: (optional) the "scope" parameter to use when fetching the bearer token from the token service
51
+ *
52
+ * @throws Error: the configuration options are not valid.
53
+ */
54
+ constructor(options) {
55
+ super(options);
56
+ // The param names are shared between the authenticator and the token
57
+ // manager so we can just pass along the options object. This will
58
+ // also perform input validation on the options.
59
+ this.tokenManager = new IamAssumeTokenManager(options);
60
+ }
61
+ /**
62
+ * Returns the authenticator's type ('iamAssume').
63
+ *
64
+ * @returns a string that indicates the authenticator's type
65
+ */
66
+ // eslint-disable-next-line class-methods-use-this
67
+ authenticationType() {
68
+ return Authenticator.AUTHTYPE_IAM_ASSUME;
69
+ }
70
+ }
@@ -61,4 +61,10 @@ export declare class IamAuthenticator extends IamRequestBasedAuthenticator {
61
61
  * @returns a string that indicates the authenticator's type
62
62
  */
63
63
  authenticationType(): string;
64
+ /**
65
+ * Return the most recently stored refresh token.
66
+ *
67
+ * @returns the refresh token string
68
+ */
69
+ getRefreshToken(): string;
64
70
  }
@@ -66,4 +66,12 @@ export class IamAuthenticator extends IamRequestBasedAuthenticator {
66
66
  authenticationType() {
67
67
  return Authenticator.AUTHTYPE_IAM;
68
68
  }
69
+ /**
70
+ * Return the most recently stored refresh token.
71
+ *
72
+ * @returns the refresh token string
73
+ */
74
+ getRefreshToken() {
75
+ return this.tokenManager.getRefreshToken();
76
+ }
69
77
  }
@@ -0,0 +1,64 @@
1
+ /**
2
+ * (C) Copyright IBM Corp. 2024.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { IamRequestBasedTokenManager } from '../token-managers/iam-request-based-token-manager';
17
+ import { BaseOptions, TokenRequestBasedAuthenticatorImmutable } from './token-request-based-authenticator-immutable';
18
+ /** Configuration options for IAM Request based authentication. */
19
+ export interface IamRequestOptions extends BaseOptions {
20
+ /**
21
+ * The `clientId` and `clientSecret` fields are used to form a "basic"
22
+ * authorization header for IAM token requests.
23
+ */
24
+ clientId?: string;
25
+ /**
26
+ * The `clientId` and `clientSecret` fields are used to form a "basic"
27
+ * authorization header for IAM token requests.
28
+ */
29
+ clientSecret?: string;
30
+ /**
31
+ * The "scope" parameter to use when fetching the bearer token from the IAM token server.
32
+ */
33
+ scope?: string;
34
+ }
35
+ /**
36
+ * The IamRequestBasedAuthenticatorImmutable provides shared configuration and functionality
37
+ * for authenticators that interact with the IAM token service. This authenticator
38
+ * is not meant for use on its own.
39
+ */
40
+ export declare class IamRequestBasedAuthenticatorImmutable extends TokenRequestBasedAuthenticatorImmutable {
41
+ protected tokenManager: IamRequestBasedTokenManager;
42
+ protected clientId: string;
43
+ protected clientSecret: string;
44
+ protected scope: string;
45
+ /**
46
+ *
47
+ * Create a new IamRequestBasedAuthenticatorImmutable instance.
48
+ *
49
+ * @param options - Configuration options for IAM authentication.
50
+ * This should be an object containing these fields:
51
+ * - url: (optional) the endpoint URL for the token service
52
+ * - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
53
+ * should be disabled or not
54
+ * - headers: (optional) a set of HTTP headers to be sent with each request to the token service
55
+ * - clientId: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
56
+ * Authorization header to be included in each request to the token service
57
+ * - clientSecret: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
58
+ * Authorization header to be included in each request to the token service
59
+ * - scope: (optional) the "scope" parameter to use when fetching the bearer token from the token service
60
+ *
61
+ * @throws Error: the configuration options are not valid.
62
+ */
63
+ constructor(options: IamRequestOptions);
64
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * (C) Copyright IBM Corp. 2024.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { IamRequestBasedTokenManager } from '../token-managers/iam-request-based-token-manager';
17
+ import { TokenRequestBasedAuthenticatorImmutable, } from './token-request-based-authenticator-immutable';
18
+ /**
19
+ * The IamRequestBasedAuthenticatorImmutable provides shared configuration and functionality
20
+ * for authenticators that interact with the IAM token service. This authenticator
21
+ * is not meant for use on its own.
22
+ */
23
+ export class IamRequestBasedAuthenticatorImmutable extends TokenRequestBasedAuthenticatorImmutable {
24
+ /**
25
+ *
26
+ * Create a new IamRequestBasedAuthenticatorImmutable instance.
27
+ *
28
+ * @param options - Configuration options for IAM authentication.
29
+ * This should be an object containing these fields:
30
+ * - url: (optional) the endpoint URL for the token service
31
+ * - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
32
+ * should be disabled or not
33
+ * - headers: (optional) a set of HTTP headers to be sent with each request to the token service
34
+ * - clientId: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
35
+ * Authorization header to be included in each request to the token service
36
+ * - clientSecret: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
37
+ * Authorization header to be included in each request to the token service
38
+ * - scope: (optional) the "scope" parameter to use when fetching the bearer token from the token service
39
+ *
40
+ * @throws Error: the configuration options are not valid.
41
+ */
42
+ constructor(options) {
43
+ // all parameters are optional
44
+ options = options || {};
45
+ super(options);
46
+ this.clientId = options.clientId;
47
+ this.clientSecret = options.clientSecret;
48
+ this.scope = options.scope;
49
+ this.tokenManager = new IamRequestBasedTokenManager(options);
50
+ }
51
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 202e.
2
+ * (C) Copyright IBM Corp. 2019, 2024.
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,54 +13,17 @@
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/iam-request-based-token-manager';
17
- import { BaseOptions, TokenRequestBasedAuthenticator } from './token-request-based-authenticator';
18
- /** Configuration options for IAM Request based authentication. */
19
- export interface IamRequestOptions extends BaseOptions {
20
- /**
21
- * The `clientId` and `clientSecret` fields are used to form a "basic"
22
- * authorization header for IAM token requests.
23
- */
24
- clientId?: string;
25
- /**
26
- * The `clientId` and `clientSecret` fields are used to form a "basic"
27
- * authorization header for IAM token requests.
28
- */
29
- clientSecret?: string;
30
- /**
31
- * The "scope" parameter to use when fetching the bearer token from the IAM token server.
32
- */
33
- scope?: string;
34
- }
16
+ /// <reference types="node" />
17
+ import { OutgoingHttpHeaders } from 'http';
18
+ import { IamRequestBasedAuthenticatorImmutable } from './iam-request-based-authenticator-immutable';
19
+ /** Shared configuration options for IAM Request based authentication. */
20
+ export { IamRequestOptions } from './iam-request-based-authenticator-immutable';
35
21
  /**
36
22
  * The IamRequestBasedAuthenticator provides shared configuration and functionality
37
23
  * for authenticators that interact with the IAM token service. This authenticator
38
24
  * is not meant for use on its own.
39
25
  */
40
- export declare class IamRequestBasedAuthenticator extends TokenRequestBasedAuthenticator {
41
- protected tokenManager: IamRequestBasedTokenManager;
42
- protected clientId: string;
43
- protected clientSecret: string;
44
- protected scope: string;
45
- /**
46
- *
47
- * Create a new IamRequestBasedAuthenticator instance.
48
- *
49
- * @param options - Configuration options for IAM authentication.
50
- * This should be an object containing these fields:
51
- * - url: (optional) the endpoint URL for the token service
52
- * - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
53
- * should be disabled or not
54
- * - headers: (optional) a set of HTTP headers to be sent with each request to the token service
55
- * - clientId: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
56
- * Authorization header to be included in each request to the token service
57
- * - clientSecret: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
58
- * Authorization header to be included in each request to the token service
59
- * - scope: (optional) the "scope" parameter to use when fetching the bearer token from the token service
60
- *
61
- * @throws Error: the configuration options are not valid.
62
- */
63
- constructor(options: IamRequestOptions);
26
+ export declare class IamRequestBasedAuthenticator extends IamRequestBasedAuthenticatorImmutable {
64
27
  /**
65
28
  * Setter for the mutually inclusive "clientId" and the "clientSecret" fields.
66
29
  * @param clientId - the "clientId" value used to form a Basic Authorization header for IAM token requests
@@ -74,9 +37,18 @@ export declare class IamRequestBasedAuthenticator extends TokenRequestBasedAuthe
74
37
  */
75
38
  setScope(scope: string): void;
76
39
  /**
77
- * Return the most recently stored refresh token.
40
+ * Set the flag that indicates whether verification of the server's SSL
41
+ * certificate should be disabled or not.
42
+ *
43
+ * @param value - a flag that indicates whether verification of the
44
+ * token server's SSL certificate should be disabled or not.
45
+ */
46
+ setDisableSslVerification(value: boolean): void;
47
+ /**
48
+ * Set headers.
78
49
  *
79
- * @returns the refresh token string
50
+ * @param headers - a set of HTTP headers to be sent with each outbound token server request.
51
+ * Overwrites previous default headers.
80
52
  */
81
- getRefreshToken(): string;
53
+ setHeaders(headers: OutgoingHttpHeaders): void;
82
54
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 202e.
2
+ * (C) Copyright IBM Corp. 2019, 2024.
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,41 +13,13 @@
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/iam-request-based-token-manager';
17
- import { TokenRequestBasedAuthenticator } from './token-request-based-authenticator';
16
+ import { IamRequestBasedAuthenticatorImmutable } from './iam-request-based-authenticator-immutable';
18
17
  /**
19
18
  * The IamRequestBasedAuthenticator provides shared configuration and functionality
20
19
  * for authenticators that interact with the IAM token service. This authenticator
21
20
  * is not meant for use on its own.
22
21
  */
23
- export class IamRequestBasedAuthenticator extends TokenRequestBasedAuthenticator {
24
- /**
25
- *
26
- * Create a new IamRequestBasedAuthenticator instance.
27
- *
28
- * @param options - Configuration options for IAM authentication.
29
- * This should be an object containing these fields:
30
- * - url: (optional) the endpoint URL for the token service
31
- * - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
32
- * should be disabled or not
33
- * - headers: (optional) a set of HTTP headers to be sent with each request to the token service
34
- * - clientId: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
35
- * Authorization header to be included in each request to the token service
36
- * - clientSecret: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
37
- * Authorization header to be included in each request to the token service
38
- * - scope: (optional) the "scope" parameter to use when fetching the bearer token from the token service
39
- *
40
- * @throws Error: the configuration options are not valid.
41
- */
42
- constructor(options) {
43
- // all parameters are optional
44
- options = options || {};
45
- super(options);
46
- this.clientId = options.clientId;
47
- this.clientSecret = options.clientSecret;
48
- this.scope = options.scope;
49
- this.tokenManager = new IamRequestBasedTokenManager(options);
50
- }
22
+ export class IamRequestBasedAuthenticator extends IamRequestBasedAuthenticatorImmutable {
51
23
  /**
52
24
  * Setter for the mutually inclusive "clientId" and the "clientSecret" fields.
53
25
  * @param clientId - the "clientId" value used to form a Basic Authorization header for IAM token requests
@@ -70,11 +42,30 @@ export class IamRequestBasedAuthenticator extends TokenRequestBasedAuthenticator
70
42
  this.tokenManager.setScope(scope);
71
43
  }
72
44
  /**
73
- * Return the most recently stored refresh token.
45
+ * Set the flag that indicates whether verification of the server's SSL
46
+ * certificate should be disabled or not.
47
+ *
48
+ * @param value - a flag that indicates whether verification of the
49
+ * token server's SSL certificate should be disabled or not.
50
+ */
51
+ setDisableSslVerification(value) {
52
+ // if they try to pass in a non-boolean value,
53
+ // use the "truthy-ness" of the value
54
+ this.disableSslVerification = Boolean(value);
55
+ this.tokenManager.setDisableSslVerification(this.disableSslVerification);
56
+ }
57
+ /**
58
+ * Set headers.
74
59
  *
75
- * @returns the refresh token string
60
+ * @param headers - a set of HTTP headers to be sent with each outbound token server request.
61
+ * Overwrites previous default headers.
76
62
  */
77
- getRefreshToken() {
78
- return this.tokenManager.getRefreshToken();
63
+ setHeaders(headers) {
64
+ if (typeof headers !== 'object') {
65
+ // do nothing, for now
66
+ return;
67
+ }
68
+ this.headers = headers;
69
+ this.tokenManager.setHeaders(this.headers);
79
70
  }
80
71
  }
@@ -19,7 +19,8 @@
19
19
  *
20
20
  * Basic Authentication
21
21
  * Bearer Token
22
- * Identity and Access Management (IAM)
22
+ * Identity and Access Management (IAM, grant type: apikey)
23
+ * Identity and Access Management (IAM, grant type: assume)
23
24
  * Container (IKS, etc)
24
25
  * VPC Instance
25
26
  * Cloud Pak for Data
@@ -35,6 +36,7 @@
35
36
  * BearerTokenAuthenticator: Authenticator for passing supplied bearer token to service endpoint.
36
37
  * CloudPakForDataAuthenticator: Authenticator for passing CP4D authentication information to service endpoint.
37
38
  * IAMAuthenticator: Authenticator for passing IAM authentication information to service endpoint.
39
+ * IAMAssumeAuthenticator: Authenticator for passing IAM authentication information to service endpoint, assuming a trusted profile.
38
40
  * ContainerAuthenticator: Authenticator for passing IAM authentication to a service, based on a token living on the container.
39
41
  * VpcInstanceAuthenticator: Authenticator that uses the VPC Instance Metadata Service API to retrieve an IAM token.
40
42
  * McspAuthenticator: Authenticator for passing MCSP authentication to a service endpoint.
@@ -52,3 +54,4 @@ export { IamRequestBasedAuthenticator } from './iam-request-based-authenticator'
52
54
  export { TokenRequestBasedAuthenticator } from './token-request-based-authenticator';
53
55
  export { VpcInstanceAuthenticator } from './vpc-instance-authenticator';
54
56
  export { McspAuthenticator } from './mcsp-authenticator';
57
+ export { IamAssumeAuthenticator } from './iam-assume-authenticator';
@@ -24,3 +24,4 @@ export { IamRequestBasedAuthenticator } from './iam-request-based-authenticator'
24
24
  export { TokenRequestBasedAuthenticator } from './token-request-based-authenticator';
25
25
  export { VpcInstanceAuthenticator } from './vpc-instance-authenticator';
26
26
  export { McspAuthenticator } from './mcsp-authenticator';
27
+ export { IamAssumeAuthenticator } from './iam-assume-authenticator';
@@ -0,0 +1,71 @@
1
+ /**
2
+ * (C) Copyright IBM Corp. 2024.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /// <reference types="node" />
17
+ import { OutgoingHttpHeaders } from 'http';
18
+ import { JwtTokenManager } from '../token-managers/jwt-token-manager';
19
+ import { Authenticator } from './authenticator';
20
+ import { AuthenticateOptions } from './authenticator-interface';
21
+ /** Configuration options for token-based authentication. */
22
+ export type BaseOptions = {
23
+ /** Headers to be sent with every outbound HTTP requests to token services. */
24
+ headers?: OutgoingHttpHeaders;
25
+ /**
26
+ * A flag that indicates whether verification of the token server's SSL
27
+ * certificate should be disabled or not.
28
+ */
29
+ disableSslVerification?: boolean;
30
+ /** Endpoint for HTTP token requests. */
31
+ url?: string;
32
+ /** Allow additional request config parameters */
33
+ [propName: string]: any;
34
+ };
35
+ /**
36
+ * Class for common functionality shared by token-request authenticators.
37
+ * Token-request authenticators use token managers to retrieve, store,
38
+ * and refresh tokens. Not intended to be used as stand-alone authenticator,
39
+ * but as base class to authenticators that have their own token manager
40
+ * implementations.
41
+ *
42
+ * The token will be added as an Authorization header in the form:
43
+ *
44
+ * Authorization: Bearer \<bearer-token\>
45
+ */
46
+ export declare class TokenRequestBasedAuthenticatorImmutable extends Authenticator {
47
+ protected tokenManager: JwtTokenManager;
48
+ protected url: string;
49
+ protected headers: OutgoingHttpHeaders;
50
+ protected disableSslVerification: boolean;
51
+ /**
52
+ * Create a new TokenRequestBasedAuthenticatorImmutable instance with an internal JwtTokenManager.
53
+ *
54
+ * @param options - Configuration options.
55
+ * This should be an object containing these fields:
56
+ * - url: (optional) the endpoint URL for the token service
57
+ * - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
58
+ * should be disabled or not
59
+ * - headers: (optional) a set of HTTP headers to be sent with each request to the token service
60
+ */
61
+ constructor(options: BaseOptions);
62
+ /**
63
+ * Adds bearer token information to "requestOptions". The bearer token information
64
+ * will be set in the Authorization property of "requestOptions.headers" in the form:
65
+ *
66
+ * Authorization: Bearer \<bearer-token\>
67
+ *
68
+ * @param requestOptions - The request to augment with authentication information.
69
+ */
70
+ authenticate(requestOptions: AuthenticateOptions): Promise<void>;
71
+ }