ibm-cloud-sdk-core 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/.secrets.baseline +20 -30
  2. package/CHANGELOG.md +16 -4
  3. package/MIGRATION-V4.md +54 -0
  4. package/auth/authenticators/authenticator-interface.d.ts +3 -4
  5. package/auth/authenticators/authenticator-interface.js +1 -1
  6. package/auth/authenticators/authenticator.d.ts +5 -9
  7. package/auth/authenticators/authenticator.js +4 -8
  8. package/auth/authenticators/basic-authenticator.d.ts +12 -12
  9. package/auth/authenticators/basic-authenticator.js +12 -12
  10. package/auth/authenticators/bearer-token-authenticator.d.ts +11 -14
  11. package/auth/authenticators/bearer-token-authenticator.js +11 -14
  12. package/auth/authenticators/cloud-pak-for-data-authenticator.d.ts +15 -15
  13. package/auth/authenticators/cloud-pak-for-data-authenticator.js +15 -15
  14. package/auth/authenticators/container-authenticator.d.ts +23 -23
  15. package/auth/authenticators/container-authenticator.js +23 -23
  16. package/auth/authenticators/iam-authenticator.d.ts +20 -20
  17. package/auth/authenticators/iam-authenticator.js +20 -20
  18. package/auth/authenticators/iam-request-based-authenticator.d.ts +23 -25
  19. package/auth/authenticators/iam-request-based-authenticator.js +23 -25
  20. package/auth/authenticators/token-request-based-authenticator.d.ts +19 -24
  21. package/auth/authenticators/token-request-based-authenticator.js +19 -24
  22. package/auth/authenticators/vpc-instance-authenticator.d.ts +17 -16
  23. package/auth/authenticators/vpc-instance-authenticator.js +17 -16
  24. package/auth/token-managers/container-token-manager.d.ts +23 -25
  25. package/auth/token-managers/container-token-manager.js +23 -25
  26. package/auth/token-managers/cp4d-token-manager.d.ts +13 -13
  27. package/auth/token-managers/cp4d-token-manager.js +13 -13
  28. package/auth/token-managers/iam-request-based-token-manager.d.ts +26 -31
  29. package/auth/token-managers/iam-request-based-token-manager.js +26 -31
  30. package/auth/token-managers/iam-token-manager.d.ts +17 -16
  31. package/auth/token-managers/iam-token-manager.js +17 -16
  32. package/auth/token-managers/jwt-token-manager.d.ts +10 -13
  33. package/auth/token-managers/jwt-token-manager.js +13 -16
  34. package/auth/token-managers/token-manager.d.ts +23 -35
  35. package/auth/token-managers/token-manager.js +22 -34
  36. package/auth/token-managers/vpc-instance-token-manager.d.ts +15 -15
  37. package/auth/token-managers/vpc-instance-token-manager.js +15 -15
  38. package/auth/utils/get-authenticator-from-environment.d.ts +2 -2
  39. package/auth/utils/get-authenticator-from-environment.js +2 -2
  40. package/auth/utils/helpers.d.ts +34 -32
  41. package/auth/utils/helpers.js +34 -32
  42. package/auth/utils/read-external-sources.d.ts +2 -1
  43. package/auth/utils/read-external-sources.js +5 -4
  44. package/build/docs/ibm-cloud-sdk-core.atleastone.md +4 -4
  45. package/build/docs/ibm-cloud-sdk-core.atmostone.md +2 -2
  46. package/build/docs/ibm-cloud-sdk-core.authenticator._constructor_.md +1 -1
  47. package/build/docs/ibm-cloud-sdk-core.authenticator.authenticate.md +1 -1
  48. package/build/docs/ibm-cloud-sdk-core.authenticator.authenticationtype.md +1 -1
  49. package/build/docs/ibm-cloud-sdk-core.authenticator.md +1 -1
  50. package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.authenticate.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.configureservice.md +1 -1
  53. package/build/docs/ibm-cloud-sdk-core.baseservice.createrequest.md +2 -2
  54. package/build/docs/ibm-cloud-sdk-core.baseservice.enableretries.md +1 -1
  55. package/build/docs/ibm-cloud-sdk-core.baseservice.getauthenticator.md +1 -1
  56. package/build/docs/ibm-cloud-sdk-core.baseservice.md +3 -3
  57. package/build/docs/ibm-cloud-sdk-core.baseservice.setdefaultheaders.md +1 -1
  58. package/build/docs/ibm-cloud-sdk-core.baseservice.setserviceurl.md +1 -1
  59. package/build/docs/ibm-cloud-sdk-core.basicauthenticator._constructor_.md +2 -2
  60. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authenticate.md +1 -1
  61. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.md +3 -3
  62. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator._constructor_.md +2 -2
  63. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.authenticate.md +2 -2
  64. package/build/docs/ibm-cloud-sdk-core.bearertokenauthenticator.md +3 -3
  65. package/build/docs/ibm-cloud-sdk-core.buildrequestfileobject.md +2 -2
  66. package/build/docs/ibm-cloud-sdk-core.checkcredentials.md +3 -3
  67. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator._constructor_.md +3 -3
  68. package/build/docs/ibm-cloud-sdk-core.cloudpakfordataauthenticator.md +5 -5
  69. package/build/docs/ibm-cloud-sdk-core.computebasicauthheader.md +1 -1
  70. package/build/docs/ibm-cloud-sdk-core.constructserviceurl.md +4 -4
  71. package/build/docs/ibm-cloud-sdk-core.containerauthenticator._constructor_.md +3 -3
  72. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.md +4 -4
  73. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setcrtokenfilename.md +1 -1
  74. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setiamprofileid.md +1 -1
  75. package/build/docs/ibm-cloud-sdk-core.containerauthenticator.setiamprofilename.md +1 -1
  76. package/build/docs/ibm-cloud-sdk-core.containertokenmanager._constructor_.md +6 -2
  77. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.md +5 -5
  78. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.requesttoken.md +0 -2
  79. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setcrtokenfilename.md +2 -2
  80. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setiamprofileid.md +2 -2
  81. package/build/docs/ibm-cloud-sdk-core.containertokenmanager.setiamprofilename.md +2 -2
  82. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager._constructor_.md +6 -2
  83. package/build/docs/ibm-cloud-sdk-core.cp4dtokenmanager.md +3 -3
  84. package/build/docs/ibm-cloud-sdk-core.fileobject.md +5 -5
  85. package/build/docs/ibm-cloud-sdk-core.fileoptions.md +4 -4
  86. package/build/docs/ibm-cloud-sdk-core.filestream.md +3 -3
  87. package/build/docs/ibm-cloud-sdk-core.filewithmetadata.md +5 -5
  88. package/build/docs/ibm-cloud-sdk-core.getauthenticatorfromenvironment.md +1 -1
  89. package/build/docs/ibm-cloud-sdk-core.getcontenttype.md +1 -1
  90. package/build/docs/ibm-cloud-sdk-core.getcurrenttime.md +2 -2
  91. package/build/docs/ibm-cloud-sdk-core.getformat.md +0 -2
  92. package/build/docs/ibm-cloud-sdk-core.getmissingparams.md +1 -1
  93. package/build/docs/ibm-cloud-sdk-core.getnewlogger.md +1 -1
  94. package/build/docs/ibm-cloud-sdk-core.getqueryparam.md +1 -5
  95. package/build/docs/ibm-cloud-sdk-core.iamauthenticator._constructor_.md +3 -3
  96. package/build/docs/ibm-cloud-sdk-core.iamauthenticator.md +5 -5
  97. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator._constructor_.md +3 -3
  98. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.getrefreshtoken.md +1 -1
  99. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.md +7 -7
  100. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setclientidandsecret.md +3 -3
  101. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedauthenticator.setscope.md +1 -1
  102. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager._constructor_.md +6 -2
  103. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.getrefreshtoken.md +2 -2
  104. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.md +8 -8
  105. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.requesttoken.md +2 -2
  106. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.savetokeninfo.md +1 -3
  107. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.setclientidandsecret.md +3 -5
  108. package/build/docs/ibm-cloud-sdk-core.iamrequestbasedtokenmanager.setscope.md +2 -4
  109. package/build/docs/ibm-cloud-sdk-core.iamrequestoptions.md +5 -5
  110. package/build/docs/ibm-cloud-sdk-core.iamtokenmanager._constructor_.md +6 -2
  111. package/build/docs/ibm-cloud-sdk-core.iamtokenmanager.md +3 -3
  112. package/build/docs/ibm-cloud-sdk-core.ishtml.md +1 -1
  113. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager._constructor_.md +2 -2
  114. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.md +5 -5
  115. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.requesttoken.md +1 -1
  116. package/build/docs/ibm-cloud-sdk-core.jwttokenmanager.savetokeninfo.md +1 -3
  117. package/build/docs/ibm-cloud-sdk-core.md +24 -24
  118. package/build/docs/ibm-cloud-sdk-core.onlyone.md +2 -2
  119. package/build/docs/ibm-cloud-sdk-core.qs.md +1 -1
  120. package/build/docs/ibm-cloud-sdk-core.readexternalsources.md +1 -1
  121. package/build/docs/ibm-cloud-sdk-core.removesuffix.md +4 -4
  122. package/build/docs/ibm-cloud-sdk-core.sdklogger.md +7 -7
  123. package/build/docs/ibm-cloud-sdk-core.streamtopromise.md +3 -1
  124. package/build/docs/ibm-cloud-sdk-core.striptrailingslash.md +4 -2
  125. package/build/docs/ibm-cloud-sdk-core.tokenmanager._constructor_.md +2 -2
  126. package/build/docs/ibm-cloud-sdk-core.tokenmanager.gettoken.md +1 -1
  127. package/build/docs/ibm-cloud-sdk-core.tokenmanager.md +15 -15
  128. package/build/docs/ibm-cloud-sdk-core.tokenmanager.pacedrequesttoken.md +1 -1
  129. package/build/docs/ibm-cloud-sdk-core.tokenmanager.requesttoken.md +1 -1
  130. package/build/docs/ibm-cloud-sdk-core.tokenmanager.savetokeninfo.md +1 -3
  131. package/build/docs/ibm-cloud-sdk-core.tokenmanager.setdisablesslverification.md +1 -3
  132. package/build/docs/ibm-cloud-sdk-core.tokenmanager.setheaders.md +2 -4
  133. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator._constructor_.md +2 -2
  134. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.authenticate.md +2 -2
  135. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.md +9 -9
  136. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.setdisablesslverification.md +1 -1
  137. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.setheaders.md +1 -1
  138. package/build/docs/ibm-cloud-sdk-core.tolowerkeys.md +1 -1
  139. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkforsuccessfulexecution.md +0 -2
  140. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkmediaheaders.md +0 -2
  141. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkurlandmethod.md +1 -3
  142. package/build/docs/ibm-cloud-sdk-core.unittestutils.checkuserheader.md +0 -2
  143. package/build/docs/ibm-cloud-sdk-core.unittestutils.expecttobepromise.md +0 -2
  144. package/build/docs/ibm-cloud-sdk-core.unittestutils.getoptions.md +1 -1
  145. package/build/docs/ibm-cloud-sdk-core.useroptions.md +9 -9
  146. package/build/docs/ibm-cloud-sdk-core.validateinput.md +8 -2
  147. package/build/docs/ibm-cloud-sdk-core.validateparams.md +1 -1
  148. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator._constructor_.md +6 -2
  149. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.md +6 -6
  150. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.setiamprofilecrn.md +2 -2
  151. package/build/docs/ibm-cloud-sdk-core.vpcinstanceauthenticator.setiamprofileid.md +2 -2
  152. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager._constructor_.md +6 -2
  153. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.md +4 -4
  154. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.setiamprofilecrn.md +2 -2
  155. package/build/docs/ibm-cloud-sdk-core.vpcinstancetokenmanager.setiamprofileid.md +2 -2
  156. package/docs/ibm-cloud-sdk-core.api.json +516 -241
  157. package/es/auth/authenticators/authenticator-interface.d.ts +3 -4
  158. package/es/auth/authenticators/authenticator-interface.js +1 -1
  159. package/es/auth/authenticators/authenticator.d.ts +5 -9
  160. package/es/auth/authenticators/authenticator.js +4 -8
  161. package/es/auth/authenticators/basic-authenticator.d.ts +12 -12
  162. package/es/auth/authenticators/basic-authenticator.js +12 -12
  163. package/es/auth/authenticators/bearer-token-authenticator.d.ts +11 -14
  164. package/es/auth/authenticators/bearer-token-authenticator.js +11 -14
  165. package/es/auth/authenticators/cloud-pak-for-data-authenticator.d.ts +15 -15
  166. package/es/auth/authenticators/cloud-pak-for-data-authenticator.js +15 -15
  167. package/es/auth/authenticators/container-authenticator.d.ts +23 -23
  168. package/es/auth/authenticators/container-authenticator.js +23 -23
  169. package/es/auth/authenticators/iam-authenticator.d.ts +20 -20
  170. package/es/auth/authenticators/iam-authenticator.js +20 -20
  171. package/es/auth/authenticators/iam-request-based-authenticator.d.ts +23 -25
  172. package/es/auth/authenticators/iam-request-based-authenticator.js +23 -25
  173. package/es/auth/authenticators/token-request-based-authenticator.d.ts +19 -24
  174. package/es/auth/authenticators/token-request-based-authenticator.js +19 -24
  175. package/es/auth/authenticators/vpc-instance-authenticator.d.ts +17 -16
  176. package/es/auth/authenticators/vpc-instance-authenticator.js +17 -16
  177. package/es/auth/token-managers/container-token-manager.d.ts +23 -25
  178. package/es/auth/token-managers/container-token-manager.js +23 -25
  179. package/es/auth/token-managers/cp4d-token-manager.d.ts +13 -13
  180. package/es/auth/token-managers/cp4d-token-manager.js +13 -13
  181. package/es/auth/token-managers/iam-request-based-token-manager.d.ts +26 -31
  182. package/es/auth/token-managers/iam-request-based-token-manager.js +26 -31
  183. package/es/auth/token-managers/iam-token-manager.d.ts +17 -16
  184. package/es/auth/token-managers/iam-token-manager.js +17 -16
  185. package/es/auth/token-managers/jwt-token-manager.d.ts +10 -13
  186. package/es/auth/token-managers/jwt-token-manager.js +13 -16
  187. package/es/auth/token-managers/token-manager.d.ts +23 -35
  188. package/es/auth/token-managers/token-manager.js +22 -34
  189. package/es/auth/token-managers/vpc-instance-token-manager.d.ts +15 -15
  190. package/es/auth/token-managers/vpc-instance-token-manager.js +15 -15
  191. package/es/auth/utils/get-authenticator-from-environment.d.ts +2 -2
  192. package/es/auth/utils/get-authenticator-from-environment.js +2 -2
  193. package/es/auth/utils/helpers.d.ts +34 -32
  194. package/es/auth/utils/helpers.js +34 -32
  195. package/es/auth/utils/read-external-sources.d.ts +2 -1
  196. package/es/auth/utils/read-external-sources.js +5 -4
  197. package/es/lib/base-service.d.ts +31 -32
  198. package/es/lib/base-service.js +31 -32
  199. package/es/lib/content-type.js +5 -5
  200. package/es/lib/get-new-logger.d.ts +2 -2
  201. package/es/lib/get-new-logger.js +2 -2
  202. package/es/lib/helper.d.ts +24 -31
  203. package/es/lib/helper.js +25 -32
  204. package/es/lib/querystring.d.ts +1 -1
  205. package/es/lib/querystring.js +3 -3
  206. package/es/lib/request-wrapper.d.ts +4 -6
  207. package/es/lib/request-wrapper.js +17 -23
  208. package/es/lib/sdk-test-helpers.d.ts +14 -19
  209. package/es/lib/sdk-test-helpers.js +14 -19
  210. package/es/lib/stream-to-promise.d.ts +3 -3
  211. package/es/lib/stream-to-promise.js +3 -3
  212. package/es/tsdoc-metadata.json +1 -1
  213. package/etc/ibm-cloud-sdk-core.api.md +12 -12
  214. package/ibm-cloud-sdk-core.d.ts +1402 -1449
  215. package/lib/base-service.d.ts +31 -32
  216. package/lib/base-service.js +31 -32
  217. package/lib/content-type.js +5 -5
  218. package/lib/get-new-logger.d.ts +2 -2
  219. package/lib/get-new-logger.js +2 -2
  220. package/lib/helper.d.ts +24 -31
  221. package/lib/helper.js +25 -32
  222. package/lib/querystring.d.ts +1 -1
  223. package/lib/querystring.js +3 -3
  224. package/lib/request-wrapper.d.ts +4 -6
  225. package/lib/request-wrapper.js +17 -23
  226. package/lib/sdk-test-helpers.d.ts +14 -19
  227. package/lib/sdk-test-helpers.js +14 -19
  228. package/lib/stream-to-promise.d.ts +3 -3
  229. package/lib/stream-to-promise.js +3 -3
  230. package/package.json +2 -2
  231. package/temp/ibm-cloud-sdk-core.api.json +516 -241
  232. package/temp/ibm-cloud-sdk-core.api.md +12 -12
  233. package/MIGRATION-V1.md +0 -42
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2021.
2
+ * (C) Copyright IBM Corp. 2019, 2022.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -21,15 +21,15 @@ export interface Options extends IamRequestOptions {
21
21
  apikey: string;
22
22
  }
