@artik0din/turbogha 1.0.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.
- package/LICENSE +21 -0
- package/README.md +322 -0
- package/dist/cli/136.index.js +903 -0
- package/dist/cli/136.index.js.map +1 -0
- package/dist/cli/360.index.js +93 -0
- package/dist/cli/360.index.js.map +1 -0
- package/dist/cli/443.index.js +795 -0
- package/dist/cli/443.index.js.map +1 -0
- package/dist/cli/566.index.js +387 -0
- package/dist/cli/566.index.js.map +1 -0
- package/dist/cli/579.index.js +265 -0
- package/dist/cli/579.index.js.map +1 -0
- package/dist/cli/605.index.js +234 -0
- package/dist/cli/605.index.js.map +1 -0
- package/dist/cli/762.index.js +673 -0
- package/dist/cli/762.index.js.map +1 -0
- package/dist/cli/869.index.js +533 -0
- package/dist/cli/869.index.js.map +1 -0
- package/dist/cli/884.index.js +701 -0
- package/dist/cli/884.index.js.map +1 -0
- package/dist/cli/956.index.js +1039 -0
- package/dist/cli/956.index.js.map +1 -0
- package/dist/cli/998.index.js +1455 -0
- package/dist/cli/998.index.js.map +1 -0
- package/dist/cli/file.js +12 -0
- package/dist/cli/index.js +208250 -0
- package/dist/cli/licenses.txt +1645 -0
- package/dist/cli/package.json +3 -0
- package/dist/cli/sourcemap-register.cjs +1 -0
- package/dist/cli/worker.js +174 -0
- package/dist/cli/worker1.js +170 -0
- package/package.json +102 -0
|
@@ -0,0 +1,1455 @@
|
|
|
1
|
+
export const id = 998;
|
|
2
|
+
export const ids = [998];
|
|
3
|
+
export const modules = {
|
|
4
|
+
|
|
5
|
+
/***/ 62041:
|
|
6
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10
|
+
exports.resolveHttpAuthSchemeConfig = exports.defaultSSOHttpAuthSchemeProvider = exports.defaultSSOHttpAuthSchemeParametersProvider = void 0;
|
|
11
|
+
const core_1 = __webpack_require__(8704);
|
|
12
|
+
const util_middleware_1 = __webpack_require__(76324);
|
|
13
|
+
const defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
14
|
+
return {
|
|
15
|
+
operation: (0, util_middleware_1.getSmithyContext)(context).operation,
|
|
16
|
+
region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
|
|
17
|
+
(() => {
|
|
18
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
19
|
+
})(),
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
exports.defaultSSOHttpAuthSchemeParametersProvider = defaultSSOHttpAuthSchemeParametersProvider;
|
|
23
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
24
|
+
return {
|
|
25
|
+
schemeId: "aws.auth#sigv4",
|
|
26
|
+
signingProperties: {
|
|
27
|
+
name: "awsssoportal",
|
|
28
|
+
region: authParameters.region,
|
|
29
|
+
},
|
|
30
|
+
propertiesExtractor: (config, context) => ({
|
|
31
|
+
signingProperties: {
|
|
32
|
+
config,
|
|
33
|
+
context,
|
|
34
|
+
},
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
|
|
39
|
+
return {
|
|
40
|
+
schemeId: "smithy.api#noAuth",
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const defaultSSOHttpAuthSchemeProvider = (authParameters) => {
|
|
44
|
+
const options = [];
|
|
45
|
+
switch (authParameters.operation) {
|
|
46
|
+
case "GetRoleCredentials": {
|
|
47
|
+
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
case "ListAccountRoles": {
|
|
51
|
+
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
case "ListAccounts": {
|
|
55
|
+
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
case "Logout": {
|
|
59
|
+
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
default: {
|
|
63
|
+
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return options;
|
|
67
|
+
};
|
|
68
|
+
exports.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider;
|
|
69
|
+
const resolveHttpAuthSchemeConfig = (config) => {
|
|
70
|
+
const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
|
|
71
|
+
return Object.assign(config_0, {
|
|
72
|
+
authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
/***/ }),
|
|
79
|
+
|
|
80
|
+
/***/ 13903:
|
|
81
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
85
|
+
exports.defaultEndpointResolver = void 0;
|
|
86
|
+
const util_endpoints_1 = __webpack_require__(83068);
|
|
87
|
+
const util_endpoints_2 = __webpack_require__(79674);
|
|
88
|
+
const ruleset_1 = __webpack_require__(41308);
|
|
89
|
+
const cache = new util_endpoints_2.EndpointCache({
|
|
90
|
+
size: 50,
|
|
91
|
+
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
|
|
92
|
+
});
|
|
93
|
+
const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
94
|
+
return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
|
|
95
|
+
endpointParams: endpointParams,
|
|
96
|
+
logger: context.logger,
|
|
97
|
+
}));
|
|
98
|
+
};
|
|
99
|
+
exports.defaultEndpointResolver = defaultEndpointResolver;
|
|
100
|
+
util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
/***/ }),
|
|
104
|
+
|
|
105
|
+
/***/ 41308:
|
|
106
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
110
|
+
exports.ruleSet = void 0;
|
|
111
|
+
const u = "required", v = "fn", w = "argv", x = "ref";
|
|
112
|
+
const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "getAttr", i = { [u]: false, "type": "string" }, j = { [u]: true, "default": false, "type": "boolean" }, k = { [x]: "Endpoint" }, l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] }, m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] }, n = {}, o = { [v]: h, [w]: [{ [x]: g }, "supportsFIPS"] }, p = { [x]: g }, q = { [v]: c, [w]: [true, { [v]: h, [w]: [p, "supportsDualStack"] }] }, r = [l], s = [m], t = [{ [x]: "Region" }];
|
|
113
|
+
const _data = { version: "1.0", parameters: { Region: i, UseDualStack: j, UseFIPS: j, Endpoint: i }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { conditions: s, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }, { conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, o] }, q], rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: r, rules: [{ conditions: [{ [v]: c, [w]: [o, a] }], rules: [{ conditions: [{ [v]: "stringEquals", [w]: [{ [v]: h, [w]: [p, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://portal.sso.{Region}.amazonaws.com", properties: n, headers: n }, type: e }, { endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: s, rules: [{ conditions: [q], rules: [{ endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }] };
|
|
114
|
+
exports.ruleSet = _data;
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
/***/ }),
|
|
118
|
+
|
|
119
|
+
/***/ 62054:
|
|
120
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
var middlewareHostHeader = __webpack_require__(52590);
|
|
125
|
+
var middlewareLogger = __webpack_require__(85242);
|
|
126
|
+
var middlewareRecursionDetection = __webpack_require__(81568);
|
|
127
|
+
var middlewareUserAgent = __webpack_require__(32959);
|
|
128
|
+
var configResolver = __webpack_require__(39316);
|
|
129
|
+
var core = __webpack_require__(90402);
|
|
130
|
+
var schema = __webpack_require__(26890);
|
|
131
|
+
var middlewareContentLength = __webpack_require__(47212);
|
|
132
|
+
var middlewareEndpoint = __webpack_require__(40099);
|
|
133
|
+
var middlewareRetry = __webpack_require__(19618);
|
|
134
|
+
var smithyClient = __webpack_require__(61411);
|
|
135
|
+
var httpAuthSchemeProvider = __webpack_require__(62041);
|
|
136
|
+
var runtimeConfig = __webpack_require__(82696);
|
|
137
|
+
var regionConfigResolver = __webpack_require__(36463);
|
|
138
|
+
var protocolHttp = __webpack_require__(72356);
|
|
139
|
+
|
|
140
|
+
const resolveClientEndpointParameters = (options) => {
|
|
141
|
+
return Object.assign(options, {
|
|
142
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
143
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
144
|
+
defaultSigningName: "awsssoportal",
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
const commonParams = {
|
|
148
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
149
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
150
|
+
Region: { type: "builtInParams", name: "region" },
|
|
151
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
155
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
156
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
157
|
+
let _credentials = runtimeConfig.credentials;
|
|
158
|
+
return {
|
|
159
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
160
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
161
|
+
if (index === -1) {
|
|
162
|
+
_httpAuthSchemes.push(httpAuthScheme);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
httpAuthSchemes() {
|
|
169
|
+
return _httpAuthSchemes;
|
|
170
|
+
},
|
|
171
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
172
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
173
|
+
},
|
|
174
|
+
httpAuthSchemeProvider() {
|
|
175
|
+
return _httpAuthSchemeProvider;
|
|
176
|
+
},
|
|
177
|
+
setCredentials(credentials) {
|
|
178
|
+
_credentials = credentials;
|
|
179
|
+
},
|
|
180
|
+
credentials() {
|
|
181
|
+
return _credentials;
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
const resolveHttpAuthRuntimeConfig = (config) => {
|
|
186
|
+
return {
|
|
187
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
188
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
189
|
+
credentials: config.credentials(),
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
194
|
+
const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
|
|
195
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
196
|
+
return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
class SSOClient extends smithyClient.Client {
|
|
200
|
+
config;
|
|
201
|
+
constructor(...[configuration]) {
|
|
202
|
+
const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});
|
|
203
|
+
super(_config_0);
|
|
204
|
+
this.initConfig = _config_0;
|
|
205
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
206
|
+
const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);
|
|
207
|
+
const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);
|
|
208
|
+
const _config_4 = configResolver.resolveRegionConfig(_config_3);
|
|
209
|
+
const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);
|
|
210
|
+
const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);
|
|
211
|
+
const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);
|
|
212
|
+
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
213
|
+
this.config = _config_8;
|
|
214
|
+
this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));
|
|
215
|
+
this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));
|
|
216
|
+
this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));
|
|
217
|
+
this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));
|
|
218
|
+
this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));
|
|
219
|
+
this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));
|
|
220
|
+
this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));
|
|
221
|
+
this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
222
|
+
httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSSOHttpAuthSchemeParametersProvider,
|
|
223
|
+
identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
|
|
224
|
+
"aws.auth#sigv4": config.credentials,
|
|
225
|
+
}),
|
|
226
|
+
}));
|
|
227
|
+
this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
|
|
228
|
+
}
|
|
229
|
+
destroy() {
|
|
230
|
+
super.destroy();
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
let SSOServiceException$1 = class SSOServiceException extends smithyClient.ServiceException {
|
|
235
|
+
constructor(options) {
|
|
236
|
+
super(options);
|
|
237
|
+
Object.setPrototypeOf(this, SSOServiceException.prototype);
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
let InvalidRequestException$1 = class InvalidRequestException extends SSOServiceException$1 {
|
|
242
|
+
name = "InvalidRequestException";
|
|
243
|
+
$fault = "client";
|
|
244
|
+
constructor(opts) {
|
|
245
|
+
super({
|
|
246
|
+
name: "InvalidRequestException",
|
|
247
|
+
$fault: "client",
|
|
248
|
+
...opts,
|
|
249
|
+
});
|
|
250
|
+
Object.setPrototypeOf(this, InvalidRequestException.prototype);
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
let ResourceNotFoundException$1 = class ResourceNotFoundException extends SSOServiceException$1 {
|
|
254
|
+
name = "ResourceNotFoundException";
|
|
255
|
+
$fault = "client";
|
|
256
|
+
constructor(opts) {
|
|
257
|
+
super({
|
|
258
|
+
name: "ResourceNotFoundException",
|
|
259
|
+
$fault: "client",
|
|
260
|
+
...opts,
|
|
261
|
+
});
|
|
262
|
+
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
let TooManyRequestsException$1 = class TooManyRequestsException extends SSOServiceException$1 {
|
|
266
|
+
name = "TooManyRequestsException";
|
|
267
|
+
$fault = "client";
|
|
268
|
+
constructor(opts) {
|
|
269
|
+
super({
|
|
270
|
+
name: "TooManyRequestsException",
|
|
271
|
+
$fault: "client",
|
|
272
|
+
...opts,
|
|
273
|
+
});
|
|
274
|
+
Object.setPrototypeOf(this, TooManyRequestsException.prototype);
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
let UnauthorizedException$1 = class UnauthorizedException extends SSOServiceException$1 {
|
|
278
|
+
name = "UnauthorizedException";
|
|
279
|
+
$fault = "client";
|
|
280
|
+
constructor(opts) {
|
|
281
|
+
super({
|
|
282
|
+
name: "UnauthorizedException",
|
|
283
|
+
$fault: "client",
|
|
284
|
+
...opts,
|
|
285
|
+
});
|
|
286
|
+
Object.setPrototypeOf(this, UnauthorizedException.prototype);
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
const _AI = "AccountInfo";
|
|
291
|
+
const _ALT = "AccountListType";
|
|
292
|
+
const _ATT = "AccessTokenType";
|
|
293
|
+
const _GRC = "GetRoleCredentials";
|
|
294
|
+
const _GRCR = "GetRoleCredentialsRequest";
|
|
295
|
+
const _GRCRe = "GetRoleCredentialsResponse";
|
|
296
|
+
const _IRE = "InvalidRequestException";
|
|
297
|
+
const _L = "Logout";
|
|
298
|
+
const _LA = "ListAccounts";
|
|
299
|
+
const _LAR = "ListAccountsRequest";
|
|
300
|
+
const _LARR = "ListAccountRolesRequest";
|
|
301
|
+
const _LARRi = "ListAccountRolesResponse";
|
|
302
|
+
const _LARi = "ListAccountsResponse";
|
|
303
|
+
const _LARis = "ListAccountRoles";
|
|
304
|
+
const _LR = "LogoutRequest";
|
|
305
|
+
const _RC = "RoleCredentials";
|
|
306
|
+
const _RI = "RoleInfo";
|
|
307
|
+
const _RLT = "RoleListType";
|
|
308
|
+
const _RNFE = "ResourceNotFoundException";
|
|
309
|
+
const _SAKT = "SecretAccessKeyType";
|
|
310
|
+
const _STT = "SessionTokenType";
|
|
311
|
+
const _TMRE = "TooManyRequestsException";
|
|
312
|
+
const _UE = "UnauthorizedException";
|
|
313
|
+
const _aI = "accountId";
|
|
314
|
+
const _aKI = "accessKeyId";
|
|
315
|
+
const _aL = "accountList";
|
|
316
|
+
const _aN = "accountName";
|
|
317
|
+
const _aT = "accessToken";
|
|
318
|
+
const _ai = "account_id";
|
|
319
|
+
const _c = "client";
|
|
320
|
+
const _e = "error";
|
|
321
|
+
const _eA = "emailAddress";
|
|
322
|
+
const _ex = "expiration";
|
|
323
|
+
const _h = "http";
|
|
324
|
+
const _hE = "httpError";
|
|
325
|
+
const _hH = "httpHeader";
|
|
326
|
+
const _hQ = "httpQuery";
|
|
327
|
+
const _m = "message";
|
|
328
|
+
const _mR = "maxResults";
|
|
329
|
+
const _mr = "max_result";
|
|
330
|
+
const _nT = "nextToken";
|
|
331
|
+
const _nt = "next_token";
|
|
332
|
+
const _rC = "roleCredentials";
|
|
333
|
+
const _rL = "roleList";
|
|
334
|
+
const _rN = "roleName";
|
|
335
|
+
const _rn = "role_name";
|
|
336
|
+
const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sso";
|
|
337
|
+
const _sAK = "secretAccessKey";
|
|
338
|
+
const _sT = "sessionToken";
|
|
339
|
+
const _xasbt = "x-amz-sso_bearer_token";
|
|
340
|
+
const n0 = "com.amazonaws.sso";
|
|
341
|
+
var AccessTokenType = [0, n0, _ATT, 8, 0];
|
|
342
|
+
var SecretAccessKeyType = [0, n0, _SAKT, 8, 0];
|
|
343
|
+
var SessionTokenType = [0, n0, _STT, 8, 0];
|
|
344
|
+
var AccountInfo = [3, n0, _AI, 0, [_aI, _aN, _eA], [0, 0, 0]];
|
|
345
|
+
var GetRoleCredentialsRequest = [
|
|
346
|
+
3,
|
|
347
|
+
n0,
|
|
348
|
+
_GRCR,
|
|
349
|
+
0,
|
|
350
|
+
[_rN, _aI, _aT],
|
|
351
|
+
[
|
|
352
|
+
[
|
|
353
|
+
0,
|
|
354
|
+
{
|
|
355
|
+
[_hQ]: _rn,
|
|
356
|
+
},
|
|
357
|
+
],
|
|
358
|
+
[
|
|
359
|
+
0,
|
|
360
|
+
{
|
|
361
|
+
[_hQ]: _ai,
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
[
|
|
365
|
+
() => AccessTokenType,
|
|
366
|
+
{
|
|
367
|
+
[_hH]: _xasbt,
|
|
368
|
+
},
|
|
369
|
+
],
|
|
370
|
+
],
|
|
371
|
+
];
|
|
372
|
+
var GetRoleCredentialsResponse = [3, n0, _GRCRe, 0, [_rC], [[() => RoleCredentials, 0]]];
|
|
373
|
+
var InvalidRequestException = [
|
|
374
|
+
-3,
|
|
375
|
+
n0,
|
|
376
|
+
_IRE,
|
|
377
|
+
{
|
|
378
|
+
[_e]: _c,
|
|
379
|
+
[_hE]: 400,
|
|
380
|
+
},
|
|
381
|
+
[_m],
|
|
382
|
+
[0],
|
|
383
|
+
];
|
|
384
|
+
schema.TypeRegistry.for(n0).registerError(InvalidRequestException, InvalidRequestException$1);
|
|
385
|
+
var ListAccountRolesRequest = [
|
|
386
|
+
3,
|
|
387
|
+
n0,
|
|
388
|
+
_LARR,
|
|
389
|
+
0,
|
|
390
|
+
[_nT, _mR, _aT, _aI],
|
|
391
|
+
[
|
|
392
|
+
[
|
|
393
|
+
0,
|
|
394
|
+
{
|
|
395
|
+
[_hQ]: _nt,
|
|
396
|
+
},
|
|
397
|
+
],
|
|
398
|
+
[
|
|
399
|
+
1,
|
|
400
|
+
{
|
|
401
|
+
[_hQ]: _mr,
|
|
402
|
+
},
|
|
403
|
+
],
|
|
404
|
+
[
|
|
405
|
+
() => AccessTokenType,
|
|
406
|
+
{
|
|
407
|
+
[_hH]: _xasbt,
|
|
408
|
+
},
|
|
409
|
+
],
|
|
410
|
+
[
|
|
411
|
+
0,
|
|
412
|
+
{
|
|
413
|
+
[_hQ]: _ai,
|
|
414
|
+
},
|
|
415
|
+
],
|
|
416
|
+
],
|
|
417
|
+
];
|
|
418
|
+
var ListAccountRolesResponse = [3, n0, _LARRi, 0, [_nT, _rL], [0, () => RoleListType]];
|
|
419
|
+
var ListAccountsRequest = [
|
|
420
|
+
3,
|
|
421
|
+
n0,
|
|
422
|
+
_LAR,
|
|
423
|
+
0,
|
|
424
|
+
[_nT, _mR, _aT],
|
|
425
|
+
[
|
|
426
|
+
[
|
|
427
|
+
0,
|
|
428
|
+
{
|
|
429
|
+
[_hQ]: _nt,
|
|
430
|
+
},
|
|
431
|
+
],
|
|
432
|
+
[
|
|
433
|
+
1,
|
|
434
|
+
{
|
|
435
|
+
[_hQ]: _mr,
|
|
436
|
+
},
|
|
437
|
+
],
|
|
438
|
+
[
|
|
439
|
+
() => AccessTokenType,
|
|
440
|
+
{
|
|
441
|
+
[_hH]: _xasbt,
|
|
442
|
+
},
|
|
443
|
+
],
|
|
444
|
+
],
|
|
445
|
+
];
|
|
446
|
+
var ListAccountsResponse = [3, n0, _LARi, 0, [_nT, _aL], [0, () => AccountListType]];
|
|
447
|
+
var LogoutRequest = [
|
|
448
|
+
3,
|
|
449
|
+
n0,
|
|
450
|
+
_LR,
|
|
451
|
+
0,
|
|
452
|
+
[_aT],
|
|
453
|
+
[
|
|
454
|
+
[
|
|
455
|
+
() => AccessTokenType,
|
|
456
|
+
{
|
|
457
|
+
[_hH]: _xasbt,
|
|
458
|
+
},
|
|
459
|
+
],
|
|
460
|
+
],
|
|
461
|
+
];
|
|
462
|
+
var ResourceNotFoundException = [
|
|
463
|
+
-3,
|
|
464
|
+
n0,
|
|
465
|
+
_RNFE,
|
|
466
|
+
{
|
|
467
|
+
[_e]: _c,
|
|
468
|
+
[_hE]: 404,
|
|
469
|
+
},
|
|
470
|
+
[_m],
|
|
471
|
+
[0],
|
|
472
|
+
];
|
|
473
|
+
schema.TypeRegistry.for(n0).registerError(ResourceNotFoundException, ResourceNotFoundException$1);
|
|
474
|
+
var RoleCredentials = [
|
|
475
|
+
3,
|
|
476
|
+
n0,
|
|
477
|
+
_RC,
|
|
478
|
+
0,
|
|
479
|
+
[_aKI, _sAK, _sT, _ex],
|
|
480
|
+
[0, [() => SecretAccessKeyType, 0], [() => SessionTokenType, 0], 1],
|
|
481
|
+
];
|
|
482
|
+
var RoleInfo = [3, n0, _RI, 0, [_rN, _aI], [0, 0]];
|
|
483
|
+
var TooManyRequestsException = [
|
|
484
|
+
-3,
|
|
485
|
+
n0,
|
|
486
|
+
_TMRE,
|
|
487
|
+
{
|
|
488
|
+
[_e]: _c,
|
|
489
|
+
[_hE]: 429,
|
|
490
|
+
},
|
|
491
|
+
[_m],
|
|
492
|
+
[0],
|
|
493
|
+
];
|
|
494
|
+
schema.TypeRegistry.for(n0).registerError(TooManyRequestsException, TooManyRequestsException$1);
|
|
495
|
+
var UnauthorizedException = [
|
|
496
|
+
-3,
|
|
497
|
+
n0,
|
|
498
|
+
_UE,
|
|
499
|
+
{
|
|
500
|
+
[_e]: _c,
|
|
501
|
+
[_hE]: 401,
|
|
502
|
+
},
|
|
503
|
+
[_m],
|
|
504
|
+
[0],
|
|
505
|
+
];
|
|
506
|
+
schema.TypeRegistry.for(n0).registerError(UnauthorizedException, UnauthorizedException$1);
|
|
507
|
+
var __Unit = "unit";
|
|
508
|
+
var SSOServiceException = [-3, _s, "SSOServiceException", 0, [], []];
|
|
509
|
+
schema.TypeRegistry.for(_s).registerError(SSOServiceException, SSOServiceException$1);
|
|
510
|
+
var AccountListType = [1, n0, _ALT, 0, () => AccountInfo];
|
|
511
|
+
var RoleListType = [1, n0, _RLT, 0, () => RoleInfo];
|
|
512
|
+
var GetRoleCredentials = [
|
|
513
|
+
9,
|
|
514
|
+
n0,
|
|
515
|
+
_GRC,
|
|
516
|
+
{
|
|
517
|
+
[_h]: ["GET", "/federation/credentials", 200],
|
|
518
|
+
},
|
|
519
|
+
() => GetRoleCredentialsRequest,
|
|
520
|
+
() => GetRoleCredentialsResponse,
|
|
521
|
+
];
|
|
522
|
+
var ListAccountRoles = [
|
|
523
|
+
9,
|
|
524
|
+
n0,
|
|
525
|
+
_LARis,
|
|
526
|
+
{
|
|
527
|
+
[_h]: ["GET", "/assignment/roles", 200],
|
|
528
|
+
},
|
|
529
|
+
() => ListAccountRolesRequest,
|
|
530
|
+
() => ListAccountRolesResponse,
|
|
531
|
+
];
|
|
532
|
+
var ListAccounts = [
|
|
533
|
+
9,
|
|
534
|
+
n0,
|
|
535
|
+
_LA,
|
|
536
|
+
{
|
|
537
|
+
[_h]: ["GET", "/assignment/accounts", 200],
|
|
538
|
+
},
|
|
539
|
+
() => ListAccountsRequest,
|
|
540
|
+
() => ListAccountsResponse,
|
|
541
|
+
];
|
|
542
|
+
var Logout = [
|
|
543
|
+
9,
|
|
544
|
+
n0,
|
|
545
|
+
_L,
|
|
546
|
+
{
|
|
547
|
+
[_h]: ["POST", "/logout", 200],
|
|
548
|
+
},
|
|
549
|
+
() => LogoutRequest,
|
|
550
|
+
() => __Unit,
|
|
551
|
+
];
|
|
552
|
+
|
|
553
|
+
class GetRoleCredentialsCommand extends smithyClient.Command
|
|
554
|
+
.classBuilder()
|
|
555
|
+
.ep(commonParams)
|
|
556
|
+
.m(function (Command, cs, config, o) {
|
|
557
|
+
return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
558
|
+
})
|
|
559
|
+
.s("SWBPortalService", "GetRoleCredentials", {})
|
|
560
|
+
.n("SSOClient", "GetRoleCredentialsCommand")
|
|
561
|
+
.sc(GetRoleCredentials)
|
|
562
|
+
.build() {
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
class ListAccountRolesCommand extends smithyClient.Command
|
|
566
|
+
.classBuilder()
|
|
567
|
+
.ep(commonParams)
|
|
568
|
+
.m(function (Command, cs, config, o) {
|
|
569
|
+
return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
570
|
+
})
|
|
571
|
+
.s("SWBPortalService", "ListAccountRoles", {})
|
|
572
|
+
.n("SSOClient", "ListAccountRolesCommand")
|
|
573
|
+
.sc(ListAccountRoles)
|
|
574
|
+
.build() {
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
class ListAccountsCommand extends smithyClient.Command
|
|
578
|
+
.classBuilder()
|
|
579
|
+
.ep(commonParams)
|
|
580
|
+
.m(function (Command, cs, config, o) {
|
|
581
|
+
return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
582
|
+
})
|
|
583
|
+
.s("SWBPortalService", "ListAccounts", {})
|
|
584
|
+
.n("SSOClient", "ListAccountsCommand")
|
|
585
|
+
.sc(ListAccounts)
|
|
586
|
+
.build() {
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
class LogoutCommand extends smithyClient.Command
|
|
590
|
+
.classBuilder()
|
|
591
|
+
.ep(commonParams)
|
|
592
|
+
.m(function (Command, cs, config, o) {
|
|
593
|
+
return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
594
|
+
})
|
|
595
|
+
.s("SWBPortalService", "Logout", {})
|
|
596
|
+
.n("SSOClient", "LogoutCommand")
|
|
597
|
+
.sc(Logout)
|
|
598
|
+
.build() {
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
const commands = {
|
|
602
|
+
GetRoleCredentialsCommand,
|
|
603
|
+
ListAccountRolesCommand,
|
|
604
|
+
ListAccountsCommand,
|
|
605
|
+
LogoutCommand,
|
|
606
|
+
};
|
|
607
|
+
class SSO extends SSOClient {
|
|
608
|
+
}
|
|
609
|
+
smithyClient.createAggregatedClient(commands, SSO);
|
|
610
|
+
|
|
611
|
+
const paginateListAccountRoles = core.createPaginator(SSOClient, ListAccountRolesCommand, "nextToken", "nextToken", "maxResults");
|
|
612
|
+
|
|
613
|
+
const paginateListAccounts = core.createPaginator(SSOClient, ListAccountsCommand, "nextToken", "nextToken", "maxResults");
|
|
614
|
+
|
|
615
|
+
Object.defineProperty(exports, "$Command", ({
|
|
616
|
+
enumerable: true,
|
|
617
|
+
get: function () { return smithyClient.Command; }
|
|
618
|
+
}));
|
|
619
|
+
Object.defineProperty(exports, "__Client", ({
|
|
620
|
+
enumerable: true,
|
|
621
|
+
get: function () { return smithyClient.Client; }
|
|
622
|
+
}));
|
|
623
|
+
exports.GetRoleCredentialsCommand = GetRoleCredentialsCommand;
|
|
624
|
+
exports.InvalidRequestException = InvalidRequestException$1;
|
|
625
|
+
exports.ListAccountRolesCommand = ListAccountRolesCommand;
|
|
626
|
+
exports.ListAccountsCommand = ListAccountsCommand;
|
|
627
|
+
exports.LogoutCommand = LogoutCommand;
|
|
628
|
+
exports.ResourceNotFoundException = ResourceNotFoundException$1;
|
|
629
|
+
exports.SSO = SSO;
|
|
630
|
+
exports.SSOClient = SSOClient;
|
|
631
|
+
exports.SSOServiceException = SSOServiceException$1;
|
|
632
|
+
exports.TooManyRequestsException = TooManyRequestsException$1;
|
|
633
|
+
exports.UnauthorizedException = UnauthorizedException$1;
|
|
634
|
+
exports.paginateListAccountRoles = paginateListAccountRoles;
|
|
635
|
+
exports.paginateListAccounts = paginateListAccounts;
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
/***/ }),
|
|
639
|
+
|
|
640
|
+
/***/ 82696:
|
|
641
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
645
|
+
exports.getRuntimeConfig = void 0;
|
|
646
|
+
const tslib_1 = __webpack_require__(61860);
|
|
647
|
+
const package_json_1 = tslib_1.__importDefault(__webpack_require__(45188));
|
|
648
|
+
const core_1 = __webpack_require__(8704);
|
|
649
|
+
const util_user_agent_node_1 = __webpack_require__(51656);
|
|
650
|
+
const config_resolver_1 = __webpack_require__(39316);
|
|
651
|
+
const hash_node_1 = __webpack_require__(5092);
|
|
652
|
+
const middleware_retry_1 = __webpack_require__(19618);
|
|
653
|
+
const node_config_provider_1 = __webpack_require__(55704);
|
|
654
|
+
const node_http_handler_1 = __webpack_require__(61279);
|
|
655
|
+
const util_body_length_node_1 = __webpack_require__(13638);
|
|
656
|
+
const util_retry_1 = __webpack_require__(15518);
|
|
657
|
+
const runtimeConfig_shared_1 = __webpack_require__(8073);
|
|
658
|
+
const smithy_client_1 = __webpack_require__(61411);
|
|
659
|
+
const util_defaults_mode_node_1 = __webpack_require__(15435);
|
|
660
|
+
const smithy_client_2 = __webpack_require__(61411);
|
|
661
|
+
const getRuntimeConfig = (config) => {
|
|
662
|
+
(0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
|
|
663
|
+
const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
|
|
664
|
+
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
|
665
|
+
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
|
|
666
|
+
(0, core_1.emitWarningIfUnsupportedVersion)(process.version);
|
|
667
|
+
const loaderConfig = {
|
|
668
|
+
profile: config?.profile,
|
|
669
|
+
logger: clientSharedValues.logger,
|
|
670
|
+
};
|
|
671
|
+
return {
|
|
672
|
+
...clientSharedValues,
|
|
673
|
+
...config,
|
|
674
|
+
runtime: "node",
|
|
675
|
+
defaultsMode,
|
|
676
|
+
authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
677
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
|
|
678
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
679
|
+
(0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
|
|
680
|
+
maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
681
|
+
region: config?.region ??
|
|
682
|
+
(0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
683
|
+
requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
684
|
+
retryMode: config?.retryMode ??
|
|
685
|
+
(0, node_config_provider_1.loadConfig)({
|
|
686
|
+
...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
687
|
+
default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
|
|
688
|
+
}, config),
|
|
689
|
+
sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
|
|
690
|
+
streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
|
|
691
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
692
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
693
|
+
userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
694
|
+
};
|
|
695
|
+
};
|
|
696
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
/***/ }),
|
|
700
|
+
|
|
701
|
+
/***/ 8073:
|
|
702
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
706
|
+
exports.getRuntimeConfig = void 0;
|
|
707
|
+
const core_1 = __webpack_require__(8704);
|
|
708
|
+
const protocols_1 = __webpack_require__(37288);
|
|
709
|
+
const core_2 = __webpack_require__(90402);
|
|
710
|
+
const smithy_client_1 = __webpack_require__(61411);
|
|
711
|
+
const url_parser_1 = __webpack_require__(14494);
|
|
712
|
+
const util_base64_1 = __webpack_require__(68385);
|
|
713
|
+
const util_utf8_1 = __webpack_require__(71577);
|
|
714
|
+
const httpAuthSchemeProvider_1 = __webpack_require__(62041);
|
|
715
|
+
const endpointResolver_1 = __webpack_require__(13903);
|
|
716
|
+
const getRuntimeConfig = (config) => {
|
|
717
|
+
return {
|
|
718
|
+
apiVersion: "2019-06-10",
|
|
719
|
+
base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
|
|
720
|
+
base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
|
|
721
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
722
|
+
endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
|
|
723
|
+
extensions: config?.extensions ?? [],
|
|
724
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSSOHttpAuthSchemeProvider,
|
|
725
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
726
|
+
{
|
|
727
|
+
schemeId: "aws.auth#sigv4",
|
|
728
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
729
|
+
signer: new core_1.AwsSdkSigV4Signer(),
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
schemeId: "smithy.api#noAuth",
|
|
733
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
734
|
+
signer: new core_2.NoAuthSigner(),
|
|
735
|
+
},
|
|
736
|
+
],
|
|
737
|
+
logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
|
|
738
|
+
protocol: config?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: "com.amazonaws.sso" }),
|
|
739
|
+
serviceId: config?.serviceId ?? "SSO",
|
|
740
|
+
urlParser: config?.urlParser ?? url_parser_1.parseUrl,
|
|
741
|
+
utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
|
|
742
|
+
utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
|
|
743
|
+
};
|
|
744
|
+
};
|
|
745
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
/***/ }),
|
|
749
|
+
|
|
750
|
+
/***/ 97523:
|
|
751
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
var protocolHttp = __webpack_require__(72356);
|
|
756
|
+
var core = __webpack_require__(90402);
|
|
757
|
+
var propertyProvider = __webpack_require__(71238);
|
|
758
|
+
var client = __webpack_require__(5152);
|
|
759
|
+
var signatureV4 = __webpack_require__(75118);
|
|
760
|
+
|
|
761
|
+
const getDateHeader = (response) => protocolHttp.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined;
|
|
762
|
+
|
|
763
|
+
const getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset);
|
|
764
|
+
|
|
765
|
+
const isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 300000;
|
|
766
|
+
|
|
767
|
+
const getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => {
|
|
768
|
+
const clockTimeInMs = Date.parse(clockTime);
|
|
769
|
+
if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) {
|
|
770
|
+
return clockTimeInMs - Date.now();
|
|
771
|
+
}
|
|
772
|
+
return currentSystemClockOffset;
|
|
773
|
+
};
|
|
774
|
+
|
|
775
|
+
const throwSigningPropertyError = (name, property) => {
|
|
776
|
+
if (!property) {
|
|
777
|
+
throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`);
|
|
778
|
+
}
|
|
779
|
+
return property;
|
|
780
|
+
};
|
|
781
|
+
const validateSigningProperties = async (signingProperties) => {
|
|
782
|
+
const context = throwSigningPropertyError("context", signingProperties.context);
|
|
783
|
+
const config = throwSigningPropertyError("config", signingProperties.config);
|
|
784
|
+
const authScheme = context.endpointV2?.properties?.authSchemes?.[0];
|
|
785
|
+
const signerFunction = throwSigningPropertyError("signer", config.signer);
|
|
786
|
+
const signer = await signerFunction(authScheme);
|
|
787
|
+
const signingRegion = signingProperties?.signingRegion;
|
|
788
|
+
const signingRegionSet = signingProperties?.signingRegionSet;
|
|
789
|
+
const signingName = signingProperties?.signingName;
|
|
790
|
+
return {
|
|
791
|
+
config,
|
|
792
|
+
signer,
|
|
793
|
+
signingRegion,
|
|
794
|
+
signingRegionSet,
|
|
795
|
+
signingName,
|
|
796
|
+
};
|
|
797
|
+
};
|
|
798
|
+
class AwsSdkSigV4Signer {
|
|
799
|
+
async sign(httpRequest, identity, signingProperties) {
|
|
800
|
+
if (!protocolHttp.HttpRequest.isInstance(httpRequest)) {
|
|
801
|
+
throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
|
|
802
|
+
}
|
|
803
|
+
const validatedProps = await validateSigningProperties(signingProperties);
|
|
804
|
+
const { config, signer } = validatedProps;
|
|
805
|
+
let { signingRegion, signingName } = validatedProps;
|
|
806
|
+
const handlerExecutionContext = signingProperties.context;
|
|
807
|
+
if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) {
|
|
808
|
+
const [first, second] = handlerExecutionContext.authSchemes;
|
|
809
|
+
if (first?.name === "sigv4a" && second?.name === "sigv4") {
|
|
810
|
+
signingRegion = second?.signingRegion ?? signingRegion;
|
|
811
|
+
signingName = second?.signingName ?? signingName;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
const signedRequest = await signer.sign(httpRequest, {
|
|
815
|
+
signingDate: getSkewCorrectedDate(config.systemClockOffset),
|
|
816
|
+
signingRegion: signingRegion,
|
|
817
|
+
signingService: signingName,
|
|
818
|
+
});
|
|
819
|
+
return signedRequest;
|
|
820
|
+
}
|
|
821
|
+
errorHandler(signingProperties) {
|
|
822
|
+
return (error) => {
|
|
823
|
+
const serverTime = error.ServerTime ?? getDateHeader(error.$response);
|
|
824
|
+
if (serverTime) {
|
|
825
|
+
const config = throwSigningPropertyError("config", signingProperties.config);
|
|
826
|
+
const initialSystemClockOffset = config.systemClockOffset;
|
|
827
|
+
config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
|
|
828
|
+
const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
|
|
829
|
+
if (clockSkewCorrected && error.$metadata) {
|
|
830
|
+
error.$metadata.clockSkewCorrected = true;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
throw error;
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
successHandler(httpResponse, signingProperties) {
|
|
837
|
+
const dateHeader = getDateHeader(httpResponse);
|
|
838
|
+
if (dateHeader) {
|
|
839
|
+
const config = throwSigningPropertyError("config", signingProperties.config);
|
|
840
|
+
config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
const AWSSDKSigV4Signer = AwsSdkSigV4Signer;
|
|
845
|
+
|
|
846
|
+
class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer {
|
|
847
|
+
async sign(httpRequest, identity, signingProperties) {
|
|
848
|
+
if (!protocolHttp.HttpRequest.isInstance(httpRequest)) {
|
|
849
|
+
throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
|
|
850
|
+
}
|
|
851
|
+
const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties);
|
|
852
|
+
const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.();
|
|
853
|
+
const multiRegionOverride = (configResolvedSigningRegionSet ??
|
|
854
|
+
signingRegionSet ?? [signingRegion]).join(",");
|
|
855
|
+
const signedRequest = await signer.sign(httpRequest, {
|
|
856
|
+
signingDate: getSkewCorrectedDate(config.systemClockOffset),
|
|
857
|
+
signingRegion: multiRegionOverride,
|
|
858
|
+
signingService: signingName,
|
|
859
|
+
});
|
|
860
|
+
return signedRequest;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
const getArrayForCommaSeparatedString = (str) => typeof str === "string" && str.length > 0 ? str.split(",").map((item) => item.trim()) : [];
|
|
865
|
+
|
|
866
|
+
const getBearerTokenEnvKey = (signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\s-]/g, "_").toUpperCase()}`;
|
|
867
|
+
|
|
868
|
+
const NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY = "AWS_AUTH_SCHEME_PREFERENCE";
|
|
869
|
+
const NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY = "auth_scheme_preference";
|
|
870
|
+
const NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = {
|
|
871
|
+
environmentVariableSelector: (env, options) => {
|
|
872
|
+
if (options?.signingName) {
|
|
873
|
+
const bearerTokenKey = getBearerTokenEnvKey(options.signingName);
|
|
874
|
+
if (bearerTokenKey in env)
|
|
875
|
+
return ["httpBearerAuth"];
|
|
876
|
+
}
|
|
877
|
+
if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env))
|
|
878
|
+
return undefined;
|
|
879
|
+
return getArrayForCommaSeparatedString(env[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]);
|
|
880
|
+
},
|
|
881
|
+
configFileSelector: (profile) => {
|
|
882
|
+
if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile))
|
|
883
|
+
return undefined;
|
|
884
|
+
return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]);
|
|
885
|
+
},
|
|
886
|
+
default: [],
|
|
887
|
+
};
|
|
888
|
+
|
|
889
|
+
const resolveAwsSdkSigV4AConfig = (config) => {
|
|
890
|
+
config.sigv4aSigningRegionSet = core.normalizeProvider(config.sigv4aSigningRegionSet);
|
|
891
|
+
return config;
|
|
892
|
+
};
|
|
893
|
+
const NODE_SIGV4A_CONFIG_OPTIONS = {
|
|
894
|
+
environmentVariableSelector(env) {
|
|
895
|
+
if (env.AWS_SIGV4A_SIGNING_REGION_SET) {
|
|
896
|
+
return env.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim());
|
|
897
|
+
}
|
|
898
|
+
throw new propertyProvider.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", {
|
|
899
|
+
tryNextLink: true,
|
|
900
|
+
});
|
|
901
|
+
},
|
|
902
|
+
configFileSelector(profile) {
|
|
903
|
+
if (profile.sigv4a_signing_region_set) {
|
|
904
|
+
return (profile.sigv4a_signing_region_set ?? "").split(",").map((_) => _.trim());
|
|
905
|
+
}
|
|
906
|
+
throw new propertyProvider.ProviderError("sigv4a_signing_region_set not set in profile.", {
|
|
907
|
+
tryNextLink: true,
|
|
908
|
+
});
|
|
909
|
+
},
|
|
910
|
+
default: undefined,
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
const resolveAwsSdkSigV4Config = (config) => {
|
|
914
|
+
let inputCredentials = config.credentials;
|
|
915
|
+
let isUserSupplied = !!config.credentials;
|
|
916
|
+
let resolvedCredentials = undefined;
|
|
917
|
+
Object.defineProperty(config, "credentials", {
|
|
918
|
+
set(credentials) {
|
|
919
|
+
if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) {
|
|
920
|
+
isUserSupplied = true;
|
|
921
|
+
}
|
|
922
|
+
inputCredentials = credentials;
|
|
923
|
+
const memoizedProvider = normalizeCredentialProvider(config, {
|
|
924
|
+
credentials: inputCredentials,
|
|
925
|
+
credentialDefaultProvider: config.credentialDefaultProvider,
|
|
926
|
+
});
|
|
927
|
+
const boundProvider = bindCallerConfig(config, memoizedProvider);
|
|
928
|
+
if (isUserSupplied && !boundProvider.attributed) {
|
|
929
|
+
resolvedCredentials = async (options) => boundProvider(options).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_CODE", "e"));
|
|
930
|
+
resolvedCredentials.memoized = boundProvider.memoized;
|
|
931
|
+
resolvedCredentials.configBound = boundProvider.configBound;
|
|
932
|
+
resolvedCredentials.attributed = true;
|
|
933
|
+
}
|
|
934
|
+
else {
|
|
935
|
+
resolvedCredentials = boundProvider;
|
|
936
|
+
}
|
|
937
|
+
},
|
|
938
|
+
get() {
|
|
939
|
+
return resolvedCredentials;
|
|
940
|
+
},
|
|
941
|
+
enumerable: true,
|
|
942
|
+
configurable: true,
|
|
943
|
+
});
|
|
944
|
+
config.credentials = inputCredentials;
|
|
945
|
+
const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256, } = config;
|
|
946
|
+
let signer;
|
|
947
|
+
if (config.signer) {
|
|
948
|
+
signer = core.normalizeProvider(config.signer);
|
|
949
|
+
}
|
|
950
|
+
else if (config.regionInfoProvider) {
|
|
951
|
+
signer = () => core.normalizeProvider(config.region)()
|
|
952
|
+
.then(async (region) => [
|
|
953
|
+
(await config.regionInfoProvider(region, {
|
|
954
|
+
useFipsEndpoint: await config.useFipsEndpoint(),
|
|
955
|
+
useDualstackEndpoint: await config.useDualstackEndpoint(),
|
|
956
|
+
})) || {},
|
|
957
|
+
region,
|
|
958
|
+
])
|
|
959
|
+
.then(([regionInfo, region]) => {
|
|
960
|
+
const { signingRegion, signingService } = regionInfo;
|
|
961
|
+
config.signingRegion = config.signingRegion || signingRegion || region;
|
|
962
|
+
config.signingName = config.signingName || signingService || config.serviceId;
|
|
963
|
+
const params = {
|
|
964
|
+
...config,
|
|
965
|
+
credentials: config.credentials,
|
|
966
|
+
region: config.signingRegion,
|
|
967
|
+
service: config.signingName,
|
|
968
|
+
sha256,
|
|
969
|
+
uriEscapePath: signingEscapePath,
|
|
970
|
+
};
|
|
971
|
+
const SignerCtor = config.signerConstructor || signatureV4.SignatureV4;
|
|
972
|
+
return new SignerCtor(params);
|
|
973
|
+
});
|
|
974
|
+
}
|
|
975
|
+
else {
|
|
976
|
+
signer = async (authScheme) => {
|
|
977
|
+
authScheme = Object.assign({}, {
|
|
978
|
+
name: "sigv4",
|
|
979
|
+
signingName: config.signingName || config.defaultSigningName,
|
|
980
|
+
signingRegion: await core.normalizeProvider(config.region)(),
|
|
981
|
+
properties: {},
|
|
982
|
+
}, authScheme);
|
|
983
|
+
const signingRegion = authScheme.signingRegion;
|
|
984
|
+
const signingService = authScheme.signingName;
|
|
985
|
+
config.signingRegion = config.signingRegion || signingRegion;
|
|
986
|
+
config.signingName = config.signingName || signingService || config.serviceId;
|
|
987
|
+
const params = {
|
|
988
|
+
...config,
|
|
989
|
+
credentials: config.credentials,
|
|
990
|
+
region: config.signingRegion,
|
|
991
|
+
service: config.signingName,
|
|
992
|
+
sha256,
|
|
993
|
+
uriEscapePath: signingEscapePath,
|
|
994
|
+
};
|
|
995
|
+
const SignerCtor = config.signerConstructor || signatureV4.SignatureV4;
|
|
996
|
+
return new SignerCtor(params);
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
const resolvedConfig = Object.assign(config, {
|
|
1000
|
+
systemClockOffset,
|
|
1001
|
+
signingEscapePath,
|
|
1002
|
+
signer,
|
|
1003
|
+
});
|
|
1004
|
+
return resolvedConfig;
|
|
1005
|
+
};
|
|
1006
|
+
const resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config;
|
|
1007
|
+
function normalizeCredentialProvider(config, { credentials, credentialDefaultProvider, }) {
|
|
1008
|
+
let credentialsProvider;
|
|
1009
|
+
if (credentials) {
|
|
1010
|
+
if (!credentials?.memoized) {
|
|
1011
|
+
credentialsProvider = core.memoizeIdentityProvider(credentials, core.isIdentityExpired, core.doesIdentityRequireRefresh);
|
|
1012
|
+
}
|
|
1013
|
+
else {
|
|
1014
|
+
credentialsProvider = credentials;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
else {
|
|
1018
|
+
if (credentialDefaultProvider) {
|
|
1019
|
+
credentialsProvider = core.normalizeProvider(credentialDefaultProvider(Object.assign({}, config, {
|
|
1020
|
+
parentClientConfig: config,
|
|
1021
|
+
})));
|
|
1022
|
+
}
|
|
1023
|
+
else {
|
|
1024
|
+
credentialsProvider = async () => {
|
|
1025
|
+
throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.");
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
credentialsProvider.memoized = true;
|
|
1030
|
+
return credentialsProvider;
|
|
1031
|
+
}
|
|
1032
|
+
function bindCallerConfig(config, credentialsProvider) {
|
|
1033
|
+
if (credentialsProvider.configBound) {
|
|
1034
|
+
return credentialsProvider;
|
|
1035
|
+
}
|
|
1036
|
+
const fn = async (options) => credentialsProvider({ ...options, callerClientConfig: config });
|
|
1037
|
+
fn.memoized = credentialsProvider.memoized;
|
|
1038
|
+
fn.configBound = true;
|
|
1039
|
+
return fn;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
exports.AWSSDKSigV4Signer = AWSSDKSigV4Signer;
|
|
1043
|
+
exports.AwsSdkSigV4ASigner = AwsSdkSigV4ASigner;
|
|
1044
|
+
exports.AwsSdkSigV4Signer = AwsSdkSigV4Signer;
|
|
1045
|
+
exports.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = NODE_AUTH_SCHEME_PREFERENCE_OPTIONS;
|
|
1046
|
+
exports.NODE_SIGV4A_CONFIG_OPTIONS = NODE_SIGV4A_CONFIG_OPTIONS;
|
|
1047
|
+
exports.getBearerTokenEnvKey = getBearerTokenEnvKey;
|
|
1048
|
+
exports.resolveAWSSDKSigV4Config = resolveAWSSDKSigV4Config;
|
|
1049
|
+
exports.resolveAwsSdkSigV4AConfig = resolveAwsSdkSigV4AConfig;
|
|
1050
|
+
exports.resolveAwsSdkSigV4Config = resolveAwsSdkSigV4Config;
|
|
1051
|
+
exports.validateSigningProperties = validateSigningProperties;
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+
/***/ }),
|
|
1055
|
+
|
|
1056
|
+
/***/ 60998:
|
|
1057
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1058
|
+
|
|
1059
|
+
var __webpack_unused_export__;
|
|
1060
|
+
|
|
1061
|
+
|
|
1062
|
+
var propertyProvider = __webpack_require__(71238);
|
|
1063
|
+
var sharedIniFileLoader = __webpack_require__(94964);
|
|
1064
|
+
var client = __webpack_require__(5152);
|
|
1065
|
+
var tokenProviders = __webpack_require__(75433);
|
|
1066
|
+
|
|
1067
|
+
const isSsoProfile = (arg) => arg &&
|
|
1068
|
+
(typeof arg.sso_start_url === "string" ||
|
|
1069
|
+
typeof arg.sso_account_id === "string" ||
|
|
1070
|
+
typeof arg.sso_session === "string" ||
|
|
1071
|
+
typeof arg.sso_region === "string" ||
|
|
1072
|
+
typeof arg.sso_role_name === "string");
|
|
1073
|
+
|
|
1074
|
+
const SHOULD_FAIL_CREDENTIAL_CHAIN = false;
|
|
1075
|
+
const resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, profile, filepath, configFilepath, ignoreCache, logger, }) => {
|
|
1076
|
+
let token;
|
|
1077
|
+
const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
|
|
1078
|
+
if (ssoSession) {
|
|
1079
|
+
try {
|
|
1080
|
+
const _token = await tokenProviders.fromSso({
|
|
1081
|
+
profile,
|
|
1082
|
+
filepath,
|
|
1083
|
+
configFilepath,
|
|
1084
|
+
ignoreCache,
|
|
1085
|
+
})();
|
|
1086
|
+
token = {
|
|
1087
|
+
accessToken: _token.token,
|
|
1088
|
+
expiresAt: new Date(_token.expiration).toISOString(),
|
|
1089
|
+
};
|
|
1090
|
+
}
|
|
1091
|
+
catch (e) {
|
|
1092
|
+
throw new propertyProvider.CredentialsProviderError(e.message, {
|
|
1093
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
1094
|
+
logger,
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
else {
|
|
1099
|
+
try {
|
|
1100
|
+
token = await sharedIniFileLoader.getSSOTokenFromFile(ssoStartUrl);
|
|
1101
|
+
}
|
|
1102
|
+
catch (e) {
|
|
1103
|
+
throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {
|
|
1104
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
1105
|
+
logger,
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {
|
|
1110
|
+
throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {
|
|
1111
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
1112
|
+
logger,
|
|
1113
|
+
});
|
|
1114
|
+
}
|
|
1115
|
+
const { accessToken } = token;
|
|
1116
|
+
const { SSOClient, GetRoleCredentialsCommand } = await Promise.resolve().then(function () { return __webpack_require__(16553); });
|
|
1117
|
+
const sso = ssoClient ||
|
|
1118
|
+
new SSOClient(Object.assign({}, clientConfig ?? {}, {
|
|
1119
|
+
logger: clientConfig?.logger ?? parentClientConfig?.logger,
|
|
1120
|
+
region: clientConfig?.region ?? ssoRegion,
|
|
1121
|
+
userAgentAppId: clientConfig?.userAgentAppId ?? parentClientConfig?.userAgentAppId,
|
|
1122
|
+
}));
|
|
1123
|
+
let ssoResp;
|
|
1124
|
+
try {
|
|
1125
|
+
ssoResp = await sso.send(new GetRoleCredentialsCommand({
|
|
1126
|
+
accountId: ssoAccountId,
|
|
1127
|
+
roleName: ssoRoleName,
|
|
1128
|
+
accessToken,
|
|
1129
|
+
}));
|
|
1130
|
+
}
|
|
1131
|
+
catch (e) {
|
|
1132
|
+
throw new propertyProvider.CredentialsProviderError(e, {
|
|
1133
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
1134
|
+
logger,
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {}, } = ssoResp;
|
|
1138
|
+
if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
|
|
1139
|
+
throw new propertyProvider.CredentialsProviderError("SSO returns an invalid temporary credential.", {
|
|
1140
|
+
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
1141
|
+
logger,
|
|
1142
|
+
});
|
|
1143
|
+
}
|
|
1144
|
+
const credentials = {
|
|
1145
|
+
accessKeyId,
|
|
1146
|
+
secretAccessKey,
|
|
1147
|
+
sessionToken,
|
|
1148
|
+
expiration: new Date(expiration),
|
|
1149
|
+
...(credentialScope && { credentialScope }),
|
|
1150
|
+
...(accountId && { accountId }),
|
|
1151
|
+
};
|
|
1152
|
+
if (ssoSession) {
|
|
1153
|
+
client.setCredentialFeature(credentials, "CREDENTIALS_SSO", "s");
|
|
1154
|
+
}
|
|
1155
|
+
else {
|
|
1156
|
+
client.setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u");
|
|
1157
|
+
}
|
|
1158
|
+
return credentials;
|
|
1159
|
+
};
|
|
1160
|
+
|
|
1161
|
+
const validateSsoProfile = (profile, logger) => {
|
|
1162
|
+
const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
|
|
1163
|
+
if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
|
|
1164
|
+
throw new propertyProvider.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", ` +
|
|
1165
|
+
`"sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger });
|
|
1166
|
+
}
|
|
1167
|
+
return profile;
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1170
|
+
const fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => {
|
|
1171
|
+
init.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");
|
|
1172
|
+
const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
|
|
1173
|
+
const { ssoClient } = init;
|
|
1174
|
+
const profileName = sharedIniFileLoader.getProfileName({
|
|
1175
|
+
profile: init.profile ?? callerClientConfig?.profile,
|
|
1176
|
+
});
|
|
1177
|
+
if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) {
|
|
1178
|
+
const profiles = await sharedIniFileLoader.parseKnownFiles(init);
|
|
1179
|
+
const profile = profiles[profileName];
|
|
1180
|
+
if (!profile) {
|
|
1181
|
+
throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger });
|
|
1182
|
+
}
|
|
1183
|
+
if (!isSsoProfile(profile)) {
|
|
1184
|
+
throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, {
|
|
1185
|
+
logger: init.logger,
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
if (profile?.sso_session) {
|
|
1189
|
+
const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init);
|
|
1190
|
+
const session = ssoSessions[profile.sso_session];
|
|
1191
|
+
const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`;
|
|
1192
|
+
if (ssoRegion && ssoRegion !== session.sso_region) {
|
|
1193
|
+
throw new propertyProvider.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, {
|
|
1194
|
+
tryNextLink: false,
|
|
1195
|
+
logger: init.logger,
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) {
|
|
1199
|
+
throw new propertyProvider.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, {
|
|
1200
|
+
tryNextLink: false,
|
|
1201
|
+
logger: init.logger,
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1204
|
+
profile.sso_region = session.sso_region;
|
|
1205
|
+
profile.sso_start_url = session.sso_start_url;
|
|
1206
|
+
}
|
|
1207
|
+
const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init.logger);
|
|
1208
|
+
return resolveSSOCredentials({
|
|
1209
|
+
ssoStartUrl: sso_start_url,
|
|
1210
|
+
ssoSession: sso_session,
|
|
1211
|
+
ssoAccountId: sso_account_id,
|
|
1212
|
+
ssoRegion: sso_region,
|
|
1213
|
+
ssoRoleName: sso_role_name,
|
|
1214
|
+
ssoClient: ssoClient,
|
|
1215
|
+
clientConfig: init.clientConfig,
|
|
1216
|
+
parentClientConfig: init.parentClientConfig,
|
|
1217
|
+
profile: profileName,
|
|
1218
|
+
filepath: init.filepath,
|
|
1219
|
+
configFilepath: init.configFilepath,
|
|
1220
|
+
ignoreCache: init.ignoreCache,
|
|
1221
|
+
logger: init.logger,
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) {
|
|
1225
|
+
throw new propertyProvider.CredentialsProviderError("Incomplete configuration. The fromSSO() argument hash must include " +
|
|
1226
|
+
'"ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"', { tryNextLink: false, logger: init.logger });
|
|
1227
|
+
}
|
|
1228
|
+
else {
|
|
1229
|
+
return resolveSSOCredentials({
|
|
1230
|
+
ssoStartUrl,
|
|
1231
|
+
ssoSession,
|
|
1232
|
+
ssoAccountId,
|
|
1233
|
+
ssoRegion,
|
|
1234
|
+
ssoRoleName,
|
|
1235
|
+
ssoClient,
|
|
1236
|
+
clientConfig: init.clientConfig,
|
|
1237
|
+
parentClientConfig: init.parentClientConfig,
|
|
1238
|
+
profile: profileName,
|
|
1239
|
+
filepath: init.filepath,
|
|
1240
|
+
configFilepath: init.configFilepath,
|
|
1241
|
+
ignoreCache: init.ignoreCache,
|
|
1242
|
+
logger: init.logger,
|
|
1243
|
+
});
|
|
1244
|
+
}
|
|
1245
|
+
};
|
|
1246
|
+
|
|
1247
|
+
exports.fromSSO = fromSSO;
|
|
1248
|
+
__webpack_unused_export__ = isSsoProfile;
|
|
1249
|
+
__webpack_unused_export__ = validateSsoProfile;
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
/***/ }),
|
|
1253
|
+
|
|
1254
|
+
/***/ 16553:
|
|
1255
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1256
|
+
|
|
1257
|
+
|
|
1258
|
+
|
|
1259
|
+
var clientSso = __webpack_require__(62054);
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
|
|
1263
|
+
Object.defineProperty(exports, "GetRoleCredentialsCommand", ({
|
|
1264
|
+
enumerable: true,
|
|
1265
|
+
get: function () { return clientSso.GetRoleCredentialsCommand; }
|
|
1266
|
+
}));
|
|
1267
|
+
Object.defineProperty(exports, "SSOClient", ({
|
|
1268
|
+
enumerable: true,
|
|
1269
|
+
get: function () { return clientSso.SSOClient; }
|
|
1270
|
+
}));
|
|
1271
|
+
|
|
1272
|
+
|
|
1273
|
+
/***/ }),
|
|
1274
|
+
|
|
1275
|
+
/***/ 75433:
|
|
1276
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1277
|
+
|
|
1278
|
+
|
|
1279
|
+
|
|
1280
|
+
var client = __webpack_require__(5152);
|
|
1281
|
+
var httpAuthSchemes = __webpack_require__(97523);
|
|
1282
|
+
var propertyProvider = __webpack_require__(71238);
|
|
1283
|
+
var sharedIniFileLoader = __webpack_require__(94964);
|
|
1284
|
+
var fs = __webpack_require__(79896);
|
|
1285
|
+
|
|
1286
|
+
const fromEnvSigningName = ({ logger, signingName } = {}) => async () => {
|
|
1287
|
+
logger?.debug?.("@aws-sdk/token-providers - fromEnvSigningName");
|
|
1288
|
+
if (!signingName) {
|
|
1289
|
+
throw new propertyProvider.TokenProviderError("Please pass 'signingName' to compute environment variable key", { logger });
|
|
1290
|
+
}
|
|
1291
|
+
const bearerTokenKey = httpAuthSchemes.getBearerTokenEnvKey(signingName);
|
|
1292
|
+
if (!(bearerTokenKey in process.env)) {
|
|
1293
|
+
throw new propertyProvider.TokenProviderError(`Token not present in '${bearerTokenKey}' environment variable`, { logger });
|
|
1294
|
+
}
|
|
1295
|
+
const token = { token: process.env[bearerTokenKey] };
|
|
1296
|
+
client.setTokenFeature(token, "BEARER_SERVICE_ENV_VARS", "3");
|
|
1297
|
+
return token;
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1300
|
+
const EXPIRE_WINDOW_MS = 5 * 60 * 1000;
|
|
1301
|
+
const REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
|
|
1302
|
+
|
|
1303
|
+
const getSsoOidcClient = async (ssoRegion, init = {}) => {
|
|
1304
|
+
const { SSOOIDCClient } = await __webpack_require__.e(/* import() */ 443).then(__webpack_require__.t.bind(__webpack_require__, 89443, 19));
|
|
1305
|
+
const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop];
|
|
1306
|
+
const ssoOidcClient = new SSOOIDCClient(Object.assign({}, init.clientConfig ?? {}, {
|
|
1307
|
+
region: ssoRegion ?? init.clientConfig?.region,
|
|
1308
|
+
logger: coalesce("logger"),
|
|
1309
|
+
userAgentAppId: coalesce("userAgentAppId"),
|
|
1310
|
+
}));
|
|
1311
|
+
return ssoOidcClient;
|
|
1312
|
+
};
|
|
1313
|
+
|
|
1314
|
+
const getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}) => {
|
|
1315
|
+
const { CreateTokenCommand } = await __webpack_require__.e(/* import() */ 443).then(__webpack_require__.t.bind(__webpack_require__, 89443, 19));
|
|
1316
|
+
const ssoOidcClient = await getSsoOidcClient(ssoRegion, init);
|
|
1317
|
+
return ssoOidcClient.send(new CreateTokenCommand({
|
|
1318
|
+
clientId: ssoToken.clientId,
|
|
1319
|
+
clientSecret: ssoToken.clientSecret,
|
|
1320
|
+
refreshToken: ssoToken.refreshToken,
|
|
1321
|
+
grantType: "refresh_token",
|
|
1322
|
+
}));
|
|
1323
|
+
};
|
|
1324
|
+
|
|
1325
|
+
const validateTokenExpiry = (token) => {
|
|
1326
|
+
if (token.expiration && token.expiration.getTime() < Date.now()) {
|
|
1327
|
+
throw new propertyProvider.TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
|
|
1328
|
+
}
|
|
1329
|
+
};
|
|
1330
|
+
|
|
1331
|
+
const validateTokenKey = (key, value, forRefresh = false) => {
|
|
1332
|
+
if (typeof value === "undefined") {
|
|
1333
|
+
throw new propertyProvider.TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
|
|
1334
|
+
}
|
|
1335
|
+
};
|
|
1336
|
+
|
|
1337
|
+
const { writeFile } = fs.promises;
|
|
1338
|
+
const writeSSOTokenToFile = (id, ssoToken) => {
|
|
1339
|
+
const tokenFilepath = sharedIniFileLoader.getSSOTokenFilepath(id);
|
|
1340
|
+
const tokenString = JSON.stringify(ssoToken, null, 2);
|
|
1341
|
+
return writeFile(tokenFilepath, tokenString);
|
|
1342
|
+
};
|
|
1343
|
+
|
|
1344
|
+
const lastRefreshAttemptTime = new Date(0);
|
|
1345
|
+
const fromSso = (_init = {}) => async ({ callerClientConfig } = {}) => {
|
|
1346
|
+
const init = {
|
|
1347
|
+
..._init,
|
|
1348
|
+
parentClientConfig: {
|
|
1349
|
+
...callerClientConfig,
|
|
1350
|
+
..._init.parentClientConfig,
|
|
1351
|
+
},
|
|
1352
|
+
};
|
|
1353
|
+
init.logger?.debug("@aws-sdk/token-providers - fromSso");
|
|
1354
|
+
const profiles = await sharedIniFileLoader.parseKnownFiles(init);
|
|
1355
|
+
const profileName = sharedIniFileLoader.getProfileName({
|
|
1356
|
+
profile: init.profile ?? callerClientConfig?.profile,
|
|
1357
|
+
});
|
|
1358
|
+
const profile = profiles[profileName];
|
|
1359
|
+
if (!profile) {
|
|
1360
|
+
throw new propertyProvider.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false);
|
|
1361
|
+
}
|
|
1362
|
+
else if (!profile["sso_session"]) {
|
|
1363
|
+
throw new propertyProvider.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`);
|
|
1364
|
+
}
|
|
1365
|
+
const ssoSessionName = profile["sso_session"];
|
|
1366
|
+
const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init);
|
|
1367
|
+
const ssoSession = ssoSessions[ssoSessionName];
|
|
1368
|
+
if (!ssoSession) {
|
|
1369
|
+
throw new propertyProvider.TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false);
|
|
1370
|
+
}
|
|
1371
|
+
for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) {
|
|
1372
|
+
if (!ssoSession[ssoSessionRequiredKey]) {
|
|
1373
|
+
throw new propertyProvider.TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false);
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
ssoSession["sso_start_url"];
|
|
1377
|
+
const ssoRegion = ssoSession["sso_region"];
|
|
1378
|
+
let ssoToken;
|
|
1379
|
+
try {
|
|
1380
|
+
ssoToken = await sharedIniFileLoader.getSSOTokenFromFile(ssoSessionName);
|
|
1381
|
+
}
|
|
1382
|
+
catch (e) {
|
|
1383
|
+
throw new propertyProvider.TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false);
|
|
1384
|
+
}
|
|
1385
|
+
validateTokenKey("accessToken", ssoToken.accessToken);
|
|
1386
|
+
validateTokenKey("expiresAt", ssoToken.expiresAt);
|
|
1387
|
+
const { accessToken, expiresAt } = ssoToken;
|
|
1388
|
+
const existingToken = { token: accessToken, expiration: new Date(expiresAt) };
|
|
1389
|
+
if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) {
|
|
1390
|
+
return existingToken;
|
|
1391
|
+
}
|
|
1392
|
+
if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1000) {
|
|
1393
|
+
validateTokenExpiry(existingToken);
|
|
1394
|
+
return existingToken;
|
|
1395
|
+
}
|
|
1396
|
+
validateTokenKey("clientId", ssoToken.clientId, true);
|
|
1397
|
+
validateTokenKey("clientSecret", ssoToken.clientSecret, true);
|
|
1398
|
+
validateTokenKey("refreshToken", ssoToken.refreshToken, true);
|
|
1399
|
+
try {
|
|
1400
|
+
lastRefreshAttemptTime.setTime(Date.now());
|
|
1401
|
+
const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init);
|
|
1402
|
+
validateTokenKey("accessToken", newSsoOidcToken.accessToken);
|
|
1403
|
+
validateTokenKey("expiresIn", newSsoOidcToken.expiresIn);
|
|
1404
|
+
const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1000);
|
|
1405
|
+
try {
|
|
1406
|
+
await writeSSOTokenToFile(ssoSessionName, {
|
|
1407
|
+
...ssoToken,
|
|
1408
|
+
accessToken: newSsoOidcToken.accessToken,
|
|
1409
|
+
expiresAt: newTokenExpiration.toISOString(),
|
|
1410
|
+
refreshToken: newSsoOidcToken.refreshToken,
|
|
1411
|
+
});
|
|
1412
|
+
}
|
|
1413
|
+
catch (error) {
|
|
1414
|
+
}
|
|
1415
|
+
return {
|
|
1416
|
+
token: newSsoOidcToken.accessToken,
|
|
1417
|
+
expiration: newTokenExpiration,
|
|
1418
|
+
};
|
|
1419
|
+
}
|
|
1420
|
+
catch (error) {
|
|
1421
|
+
validateTokenExpiry(existingToken);
|
|
1422
|
+
return existingToken;
|
|
1423
|
+
}
|
|
1424
|
+
};
|
|
1425
|
+
|
|
1426
|
+
const fromStatic = ({ token, logger }) => async () => {
|
|
1427
|
+
logger?.debug("@aws-sdk/token-providers - fromStatic");
|
|
1428
|
+
if (!token || !token.token) {
|
|
1429
|
+
throw new propertyProvider.TokenProviderError(`Please pass a valid token to fromStatic`, false);
|
|
1430
|
+
}
|
|
1431
|
+
return token;
|
|
1432
|
+
};
|
|
1433
|
+
|
|
1434
|
+
const nodeProvider = (init = {}) => propertyProvider.memoize(propertyProvider.chain(fromSso(init), async () => {
|
|
1435
|
+
throw new propertyProvider.TokenProviderError("Could not load token from any providers", false);
|
|
1436
|
+
}), (token) => token.expiration !== undefined && token.expiration.getTime() - Date.now() < 300000, (token) => token.expiration !== undefined);
|
|
1437
|
+
|
|
1438
|
+
exports.fromEnvSigningName = fromEnvSigningName;
|
|
1439
|
+
exports.fromSso = fromSso;
|
|
1440
|
+
exports.fromStatic = fromStatic;
|
|
1441
|
+
exports.nodeProvider = nodeProvider;
|
|
1442
|
+
|
|
1443
|
+
|
|
1444
|
+
/***/ }),
|
|
1445
|
+
|
|
1446
|
+
/***/ 45188:
|
|
1447
|
+
/***/ ((module) => {
|
|
1448
|
+
|
|
1449
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/client-sso","description":"AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native","version":"3.940.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"node ../../scripts/compilation/inline client-sso","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.940.0","@aws-sdk/middleware-host-header":"3.936.0","@aws-sdk/middleware-logger":"3.936.0","@aws-sdk/middleware-recursion-detection":"3.936.0","@aws-sdk/middleware-user-agent":"3.940.0","@aws-sdk/region-config-resolver":"3.936.0","@aws-sdk/types":"3.936.0","@aws-sdk/util-endpoints":"3.936.0","@aws-sdk/util-user-agent-browser":"3.936.0","@aws-sdk/util-user-agent-node":"3.940.0","@smithy/config-resolver":"^4.4.3","@smithy/core":"^3.18.5","@smithy/fetch-http-handler":"^5.3.6","@smithy/hash-node":"^4.2.5","@smithy/invalid-dependency":"^4.2.5","@smithy/middleware-content-length":"^4.2.5","@smithy/middleware-endpoint":"^4.3.12","@smithy/middleware-retry":"^4.4.12","@smithy/middleware-serde":"^4.2.6","@smithy/middleware-stack":"^4.2.5","@smithy/node-config-provider":"^4.3.5","@smithy/node-http-handler":"^4.4.5","@smithy/protocol-http":"^5.3.5","@smithy/smithy-client":"^4.9.8","@smithy/types":"^4.9.0","@smithy/url-parser":"^4.2.5","@smithy/util-base64":"^4.3.0","@smithy/util-body-length-browser":"^4.2.0","@smithy/util-body-length-node":"^4.2.1","@smithy/util-defaults-mode-browser":"^4.3.11","@smithy/util-defaults-mode-node":"^4.2.14","@smithy/util-endpoints":"^3.2.5","@smithy/util-middleware":"^4.2.5","@smithy/util-retry":"^4.2.5","@smithy/util-utf8":"^4.2.0","tslib":"^2.6.2"},"devDependencies":{"@tsconfig/node18":"18.2.4","@types/node":"^18.19.69","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~5.8.3"},"engines":{"node":">=18.0.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["dist-*/**"],"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-sso"}}');
|
|
1450
|
+
|
|
1451
|
+
/***/ })
|
|
1452
|
+
|
|
1453
|
+
};
|
|
1454
|
+
|
|
1455
|
+
//# sourceMappingURL=998.index.js.map
|