ibm-cloud-sdk-core 5.3.1 → 5.4.0

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 (41) hide show
  1. package/auth/authenticators/authenticator.d.ts +2 -1
  2. package/auth/authenticators/authenticator.js +1 -0
  3. package/auth/authenticators/index.d.ts +3 -1
  4. package/auth/authenticators/index.js +3 -1
  5. package/auth/authenticators/mcsp-authenticator.d.ts +2 -4
  6. package/auth/authenticators/mcsp-authenticator.js +2 -4
  7. package/auth/authenticators/mcspv2-authenticator.d.ts +95 -0
  8. package/auth/authenticators/mcspv2-authenticator.js +85 -0
  9. package/auth/token-managers/index.d.ts +6 -3
  10. package/auth/token-managers/index.js +8 -4
  11. package/auth/token-managers/jwt-token-manager.js +6 -3
  12. package/auth/token-managers/mcspv2-token-manager.d.ts +112 -0
  13. package/auth/token-managers/mcspv2-token-manager.js +176 -0
  14. package/auth/token-managers/token-manager.d.ts +1 -1
  15. package/auth/token-managers/token-manager.js +1 -1
  16. package/auth/utils/get-authenticator-from-environment.d.ts +1 -1
  17. package/auth/utils/get-authenticator-from-environment.js +4 -1
  18. package/docs/ibm-cloud-sdk-core.api.json +293 -5
  19. package/es/auth/authenticators/authenticator.d.ts +2 -1
  20. package/es/auth/authenticators/authenticator.js +1 -0
  21. package/es/auth/authenticators/index.d.ts +3 -1
  22. package/es/auth/authenticators/index.js +1 -0
  23. package/es/auth/authenticators/mcsp-authenticator.d.ts +2 -4
  24. package/es/auth/authenticators/mcsp-authenticator.js +2 -4
  25. package/es/auth/authenticators/mcspv2-authenticator.d.ts +95 -0
  26. package/es/auth/authenticators/mcspv2-authenticator.js +63 -0
  27. package/es/auth/token-managers/index.d.ts +6 -3
  28. package/es/auth/token-managers/index.js +6 -3
  29. package/es/auth/token-managers/jwt-token-manager.js +6 -3
  30. package/es/auth/token-managers/mcspv2-token-manager.d.ts +112 -0
  31. package/es/auth/token-managers/mcspv2-token-manager.js +151 -0
  32. package/es/auth/token-managers/token-manager.d.ts +1 -1
  33. package/es/auth/token-managers/token-manager.js +1 -1
  34. package/es/auth/utils/get-authenticator-from-environment.d.ts +1 -1
  35. package/es/auth/utils/get-authenticator-from-environment.js +5 -2
  36. package/es/lib/request-wrapper.d.ts +1 -1
  37. package/es/lib/request-wrapper.js +8 -3
  38. package/ibm-cloud-sdk-core.d.ts +183 -7
  39. package/lib/request-wrapper.d.ts +1 -1
  40. package/lib/request-wrapper.js +8 -3
  41. package/package.json +2 -2