23
23
  /**
24
- * The [[IamAuthenticator]] will use the user-supplied `apikey`
25
- * values to obtain a bearer token from a token server. When the bearer token
24
+ * The IamAuthenticator will use the user-supplied `apikey`
25
+ * value to obtain a bearer token from a token server. When the bearer token
26
26
  * expires, a new token is obtained from the token server. If specified, the
27
- * optional, mutually inclusive `clientId` and`clientSecret` pair can be used to
27
+ * optional, mutually inclusive "clientId" and "clientSecret" pair can be used to
28
28
  * influence rate-limiting for requests to the IAM token server.
29
29
  *
30
30
  * The bearer token will be sent as an Authorization header in the form:
31
31
  *
32
- * Authorization: Bearer <bearer-token>
32
+ * Authorization: Bearer \<bearer-token\>
33
33
  */
34
34
  export declare class IamAuthenticator extends IamRequestBasedAuthenticator {
35
35
  protected requiredOptions: string[];
@@ -37,22 +37,22 @@ export declare class IamAuthenticator extends IamRequestBasedAuthenticator {
37
37
  private apikey;
38
38
  /**
39
39
  *
40
- * Create a new [[IamAuthenticator]] instance.
40
+ * Create a new IamAuthenticator instance.
41
41
  *
42
- * @param {object} options Configuration options for IAM authentication.
43
- * @param {boolean} options.disableSslVerification A flag that indicates
44
- * whether verification of the token server's SSL certificate should be
45
- * disabled or not
46
- * @param {string} options.url for HTTP token requests.
47
- * @param {object<string, string>} options.headers to be sent with every
48
- * @param {string} options.apikey The IAM api key.
49
- * @param {string} [options.clientId] The `clientId` and `clientSecret` fields are used to form a "basic"
50
- * authorization header for IAM token requests.
51
- * @param {string} [options.clientSecret] The `clientId` and `clientSecret` fields are used to form a "basic"
52
- * authorization header for IAM token requests.
53
- * @param {string} [options.scope] The "scope" parameter to use when fetching the bearer token from the
54
- * IAM token server.
55
- * @throws {Error} When the configuration options are not valid.
42
+ * @param options - Configuration options for IAM authentication.
43
+ * This should be an object containing these fields:
44
+ * - url: (optional) the endpoint URL for the token service
45
+ * - apikey: (required) the IAM api key
46
+ * - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
47
+ * should be disabled or not
48
+ * - headers: (optional) a set of HTTP headers to be sent with each request to the token service
49
+ * - clientId: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
50
+ * Authorization header to be included in each request to the token service
51
+ * - clientSecret: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
52
+ * Authorization header to be included in each request to the token service
53
+ * - scope: (optional) the "scope" parameter to use when fetching the bearer token from the token service
54
+ *
55
+ * @throws Error: the configuration options are not valid.
56
56
  */
57
57
  constructor(options: Options);
58
58
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2021.
2
+ * (C) Copyright IBM Corp. 2019, 2022.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -18,35 +18,35 @@ import { IamTokenManager } from '../token-managers';
18
18
  import { validateInput } from '../utils';
19
19
  import { IamRequestBasedAuthenticator } from './iam-request-based-authenticator';
20
20
  /**
21
- * The [[IamAuthenticator]] will use the user-supplied `apikey`
22
- * values to obtain a bearer token from a token server. When the bearer token
21
+ * The IamAuthenticator will use the user-supplied `apikey`
22
+ * value to obtain a bearer token from a token server. When the bearer token
23
23
  * expires, a new token is obtained from the token server. If specified, the
24
- * optional, mutually inclusive `clientId` and`clientSecret` pair can be used to
24
+ * optional, mutually inclusive "clientId" and "clientSecret" pair can be used to
25
25
  * influence rate-limiting for requests to the IAM token server.
26
26
  *
27
27
  * The bearer token will be sent as an Authorization header in the form:
28
28
  *
29
- * Authorization: Bearer <bearer-token>
29
+ * Authorization: Bearer \<bearer-token\>
30
30
  */
31
31
  export class IamAuthenticator extends IamRequestBasedAuthenticator {
32
32
  /**
33
33
  *
34
- * Create a new [[IamAuthenticator]] instance.
34
+ * Create a new IamAuthenticator instance.
35
35
  *
36
- * @param {object} options Configuration options for IAM authentication.
37
- * @param {boolean} options.disableSslVerification A flag that indicates
38
- * whether verification of the token server's SSL certificate should be
39
- * disabled or not
40
- * @param {string} options.url for HTTP token requests.
41
- * @param {object<string, string>} options.headers to be sent with every
42
- * @param {string} options.apikey The IAM api key.
43
- * @param {string} [options.clientId] The `clientId` and `clientSecret` fields are used to form a "basic"
44
- * authorization header for IAM token requests.
45
- * @param {string} [options.clientSecret] The `clientId` and `clientSecret` fields are used to form a "basic"
46
- * authorization header for IAM token requests.
47
- * @param {string} [options.scope] The "scope" parameter to use when fetching the bearer token from the
48
- * IAM token server.
49
- * @throws {Error} When the configuration options are not valid.
36
+ * @param options - Configuration options for IAM authentication.
37
+ * This should be an object containing these fields:
38
+ * - url: (optional) the endpoint URL for the token service
39
+ * - apikey: (required) the IAM api key
40
+ * - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
41
+ * should be disabled or not
42
+ * - headers: (optional) a set of HTTP headers to be sent with each request to the token service
43
+ * - clientId: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
44
+ * Authorization header to be included in each request to the token service
45
+ * - clientSecret: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
46
+ * Authorization header to be included in each request to the token service
47
+ * - scope: (optional) the "scope" parameter to use when fetching the bearer token from the token service
48
+ *
49
+ * @throws Error: the configuration options are not valid.
50
50
  */
51
51
  constructor(options) {
52
52
  super(options);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2021.
2
+ * (C) Copyright IBM Corp. 2019, 2022.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -33,8 +33,8 @@ export interface IamRequestOptions extends BaseOptions {
33
33
  scope?: string;
34
34
  }
35
35
  /**
36
- * The [[IamRequestBasedAuthenticator]] provides shared configuration and functionality
37
- * for authenticators that interact with the IAM service to inherit. This authenticator
36
+ * The IamRequestBasedAuthenticator provides shared configuration and functionality
37
+ * for authenticators that interact with the IAM token service. This authenticator
38
38
  * is not meant for use on its own.
39
39
  */
40
40
  export declare class IamRequestBasedAuthenticator extends TokenRequestBasedAuthenticator {
@@ -44,41 +44,39 @@ export declare class IamRequestBasedAuthenticator extends TokenRequestBasedAuthe
44
44
  protected scope: string;
45
45
  /**
46
46
  *
47
- * Create a new [[IamRequestBasedAuthenticator]] instance.
47
+ * Create a new IamRequestBasedAuthenticator instance.
48
48
  *
49
- * @param {object} options Configuration options for IAM authentication.
50
- * @param {boolean} options.disableSslVerification A flag that indicates
51
- * whether verification of the token server's SSL certificate should be
52
- * disabled or not
53
- * @param {string} options.url for HTTP token requests.
54
- * @param {object<string, string>} options.headers to be sent with every IAM token request
55
- * @param {string} [options.clientId] The `clientId` and `clientSecret` fields are used to form a "basic"
56
- * authorization header for IAM token requests.
57
- * @param {string} [options.clientSecret] The `clientId` and `clientSecret` fields are used to form a "basic"
58
- * authorization header for IAM token requests.
59
- * @param {string} [options.scope] The "scope" parameter to use when fetching the bearer token from the
60
- * IAM token server.
61
- * @throws {Error} When the configuration options are not valid.
49
+ * @param options - Configuration options for IAM authentication.
50
+ * This should be an object containing these fields:
51
+ * - url: (optional) the endpoint URL for the token service
52
+ * - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
53
+ * should be disabled or not
54
+ * - headers: (optional) a set of HTTP headers to be sent with each request to the token service
55
+ * - clientId: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
56
+ * Authorization header to be included in each request to the token service
57
+ * - clientSecret: (optional) the "clientId" and "clientSecret" fields are used to form a Basic
58
+ * Authorization header to be included in each request to the token service
59
+ * - scope: (optional) the "scope" parameter to use when fetching the bearer token from the token service
60
+ *
61
+ * @throws Error: the configuration options are not valid.
62
62
  */
63
63
  constructor(options: IamRequestOptions);
64
64
  /**
65
- * Setter for the mutually inclusive `clientId` and the `clientSecret`.
66
- * @param {string} clientId The `clientId` and `clientSecret` fields are used to form a "basic"
67
- * authorization header for IAM token requests.
68
- * @param {string} clientSecret The `clientId` and `clientSecret` fields are used to form a "basic"
69
- * authorization header for IAM token requests.
65
+ * Setter for the mutually inclusive "clientId" and the "clientSecret" fields.
66
+ * @param clientId - the "clientId" value used to form a Basic Authorization header for IAM token requests
67
+ * @param clientSecret - the "clientSecret" value used to form a Basic Authorization header for IAM token requests
70
68
  */
71
69
  setClientIdAndSecret(clientId: string, clientSecret: string): void;
72
70
  /**
73
71
  * Setter for the "scope" parameter to use when fetching the bearer token from the IAM token server.
74
- * @param {string} scope A space seperated string that makes up the scope parameter
72
+ * @param scope - (optional) a space-separated string that specifies one or more scopes to be
73
+ * associated with IAM token requests
75
74
  */
76
75
  setScope(scope: string): void;
77
76
  /**
78
77
  * Return the most recently stored refresh token.
79
78
  *
80
- * @public
81
- * @returns {string}
79
+ * @returns the refresh token string
82
80
  */
83
81
  getRefreshToken(): string;
84
82
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2021.
2
+ * (C) Copyright IBM Corp. 2019, 2022.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -16,28 +16,28 @@
16
16
  import { IamRequestBasedTokenManager } from '../token-managers';
17
17
  import { TokenRequestBasedAuthenticator } from './token-request-based-authenticator';
18
18
  /**
19
- * The [[IamRequestBasedAuthenticator]] provides shared configuration and functionality
20
- * for authenticators that interact with the IAM service to inherit. This authenticator
19
+ * The IamRequestBasedAuthenticator provides shared configuration and functionality
20
+ * for authenticators that interact with the IAM token service. This authenticator
21
21
  * is not meant for use on its own.
22
22
  */
23
23
  export class IamRequestBasedAuthenticator extends TokenRequestBasedAuthenticator {
24
24
  /**
25
25
  *
26
- * Create a new [[IamRequestBasedAuthenticator]] instance.
26
+ * Create a new IamRequestBasedAuthenticator instance.
27
27
  *
28
- * @param {object} options Configuration options for IAM authentication.
29
- * @param {boolean} options.disableSslVerification A flag that indicates
30
- * whether verification of the token server's SSL certificate should be
31
- * disabled or not
32
- * @param {string} options.url for HTTP token requests.
33
- * @param {object<string, string>} options.headers to be sent with every IAM token request
34
- * @param {string} [options.clientId] The `clientId` and `clientSecret` fields are used to form a "basic"
35
- * authorization header for IAM token requests.
36
- * @param {string} [options.clientSecret] The `clientId` and `clientSecret` fields are used to form a "basic"
37
- * authorization header for IAM token requests.
38
- * @param {string} [options.scope] The "scope" parameter to use when fetching the bearer token from the
39
- * IAM token server.
40
- * @throws {Error} When the configuration options are not valid.
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
41
  */
42
42
  constructor(options) {
43
43
  // all parameters are optional
@@ -49,11 +49,9 @@ export class IamRequestBasedAuthenticator extends TokenRequestBasedAuthenticator
49
49
  this.tokenManager = new IamRequestBasedTokenManager(options);
50
50
  }
51
51
  /**
52
- * Setter for the mutually inclusive `clientId` and the `clientSecret`.
53
- * @param {string} clientId The `clientId` and `clientSecret` fields are used to form a "basic"
54
- * authorization header for IAM token requests.
55
- * @param {string} clientSecret The `clientId` and `clientSecret` fields are used to form a "basic"
56
- * authorization header for IAM token requests.
52
+ * Setter for the mutually inclusive "clientId" and the "clientSecret" fields.
53
+ * @param clientId - the "clientId" value used to form a Basic Authorization header for IAM token requests
54
+ * @param clientSecret - the "clientSecret" value used to form a Basic Authorization header for IAM token requests
57
55
  */
58
56
  setClientIdAndSecret(clientId, clientSecret) {
59
57
  this.clientId = clientId;
@@ -63,7 +61,8 @@ export class IamRequestBasedAuthenticator extends TokenRequestBasedAuthenticator
63
61
  }
64
62
  /**
65
63
  * Setter for the "scope" parameter to use when fetching the bearer token from the IAM token server.
66
- * @param {string} scope A space seperated string that makes up the scope parameter
64
+ * @param scope - (optional) a space-separated string that specifies one or more scopes to be
65
+ * associated with IAM token requests
67
66
  */
68
67
  setScope(scope) {
69
68
  this.scope = scope;
@@ -73,8 +72,7 @@ export class IamRequestBasedAuthenticator extends TokenRequestBasedAuthenticator
73
72
  /**
74
73
  * Return the most recently stored refresh token.
75
74
  *
76
- * @public
77
- * @returns {string}
75
+ * @returns the refresh token string
78
76
  */
79
77
  getRefreshToken() {
80
78
  return this.tokenManager.getRefreshToken();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2021.
2
+ * (C) Copyright IBM Corp. 2019, 2022.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -34,14 +34,14 @@ export type BaseOptions = {
34
34
  };
35
35
  /**
36
36
  * Class for common functionality shared by token-request authenticators.
37
- * [[TokenRequestBasedAuthenticator]]s use token managers to retrieve, store,
37
+ * TokenRequestBasedAuthenticators use token managers to retrieve, store,
38
38
  * and refresh tokens. Not intended to be used as stand-alone authenticator,
39
- * but as parent class to authenticators that have their own token manager
39
+ * but as base class to authenticators that have their own token manager
40
40
  * implementations.
41
41
  *
42
- * The tokens will be added as an Authorization headers in the form:
42
+ * The token will be added as an Authorization header in the form:
43
43
  *
44
- * Authorization: Bearer <bearer-token>
44
+ * Authorization: Bearer \<bearer-token\>
45
45
  */
46
46
  export declare class TokenRequestBasedAuthenticator extends Authenticator {
47
47
  protected tokenManager: JwtTokenManager;
@@ -49,43 +49,38 @@ export declare class TokenRequestBasedAuthenticator extends Authenticator {
49
49
  protected headers: OutgoingHttpHeaders;
50
50
  protected disableSslVerification: boolean;
51
51
  /**
52
- * Create a new [[TokenRequestBasedAuthenticator]] instance with an internal [[JwtTokenManager]].
52
+ * Create a new TokenRequestBasedAuthenticator instance with an internal JwtTokenManager.
53
53
  *
54
- * @param {object} options Configuration options.
55
- * @param {string} options.url for HTTP token requests.
56
- * @param {boolean} [options.disableSslVerification] A flag that indicates
57
- * whether verification of the token server's SSL certificate should be
58
- * disabled or not.
59
- * @param {object<string, string>} [options.headers] to be sent with every
60
- * outbound HTTP requests to token services.
54
+ * @param options - Configuration options.
55
+ * This should be an object containing these fields:
56
+ * - url: (optional) the endpoint URL for the token service
57
+ * - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
58
+ * should be disabled or not
59
+ * - headers: (optional) a set of HTTP headers to be sent with each request to the token service
61
60
  */
62
61
  constructor(options: BaseOptions);
63
62
  /**
64
63
  * Set the flag that indicates whether verification of the server's SSL
65
64
  * certificate should be disabled or not.
66
65
  *
67
- * @param {boolean} value A flag that indicates whether verification of the
66
+ * @param value - a flag that indicates whether verification of the
68
67
  * token server's SSL certificate should be disabled or not.
69
68
  */
70
69
  setDisableSslVerification(value: boolean): void;
71
70
  /**
72
71
  * Set headers.
73
72
  *
74
- * @param {object<string, string>} headers Default headers to be sent with
75
- * every Cloud Pak For Data token request. Overwrites previous default headers.
73
+ * @param headers - a set of HTTP headers to be sent with each outbound token server request.
74
+ * Overwrites previous default headers.
76
75
  */
77
76
  setHeaders(headers: OutgoingHttpHeaders): void;
78
77
  /**
79
- * Adds bearer token information to `request`. The bearer token information
80
- * will be set in the Authorization property of`request.headers` in the form:
78
+ * Adds bearer token information to "requestOptions". The bearer token information
79
+ * will be set in the Authorization property of "requestOptions.headers" in the form:
81
80
  *
82
- * Authorization: Bearer <bearer-token>
81
+ * Authorization: Bearer \<bearer-token\>
83
82
  *
84
- * @param {object} requestOptions - The request to augment with authentication
85
- * information.
86
- * @param {object.<string, string>} requestOptions.headers - The headers the
87
- * authentication information will be added too. Overrides default headers
88
- * where there's conflict.
83
+ * @param requestOptions - The request to augment with authentication information.
89
84
  */
90
85
  authenticate(requestOptions: AuthenticateOptions): Promise<void>;
91
86
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2021.
2
+ * (C) Copyright IBM Corp. 2019, 2022.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -18,26 +18,25 @@ import { JwtTokenManager } from '../token-managers';
18
18
  import { Authenticator } from './authenticator';
19
19
  /**
20
20
  * Class for common functionality shared by token-request authenticators.
21
- * [[TokenRequestBasedAuthenticator]]s use token managers to retrieve, store,
21
+ * TokenRequestBasedAuthenticators use token managers to retrieve, store,
22
22
  * and refresh tokens. Not intended to be used as stand-alone authenticator,
23
- * but as parent class to authenticators that have their own token manager
23
+ * but as base class to authenticators that have their own token manager
24
24
  * implementations.
25
25
  *
26
- * The tokens will be added as an Authorization headers in the form:
26
+ * The token will be added as an Authorization header in the form:
27
27
  *
28
- * Authorization: Bearer <bearer-token>
28
+ * Authorization: Bearer \<bearer-token\>
29
29
  */
30
30
  export class TokenRequestBasedAuthenticator extends Authenticator {
31
31
  /**
32
- * Create a new [[TokenRequestBasedAuthenticator]] instance with an internal [[JwtTokenManager]].
32
+ * Create a new TokenRequestBasedAuthenticator instance with an internal JwtTokenManager.
33
33
  *
34
- * @param {object} options Configuration options.
35
- * @param {string} options.url for HTTP token requests.
36
- * @param {boolean} [options.disableSslVerification] A flag that indicates
37
- * whether verification of the token server's SSL certificate should be
38
- * disabled or not.
39
- * @param {object<string, string>} [options.headers] to be sent with every
40
- * outbound HTTP requests to token services.
34
+ * @param options - Configuration options.
35
+ * This should be an object containing these fields:
36
+ * - url: (optional) the endpoint URL for the token service
37
+ * - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
38
+ * should be disabled or not
39
+ * - headers: (optional) a set of HTTP headers to be sent with each request to the token service
41
40
  */
42
41
  constructor(options) {
43
42
  super();
@@ -51,7 +50,7 @@ export class TokenRequestBasedAuthenticator extends Authenticator {
51
50
  * Set the flag that indicates whether verification of the server's SSL
52
51
  * certificate should be disabled or not.
53
52
  *
54
- * @param {boolean} value A flag that indicates whether verification of the
53
+ * @param value - a flag that indicates whether verification of the
55
54
  * token server's SSL certificate should be disabled or not.
56
55
  */
57
56
  setDisableSslVerification(value) {
@@ -63,8 +62,8 @@ export class TokenRequestBasedAuthenticator extends Authenticator {
63
62
  /**
64
63
  * Set headers.
65
64
  *
66
- * @param {object<string, string>} headers Default headers to be sent with
67
- * every Cloud Pak For Data token request. Overwrites previous default headers.
65
+ * @param headers - a set of HTTP headers to be sent with each outbound token server request.
66
+ * Overwrites previous default headers.
68
67
  */
69
68
  setHeaders(headers) {
70
69
  if (typeof headers !== 'object') {
@@ -75,16 +74,12 @@ export class TokenRequestBasedAuthenticator extends Authenticator {
75
74
  this.tokenManager.setHeaders(this.headers);
76
75
  }
77
76
  /**
78
- * Adds bearer token information to `request`. The bearer token information
79
- * will be set in the Authorization property of`request.headers` in the form:
77
+ * Adds bearer token information to "requestOptions". The bearer token information
78
+ * will be set in the Authorization property of "requestOptions.headers" in the form:
80
79
  *
81
- * Authorization: Bearer <bearer-token>
80
+ * Authorization: Bearer \<bearer-token\>
82
81
  *
83
- * @param {object} requestOptions - The request to augment with authentication
84
- * information.
85
- * @param {object.<string, string>} requestOptions.headers - The headers the
86
- * authentication information will be added too. Overrides default headers
87
- * where there's conflict.
82
+ * @param requestOptions - The request to augment with authentication information.
88
83
  */
89
84
  authenticate(requestOptions) {
90
85
  return this.tokenManager.getToken().then((token) => {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2021.
2
+ * (C) Copyright IBM Corp. 2021, 2022.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -23,40 +23,41 @@ export interface Options extends BaseOptions {
23
23
  iamProfileId?: string;
24
24
  }
25
25
  /**
26
- * The [[VpcInstanceAuthenticator]] implements an authentication scheme in which it retrieves an "instance identity token"
26
+ * The VpcInstanceAuthenticator implements an authentication scheme in which it retrieves an "instance identity token"
27
27
  * and exchanges that for an IAM access token using the VPC Instance Metadata Service API which is available on the local
28
28
  * compute resource (VM). The instance identity token is similar to an IAM apikey, except that it is managed automatically
29
29
  * by the compute resource provider (VPC).
30
30
  *
31
31
  * The resulting IAM access token is then added to outbound requests in an Authorization header
32
32
  *
33
- * Authorization: Bearer <access-token>
33
+ * Authorization: Bearer \<access-token\>
34
34
  */
35
35
  export declare class VpcInstanceAuthenticator extends TokenRequestBasedAuthenticator {
36
36
  protected tokenManager: VpcInstanceTokenManager;
37
37
  private iamProfileCrn;
38
38
  private iamProfileId;
39
39
  /**
40
- * Create a new [[VpcInstanceAuthenticator]] instance.
40
+ * Create a new VpcInstanceAuthenticator instance.
41
41
  *
42
- * @param {object} [options] Configuration options for VpcInstance authentication.
43
- * @param {string} [options.iamProfileCrn] The CRN of the linked trusted IAM profile to be used as the identity of the compute resource.
44
- * At most one of iamProfileCrn or iamProfileId may be specified.
45
- * If neither one is specified, then the default IAM profile defined for the compute resource will be used.
46
- * @param {string} [options.iamProfileId] The ID of the linked trusted IAM profile to be used when obtaining the IAM access token.
47
- * At most one of iamProfileCrn or iamProfileId may be specified.
48
- * If neither one is specified, then the default IAM profile defined for the compute resource will be used.
49
- * @param {string} [options.url] The VPC Instance Metadata Service's base endpoint URL. Default value: "http://169.254.169.254"
42
+ * @param options - Configuration options for VpcInstance authentication.
43
+ * This should be an object containing these fields:
44
+ * - url: (optional) the endpoint URL for the VPC Instance Metadata Service (default value: "http://169.254.169.254")
45
+ * - iamProfileCrn: (optional) the CRN of the linked IAM trusted profile to be used to obtain the IAM access token
46
+ * - iamProfileId: (optional) the ID of the linked IAM trusted profile to be used to obtain the IAM access token
47
+ *
48
+ * @remarks
49
+ * At most one of "iamProfileCrn" or "iamProfileId" may be specified. If neither one is specified,
50
+ * then the default IAM profile defined for the compute resource will be used.
50
51
  */
51
52
  constructor(options: Options);
52
53
  /**
53
- * Setter for the "profile_crn" parameter to use when fetching the bearer token from the IAM token server.
54
- * @param {string} A string that makes up the iamProfileCrn parameter
54
+ * Sets the "iamProfileCrn" value to be used when obtaining an IAM access token
55
+ * @param iamProfileCrn - the CRN of the linked IAM trusted profile to use when obtaining an IAM access token
55
56
  */
56
57
  setIamProfileCrn(iamProfileCrn: string): void;
57
58
  /**
58
- * Setter for the "profile_id" parameter to use when fetching the bearer token from the IAM token server.
59
- * @param {string} A string that makes up the iamProfileId parameter
59
+ * Sets the "iamProfileId" value to be used when obtaining an IAM access token
60
+ * @param iamProfileId - the ID of the linked IAM trusted profile to use when obtaining an IAM access token
60
61
  */
61
62
  setIamProfileId(iamProfileId: string): void;
62
63
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2021.
2
+ * (C) Copyright IBM Corp. 2021, 2022.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -17,27 +17,28 @@ import { Authenticator } from './authenticator';
17
17
  import { VpcInstanceTokenManager } from '../token-managers';
18
18
  import { TokenRequestBasedAuthenticator } from './token-request-based-authenticator';
19
19
  /**
20
- * The [[VpcInstanceAuthenticator]] implements an authentication scheme in which it retrieves an "instance identity token"
20
+ * The VpcInstanceAuthenticator implements an authentication scheme in which it retrieves an "instance identity token"
21
21
  * and exchanges that for an IAM access token using the VPC Instance Metadata Service API which is available on the local
22
22
  * compute resource (VM). The instance identity token is similar to an IAM apikey, except that it is managed automatically
23
23
  * by the compute resource provider (VPC).
24
24
  *
25
25
  * The resulting IAM access token is then added to outbound requests in an Authorization header
26
26
  *
27
- * Authorization: Bearer <access-token>
27
+ * Authorization: Bearer \<access-token\>
28
28
  */
29
29
  export class VpcInstanceAuthenticator extends TokenRequestBasedAuthenticator {
30
30
  /**
31
- * Create a new [[VpcInstanceAuthenticator]] instance.
31
+ * Create a new VpcInstanceAuthenticator instance.
32
32
  *
33
- * @param {object} [options] Configuration options for VpcInstance authentication.
34
- * @param {string} [options.iamProfileCrn] The CRN of the linked trusted IAM profile to be used as the identity of the compute resource.
35
- * At most one of iamProfileCrn or iamProfileId may be specified.
36
- * If neither one is specified, then the default IAM profile defined for the compute resource will be used.
37
- * @param {string} [options.iamProfileId] The ID of the linked trusted IAM profile to be used when obtaining the IAM access token.
38
- * At most one of iamProfileCrn or iamProfileId may be specified.
39
- * If neither one is specified, then the default IAM profile defined for the compute resource will be used.
40
- * @param {string} [options.url] The VPC Instance Metadata Service's base endpoint URL. Default value: "http://169.254.169.254"
33
+ * @param options - Configuration options for VpcInstance authentication.
34
+ * This should be an object containing these fields:
35
+ * - url: (optional) the endpoint URL for the VPC Instance Metadata Service (default value: "http://169.254.169.254")
36
+ * - iamProfileCrn: (optional) the CRN of the linked IAM trusted profile to be used to obtain the IAM access token
37
+ * - iamProfileId: (optional) the ID of the linked IAM trusted profile to be used to obtain the IAM access token
38
+ *
39
+ * @remarks
40
+ * At most one of "iamProfileCrn" or "iamProfileId" may be specified. If neither one is specified,
41
+ * then the default IAM profile defined for the compute resource will be used.
41
42
  */
42
43
  constructor(options) {
43
44
  // all parameters are optional
@@ -55,8 +56,8 @@ export class VpcInstanceAuthenticator extends TokenRequestBasedAuthenticator {
55
56
  this.tokenManager = new VpcInstanceTokenManager(options);
56
57
  }
57
58
  /**
58
- * Setter for the "profile_crn" parameter to use when fetching the bearer token from the IAM token server.
59
- * @param {string} A string that makes up the iamProfileCrn parameter
59
+ * Sets the "iamProfileCrn" value to be used when obtaining an IAM access token
60
+ * @param iamProfileCrn - the CRN of the linked IAM trusted profile to use when obtaining an IAM access token
60
61
  */
61
62
  setIamProfileCrn(iamProfileCrn) {
62
63
  this.iamProfileCrn = iamProfileCrn;
@@ -64,8 +65,8 @@ export class VpcInstanceAuthenticator extends TokenRequestBasedAuthenticator {
64
65
  this.tokenManager.setIamProfileCrn(iamProfileCrn);
65
66
  }
66
67
  /**
67
- * Setter for the "profile_id" parameter to use when fetching the bearer token from the IAM token server.
68
- * @param {string} A string that makes up the iamProfileId parameter
68
+ * Sets the "iamProfileId" value to be used when obtaining an IAM access token
69
+ * @param iamProfileId - the ID of the linked IAM trusted profile to use when obtaining an IAM access token
69
70
  */
70
71
  setIamProfileId(iamProfileId) {
71
72
  this.iamProfileId = iamProfileId;