ibm-cloud-sdk-core 3.2.1 → 3.2.2-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{auth → dist/auth}/authenticators/authenticator-interface.d.ts +0 -0
- package/{auth → dist/auth}/authenticators/authenticator-interface.js +0 -0
- package/{auth → dist/auth}/authenticators/authenticator.d.ts +0 -0
- package/{auth → dist/auth}/authenticators/authenticator.js +1 -0
- package/{auth → dist/auth}/authenticators/basic-authenticator.d.ts +0 -0
- package/{auth → dist/auth}/authenticators/basic-authenticator.js +7 -4
- package/{auth → dist/auth}/authenticators/bearer-token-authenticator.d.ts +0 -0
- package/{auth → dist/auth}/authenticators/bearer-token-authenticator.js +7 -4
- package/{auth → dist/auth}/authenticators/cloud-pak-for-data-authenticator.d.ts +0 -0
- package/{auth → dist/auth}/authenticators/cloud-pak-for-data-authenticator.js +4 -1
- package/{auth → dist/auth}/authenticators/container-authenticator.d.ts +0 -0
- package/{auth → dist/auth}/authenticators/container-authenticator.js +4 -1
- package/{auth → dist/auth}/authenticators/iam-authenticator.d.ts +0 -0
- package/{auth → dist/auth}/authenticators/iam-authenticator.js +5 -2
- package/{auth → dist/auth}/authenticators/iam-request-based-authenticator.d.ts +0 -0
- package/{auth → dist/auth}/authenticators/iam-request-based-authenticator.js +4 -1
- package/{auth → dist/auth}/authenticators/index.d.ts +0 -0
- package/dist/auth/authenticators/index.js +38 -0
- package/{auth → dist/auth}/authenticators/no-auth-authenticator.d.ts +0 -0
- package/{auth → dist/auth}/authenticators/no-auth-authenticator.js +4 -1
- package/{auth → dist/auth}/authenticators/token-request-based-authenticator.d.ts +0 -0
- package/{auth → dist/auth}/authenticators/token-request-based-authenticator.js +6 -3
- package/{auth → dist/auth}/authenticators/vpc-instance-authenticator.d.ts +0 -0
- package/{auth → dist/auth}/authenticators/vpc-instance-authenticator.js +4 -1
- package/{auth → dist/auth}/index.d.ts +0 -0
- package/dist/auth/index.js +34 -0
- package/{auth → dist/auth}/token-managers/container-token-manager.d.ts +0 -0
- package/{auth → dist/auth}/token-managers/container-token-manager.js +7 -4
- package/{auth → dist/auth}/token-managers/cp4d-token-manager.d.ts +0 -0
- package/{auth → dist/auth}/token-managers/cp4d-token-manager.js +6 -3
- package/{auth → dist/auth}/token-managers/iam-request-based-token-manager.d.ts +0 -0
- package/{auth → dist/auth}/token-managers/iam-request-based-token-manager.js +9 -6
- package/{auth → dist/auth}/token-managers/iam-token-manager.d.ts +0 -0
- package/{auth → dist/auth}/token-managers/iam-token-manager.js +5 -2
- package/{auth → dist/auth}/token-managers/index.d.ts +0 -0
- package/{auth → dist/auth}/token-managers/index.js +8 -7
- package/{auth → dist/auth}/token-managers/jwt-token-manager.d.ts +0 -0
- package/{auth → dist/auth}/token-managers/jwt-token-manager.js +5 -2
- package/{auth → dist/auth}/token-managers/token-manager.d.ts +0 -0
- package/{auth → dist/auth}/token-managers/token-manager.js +5 -4
- package/{auth → dist/auth}/token-managers/vpc-instance-token-manager.d.ts +0 -0
- package/{auth → dist/auth}/token-managers/vpc-instance-token-manager.js +11 -8
- package/{auth → dist/auth}/utils/file-reading-helpers.browser.d.ts +0 -0
- package/{auth → dist/auth}/utils/file-reading-helpers.browser.js +1 -0
- package/{auth → dist/auth}/utils/file-reading-helpers.d.ts +0 -0
- package/{auth → dist/auth}/utils/file-reading-helpers.js +12 -11
- package/{auth → dist/auth}/utils/get-authenticator-from-environment.d.ts +0 -0
- package/{auth → dist/auth}/utils/get-authenticator-from-environment.js +3 -2
- package/{auth → dist/auth}/utils/helpers.d.ts +0 -0
- package/{auth → dist/auth}/utils/helpers.js +5 -4
- package/{auth → dist/auth}/utils/index.d.ts +0 -0
- package/dist/auth/utils/index.js +46 -0
- package/{auth → dist/auth}/utils/read-external-sources.d.ts +0 -0
- package/{auth → dist/auth}/utils/read-external-sources.js +6 -5
- package/{docs → dist/docs}/ibm-cloud-sdk-core.api.json +0 -0
- package/{es → dist/es}/auth/authenticators/authenticator-interface.d.ts +0 -0
- package/{es → dist/es}/auth/authenticators/authenticator-interface.js +1 -0
- package/{es → dist/es}/auth/authenticators/authenticator.d.ts +0 -0
- package/{es → dist/es}/auth/authenticators/authenticator.js +0 -0
- package/{es → dist/es}/auth/authenticators/basic-authenticator.d.ts +0 -0
- package/{es → dist/es}/auth/authenticators/basic-authenticator.js +0 -0
- package/{es → dist/es}/auth/authenticators/bearer-token-authenticator.d.ts +0 -0
- package/{es → dist/es}/auth/authenticators/bearer-token-authenticator.js +0 -0
- package/{es → dist/es}/auth/authenticators/cloud-pak-for-data-authenticator.d.ts +0 -0
- package/{es → dist/es}/auth/authenticators/cloud-pak-for-data-authenticator.js +0 -0
- package/{es → dist/es}/auth/authenticators/container-authenticator.d.ts +0 -0
- package/{es → dist/es}/auth/authenticators/container-authenticator.js +0 -0
- package/{es → dist/es}/auth/authenticators/iam-authenticator.d.ts +0 -0
- package/{es → dist/es}/auth/authenticators/iam-authenticator.js +0 -0
- package/{es → dist/es}/auth/authenticators/iam-request-based-authenticator.d.ts +0 -0
- package/{es → dist/es}/auth/authenticators/iam-request-based-authenticator.js +0 -0
- package/{es → dist/es}/auth/authenticators/index.d.ts +0 -0
- package/{es → dist/es}/auth/authenticators/index.js +0 -0
- package/{es → dist/es}/auth/authenticators/no-auth-authenticator.d.ts +0 -0
- package/{es → dist/es}/auth/authenticators/no-auth-authenticator.js +0 -0
- package/{es → dist/es}/auth/authenticators/token-request-based-authenticator.d.ts +0 -0
- package/{es → dist/es}/auth/authenticators/token-request-based-authenticator.js +0 -0
- package/{es → dist/es}/auth/authenticators/vpc-instance-authenticator.d.ts +0 -0
- package/{es → dist/es}/auth/authenticators/vpc-instance-authenticator.js +0 -0
- package/{es → dist/es}/auth/index.d.ts +0 -0
- package/{es → dist/es}/auth/index.js +0 -0
- package/{es → dist/es}/auth/token-managers/container-token-manager.d.ts +0 -0
- package/{es → dist/es}/auth/token-managers/container-token-manager.js +0 -0
- package/{es → dist/es}/auth/token-managers/cp4d-token-manager.d.ts +0 -0
- package/{es → dist/es}/auth/token-managers/cp4d-token-manager.js +0 -0
- package/{es → dist/es}/auth/token-managers/iam-request-based-token-manager.d.ts +0 -0
- package/{es → dist/es}/auth/token-managers/iam-request-based-token-manager.js +0 -0
- package/{es → dist/es}/auth/token-managers/iam-token-manager.d.ts +0 -0
- package/{es → dist/es}/auth/token-managers/iam-token-manager.js +0 -0
- package/{es → dist/es}/auth/token-managers/index.d.ts +0 -0
- package/{es → dist/es}/auth/token-managers/index.js +0 -0
- package/{es → dist/es}/auth/token-managers/jwt-token-manager.d.ts +0 -0
- package/{es → dist/es}/auth/token-managers/jwt-token-manager.js +0 -0
- package/{es → dist/es}/auth/token-managers/token-manager.d.ts +0 -0
- package/{es → dist/es}/auth/token-managers/token-manager.js +0 -0
- package/{es → dist/es}/auth/token-managers/vpc-instance-token-manager.d.ts +0 -0
- package/{es → dist/es}/auth/token-managers/vpc-instance-token-manager.js +0 -0
- package/{es → dist/es}/auth/utils/file-reading-helpers.browser.d.ts +0 -0
- package/{es → dist/es}/auth/utils/file-reading-helpers.browser.js +0 -0
- package/{es → dist/es}/auth/utils/file-reading-helpers.d.ts +0 -0
- package/{es → dist/es}/auth/utils/file-reading-helpers.js +0 -0
- package/{es → dist/es}/auth/utils/get-authenticator-from-environment.d.ts +0 -0
- package/{es → dist/es}/auth/utils/get-authenticator-from-environment.js +0 -0
- package/{es → dist/es}/auth/utils/helpers.d.ts +0 -0
- package/{es → dist/es}/auth/utils/helpers.js +0 -0
- package/{es → dist/es}/auth/utils/index.d.ts +0 -0
- package/{es → dist/es}/auth/utils/index.js +0 -0
- package/{es → dist/es}/auth/utils/read-external-sources.d.ts +0 -0
- package/{es → dist/es}/auth/utils/read-external-sources.js +0 -0
- package/{es → dist/es}/index.d.ts +0 -0
- package/{es → dist/es}/index.js +0 -0
- package/{es → dist/es}/lib/base-service.d.ts +0 -0
- package/{es → dist/es}/lib/base-service.js +0 -0
- package/{es → dist/es}/lib/content-type.d.ts +0 -0
- package/{es → dist/es}/lib/content-type.js +0 -0
- package/{es → dist/es}/lib/get-new-logger.d.ts +0 -0
- package/{es → dist/es}/lib/get-new-logger.js +0 -0
- package/{es → dist/es}/lib/helper.d.ts +0 -0
- package/{es → dist/es}/lib/helper.js +0 -0
- package/{es → dist/es}/lib/logger.d.ts +0 -0
- package/{es → dist/es}/lib/logger.js +0 -0
- package/{es → dist/es}/lib/querystring.d.ts +0 -0
- package/{es → dist/es}/lib/querystring.js +0 -0
- package/{es → dist/es}/lib/request-wrapper.d.ts +0 -0
- package/{es → dist/es}/lib/request-wrapper.js +13 -5
- package/{es → dist/es}/lib/sdk-test-helpers.browser.d.ts +0 -0
- package/{es → dist/es}/lib/sdk-test-helpers.browser.js +0 -0
- package/{es → dist/es}/lib/sdk-test-helpers.d.ts +0 -0
- package/{es → dist/es}/lib/sdk-test-helpers.js +0 -0
- package/{es → dist/es}/lib/stream-to-promise.d.ts +0 -0
- package/{es → dist/es}/lib/stream-to-promise.js +0 -0
- package/{ibm-cloud-sdk-core.d.ts → dist/ibm-cloud-sdk-core.d.ts} +0 -0
- package/{index.d.ts → dist/index.d.ts} +0 -0
- package/dist/index.js +63 -0
- package/{lib → dist/lib}/base-service.d.ts +0 -0
- package/{lib → dist/lib}/base-service.js +7 -6
- package/{lib → dist/lib}/content-type.d.ts +0 -0
- package/{lib → dist/lib}/content-type.js +1 -1
- package/{lib → dist/lib}/get-new-logger.d.ts +0 -0
- package/{lib → dist/lib}/get-new-logger.js +6 -5
- package/{lib → dist/lib}/helper.d.ts +0 -0
- package/{lib → dist/lib}/helper.js +21 -18
- package/{lib → dist/lib}/logger.d.ts +0 -0
- package/{lib → dist/lib}/logger.js +1 -1
- package/{lib → dist/lib}/querystring.d.ts +0 -0
- package/{lib → dist/lib}/querystring.js +1 -1
- package/{lib → dist/lib}/request-wrapper.d.ts +0 -0
- package/{lib → dist/lib}/request-wrapper.js +54 -29
- package/{lib → dist/lib}/sdk-test-helpers.browser.d.ts +0 -0
- package/{lib → dist/lib}/sdk-test-helpers.browser.js +1 -0
- package/{lib → dist/lib}/sdk-test-helpers.d.ts +0 -0
- package/{lib → dist/lib}/sdk-test-helpers.js +8 -7
- package/{lib → dist/lib}/stream-to-promise.d.ts +0 -0
- package/{lib → dist/lib}/stream-to-promise.js +1 -0
- package/dist/package.json +71 -0
- package/package.json +40 -6
- package/auth/authenticators/index.js +0 -37
- package/auth/index.js +0 -23
- package/auth/utils/index.js +0 -34
- package/index.js +0 -43
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unused-vars, class-methods-use-this */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Authenticator = void 0;
|
|
4
5
|
/**
|
|
5
6
|
* Base Authenticator class for other Authenticators to extend. Not intended
|
|
6
7
|
* to be used as a stand-alone authenticator.
|
|
File without changes
|
|
@@ -18,10 +18,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
18
18
|
var extendStatics = function (d, b) {
|
|
19
19
|
extendStatics = Object.setPrototypeOf ||
|
|
20
20
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (
|
|
21
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
22
22
|
return extendStatics(d, b);
|
|
23
23
|
};
|
|
24
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");
|
|
25
27
|
extendStatics(d, b);
|
|
26
28
|
function __() { this.constructor = d; }
|
|
27
29
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -31,6 +33,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
31
33
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
34
|
};
|
|
33
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.BasicAuthenticator = void 0;
|
|
34
37
|
var extend_1 = __importDefault(require("extend"));
|
|
35
38
|
var utils_1 = require("../utils");
|
|
36
39
|
var authenticator_1 = require("./authenticator");
|
|
@@ -56,9 +59,9 @@ var BasicAuthenticator = /** @class */ (function (_super) {
|
|
|
56
59
|
function BasicAuthenticator(options) {
|
|
57
60
|
var _this = _super.call(this) || this;
|
|
58
61
|
_this.requiredOptions = ['username', 'password'];
|
|
59
|
-
utils_1.validateInput(options, _this.requiredOptions);
|
|
62
|
+
(0, utils_1.validateInput)(options, _this.requiredOptions);
|
|
60
63
|
var username = options.username, password = options.password;
|
|
61
|
-
var authHeaderString = utils_1.computeBasicAuthHeader(username, password);
|
|
64
|
+
var authHeaderString = (0, utils_1.computeBasicAuthHeader)(username, password);
|
|
62
65
|
_this.authHeader = { Authorization: authHeaderString };
|
|
63
66
|
return _this;
|
|
64
67
|
}
|
|
@@ -75,7 +78,7 @@ var BasicAuthenticator = /** @class */ (function (_super) {
|
|
|
75
78
|
BasicAuthenticator.prototype.authenticate = function (requestOptions) {
|
|
76
79
|
var _this = this;
|
|
77
80
|
return new Promise(function (resolve) {
|
|
78
|
-
requestOptions.headers = extend_1.default(true, {}, requestOptions.headers, _this.authHeader);
|
|
81
|
+
requestOptions.headers = (0, extend_1.default)(true, {}, requestOptions.headers, _this.authHeader);
|
|
79
82
|
resolve();
|
|
80
83
|
});
|
|
81
84
|
};
|
|
File without changes
|
|
@@ -18,10 +18,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
18
18
|
var extendStatics = function (d, b) {
|
|
19
19
|
extendStatics = Object.setPrototypeOf ||
|
|
20
20
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (
|
|
21
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
22
22
|
return extendStatics(d, b);
|
|
23
23
|
};
|
|
24
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");
|
|
25
27
|
extendStatics(d, b);
|
|
26
28
|
function __() { this.constructor = d; }
|
|
27
29
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -31,6 +33,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
31
33
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
34
|
};
|
|
33
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.BearerTokenAuthenticator = void 0;
|
|
34
37
|
var extend_1 = __importDefault(require("extend"));
|
|
35
38
|
var utils_1 = require("../utils");
|
|
36
39
|
var authenticator_1 = require("./authenticator");
|
|
@@ -55,7 +58,7 @@ var BearerTokenAuthenticator = /** @class */ (function (_super) {
|
|
|
55
58
|
function BearerTokenAuthenticator(options) {
|
|
56
59
|
var _this = _super.call(this) || this;
|
|
57
60
|
_this.requiredOptions = ['bearerToken'];
|
|
58
|
-
utils_1.validateInput(options, _this.requiredOptions);
|
|
61
|
+
(0, utils_1.validateInput)(options, _this.requiredOptions);
|
|
59
62
|
_this.bearerToken = options.bearerToken;
|
|
60
63
|
return _this;
|
|
61
64
|
}
|
|
@@ -82,8 +85,8 @@ var BearerTokenAuthenticator = /** @class */ (function (_super) {
|
|
|
82
85
|
BearerTokenAuthenticator.prototype.authenticate = function (requestOptions) {
|
|
83
86
|
var _this = this;
|
|
84
87
|
return new Promise(function (resolve) {
|
|
85
|
-
var authHeader = { Authorization: "Bearer "
|
|
86
|
-
requestOptions.headers = extend_1.default(true, {}, requestOptions.headers, authHeader);
|
|
88
|
+
var authHeader = { Authorization: "Bearer ".concat(_this.bearerToken) };
|
|
89
|
+
requestOptions.headers = (0, extend_1.default)(true, {}, requestOptions.headers, authHeader);
|
|
87
90
|
resolve();
|
|
88
91
|
});
|
|
89
92
|
};
|
|
File without changes
|
|
@@ -18,16 +18,19 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
18
18
|
var extendStatics = function (d, b) {
|
|
19
19
|
extendStatics = Object.setPrototypeOf ||
|
|
20
20
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (
|
|
21
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
22
22
|
return extendStatics(d, b);
|
|
23
23
|
};
|
|
24
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");
|
|
25
27
|
extendStatics(d, b);
|
|
26
28
|
function __() { this.constructor = d; }
|
|
27
29
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
30
|
};
|
|
29
31
|
})();
|
|
30
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.CloudPakForDataAuthenticator = void 0;
|
|
31
34
|
var authenticator_1 = require("./authenticator");
|
|
32
35
|
var token_managers_1 = require("../token-managers");
|
|
33
36
|
var token_request_based_authenticator_1 = require("./token-request-based-authenticator");
|
|
File without changes
|
|
@@ -18,16 +18,19 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
18
18
|
var extendStatics = function (d, b) {
|
|
19
19
|
extendStatics = Object.setPrototypeOf ||
|
|
20
20
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (
|
|
21
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
22
22
|
return extendStatics(d, b);
|
|
23
23
|
};
|
|
24
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");
|
|
25
27
|
extendStatics(d, b);
|
|
26
28
|
function __() { this.constructor = d; }
|
|
27
29
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
30
|
};
|
|
29
31
|
})();
|
|
30
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.ContainerAuthenticator = void 0;
|
|
31
34
|
var authenticator_1 = require("./authenticator");
|
|
32
35
|
var token_managers_1 = require("../token-managers");
|
|
33
36
|
var iam_request_based_authenticator_1 = require("./iam-request-based-authenticator");
|
|
File without changes
|
|
@@ -18,16 +18,19 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
18
18
|
var extendStatics = function (d, b) {
|
|
19
19
|
extendStatics = Object.setPrototypeOf ||
|
|
20
20
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (
|
|
21
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
22
22
|
return extendStatics(d, b);
|
|
23
23
|
};
|
|
24
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");
|
|
25
27
|
extendStatics(d, b);
|
|
26
28
|
function __() { this.constructor = d; }
|
|
27
29
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
30
|
};
|
|
29
31
|
})();
|
|
30
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.IamAuthenticator = void 0;
|
|
31
34
|
var authenticator_1 = require("./authenticator");
|
|
32
35
|
var token_managers_1 = require("../token-managers");
|
|
33
36
|
var utils_1 = require("../utils");
|
|
@@ -67,7 +70,7 @@ var IamAuthenticator = /** @class */ (function (_super) {
|
|
|
67
70
|
function IamAuthenticator(options) {
|
|
68
71
|
var _this = _super.call(this, options) || this;
|
|
69
72
|
_this.requiredOptions = ['apikey'];
|
|
70
|
-
utils_1.validateInput(options, _this.requiredOptions);
|
|
73
|
+
(0, utils_1.validateInput)(options, _this.requiredOptions);
|
|
71
74
|
_this.apikey = options.apikey;
|
|
72
75
|
// the param names are shared between the authenticator and the token
|
|
73
76
|
// manager so we can just pass along the options object
|
|
File without changes
|
|
@@ -18,16 +18,19 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
18
18
|
var extendStatics = function (d, b) {
|
|
19
19
|
extendStatics = Object.setPrototypeOf ||
|
|
20
20
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (
|
|
21
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
22
22
|
return extendStatics(d, b);
|
|
23
23
|
};
|
|
24
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");
|
|
25
27
|
extendStatics(d, b);
|
|
26
28
|
function __() { this.constructor = d; }
|
|
27
29
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
30
|
};
|
|
29
31
|
})();
|
|
30
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.IamRequestBasedAuthenticator = void 0;
|
|
31
34
|
var token_managers_1 = require("../token-managers");
|
|
32
35
|
var token_request_based_authenticator_1 = require("./token-request-based-authenticator");
|
|
33
36
|
/**
|
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* (C) Copyright IBM Corp. 2019, 2021.
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.VpcInstanceAuthenticator = exports.TokenRequestBasedAuthenticator = exports.IamRequestBasedAuthenticator = exports.NoAuthAuthenticator = exports.ContainerAuthenticator = exports.IamAuthenticator = exports.CloudPakForDataAuthenticator = exports.BearerTokenAuthenticator = exports.BasicAuthenticator = exports.Authenticator = void 0;
|
|
19
|
+
var authenticator_1 = require("./authenticator");
|
|
20
|
+
Object.defineProperty(exports, "Authenticator", { enumerable: true, get: function () { return authenticator_1.Authenticator; } });
|
|
21
|
+
var basic_authenticator_1 = require("./basic-authenticator");
|
|
22
|
+
Object.defineProperty(exports, "BasicAuthenticator", { enumerable: true, get: function () { return basic_authenticator_1.BasicAuthenticator; } });
|
|
23
|
+
var bearer_token_authenticator_1 = require("./bearer-token-authenticator");
|
|
24
|
+
Object.defineProperty(exports, "BearerTokenAuthenticator", { enumerable: true, get: function () { return bearer_token_authenticator_1.BearerTokenAuthenticator; } });
|
|
25
|
+
var cloud_pak_for_data_authenticator_1 = require("./cloud-pak-for-data-authenticator");
|
|
26
|
+
Object.defineProperty(exports, "CloudPakForDataAuthenticator", { enumerable: true, get: function () { return cloud_pak_for_data_authenticator_1.CloudPakForDataAuthenticator; } });
|
|
27
|
+
var iam_authenticator_1 = require("./iam-authenticator");
|
|
28
|
+
Object.defineProperty(exports, "IamAuthenticator", { enumerable: true, get: function () { return iam_authenticator_1.IamAuthenticator; } });
|
|
29
|
+
var container_authenticator_1 = require("./container-authenticator");
|
|
30
|
+
Object.defineProperty(exports, "ContainerAuthenticator", { enumerable: true, get: function () { return container_authenticator_1.ContainerAuthenticator; } });
|
|
31
|
+
var no_auth_authenticator_1 = require("./no-auth-authenticator");
|
|
32
|
+
Object.defineProperty(exports, "NoAuthAuthenticator", { enumerable: true, get: function () { return no_auth_authenticator_1.NoAuthAuthenticator; } });
|
|
33
|
+
var iam_request_based_authenticator_1 = require("./iam-request-based-authenticator");
|
|
34
|
+
Object.defineProperty(exports, "IamRequestBasedAuthenticator", { enumerable: true, get: function () { return iam_request_based_authenticator_1.IamRequestBasedAuthenticator; } });
|
|
35
|
+
var token_request_based_authenticator_1 = require("./token-request-based-authenticator");
|
|
36
|
+
Object.defineProperty(exports, "TokenRequestBasedAuthenticator", { enumerable: true, get: function () { return token_request_based_authenticator_1.TokenRequestBasedAuthenticator; } });
|
|
37
|
+
var vpc_instance_authenticator_1 = require("./vpc-instance-authenticator");
|
|
38
|
+
Object.defineProperty(exports, "VpcInstanceAuthenticator", { enumerable: true, get: function () { return vpc_instance_authenticator_1.VpcInstanceAuthenticator; } });
|
|
File without changes
|
|
@@ -4,16 +4,19 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
4
4
|
var extendStatics = function (d, b) {
|
|
5
5
|
extendStatics = Object.setPrototypeOf ||
|
|
6
6
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7
|
-
function (d, b) { for (var p in b) if (
|
|
7
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
8
8
|
return extendStatics(d, b);
|
|
9
9
|
};
|
|
10
10
|
return function (d, b) {
|
|
11
|
+
if (typeof b !== "function" && b !== null)
|
|
12
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
13
|
extendStatics(d, b);
|
|
12
14
|
function __() { this.constructor = d; }
|
|
13
15
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
16
|
};
|
|
15
17
|
})();
|
|
16
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.NoAuthAuthenticator = void 0;
|
|
17
20
|
/**
|
|
18
21
|
* (C) Copyright IBM Corp. 2019, 2021.
|
|
19
22
|
*
|
|
File without changes
|
|
@@ -18,10 +18,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
18
18
|
var extendStatics = function (d, b) {
|
|
19
19
|
extendStatics = Object.setPrototypeOf ||
|
|
20
20
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (
|
|
21
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
22
22
|
return extendStatics(d, b);
|
|
23
23
|
};
|
|
24
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");
|
|
25
27
|
extendStatics(d, b);
|
|
26
28
|
function __() { this.constructor = d; }
|
|
27
29
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -31,6 +33,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
31
33
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
34
|
};
|
|
33
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.TokenRequestBasedAuthenticator = void 0;
|
|
34
37
|
var extend_1 = __importDefault(require("extend"));
|
|
35
38
|
var token_managers_1 = require("../token-managers");
|
|
36
39
|
var authenticator_1 = require("./authenticator");
|
|
@@ -108,8 +111,8 @@ var TokenRequestBasedAuthenticator = /** @class */ (function (_super) {
|
|
|
108
111
|
*/
|
|
109
112
|
TokenRequestBasedAuthenticator.prototype.authenticate = function (requestOptions) {
|
|
110
113
|
return this.tokenManager.getToken().then(function (token) {
|
|
111
|
-
var authHeader = { Authorization: "Bearer "
|
|
112
|
-
requestOptions.headers = extend_1.default(true, {}, requestOptions.headers, authHeader);
|
|
114
|
+
var authHeader = { Authorization: "Bearer ".concat(token) };
|
|
115
|
+
requestOptions.headers = (0, extend_1.default)(true, {}, requestOptions.headers, authHeader);
|
|
113
116
|
});
|
|
114
117
|
};
|
|
115
118
|
return TokenRequestBasedAuthenticator;
|
|
File without changes
|
|
@@ -18,16 +18,19 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
18
18
|
var extendStatics = function (d, b) {
|
|
19
19
|
extendStatics = Object.setPrototypeOf ||
|
|
20
20
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (
|
|
21
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
22
22
|
return extendStatics(d, b);
|
|
23
23
|
};
|
|
24
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");
|
|
25
27
|
extendStatics(d, b);
|
|
26
28
|
function __() { this.constructor = d; }
|
|
27
29
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
30
|
};
|
|
29
31
|
})();
|
|
30
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.VpcInstanceAuthenticator = void 0;
|
|
31
34
|
var authenticator_1 = require("./authenticator");
|
|
32
35
|
var token_managers_1 = require("../token-managers");
|
|
33
36
|
var token_request_based_authenticator_1 = require("./token-request-based-authenticator");
|
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2019 IBM Corp. All Rights Reserved.
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
29
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
__exportStar(require("./authenticators"), exports);
|
|
33
|
+
__exportStar(require("./token-managers"), exports);
|
|
34
|
+
__exportStar(require("./utils"), exports);
|
|
File without changes
|
|
@@ -18,10 +18,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
18
18
|
var extendStatics = function (d, b) {
|
|
19
19
|
extendStatics = Object.setPrototypeOf ||
|
|
20
20
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (
|
|
21
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
22
22
|
return extendStatics(d, b);
|
|
23
23
|
};
|
|
24
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");
|
|
25
27
|
extendStatics(d, b);
|
|
26
28
|
function __() { this.constructor = d; }
|
|
27
29
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -67,6 +69,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
67
69
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
68
70
|
};
|
|
69
71
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
72
|
+
exports.ContainerTokenManager = void 0;
|
|
70
73
|
var logger_1 = __importDefault(require("../../lib/logger"));
|
|
71
74
|
var utils_1 = require("../utils");
|
|
72
75
|
var iam_request_based_token_manager_1 = require("./iam-request-based-token-manager");
|
|
@@ -103,7 +106,7 @@ var ContainerTokenManager = /** @class */ (function (_super) {
|
|
|
103
106
|
// all parameters are optional
|
|
104
107
|
options = options || {};
|
|
105
108
|
_this = _super.call(this, options) || this;
|
|
106
|
-
if (!utils_1.atLeastOne(options.iamProfileId, options.iamProfileName)) {
|
|
109
|
+
if (!(0, utils_1.atLeastOne)(options.iamProfileId, options.iamProfileName)) {
|
|
107
110
|
throw new Error('At least one of `iamProfileName` or `iamProfileId` must be specified.');
|
|
108
111
|
}
|
|
109
112
|
_this.crTokenFilename = options.crTokenFilename || DEFAULT_CR_TOKEN_FILEPATH;
|
|
@@ -165,7 +168,7 @@ var ContainerTokenManager = /** @class */ (function (_super) {
|
|
|
165
168
|
}(iam_request_based_token_manager_1.IamRequestBasedTokenManager));
|
|
166
169
|
exports.ContainerTokenManager = ContainerTokenManager;
|
|
167
170
|
function getCrToken(filename) {
|
|
168
|
-
logger_1.default.debug("Attempting to read CR token from file: "
|
|
171
|
+
logger_1.default.debug("Attempting to read CR token from file: ".concat(filename));
|
|
169
172
|
// moving the actual read to another file to isolate usage of node-only packages like `fs`
|
|
170
|
-
return utils_1.readCrTokenFile(filename);
|
|
173
|
+
return (0, utils_1.readCrTokenFile)(filename);
|
|
171
174
|
}
|
|
File without changes
|
|
@@ -18,10 +18,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
18
18
|
var extendStatics = function (d, b) {
|
|
19
19
|
extendStatics = Object.setPrototypeOf ||
|
|
20
20
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (
|
|
21
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
22
22
|
return extendStatics(d, b);
|
|
23
23
|
};
|
|
24
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");
|
|
25
27
|
extendStatics(d, b);
|
|
26
28
|
function __() { this.constructor = d; }
|
|
27
29
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -31,6 +33,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
31
33
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
34
|
};
|
|
33
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Cp4dTokenManager = void 0;
|
|
34
37
|
var extend_1 = __importDefault(require("extend"));
|
|
35
38
|
var utils_1 = require("../utils");
|
|
36
39
|
var jwt_token_manager_1 = require("./jwt-token-manager");
|
|
@@ -64,7 +67,7 @@ var Cp4dTokenManager = /** @class */ (function (_super) {
|
|
|
64
67
|
if ((!options.password && !options.apikey) || (options.password && options.apikey)) {
|
|
65
68
|
throw new Error('Exactly one of `apikey` or `password` must be specified.');
|
|
66
69
|
}
|
|
67
|
-
utils_1.validateInput(options, _this.requiredOptions);
|
|
70
|
+
(0, utils_1.validateInput)(options, _this.requiredOptions);
|
|
68
71
|
var tokenApiPath = '/v1/authorize';
|
|
69
72
|
// do not append the path if user already has
|
|
70
73
|
if (_this.url && !_this.url.endsWith(tokenApiPath)) {
|
|
@@ -89,7 +92,7 @@ var Cp4dTokenManager = /** @class */ (function (_super) {
|
|
|
89
92
|
api_key: this.apikey,
|
|
90
93
|
},
|
|
91
94
|
method: 'POST',
|
|
92
|
-
headers: extend_1.default(true, {}, this.headers, requiredHeaders),
|
|
95
|
+
headers: (0, extend_1.default)(true, {}, this.headers, requiredHeaders),
|
|
93
96
|
rejectUnauthorized: !this.disableSslVerification,
|
|
94
97
|
},
|
|
95
98
|
};
|
|
File without changes
|
|
@@ -18,10 +18,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
18
18
|
var extendStatics = function (d, b) {
|
|
19
19
|
extendStatics = Object.setPrototypeOf ||
|
|
20
20
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (
|
|
21
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
22
22
|
return extendStatics(d, b);
|
|
23
23
|
};
|
|
24
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");
|
|
25
27
|
extendStatics(d, b);
|
|
26
28
|
function __() { this.constructor = d; }
|
|
27
29
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -31,6 +33,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
31
33
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
34
|
};
|
|
33
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.IamRequestBasedTokenManager = void 0;
|
|
34
37
|
var extend_1 = __importDefault(require("extend"));
|
|
35
38
|
var logger_1 = __importDefault(require("../../lib/logger"));
|
|
36
39
|
var utils_1 = require("../utils");
|
|
@@ -70,7 +73,7 @@ var IamRequestBasedTokenManager = /** @class */ (function (_super) {
|
|
|
70
73
|
options = options || {};
|
|
71
74
|
_this = _super.call(this, options) || this;
|
|
72
75
|
// Canonicalize the URL by removing the operation path if it was specified by the user.
|
|
73
|
-
_this.url = _this.url ? utils_1.removeSuffix(_this.url, OPERATION_PATH) : DEFAULT_IAM_URL;
|
|
76
|
+
_this.url = _this.url ? (0, utils_1.removeSuffix)(_this.url, OPERATION_PATH) : DEFAULT_IAM_URL;
|
|
74
77
|
if (options.clientId) {
|
|
75
78
|
_this.clientId = options.clientId;
|
|
76
79
|
}
|
|
@@ -80,7 +83,7 @@ var IamRequestBasedTokenManager = /** @class */ (function (_super) {
|
|
|
80
83
|
if (options.scope) {
|
|
81
84
|
_this.scope = options.scope;
|
|
82
85
|
}
|
|
83
|
-
if (utils_1.onlyOne(options.clientId, options.clientSecret)) {
|
|
86
|
+
if ((0, utils_1.onlyOne)(options.clientId, options.clientSecret)) {
|
|
84
87
|
// tslint:disable-next-line
|
|
85
88
|
logger_1.default.warn(CLIENT_ID_SECRET_WARNING);
|
|
86
89
|
}
|
|
@@ -113,7 +116,7 @@ var IamRequestBasedTokenManager = /** @class */ (function (_super) {
|
|
|
113
116
|
IamRequestBasedTokenManager.prototype.setClientIdAndSecret = function (clientId, clientSecret) {
|
|
114
117
|
this.clientId = clientId;
|
|
115
118
|
this.clientSecret = clientSecret;
|
|
116
|
-
if (utils_1.onlyOne(clientId, clientSecret)) {
|
|
119
|
+
if ((0, utils_1.onlyOne)(clientId, clientSecret)) {
|
|
117
120
|
// tslint:disable-next-line
|
|
118
121
|
logger_1.default.warn(CLIENT_ID_SECRET_WARNING);
|
|
119
122
|
}
|
|
@@ -154,7 +157,7 @@ var IamRequestBasedTokenManager = /** @class */ (function (_super) {
|
|
|
154
157
|
};
|
|
155
158
|
// If both the clientId and secret were specified by the user, then use them.
|
|
156
159
|
if (this.clientId && this.clientSecret) {
|
|
157
|
-
requiredHeaders.Authorization = utils_1.computeBasicAuthHeader(this.clientId, this.clientSecret);
|
|
160
|
+
requiredHeaders.Authorization = (0, utils_1.computeBasicAuthHeader)(this.clientId, this.clientSecret);
|
|
158
161
|
}
|
|
159
162
|
if (this.scope) {
|
|
160
163
|
this.formData.scope = this.scope;
|
|
@@ -163,7 +166,7 @@ var IamRequestBasedTokenManager = /** @class */ (function (_super) {
|
|
|
163
166
|
options: {
|
|
164
167
|
url: this.url + OPERATION_PATH,
|
|
165
168
|
method: 'POST',
|
|
166
|
-
headers: extend_1.default(true, {}, this.headers, requiredHeaders),
|
|
169
|
+
headers: (0, extend_1.default)(true, {}, this.headers, requiredHeaders),
|
|
167
170
|
form: this.formData,
|
|
168
171
|
rejectUnauthorized: !this.disableSslVerification,
|
|
169
172
|
},
|
|
File without changes
|
|
@@ -18,16 +18,19 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
18
18
|
var extendStatics = function (d, b) {
|
|
19
19
|
extendStatics = Object.setPrototypeOf ||
|
|
20
20
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (
|
|
21
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
22
22
|
return extendStatics(d, b);
|
|
23
23
|
};
|
|
24
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");
|
|
25
27
|
extendStatics(d, b);
|
|
26
28
|
function __() { this.constructor = d; }
|
|
27
29
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
30
|
};
|
|
29
31
|
})();
|
|
30
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.IamTokenManager = void 0;
|
|
31
34
|
var utils_1 = require("../utils");
|
|
32
35
|
var iam_request_based_token_manager_1 = require("./iam-request-based-token-manager");
|
|
33
36
|
/**
|
|
@@ -58,7 +61,7 @@ var IamTokenManager = /** @class */ (function (_super) {
|
|
|
58
61
|
function IamTokenManager(options) {
|
|
59
62
|
var _this = _super.call(this, options) || this;
|
|
60
63
|
_this.requiredOptions = ['apikey'];
|
|
61
|
-
utils_1.validateInput(options, _this.requiredOptions);
|
|
64
|
+
(0, utils_1.validateInput)(options, _this.requiredOptions);
|
|
62
65
|
_this.apikey = options.apikey;
|
|
63
66
|
// construct form data for the apikey use case of iam token management
|
|
64
67
|
_this.formData.apikey = _this.apikey;
|
|
File without changes
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.VpcInstanceTokenManager = exports.TokenManager = exports.JwtTokenManager = exports.IamRequestBasedTokenManager = exports.ContainerTokenManager = exports.Cp4dTokenManager = exports.IamTokenManager = void 0;
|
|
18
19
|
/**
|
|
19
20
|
* @module token-managers
|
|
20
21
|
* The ibm-cloud-sdk-core module supports the following types of token authentication:
|
|
@@ -35,16 +36,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
35
36
|
* JwtTokenManager: A class for shared functionality for parsing, storing, and requesting JWT tokens.
|
|
36
37
|
*/
|
|
37
38
|
var iam_token_manager_1 = require("./iam-token-manager");
|
|
38
|
-
exports
|
|
39
|
+
Object.defineProperty(exports, "IamTokenManager", { enumerable: true, get: function () { return iam_token_manager_1.IamTokenManager; } });
|
|
39
40
|
var cp4d_token_manager_1 = require("./cp4d-token-manager");
|
|
40
|
-
exports
|
|
41
|
+
Object.defineProperty(exports, "Cp4dTokenManager", { enumerable: true, get: function () { return cp4d_token_manager_1.Cp4dTokenManager; } });
|
|
41
42
|
var container_token_manager_1 = require("./container-token-manager");
|
|
42
|
-
exports
|
|
43
|
+
Object.defineProperty(exports, "ContainerTokenManager", { enumerable: true, get: function () { return container_token_manager_1.ContainerTokenManager; } });
|
|
43
44
|
var iam_request_based_token_manager_1 = require("./iam-request-based-token-manager");
|
|
44
|
-
exports
|
|
45
|
+
Object.defineProperty(exports, "IamRequestBasedTokenManager", { enumerable: true, get: function () { return iam_request_based_token_manager_1.IamRequestBasedTokenManager; } });
|
|
45
46
|
var jwt_token_manager_1 = require("./jwt-token-manager");
|
|
46
|
-
exports
|
|
47
|
+
Object.defineProperty(exports, "JwtTokenManager", { enumerable: true, get: function () { return jwt_token_manager_1.JwtTokenManager; } });
|
|
47
48
|
var token_manager_1 = require("./token-manager");
|
|
48
|
-
exports
|
|
49
|
+
Object.defineProperty(exports, "TokenManager", { enumerable: true, get: function () { return token_manager_1.TokenManager; } });
|
|
49
50
|
var vpc_instance_token_manager_1 = require("./vpc-instance-token-manager");
|
|
50
|
-
exports
|
|
51
|
+
Object.defineProperty(exports, "VpcInstanceTokenManager", { enumerable: true, get: function () { return vpc_instance_token_manager_1.VpcInstanceTokenManager; } });
|
|
File without changes
|