@@ -0,0 +1,176 @@
1
+ "use strict";
2
+ /**
3
+ * (C) Copyright IBM Corp. 2025.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ var __extends = (this && this.__extends) || (function () {
18
+ var extendStatics = function (d, b) {
19
+ extendStatics = Object.setPrototypeOf ||
20
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
21
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
22
+ return extendStatics(d, b);
23
+ };
24
+ return function (d, b) {
25
+ if (typeof b !== "function" && b !== null)
26
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
27
+ extendStatics(d, b);
28
+ function __() { this.constructor = d; }
29
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
30
+ };
31
+ })();
32
+ var __importDefault = (this && this.__importDefault) || function (mod) {
33
+ return (mod && mod.__esModule) ? mod : { "default": mod };
34
+ };
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.McspV2TokenManager = void 0;
37
+ var extend_1 = __importDefault(require("extend"));
38
+ var helpers_1 = require("../utils/helpers");
39
+ var build_user_agent_1 = require("../../lib/build-user-agent");
40
+ var jwt_token_manager_1 = require("./jwt-token-manager");
41
+ var logger_1 = __importDefault(require("../../lib/logger"));
42
+ /**
43
+ * Token Manager for Multi-Cloud Saas Platform (MCSP) V2 authentication.
44
+ *
45
+ * The McspV2TokenManager will invoke the MCSP token service's 'POST /api/2.0/\{scopeCollectionType\}/\{scopeId\}/apikeys/token'
46
+ * operation to obtain an MCSP access token for an apikey.
47
+ */
48
+ var McspV2TokenManager = /** @class */ (function (_super) {
49
+ __extends(McspV2TokenManager, _super);
50
+ /**
51
+ * Create a new McspV2TokenManager instance.
52
+ *
53
+ * @param options - Configuration options.
54
+ * This should be an object containing these fields:
55
+ * - url: (required) the endpoint URL for the CloudPakForData token service.
56
+ * - apikey: (optional) the API key used to obtain a bearer token (required if password is not specified).
57
+ * - scopeCollectionType: (required) The scope collection type of item(s). Valid values are: "accounts", "subscriptions", "services".
58
+ * - scopeId: (required) the scope identifier of item(s).
59
+ * - includeBuiltinActions: (optional) a flag to include builtin actions in the "actions" claim in the MCSP access token (default: false).
60
+ * - includeCustomActions: (optional) a flag to include custom actions in the "actions" claim in the MCSP access token (default: false).
61
+ * - includeRoles: (optional) a flag to include the "roles" claim in the MCSP access token (default: true).
62
+ * - prefixRoles: (optional) a flag to add a prefix with the scope level where the role is defined in the "roles" claim (default: false).
63
+ * - callerExtClaim: (optional) a map (object) containing keys and values to be injected into the access token as the "callerExt" claim.
64
+ * The keys used in this map must be enabled in the apikey by setting the "callerExtClaimNames" property when the apikey is created.
65
+ * This property is typically only used in scenarios involving an apikey with identityType `SERVICEID`.
66
+ * - disableSslVerification: (optional) a flag to disable verification of the token server's SSL certificate; defaults to false.
67
+ * - headers: (optional) a set of HTTP headers to be sent with each request to the token service.
68
+ *
69
+ * @throws Error: the input configuration failed validation
70
+ */
71
+ function McspV2TokenManager(options) {
72
+ var _this = _super.call(this, options) || this;
73
+ _this.requiredOptions = ['apikey', 'url', 'scopeCollectionType', 'scopeId'];
74
+ // This is the path associated with the operation used to obtain
75
+ // an access token from the MCSP token service (v2).
76
+ // The path parameter references must match the keys used in pathParams below.
77
+ _this.PATH_TEMPLATE = '/api/2.0/{scopeCollectionType}/{scopeId}/apikeys/token';
78
+ // The name of the field (within the token-exchange operation's responseBody)
79
+ // that contains the access token.
80
+ _this.tokenName = 'token';
81
+ // Validate the required properties.
82
+ (0, helpers_1.validateInput)(options, _this.requiredOptions);
83
+ _this.url = options.url;
84
+ _this.apikey = options.apikey;
85
+ _this.scopeCollectionType = options.scopeCollectionType;
86
+ _this.scopeId = options.scopeId;
87
+ // Now parse/validate the optional properties.
88
+ _this.includeBuiltinActions = McspV2TokenManager.parseBoolean(options, 'includeBuiltinActions', false);
89
+ _this.includeCustomActions = McspV2TokenManager.parseBoolean(options, 'includeCustomActions', false);
90
+ _this.includeRoles = McspV2TokenManager.parseBoolean(options, 'includeRoles', true);
91
+ _this.prefixRoles = McspV2TokenManager.parseBoolean(options, 'prefixRoles', false);
92
+ if ('callerExtClaim' in options) {
93
+ var value = options.callerExtClaim;
94
+ if (typeof value === 'string') {
95
+ try {
96
+ _this.callerExtClaim = JSON.parse(value);
97
+ }
98
+ catch (err) {
99
+ throw new Error("An error occurred while parsing the callerExtClaim value '".concat(value, "': ").concat(err.message));
100
+ }
101
+ }
102
+ else if (typeof value === 'object') {
103
+ _this.callerExtClaim = value;
104
+ }
105
+ else {
106
+ throw new Error("callerExtClaim must be a string or object, but was '".concat(typeof value, "'"));
107
+ }
108
+ }
109
+ _this.userAgent = (0, build_user_agent_1.buildUserAgent)('mcspv2-authenticator');
110
+ return _this;
111
+ }
112
+ McspV2TokenManager.prototype.requestToken = function () {
113
+ var requiredHeaders = {
114
+ Accept: 'application/json',
115
+ 'Content-Type': 'application/json',
116
+ 'User-Agent': this.userAgent,
117
+ };
118
+ var requestHeaders = (0, extend_1.default)(true, {}, this.headers, requiredHeaders);
119
+ // The keys used here must match the path parameter references in PATH_TEMPLATE above.
120
+ var pathParams = {
121
+ scopeCollectionType: this.scopeCollectionType,
122
+ scopeId: this.scopeId,
123
+ };
124
+ // The keys used here must match the operation's query parameter names.
125
+ var queryParams = {
126
+ includeBuiltinActions: this.includeBuiltinActions,
127
+ includeCustomActions: this.includeCustomActions,
128
+ includeRoles: this.includeRoles,
129
+ prefixRolesWithDefinitionScope: this.prefixRoles,
130
+ };
131
+ var requestBody = {
132
+ apikey: this.apikey,
133
+ callerExtClaim: this.callerExtClaim || undefined,
134
+ };
135
+ var request = {
136
+ options: {
137
+ method: 'POST',
138
+ url: this.url + this.PATH_TEMPLATE,
139
+ body: requestBody,
140
+ path: pathParams,
141
+ qs: queryParams,
142
+ headers: requestHeaders,
143
+ rejectUnauthorized: !this.disableSslVerification,
144
+ },
145
+ };
146
+ logger_1.default.debug("Invoking MCSP v2 token service operation: ".concat(request.options.url));
147
+ return this.requestWrapperInstance.sendRequest(request).then(function (response) {
148
+ logger_1.default.debug('Returned from MCSP v2 token service operation');
149
+ return response;
150
+ });
151
+ };
152
+ /**
153
+ * Parses the Options configuration property named by 'fieldName' as a boolean value.
154
+ * The value in the Options object could be either boolean or string and this function
155
+ * will do its best to parse it correctly.
156
+ * @param options - the Options object containing the configuration
157
+ * @param fieldName - the name of the field to parse as a boolean
158
+ * @param defaultValue - the default value to use in case the specified field is not present in Options
159
+ * @returns boolean the boolean value to be used for the configuration property
160
+ */
161
+ McspV2TokenManager.parseBoolean = function (options, fieldName, defaultValue) {
162
+ var result = defaultValue;
163
+ if (fieldName in options) {
164
+ var value = options[fieldName];
165
+ if (typeof value === 'boolean') {
166
+ result = value;
167
+ }
168
+ else if (typeof value === 'string') {
169
+ result = value.toLowerCase() === 'true';
170
+ }
171
+ }
172
+ return result;
173
+ };
174
+ return McspV2TokenManager;
175
+ }(jwt_token_manager_1.JwtTokenManager));
176
+ exports.McspV2TokenManager = McspV2TokenManager;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  /**
3
- * (C) Copyright IBM Corp. 2020, 2024.
3
+ * (C) Copyright IBM Corp. 2020, 2025.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -141,7 +141,7 @@ var TokenManager = /** @class */ (function () {
141
141
  * @returns Promise
142
142
  */
143
143
  TokenManager.prototype.requestToken = function () {
144
- var errMsg = '`requestToken` MUST be overridden by a subclass of TokenManagerV1.';
144
+ var errMsg = '`requestToken` MUST be overridden by a subclass of TokenManager.';
145
145
  var err = new Error(errMsg);
146
146
  logger_1.default.error(errMsg);
147
147
  return Promise.reject(err);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2022.
2
+ * (C) Copyright IBM Corp. 2019, 2025.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * (C) Copyright IBM Corp. 2019, 2022.
3
+ * (C) Copyright IBM Corp. 2019, 2025.
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -93,6 +93,9 @@ function getAuthenticatorFromEnvironment(serviceName) {
93
93
  else if (authType === authenticators_1.Authenticator.AUTHTYPE_MCSP.toLowerCase()) {
94
94
  authenticator = new authenticators_1.McspAuthenticator(credentials);
95
95
  }
96
+ else if (authType === authenticators_1.Authenticator.AUTHTYPE_MCSPV2.toLowerCase()) {
97
+ authenticator = new authenticators_1.McspV2Authenticator(credentials);
98
+ }
96
99
  else {
97
100
  throw new Error("Invalid value for AUTH_TYPE: ".concat(authType));
98
101
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "metadata": {
3
3
  "toolPackage": "@microsoft/api-extractor",
4
- "toolVersion": "7.43.1",
4
+ "toolVersion": "7.52.8",
5
5
  "schemaVersion": 1011,
6
6
  "oldestForwardsCompatibleVersion": 1001,
7
7
  "tsdocConfig": {
@@ -597,6 +597,36 @@
597
597
  "isProtected": false,
598
598
  "isAbstract": false
599
599
  },
600
+ {
601
+ "kind": "Property",
602
+ "canonicalReference": "ibm-cloud-sdk-core!Authenticator.AUTHTYPE_MCSPV2:member",
603
+ "docComment": "",
604
+ "excerptTokens": [
605
+ {
606
+ "kind": "Content",
607
+ "text": "static AUTHTYPE_MCSPV2: "
608
+ },
609
+ {
610
+ "kind": "Content",
611
+ "text": "string"
612
+ },
613
+ {
614
+ "kind": "Content",
615
+ "text": ";"
616
+ }
617
+ ],
618
+ "isReadonly": false,
619
+ "isOptional": false,
620
+ "releaseTag": "Public",
621
+ "name": "AUTHTYPE_MCSPV2",
622
+ "propertyTypeTokenRange": {
623
+ "startIndex": 1,
624
+ "endIndex": 2
625
+ },
626
+ "isStatic": true,
627
+ "isProtected": false,
628
+ "isAbstract": false
629
+ },
600
630
  {
601
631
  "kind": "Property",
602
632
  "canonicalReference": "ibm-cloud-sdk-core!Authenticator.AUTHTYPE_NOAUTH:member",
@@ -4006,7 +4036,7 @@
4006
4036
  {
4007
4037
  "kind": "Reference",
4008
4038
  "text": "Options",
4009
- "canonicalReference": "ibm-cloud-sdk-core!~Options_14:interface"
4039
+ "canonicalReference": "ibm-cloud-sdk-core!~Options_16:interface"
4010
4040
  },
4011
4041
  {
4012
4042
  "kind": "Content",
@@ -4133,7 +4163,7 @@
4133
4163
  {
4134
4164
  "kind": "Reference",
4135
4165
  "text": "Options",
4136
- "canonicalReference": "ibm-cloud-sdk-core!~Options_13:interface"
4166
+ "canonicalReference": "ibm-cloud-sdk-core!~Options_15:interface"
4137
4167
  },
4138
4168
  {
4139
4169
  "kind": "Content",
@@ -6112,7 +6142,7 @@
6112
6142
  {
6113
6143
  "kind": "Constructor",
6114
6144
  "canonicalReference": "ibm-cloud-sdk-core!McspAuthenticator:constructor(1)",
6115
- "docComment": "/**\n * Create a new McspAuthenticator instance.\n *\n * @param options - Configuration options for CloudPakForData authentication. This should be an object containing these fields: - url: (required) the endpoint URL for the CloudPakForData token service - username: (required) the username used to obtain a bearer token - password: (optional) the password used to obtain a bearer token (required if apikey is not specified) - apikey: (optional) the API key used to obtain a bearer token (required if password is not specified) - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate should be disabled or not - headers: (optional) a set of HTTP headers to be sent with each request to the token service\n *\n * @throws\n *\n * Error: the username, password, and/or url are not valid, or unspecified, for Cloud Pak For Data token requests.\n */\n",
6145
+ "docComment": "/**\n * Create a new McspAuthenticator instance.\n *\n * @param options - Configuration options for CloudPakForData authentication. This should be an object containing these fields: - url: (required) the endpoint URL for the CloudPakForData token service - apikey: (optional) the API key used to obtain a bearer token (required if password is not specified) - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate should be disabled or not - headers: (optional) a set of HTTP headers to be sent with each request to the token service\n *\n * @throws\n *\n * Error: the username, password, and/or url are not valid, or unspecified, for Cloud Pak For Data token requests.\n */\n",
6116
6146
  "excerptTokens": [
6117
6147
  {
6118
6148
  "kind": "Content",
@@ -6145,7 +6175,7 @@
6145
6175
  {
6146
6176
  "kind": "Method",
6147
6177
  "canonicalReference": "ibm-cloud-sdk-core!McspAuthenticator#authenticationType:member(1)",
6148
- "docComment": "/**\n * Returns the authenticator's type ('cp4d').\n *\n * @returns a string that indicates the authenticator's type\n */\n",
6178
+ "docComment": "/**\n * Returns the authenticator's type ('mcsp').\n *\n * @returns a string that indicates the authenticator's type\n */\n",
6149
6179
  "excerptTokens": [
6150
6180
  {
6151
6181
  "kind": "Content",
@@ -6372,6 +6402,264 @@
6372
6402
  },
6373
6403
  "implementsTokenRanges": []
6374
6404
  },
6405
+ {
6406
+ "kind": "Class",
6407
+ "canonicalReference": "ibm-cloud-sdk-core!McspV2Authenticator:class",
6408
+ "docComment": "/**\n * The McspV2Authenticator invokes the MCSP v2 token-exchange operation (POST /api/2.0/\\{scopeCollectionType\\}/\\{scopeId\\}/apikeys/token) to obtain an access token for an apikey, and adds the access token to requests via an Authorization header of the form: \"Authorization: Bearer <access-token>\"\n */\n",
6409
+ "excerptTokens": [
6410
+ {
6411
+ "kind": "Content",
6412
+ "text": "export declare class McspV2Authenticator extends "
6413
+ },
6414
+ {
6415
+ "kind": "Reference",
6416
+ "text": "TokenRequestBasedAuthenticator",
6417
+ "canonicalReference": "ibm-cloud-sdk-core!TokenRequestBasedAuthenticator:class"
6418
+ },
6419
+ {
6420
+ "kind": "Content",
6421
+ "text": " "
6422
+ }
6423
+ ],
6424
+ "fileUrlPath": "dist/es/auth/authenticators/mcspv2-authenticator.d.ts",
6425
+ "releaseTag": "Public",
6426
+ "isAbstract": false,
6427
+ "name": "McspV2Authenticator",
6428
+ "preserveMemberOrder": false,
6429
+ "members": [
6430
+ {
6431
+ "kind": "Constructor",
6432
+ "canonicalReference": "ibm-cloud-sdk-core!McspV2Authenticator:constructor(1)",
6433
+ "docComment": "/**\n * Create a new McspV2Authenticator instance.\n *\n * @param options - Configuration options for MCSP v2 authentication. This should be an object containing these fields: - url: (required) the endpoint URL for the CloudPakForData token service. - apikey: (optional) the API key used to obtain a bearer token (required if password is not specified). - scopeCollectionType: (required) The scope collection type of item(s). Valid values are: \"accounts\", \"subscriptions\", \"services\". - scopeId: (required) the scope identifier of item(s). - includeBuiltinActions: (optional) a flag to include builtin actions in the \"actions\" claim in the MCSP access token (default: false). - includeCustomActions: (optional) a flag to include custom actions in the \"actions\" claim in the MCSP access token (default: false). - includeRoles: (optional) a flag to include the \"roles\" claim in the MCSP access token (default: true). - prefixRoles: (optional) a flag to add a prefix with the scope level where the role is defined in the \"roles\" claim (default: false). - callerExtClaim: (optional) a map (object) containing keys and values to be injected into the access token as the \"callerExt\" claim. The keys used in this map must be enabled in the apikey by setting the \"callerExtClaimNames\" property when the apikey is created. This property is typically only used in scenarios involving an apikey with identityType `SERVICEID`. - disableSslVerification: (optional) a flag to disable verification of the token server's SSL certificate; defaults to false. - headers: (optional) a set of HTTP headers to be sent with each request to the token service.\n *\n * @throws\n *\n * Error: the input configuration failed validation\n */\n",
6434
+ "excerptTokens": [
6435
+ {
6436
+ "kind": "Content",
6437
+ "text": "constructor(options: "
6438
+ },
6439
+ {
6440
+ "kind": "Reference",
6441
+ "text": "Options",
6442
+ "canonicalReference": "ibm-cloud-sdk-core!~Options_14:interface"
6443
+ },
6444
+ {
6445
+ "kind": "Content",
6446
+ "text": ");"
6447
+ }
6448
+ ],
6449
+ "releaseTag": "Public",
6450
+ "isProtected": false,
6451
+ "overloadIndex": 1,
6452
+ "parameters": [
6453
+ {
6454
+ "parameterName": "options",
6455
+ "parameterTypeTokenRange": {
6456
+ "startIndex": 1,
6457
+ "endIndex": 2
6458
+ },
6459
+ "isOptional": false
6460
+ }
6461
+ ]
6462
+ },
6463
+ {
6464
+ "kind": "Method",
6465
+ "canonicalReference": "ibm-cloud-sdk-core!McspV2Authenticator#authenticationType:member(1)",
6466
+ "docComment": "/**\n * Returns the authenticator's type ('mcspv2').\n *\n * @returns a string that indicates the authenticator's type\n */\n",
6467
+ "excerptTokens": [
6468
+ {
6469
+ "kind": "Content",
6470
+ "text": "authenticationType(): "
6471
+ },
6472
+ {
6473
+ "kind": "Content",
6474
+ "text": "string"
6475
+ },
6476
+ {
6477
+ "kind": "Content",
6478
+ "text": ";"
6479
+ }
6480
+ ],
6481
+ "isStatic": false,
6482
+ "returnTypeTokenRange": {
6483
+ "startIndex": 1,
6484
+ "endIndex": 2
6485
+ },
6486
+ "releaseTag": "Public",
6487
+ "isProtected": false,
6488
+ "overloadIndex": 1,
6489
+ "parameters": [],
6490
+ "isOptional": false,
6491
+ "isAbstract": false,
6492
+ "name": "authenticationType"
6493
+ },
6494
+ {
6495
+ "kind": "Property",
6496
+ "canonicalReference": "ibm-cloud-sdk-core!McspV2Authenticator#tokenManager:member",
6497
+ "docComment": "",
6498
+ "excerptTokens": [
6499
+ {
6500
+ "kind": "Content",
6501
+ "text": "protected tokenManager: "
6502
+ },
6503
+ {
6504
+ "kind": "Reference",
6505
+ "text": "McspV2TokenManager",
6506
+ "canonicalReference": "ibm-cloud-sdk-core!McspV2TokenManager:class"
6507
+ },
6508
+ {
6509
+ "kind": "Content",
6510
+ "text": ";"
6511
+ }
6512
+ ],
6513
+ "isReadonly": false,
6514
+ "isOptional": false,
6515
+ "releaseTag": "Public",
6516
+ "name": "tokenManager",
6517
+ "propertyTypeTokenRange": {
6518
+ "startIndex": 1,
6519
+ "endIndex": 2
6520
+ },
6521
+ "isStatic": false,
6522
+ "isProtected": true,
6523
+ "isAbstract": false
6524
+ }
6525
+ ],
6526
+ "extendsTokenRange": {
6527
+ "startIndex": 1,
6528
+ "endIndex": 2
6529
+ },
6530
+ "implementsTokenRanges": []
6531
+ },
6532
+ {
6533
+ "kind": "Class",
6534
+ "canonicalReference": "ibm-cloud-sdk-core!McspV2TokenManager:class",
6535
+ "docComment": "/**\n * Token Manager for Multi-Cloud Saas Platform (MCSP) V2 authentication.\n *\n * The McspV2TokenManager will invoke the MCSP token service's 'POST /api/2.0/\\{scopeCollectionType\\}/\\{scopeId\\}/apikeys/token' operation to obtain an MCSP access token for an apikey.\n */\n",
6536
+ "excerptTokens": [
6537
+ {
6538
+ "kind": "Content",
6539
+ "text": "export declare class McspV2TokenManager extends "
6540
+ },
6541
+ {
6542
+ "kind": "Reference",
6543
+ "text": "JwtTokenManager",
6544
+ "canonicalReference": "ibm-cloud-sdk-core!JwtTokenManager:class"
6545
+ },
6546
+ {
6547
+ "kind": "Content",
6548
+ "text": " "
6549
+ }
6550
+ ],
6551
+ "fileUrlPath": "dist/es/auth/token-managers/mcspv2-token-manager.d.ts",
6552
+ "releaseTag": "Public",
6553
+ "isAbstract": false,
6554
+ "name": "McspV2TokenManager",
6555
+ "preserveMemberOrder": false,
6556
+ "members": [
6557
+ {
6558
+ "kind": "Constructor",
6559
+ "canonicalReference": "ibm-cloud-sdk-core!McspV2TokenManager:constructor(1)",
6560
+ "docComment": "/**\n * Create a new McspV2TokenManager instance.\n *\n * @param options - Configuration options. This should be an object containing these fields: - url: (required) the endpoint URL for the CloudPakForData token service. - apikey: (optional) the API key used to obtain a bearer token (required if password is not specified). - scopeCollectionType: (required) The scope collection type of item(s). Valid values are: \"accounts\", \"subscriptions\", \"services\". - scopeId: (required) the scope identifier of item(s). - includeBuiltinActions: (optional) a flag to include builtin actions in the \"actions\" claim in the MCSP access token (default: false). - includeCustomActions: (optional) a flag to include custom actions in the \"actions\" claim in the MCSP access token (default: false). - includeRoles: (optional) a flag to include the \"roles\" claim in the MCSP access token (default: true). - prefixRoles: (optional) a flag to add a prefix with the scope level where the role is defined in the \"roles\" claim (default: false). - callerExtClaim: (optional) a map (object) containing keys and values to be injected into the access token as the \"callerExt\" claim. The keys used in this map must be enabled in the apikey by setting the \"callerExtClaimNames\" property when the apikey is created. This property is typically only used in scenarios involving an apikey with identityType `SERVICEID`. - disableSslVerification: (optional) a flag to disable verification of the token server's SSL certificate; defaults to false. - headers: (optional) a set of HTTP headers to be sent with each request to the token service.\n *\n * @throws\n *\n * Error: the input configuration failed validation\n */\n",
6561
+ "excerptTokens": [
6562
+ {
6563
+ "kind": "Content",
6564
+ "text": "constructor(options: "
6565
+ },
6566
+ {
6567
+ "kind": "Reference",
6568
+ "text": "Options",
6569
+ "canonicalReference": "ibm-cloud-sdk-core!~Options_13:interface"
6570
+ },
6571
+ {
6572
+ "kind": "Content",
6573
+ "text": ");"
6574
+ }
6575
+ ],
6576
+ "releaseTag": "Public",
6577
+ "isProtected": false,
6578
+ "overloadIndex": 1,
6579
+ "parameters": [
6580
+ {
6581
+ "parameterName": "options",
6582
+ "parameterTypeTokenRange": {
6583
+ "startIndex": 1,
6584
+ "endIndex": 2
6585
+ },
6586
+ "isOptional": false
6587
+ }
6588
+ ]
6589
+ },
6590
+ {
6591
+ "kind": "Method",
6592
+ "canonicalReference": "ibm-cloud-sdk-core!McspV2TokenManager#requestToken:member(1)",
6593
+ "docComment": "",
6594
+ "excerptTokens": [
6595
+ {
6596
+ "kind": "Content",
6597
+ "text": "protected requestToken(): "
6598
+ },
6599
+ {
6600
+ "kind": "Reference",
6601
+ "text": "Promise",
6602
+ "canonicalReference": "!Promise:interface"
6603
+ },
6604
+ {
6605
+ "kind": "Content",
6606
+ "text": "<any>"
6607
+ },
6608
+ {
6609
+ "kind": "Content",
6610
+ "text": ";"
6611
+ }
6612
+ ],
6613
+ "isStatic": false,
6614
+ "returnTypeTokenRange": {
6615
+ "startIndex": 1,
6616
+ "endIndex": 3
6617
+ },
6618
+ "releaseTag": "Public",
6619
+ "isProtected": true,
6620
+ "overloadIndex": 1,
6621
+ "parameters": [],
6622
+ "isOptional": false,
6623
+ "isAbstract": false,
6624
+ "name": "requestToken"
6625
+ },
6626
+ {
6627
+ "kind": "Property",
6628
+ "canonicalReference": "ibm-cloud-sdk-core!McspV2TokenManager#requiredOptions:member",
6629
+ "docComment": "",
6630
+ "excerptTokens": [
6631
+ {
6632
+ "kind": "Content",
6633
+ "text": "protected requiredOptions: "
6634
+ },
6635
+ {
6636
+ "kind": "Content",
6637
+ "text": "string[]"
6638
+ },
6639
+ {
6640
+ "kind": "Content",
6641
+ "text": ";"
6642
+ }
6643
+ ],
6644
+ "isReadonly": false,
6645
+ "isOptional": false,
6646
+ "releaseTag": "Public",
6647
+ "name": "requiredOptions",
6648
+ "propertyTypeTokenRange": {
6649
+ "startIndex": 1,
6650
+ "endIndex": 2
6651
+ },
6652
+ "isStatic": false,
6653
+ "isProtected": true,
6654
+ "isAbstract": false
6655
+ }
6656
+ ],
6657
+ "extendsTokenRange": {
6658
+ "startIndex": 1,
6659
+ "endIndex": 2
6660
+ },
6661
+ "implementsTokenRanges": []
6662
+ },
6375
6663
  {
6376
6664
  "kind": "Class",
6377
6665
  "canonicalReference": "ibm-cloud-sdk-core!NoAuthAuthenticator:class",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2019, 2023.
2
+ * (C) Copyright IBM Corp. 2019, 2025.
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.
@@ -31,6 +31,7 @@ export declare class Authenticator implements AuthenticatorInterface {
31
31
  static AUTHTYPE_NOAUTH: string;
32
32
  static AUTHTYPE_VPC: string;
33
33
  static AUTHTYPE_MCSP: string;
34
+ static AUTHTYPE_MCSPV2: string;
34
35
  static AUTHTYPE_UNKNOWN: string;
35
36
  /**
36
37
  * Create a new Authenticator instance.
@@ -51,4 +51,5 @@ Authenticator.AUTHTYPE_CP4D = 'cp4d';
51
51
  Authenticator.AUTHTYPE_NOAUTH = 'noAuth';
52
52
  Authenticator.AUTHTYPE_VPC = 'vpc';
53
53
  Authenticator.AUTHTYPE_MCSP = 'mcsp';
54
+ Authenticator.AUTHTYPE_MCSPV2 = 'mcspv2';
54
55
  Authenticator.AUTHTYPE_UNKNOWN = 'unknown';
@@ -39,7 +39,8 @@
39
39
  * IAMAssumeAuthenticator: Authenticator for passing IAM authentication information to service endpoint, assuming a trusted profile.
40
40
  * ContainerAuthenticator: Authenticator for passing IAM authentication to a service, based on a token living on the container.
41
41
  * VpcInstanceAuthenticator: Authenticator that uses the VPC Instance Metadata Service API to retrieve an IAM token.
42
- * McspAuthenticator: Authenticator for passing MCSP authentication to a service endpoint.
42
+ * McspAuthenticator: Authenticator for passing MCSP v1 authentication to a service endpoint.
43
+ * McspV2Authenticator: Authenticator for passing MCSP v2 authentication to a service endpoint.
43
44
  * NoAuthAuthenticator: Performs no authentication. Useful for testing purposes.
44
45
  */
45
46
  export { AuthenticatorInterface } from './authenticator-interface';
@@ -54,4 +55,5 @@ export { IamRequestBasedAuthenticator } from './iam-request-based-authenticator'
54
55
  export { TokenRequestBasedAuthenticator } from './token-request-based-authenticator';
55
56
  export { VpcInstanceAuthenticator } from './vpc-instance-authenticator';
56
57
  export { McspAuthenticator } from './mcsp-authenticator';
58
+ export { McspV2Authenticator } from './mcspv2-authenticator';
57
59
  export { IamAssumeAuthenticator } from './iam-assume-authenticator';
@@ -24,4 +24,5 @@ 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 { McspV2Authenticator } from './mcspv2-authenticator';
27
28
  export { IamAssumeAuthenticator } from './iam-assume-authenticator';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * (C) Copyright IBM Corp. 2023.
2
+ * (C) Copyright IBM Corp. 2023, 2025.
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.
@@ -38,8 +38,6 @@ export declare class McspAuthenticator extends TokenRequestBasedAuthenticator {
38
38
  * @param options - Configuration options for CloudPakForData authentication.
39
39
  * This should be an object containing these fields:
40
40
  * - url: (required) the endpoint URL for the CloudPakForData token service
41
- * - username: (required) the username used to obtain a bearer token
42
- * - password: (optional) the password used to obtain a bearer token (required if apikey is not specified)
43
41
  * - apikey: (optional) the API key used to obtain a bearer token (required if password is not specified)
44
42
  * - disableSslVerification: (optional) a flag that indicates whether verification of the token server's SSL certificate
45
43
  * should be disabled or not
@@ -49,7 +47,7 @@ export declare class McspAuthenticator extends TokenRequestBasedAuthenticator {
49
47
  */
50
48
  constructor(options: Options);
51
49
  /**
52
- * Returns the authenticator's type ('cp4d').
50
+ * Returns the authenticator's type ('mcsp').
53
51
  *
54
52
  * @returns a string that indicates the authenticator's type
55
53
  */