terratest 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -0
- package/dist/action/136.index.js +990 -0
- package/dist/action/360.index.js +92 -0
- package/dist/action/443.index.js +724 -0
- package/dist/action/449.index.js +13 -0
- package/dist/action/566.index.js +385 -0
- package/dist/action/605.index.js +241 -0
- package/dist/action/762.index.js +583 -0
- package/dist/action/869.index.js +529 -0
- package/dist/action/956.index.js +117 -0
- package/dist/action/998.index.js +894 -0
- package/dist/action/index.js +18 -0
- package/dist/cli/136.index.js +990 -0
- package/dist/cli/360.index.js +92 -0
- package/dist/cli/443.index.js +724 -0
- package/dist/cli/449.index.js +13 -0
- package/dist/cli/566.index.js +385 -0
- package/dist/cli/605.index.js +241 -0
- package/dist/cli/762.index.js +583 -0
- package/dist/cli/869.index.js +529 -0
- package/dist/cli/956.index.js +117 -0
- package/dist/cli/998.index.js +894 -0
- package/dist/cli/index.js +17 -0
- package/package.json +36 -0
|
@@ -0,0 +1,990 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.id = 136;
|
|
3
|
+
exports.ids = [136];
|
|
4
|
+
exports.modules = {
|
|
5
|
+
|
|
6
|
+
/***/ 1136:
|
|
7
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8
|
+
|
|
9
|
+
var __webpack_unused_export__;
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var client$1 = __webpack_require__(5152);
|
|
13
|
+
var core = __webpack_require__(90402);
|
|
14
|
+
var client = __webpack_require__(92658);
|
|
15
|
+
var config = __webpack_require__(47291);
|
|
16
|
+
var endpoints = __webpack_require__(62085);
|
|
17
|
+
var protocols = __webpack_require__(93422);
|
|
18
|
+
var retry = __webpack_require__(23609);
|
|
19
|
+
var schema = __webpack_require__(26890);
|
|
20
|
+
var httpAuthSchemes = __webpack_require__(97523);
|
|
21
|
+
var signatureV4MultiRegion = __webpack_require__(5785);
|
|
22
|
+
var serde = __webpack_require__(92430);
|
|
23
|
+
var nodeHttpHandler = __webpack_require__(61279);
|
|
24
|
+
var protocols$1 = __webpack_require__(37288);
|
|
25
|
+
|
|
26
|
+
const q = "ref";
|
|
27
|
+
const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "booleanEquals", f = "stringEquals", g = "getAttr", h = "us-east-1", i = "sigv4", j = "sts", k = "https://sts.{Region}.{PartitionResult#dnsSuffix}", l = { [q]: "Endpoint" }, m = { [q]: "Region" }, n = { [q]: d }, o = {}, p = [m];
|
|
28
|
+
const _data = {
|
|
29
|
+
conditions: [
|
|
30
|
+
[c, [l]],
|
|
31
|
+
[c, p],
|
|
32
|
+
["aws.partition", p, d],
|
|
33
|
+
[e, [{ [q]: "UseFIPS" }, b]],
|
|
34
|
+
[e, [{ [q]: "UseDualStack" }, b]],
|
|
35
|
+
[f, [m, "aws-global"]],
|
|
36
|
+
[e, [{ [q]: "UseGlobalEndpoint" }, b]],
|
|
37
|
+
[f, [m, "eu-central-1"]],
|
|
38
|
+
[e, [{ fn: g, argv: [n, "supportsDualStack"] }, b]],
|
|
39
|
+
[e, [{ fn: g, argv: [n, "supportsFIPS"] }, b]],
|
|
40
|
+
[f, [m, "ap-south-1"]],
|
|
41
|
+
[f, [m, "eu-north-1"]],
|
|
42
|
+
[f, [m, "eu-west-1"]],
|
|
43
|
+
[f, [m, "eu-west-2"]],
|
|
44
|
+
[f, [m, "eu-west-3"]],
|
|
45
|
+
[f, [m, "sa-east-1"]],
|
|
46
|
+
[f, [m, h]],
|
|
47
|
+
[f, [m, "us-east-2"]],
|
|
48
|
+
[f, [m, "us-west-2"]],
|
|
49
|
+
[f, [m, "us-west-1"]],
|
|
50
|
+
[f, [m, "ca-central-1"]],
|
|
51
|
+
[f, [m, "ap-southeast-1"]],
|
|
52
|
+
[f, [m, "ap-northeast-1"]],
|
|
53
|
+
[f, [m, "ap-southeast-2"]],
|
|
54
|
+
[f, [{ fn: g, argv: [n, "name"] }, "aws-us-gov"]],
|
|
55
|
+
],
|
|
56
|
+
results: [
|
|
57
|
+
[a],
|
|
58
|
+
["https://sts.amazonaws.com", { authSchemes: [{ name: i, signingName: j, signingRegion: h }] }],
|
|
59
|
+
[k, { authSchemes: [{ name: i, signingName: j, signingRegion: "{Region}" }] }],
|
|
60
|
+
[a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
|
|
61
|
+
[a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
|
|
62
|
+
[l, o],
|
|
63
|
+
["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", o],
|
|
64
|
+
[a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
|
|
65
|
+
["https://sts.{Region}.amazonaws.com", o],
|
|
66
|
+
["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", o],
|
|
67
|
+
[a, "FIPS is enabled but this partition does not support FIPS"],
|
|
68
|
+
["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", o],
|
|
69
|
+
[a, "DualStack is enabled but this partition does not support DualStack"],
|
|
70
|
+
[k, o],
|
|
71
|
+
[a, "Invalid Configuration: Missing Region"],
|
|
72
|
+
],
|
|
73
|
+
};
|
|
74
|
+
const root = 2;
|
|
75
|
+
const r = 100_000_000;
|
|
76
|
+
const nodes = new Int32Array([
|
|
77
|
+
-1,
|
|
78
|
+
1,
|
|
79
|
+
-1,
|
|
80
|
+
0,
|
|
81
|
+
30,
|
|
82
|
+
3,
|
|
83
|
+
1,
|
|
84
|
+
4,
|
|
85
|
+
r + 14,
|
|
86
|
+
2,
|
|
87
|
+
5,
|
|
88
|
+
r + 14,
|
|
89
|
+
3,
|
|
90
|
+
25,
|
|
91
|
+
6,
|
|
92
|
+
4,
|
|
93
|
+
24,
|
|
94
|
+
7,
|
|
95
|
+
5,
|
|
96
|
+
r + 1,
|
|
97
|
+
8,
|
|
98
|
+
6,
|
|
99
|
+
9,
|
|
100
|
+
r + 13,
|
|
101
|
+
7,
|
|
102
|
+
r + 1,
|
|
103
|
+
10,
|
|
104
|
+
10,
|
|
105
|
+
r + 1,
|
|
106
|
+
11,
|
|
107
|
+
11,
|
|
108
|
+
r + 1,
|
|
109
|
+
12,
|
|
110
|
+
12,
|
|
111
|
+
r + 1,
|
|
112
|
+
13,
|
|
113
|
+
13,
|
|
114
|
+
r + 1,
|
|
115
|
+
14,
|
|
116
|
+
14,
|
|
117
|
+
r + 1,
|
|
118
|
+
15,
|
|
119
|
+
15,
|
|
120
|
+
r + 1,
|
|
121
|
+
16,
|
|
122
|
+
16,
|
|
123
|
+
r + 1,
|
|
124
|
+
17,
|
|
125
|
+
17,
|
|
126
|
+
r + 1,
|
|
127
|
+
18,
|
|
128
|
+
18,
|
|
129
|
+
r + 1,
|
|
130
|
+
19,
|
|
131
|
+
19,
|
|
132
|
+
r + 1,
|
|
133
|
+
20,
|
|
134
|
+
20,
|
|
135
|
+
r + 1,
|
|
136
|
+
21,
|
|
137
|
+
21,
|
|
138
|
+
r + 1,
|
|
139
|
+
22,
|
|
140
|
+
22,
|
|
141
|
+
r + 1,
|
|
142
|
+
23,
|
|
143
|
+
23,
|
|
144
|
+
r + 1,
|
|
145
|
+
r + 2,
|
|
146
|
+
8,
|
|
147
|
+
r + 11,
|
|
148
|
+
r + 12,
|
|
149
|
+
4,
|
|
150
|
+
28,
|
|
151
|
+
26,
|
|
152
|
+
9,
|
|
153
|
+
27,
|
|
154
|
+
r + 10,
|
|
155
|
+
24,
|
|
156
|
+
r + 8,
|
|
157
|
+
r + 9,
|
|
158
|
+
8,
|
|
159
|
+
29,
|
|
160
|
+
r + 7,
|
|
161
|
+
9,
|
|
162
|
+
r + 6,
|
|
163
|
+
r + 7,
|
|
164
|
+
3,
|
|
165
|
+
r + 3,
|
|
166
|
+
31,
|
|
167
|
+
4,
|
|
168
|
+
r + 4,
|
|
169
|
+
r + 5,
|
|
170
|
+
]);
|
|
171
|
+
const bdd = endpoints.BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
|
|
172
|
+
|
|
173
|
+
const cache = new endpoints.EndpointCache({
|
|
174
|
+
size: 50,
|
|
175
|
+
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"],
|
|
176
|
+
});
|
|
177
|
+
const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
178
|
+
return cache.get(endpointParams, () => endpoints.decideEndpoint(bdd, {
|
|
179
|
+
endpointParams: endpointParams,
|
|
180
|
+
logger: context.logger,
|
|
181
|
+
}));
|
|
182
|
+
};
|
|
183
|
+
endpoints.customEndpointFunctions.aws = client$1.awsEndpointFunctions;
|
|
184
|
+
|
|
185
|
+
const createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
|
|
186
|
+
if (!input) {
|
|
187
|
+
throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");
|
|
188
|
+
}
|
|
189
|
+
const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
|
|
190
|
+
const instructionsFn = client.getSmithyContext(context)?.commandInstance?.constructor
|
|
191
|
+
?.getEndpointParameterInstructions;
|
|
192
|
+
if (!instructionsFn) {
|
|
193
|
+
throw new Error(`getEndpointParameterInstructions() is not defined on '${context.commandName}'`);
|
|
194
|
+
}
|
|
195
|
+
const endpointParameters = await endpoints.resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config);
|
|
196
|
+
return Object.assign(defaultParameters, endpointParameters);
|
|
197
|
+
};
|
|
198
|
+
const _defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
199
|
+
return {
|
|
200
|
+
operation: client.getSmithyContext(context).operation,
|
|
201
|
+
region: (await client.normalizeProvider(config.region)()) ||
|
|
202
|
+
(() => {
|
|
203
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
204
|
+
})(),
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
const defaultSTSHttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultSTSHttpAuthSchemeParametersProvider);
|
|
208
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
209
|
+
return {
|
|
210
|
+
schemeId: "aws.auth#sigv4",
|
|
211
|
+
signingProperties: {
|
|
212
|
+
name: "sts",
|
|
213
|
+
region: authParameters.region,
|
|
214
|
+
},
|
|
215
|
+
propertiesExtractor: (config, context) => ({
|
|
216
|
+
signingProperties: {
|
|
217
|
+
config,
|
|
218
|
+
context,
|
|
219
|
+
},
|
|
220
|
+
}),
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function createAwsAuthSigv4aHttpAuthOption(authParameters) {
|
|
224
|
+
return {
|
|
225
|
+
schemeId: "aws.auth#sigv4a",
|
|
226
|
+
signingProperties: {
|
|
227
|
+
name: "sts",
|
|
228
|
+
region: authParameters.region,
|
|
229
|
+
},
|
|
230
|
+
propertiesExtractor: (config, context) => ({
|
|
231
|
+
signingProperties: {
|
|
232
|
+
config,
|
|
233
|
+
context,
|
|
234
|
+
},
|
|
235
|
+
}),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
|
|
239
|
+
return {
|
|
240
|
+
schemeId: "smithy.api#noAuth",
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
const createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
|
|
244
|
+
const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
|
|
245
|
+
const endpoint = defaultEndpointResolver(authParameters);
|
|
246
|
+
const authSchemes = endpoint.properties?.authSchemes;
|
|
247
|
+
if (!authSchemes) {
|
|
248
|
+
return defaultHttpAuthSchemeResolver(authParameters);
|
|
249
|
+
}
|
|
250
|
+
const options = [];
|
|
251
|
+
for (const scheme of authSchemes) {
|
|
252
|
+
const { name: resolvedName, properties = {}, ...rest } = scheme;
|
|
253
|
+
const name = resolvedName.toLowerCase();
|
|
254
|
+
if (resolvedName !== name) {
|
|
255
|
+
console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`);
|
|
256
|
+
}
|
|
257
|
+
let schemeId;
|
|
258
|
+
if (name === "sigv4a") {
|
|
259
|
+
schemeId = "aws.auth#sigv4a";
|
|
260
|
+
const sigv4Present = authSchemes.find((s) => {
|
|
261
|
+
const name = s.name.toLowerCase();
|
|
262
|
+
return name !== "sigv4a" && name.startsWith("sigv4");
|
|
263
|
+
});
|
|
264
|
+
if (signatureV4MultiRegion.SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) {
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
else if (name.startsWith("sigv4")) {
|
|
269
|
+
schemeId = "aws.auth#sigv4";
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`);
|
|
273
|
+
}
|
|
274
|
+
const createOption = createHttpAuthOptionFunctions[schemeId];
|
|
275
|
+
if (!createOption) {
|
|
276
|
+
throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`);
|
|
277
|
+
}
|
|
278
|
+
const option = createOption(authParameters);
|
|
279
|
+
option.schemeId = schemeId;
|
|
280
|
+
option.signingProperties = { ...(option.signingProperties || {}), ...rest, ...properties };
|
|
281
|
+
options.push(option);
|
|
282
|
+
}
|
|
283
|
+
return options;
|
|
284
|
+
};
|
|
285
|
+
return endpointRuleSetHttpAuthSchemeProvider;
|
|
286
|
+
};
|
|
287
|
+
const _defaultSTSHttpAuthSchemeProvider = (authParameters) => {
|
|
288
|
+
const options = [];
|
|
289
|
+
switch (authParameters.operation) {
|
|
290
|
+
case "AssumeRoleWithWebIdentity": {
|
|
291
|
+
options.push(createSmithyApiNoAuthHttpAuthOption());
|
|
292
|
+
options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
default: {
|
|
296
|
+
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
297
|
+
options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return options;
|
|
301
|
+
};
|
|
302
|
+
const defaultSTSHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultSTSHttpAuthSchemeProvider, {
|
|
303
|
+
"aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
|
|
304
|
+
"aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
|
|
305
|
+
"smithy.api#noAuth": createSmithyApiNoAuthHttpAuthOption,
|
|
306
|
+
});
|
|
307
|
+
const resolveHttpAuthSchemeConfig = (config) => {
|
|
308
|
+
const config_0 = httpAuthSchemes.resolveAwsSdkSigV4Config(config);
|
|
309
|
+
const config_1 = httpAuthSchemes.resolveAwsSdkSigV4AConfig(config_0);
|
|
310
|
+
return Object.assign(config_1, {
|
|
311
|
+
authSchemePreference: client.normalizeProvider(config.authSchemePreference ?? []),
|
|
312
|
+
});
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
const resolveClientEndpointParameters = (options) => {
|
|
316
|
+
return Object.assign(options, {
|
|
317
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
318
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
319
|
+
useGlobalEndpoint: options.useGlobalEndpoint ?? false,
|
|
320
|
+
defaultSigningName: "sts",
|
|
321
|
+
});
|
|
322
|
+
};
|
|
323
|
+
const commonParams = {
|
|
324
|
+
UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
|
|
325
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
326
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
327
|
+
Region: { type: "builtInParams", name: "region" },
|
|
328
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
var version = "3.997.11";
|
|
332
|
+
var packageInfo = {
|
|
333
|
+
version: version};
|
|
334
|
+
|
|
335
|
+
class STSServiceException extends client.ServiceException {
|
|
336
|
+
constructor(options) {
|
|
337
|
+
super(options);
|
|
338
|
+
Object.setPrototypeOf(this, STSServiceException.prototype);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
class ExpiredTokenException extends STSServiceException {
|
|
343
|
+
name = "ExpiredTokenException";
|
|
344
|
+
$fault = "client";
|
|
345
|
+
constructor(opts) {
|
|
346
|
+
super({
|
|
347
|
+
name: "ExpiredTokenException",
|
|
348
|
+
$fault: "client",
|
|
349
|
+
...opts,
|
|
350
|
+
});
|
|
351
|
+
Object.setPrototypeOf(this, ExpiredTokenException.prototype);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
class MalformedPolicyDocumentException extends STSServiceException {
|
|
355
|
+
name = "MalformedPolicyDocumentException";
|
|
356
|
+
$fault = "client";
|
|
357
|
+
constructor(opts) {
|
|
358
|
+
super({
|
|
359
|
+
name: "MalformedPolicyDocumentException",
|
|
360
|
+
$fault: "client",
|
|
361
|
+
...opts,
|
|
362
|
+
});
|
|
363
|
+
Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
class PackedPolicyTooLargeException extends STSServiceException {
|
|
367
|
+
name = "PackedPolicyTooLargeException";
|
|
368
|
+
$fault = "client";
|
|
369
|
+
constructor(opts) {
|
|
370
|
+
super({
|
|
371
|
+
name: "PackedPolicyTooLargeException",
|
|
372
|
+
$fault: "client",
|
|
373
|
+
...opts,
|
|
374
|
+
});
|
|
375
|
+
Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
class RegionDisabledException extends STSServiceException {
|
|
379
|
+
name = "RegionDisabledException";
|
|
380
|
+
$fault = "client";
|
|
381
|
+
constructor(opts) {
|
|
382
|
+
super({
|
|
383
|
+
name: "RegionDisabledException",
|
|
384
|
+
$fault: "client",
|
|
385
|
+
...opts,
|
|
386
|
+
});
|
|
387
|
+
Object.setPrototypeOf(this, RegionDisabledException.prototype);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
class IDPRejectedClaimException extends STSServiceException {
|
|
391
|
+
name = "IDPRejectedClaimException";
|
|
392
|
+
$fault = "client";
|
|
393
|
+
constructor(opts) {
|
|
394
|
+
super({
|
|
395
|
+
name: "IDPRejectedClaimException",
|
|
396
|
+
$fault: "client",
|
|
397
|
+
...opts,
|
|
398
|
+
});
|
|
399
|
+
Object.setPrototypeOf(this, IDPRejectedClaimException.prototype);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
class InvalidIdentityTokenException extends STSServiceException {
|
|
403
|
+
name = "InvalidIdentityTokenException";
|
|
404
|
+
$fault = "client";
|
|
405
|
+
constructor(opts) {
|
|
406
|
+
super({
|
|
407
|
+
name: "InvalidIdentityTokenException",
|
|
408
|
+
$fault: "client",
|
|
409
|
+
...opts,
|
|
410
|
+
});
|
|
411
|
+
Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
class IDPCommunicationErrorException extends STSServiceException {
|
|
415
|
+
name = "IDPCommunicationErrorException";
|
|
416
|
+
$fault = "client";
|
|
417
|
+
$retryable = {};
|
|
418
|
+
constructor(opts) {
|
|
419
|
+
super({
|
|
420
|
+
name: "IDPCommunicationErrorException",
|
|
421
|
+
$fault: "client",
|
|
422
|
+
...opts,
|
|
423
|
+
});
|
|
424
|
+
Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
const _A = "Arn";
|
|
429
|
+
const _AKI = "AccessKeyId";
|
|
430
|
+
const _AR = "AssumeRole";
|
|
431
|
+
const _ARI = "AssumedRoleId";
|
|
432
|
+
const _ARR = "AssumeRoleRequest";
|
|
433
|
+
const _ARRs = "AssumeRoleResponse";
|
|
434
|
+
const _ARU = "AssumedRoleUser";
|
|
435
|
+
const _ARWWI = "AssumeRoleWithWebIdentity";
|
|
436
|
+
const _ARWWIR = "AssumeRoleWithWebIdentityRequest";
|
|
437
|
+
const _ARWWIRs = "AssumeRoleWithWebIdentityResponse";
|
|
438
|
+
const _Au = "Audience";
|
|
439
|
+
const _C = "Credentials";
|
|
440
|
+
const _CA = "ContextAssertion";
|
|
441
|
+
const _DS = "DurationSeconds";
|
|
442
|
+
const _E = "Expiration";
|
|
443
|
+
const _EI = "ExternalId";
|
|
444
|
+
const _ETE = "ExpiredTokenException";
|
|
445
|
+
const _IDPCEE = "IDPCommunicationErrorException";
|
|
446
|
+
const _IDPRCE = "IDPRejectedClaimException";
|
|
447
|
+
const _IITE = "InvalidIdentityTokenException";
|
|
448
|
+
const _K = "Key";
|
|
449
|
+
const _MPDE = "MalformedPolicyDocumentException";
|
|
450
|
+
const _P = "Policy";
|
|
451
|
+
const _PA = "PolicyArns";
|
|
452
|
+
const _PAr = "ProviderArn";
|
|
453
|
+
const _PC = "ProvidedContexts";
|
|
454
|
+
const _PCLT = "ProvidedContextsListType";
|
|
455
|
+
const _PCr = "ProvidedContext";
|
|
456
|
+
const _PDT = "PolicyDescriptorType";
|
|
457
|
+
const _PI = "ProviderId";
|
|
458
|
+
const _PPS = "PackedPolicySize";
|
|
459
|
+
const _PPTLE = "PackedPolicyTooLargeException";
|
|
460
|
+
const _Pr = "Provider";
|
|
461
|
+
const _RA = "RoleArn";
|
|
462
|
+
const _RDE = "RegionDisabledException";
|
|
463
|
+
const _RSN = "RoleSessionName";
|
|
464
|
+
const _SAK = "SecretAccessKey";
|
|
465
|
+
const _SFWIT = "SubjectFromWebIdentityToken";
|
|
466
|
+
const _SI = "SourceIdentity";
|
|
467
|
+
const _SN = "SerialNumber";
|
|
468
|
+
const _ST = "SessionToken";
|
|
469
|
+
const _T = "Tags";
|
|
470
|
+
const _TC = "TokenCode";
|
|
471
|
+
const _TTK = "TransitiveTagKeys";
|
|
472
|
+
const _Ta = "Tag";
|
|
473
|
+
const _V = "Value";
|
|
474
|
+
const _WIT = "WebIdentityToken";
|
|
475
|
+
const _a = "arn";
|
|
476
|
+
const _aKST = "accessKeySecretType";
|
|
477
|
+
const _aQE = "awsQueryError";
|
|
478
|
+
const _c = "client";
|
|
479
|
+
const _cTT = "clientTokenType";
|
|
480
|
+
const _e = "error";
|
|
481
|
+
const _hE = "httpError";
|
|
482
|
+
const _m = "message";
|
|
483
|
+
const _pDLT = "policyDescriptorListType";
|
|
484
|
+
const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sts";
|
|
485
|
+
const _tLT = "tagListType";
|
|
486
|
+
const n0 = "com.amazonaws.sts";
|
|
487
|
+
const _s_registry = schema.TypeRegistry.for(_s);
|
|
488
|
+
var STSServiceException$ = [-3, _s, "STSServiceException", 0, [], []];
|
|
489
|
+
_s_registry.registerError(STSServiceException$, STSServiceException);
|
|
490
|
+
const n0_registry = schema.TypeRegistry.for(n0);
|
|
491
|
+
var ExpiredTokenException$ = [
|
|
492
|
+
-3,
|
|
493
|
+
n0,
|
|
494
|
+
_ETE,
|
|
495
|
+
{ [_aQE]: [`ExpiredTokenException`, 400], [_e]: _c, [_hE]: 400 },
|
|
496
|
+
[_m],
|
|
497
|
+
[0],
|
|
498
|
+
];
|
|
499
|
+
n0_registry.registerError(ExpiredTokenException$, ExpiredTokenException);
|
|
500
|
+
var IDPCommunicationErrorException$ = [
|
|
501
|
+
-3,
|
|
502
|
+
n0,
|
|
503
|
+
_IDPCEE,
|
|
504
|
+
{ [_aQE]: [`IDPCommunicationError`, 400], [_e]: _c, [_hE]: 400 },
|
|
505
|
+
[_m],
|
|
506
|
+
[0],
|
|
507
|
+
];
|
|
508
|
+
n0_registry.registerError(IDPCommunicationErrorException$, IDPCommunicationErrorException);
|
|
509
|
+
var IDPRejectedClaimException$ = [
|
|
510
|
+
-3,
|
|
511
|
+
n0,
|
|
512
|
+
_IDPRCE,
|
|
513
|
+
{ [_aQE]: [`IDPRejectedClaim`, 403], [_e]: _c, [_hE]: 403 },
|
|
514
|
+
[_m],
|
|
515
|
+
[0],
|
|
516
|
+
];
|
|
517
|
+
n0_registry.registerError(IDPRejectedClaimException$, IDPRejectedClaimException);
|
|
518
|
+
var InvalidIdentityTokenException$ = [
|
|
519
|
+
-3,
|
|
520
|
+
n0,
|
|
521
|
+
_IITE,
|
|
522
|
+
{ [_aQE]: [`InvalidIdentityToken`, 400], [_e]: _c, [_hE]: 400 },
|
|
523
|
+
[_m],
|
|
524
|
+
[0],
|
|
525
|
+
];
|
|
526
|
+
n0_registry.registerError(InvalidIdentityTokenException$, InvalidIdentityTokenException);
|
|
527
|
+
var MalformedPolicyDocumentException$ = [
|
|
528
|
+
-3,
|
|
529
|
+
n0,
|
|
530
|
+
_MPDE,
|
|
531
|
+
{ [_aQE]: [`MalformedPolicyDocument`, 400], [_e]: _c, [_hE]: 400 },
|
|
532
|
+
[_m],
|
|
533
|
+
[0],
|
|
534
|
+
];
|
|
535
|
+
n0_registry.registerError(MalformedPolicyDocumentException$, MalformedPolicyDocumentException);
|
|
536
|
+
var PackedPolicyTooLargeException$ = [
|
|
537
|
+
-3,
|
|
538
|
+
n0,
|
|
539
|
+
_PPTLE,
|
|
540
|
+
{ [_aQE]: [`PackedPolicyTooLarge`, 400], [_e]: _c, [_hE]: 400 },
|
|
541
|
+
[_m],
|
|
542
|
+
[0],
|
|
543
|
+
];
|
|
544
|
+
n0_registry.registerError(PackedPolicyTooLargeException$, PackedPolicyTooLargeException);
|
|
545
|
+
var RegionDisabledException$ = [
|
|
546
|
+
-3,
|
|
547
|
+
n0,
|
|
548
|
+
_RDE,
|
|
549
|
+
{ [_aQE]: [`RegionDisabledException`, 403], [_e]: _c, [_hE]: 403 },
|
|
550
|
+
[_m],
|
|
551
|
+
[0],
|
|
552
|
+
];
|
|
553
|
+
n0_registry.registerError(RegionDisabledException$, RegionDisabledException);
|
|
554
|
+
const errorTypeRegistries = [_s_registry, n0_registry];
|
|
555
|
+
var accessKeySecretType = [0, n0, _aKST, 8, 0];
|
|
556
|
+
var clientTokenType = [0, n0, _cTT, 8, 0];
|
|
557
|
+
var AssumedRoleUser$ = [3, n0, _ARU, 0, [_ARI, _A], [0, 0], 2];
|
|
558
|
+
var AssumeRoleRequest$ = [
|
|
559
|
+
3,
|
|
560
|
+
n0,
|
|
561
|
+
_ARR,
|
|
562
|
+
0,
|
|
563
|
+
[_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC],
|
|
564
|
+
[0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType],
|
|
565
|
+
2,
|
|
566
|
+
];
|
|
567
|
+
var AssumeRoleResponse$ = [
|
|
568
|
+
3,
|
|
569
|
+
n0,
|
|
570
|
+
_ARRs,
|
|
571
|
+
0,
|
|
572
|
+
[_C, _ARU, _PPS, _SI],
|
|
573
|
+
[[() => Credentials$, 0], () => AssumedRoleUser$, 1, 0],
|
|
574
|
+
];
|
|
575
|
+
var AssumeRoleWithWebIdentityRequest$ = [
|
|
576
|
+
3,
|
|
577
|
+
n0,
|
|
578
|
+
_ARWWIR,
|
|
579
|
+
0,
|
|
580
|
+
[_RA, _RSN, _WIT, _PI, _PA, _P, _DS],
|
|
581
|
+
[0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1],
|
|
582
|
+
3,
|
|
583
|
+
];
|
|
584
|
+
var AssumeRoleWithWebIdentityResponse$ = [
|
|
585
|
+
3,
|
|
586
|
+
n0,
|
|
587
|
+
_ARWWIRs,
|
|
588
|
+
0,
|
|
589
|
+
[_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI],
|
|
590
|
+
[[() => Credentials$, 0], 0, () => AssumedRoleUser$, 1, 0, 0, 0],
|
|
591
|
+
];
|
|
592
|
+
var Credentials$ = [
|
|
593
|
+
3,
|
|
594
|
+
n0,
|
|
595
|
+
_C,
|
|
596
|
+
0,
|
|
597
|
+
[_AKI, _SAK, _ST, _E],
|
|
598
|
+
[0, [() => accessKeySecretType, 0], 0, 4],
|
|
599
|
+
4,
|
|
600
|
+
];
|
|
601
|
+
var PolicyDescriptorType$ = [3, n0, _PDT, 0, [_a], [0]];
|
|
602
|
+
var ProvidedContext$ = [3, n0, _PCr, 0, [_PAr, _CA], [0, 0]];
|
|
603
|
+
var Tag$ = [3, n0, _Ta, 0, [_K, _V], [0, 0], 2];
|
|
604
|
+
var policyDescriptorListType = [1, n0, _pDLT, 0, () => PolicyDescriptorType$];
|
|
605
|
+
var ProvidedContextsListType = [1, n0, _PCLT, 0, () => ProvidedContext$];
|
|
606
|
+
var tagListType = [1, n0, _tLT, 0, () => Tag$];
|
|
607
|
+
var AssumeRole$ = [9, n0, _AR, 0, () => AssumeRoleRequest$, () => AssumeRoleResponse$];
|
|
608
|
+
var AssumeRoleWithWebIdentity$ = [
|
|
609
|
+
9,
|
|
610
|
+
n0,
|
|
611
|
+
_ARWWI,
|
|
612
|
+
0,
|
|
613
|
+
() => AssumeRoleWithWebIdentityRequest$,
|
|
614
|
+
() => AssumeRoleWithWebIdentityResponse$,
|
|
615
|
+
];
|
|
616
|
+
|
|
617
|
+
const getRuntimeConfig$1 = (config) => {
|
|
618
|
+
return {
|
|
619
|
+
apiVersion: "2011-06-15",
|
|
620
|
+
base64Decoder: config?.base64Decoder ?? serde.fromBase64,
|
|
621
|
+
base64Encoder: config?.base64Encoder ?? serde.toBase64,
|
|
622
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
623
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
624
|
+
extensions: config?.extensions ?? [],
|
|
625
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSTSHttpAuthSchemeProvider,
|
|
626
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
627
|
+
{
|
|
628
|
+
schemeId: "aws.auth#sigv4",
|
|
629
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
630
|
+
signer: new httpAuthSchemes.AwsSdkSigV4Signer(),
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
schemeId: "aws.auth#sigv4a",
|
|
634
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
|
|
635
|
+
signer: new httpAuthSchemes.AwsSdkSigV4ASigner(),
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
schemeId: "smithy.api#noAuth",
|
|
639
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
640
|
+
signer: new core.NoAuthSigner(),
|
|
641
|
+
},
|
|
642
|
+
],
|
|
643
|
+
logger: config?.logger ?? new client.NoOpLogger(),
|
|
644
|
+
protocol: config?.protocol ?? protocols$1.AwsQueryProtocol,
|
|
645
|
+
protocolSettings: config?.protocolSettings ?? {
|
|
646
|
+
defaultNamespace: "com.amazonaws.sts",
|
|
647
|
+
errorTypeRegistries,
|
|
648
|
+
xmlNamespace: "https://sts.amazonaws.com/doc/2011-06-15/",
|
|
649
|
+
version: "2011-06-15",
|
|
650
|
+
serviceTarget: "AWSSecurityTokenServiceV20110615",
|
|
651
|
+
},
|
|
652
|
+
serviceId: config?.serviceId ?? "STS",
|
|
653
|
+
signerConstructor: config?.signerConstructor ?? signatureV4MultiRegion.SignatureV4MultiRegion,
|
|
654
|
+
urlParser: config?.urlParser ?? protocols.parseUrl,
|
|
655
|
+
utf8Decoder: config?.utf8Decoder ?? serde.fromUtf8,
|
|
656
|
+
utf8Encoder: config?.utf8Encoder ?? serde.toUtf8,
|
|
657
|
+
};
|
|
658
|
+
};
|
|
659
|
+
|
|
660
|
+
const getRuntimeConfig = (config$1) => {
|
|
661
|
+
client.emitWarningIfUnsupportedVersion(process.version);
|
|
662
|
+
const defaultsMode = config.resolveDefaultsModeConfig(config$1);
|
|
663
|
+
const defaultConfigProvider = () => defaultsMode().then(client.loadConfigsForDefaultMode);
|
|
664
|
+
const clientSharedValues = getRuntimeConfig$1(config$1);
|
|
665
|
+
client$1.emitWarningIfUnsupportedVersion(process.version);
|
|
666
|
+
const loaderConfig = {
|
|
667
|
+
profile: config$1?.profile,
|
|
668
|
+
logger: clientSharedValues.logger,
|
|
669
|
+
};
|
|
670
|
+
return {
|
|
671
|
+
...clientSharedValues,
|
|
672
|
+
...config$1,
|
|
673
|
+
runtime: "node",
|
|
674
|
+
defaultsMode,
|
|
675
|
+
authSchemePreference: config$1?.authSchemePreference ?? config.loadConfig(httpAuthSchemes.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
676
|
+
bodyLengthChecker: config$1?.bodyLengthChecker ?? serde.calculateBodyLength,
|
|
677
|
+
defaultUserAgentProvider: config$1?.defaultUserAgentProvider ??
|
|
678
|
+
client$1.createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
679
|
+
httpAuthSchemes: config$1?.httpAuthSchemes ?? [
|
|
680
|
+
{
|
|
681
|
+
schemeId: "aws.auth#sigv4",
|
|
682
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") ||
|
|
683
|
+
(async (idProps) => await config$1.credentialDefaultProvider(idProps?.__config || {})()),
|
|
684
|
+
signer: new httpAuthSchemes.AwsSdkSigV4Signer(),
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
schemeId: "aws.auth#sigv4a",
|
|
688
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
|
|
689
|
+
signer: new httpAuthSchemes.AwsSdkSigV4ASigner(),
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
schemeId: "smithy.api#noAuth",
|
|
693
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
694
|
+
signer: new core.NoAuthSigner(),
|
|
695
|
+
},
|
|
696
|
+
],
|
|
697
|
+
maxAttempts: config$1?.maxAttempts ?? config.loadConfig(retry.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config$1),
|
|
698
|
+
region: config$1?.region ??
|
|
699
|
+
config.loadConfig(config.NODE_REGION_CONFIG_OPTIONS, { ...config.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
700
|
+
requestHandler: nodeHttpHandler.NodeHttpHandler.create(config$1?.requestHandler ?? defaultConfigProvider),
|
|
701
|
+
retryMode: config$1?.retryMode ??
|
|
702
|
+
config.loadConfig({
|
|
703
|
+
...retry.NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
704
|
+
default: async () => (await defaultConfigProvider()).retryMode || retry.DEFAULT_RETRY_MODE,
|
|
705
|
+
}, config$1),
|
|
706
|
+
sha256: config$1?.sha256 ?? serde.Hash.bind(null, "sha256"),
|
|
707
|
+
sigv4aSigningRegionSet: config$1?.sigv4aSigningRegionSet ?? config.loadConfig(httpAuthSchemes.NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig),
|
|
708
|
+
streamCollector: config$1?.streamCollector ?? nodeHttpHandler.streamCollector,
|
|
709
|
+
useDualstackEndpoint: config$1?.useDualstackEndpoint ?? config.loadConfig(config.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
710
|
+
useFipsEndpoint: config$1?.useFipsEndpoint ?? config.loadConfig(config.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
711
|
+
userAgentAppId: config$1?.userAgentAppId ?? config.loadConfig(client$1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
712
|
+
};
|
|
713
|
+
};
|
|
714
|
+
|
|
715
|
+
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
716
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
717
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
718
|
+
let _credentials = runtimeConfig.credentials;
|
|
719
|
+
return {
|
|
720
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
721
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
722
|
+
if (index === -1) {
|
|
723
|
+
_httpAuthSchemes.push(httpAuthScheme);
|
|
724
|
+
}
|
|
725
|
+
else {
|
|
726
|
+
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
httpAuthSchemes() {
|
|
730
|
+
return _httpAuthSchemes;
|
|
731
|
+
},
|
|
732
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
733
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
734
|
+
},
|
|
735
|
+
httpAuthSchemeProvider() {
|
|
736
|
+
return _httpAuthSchemeProvider;
|
|
737
|
+
},
|
|
738
|
+
setCredentials(credentials) {
|
|
739
|
+
_credentials = credentials;
|
|
740
|
+
},
|
|
741
|
+
credentials() {
|
|
742
|
+
return _credentials;
|
|
743
|
+
},
|
|
744
|
+
};
|
|
745
|
+
};
|
|
746
|
+
const resolveHttpAuthRuntimeConfig = (config) => {
|
|
747
|
+
return {
|
|
748
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
749
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
750
|
+
credentials: config.credentials(),
|
|
751
|
+
};
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
755
|
+
const extensionConfiguration = Object.assign(client$1.getAwsRegionExtensionConfiguration(runtimeConfig), client.getDefaultExtensionConfiguration(runtimeConfig), protocols.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
|
|
756
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
757
|
+
return Object.assign(runtimeConfig, client$1.resolveAwsRegionExtensionConfiguration(extensionConfiguration), client.resolveDefaultRuntimeConfig(extensionConfiguration), protocols.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
class STSClient extends client.Client {
|
|
761
|
+
config;
|
|
762
|
+
constructor(...[configuration]) {
|
|
763
|
+
const _config_0 = getRuntimeConfig(configuration || {});
|
|
764
|
+
super(_config_0);
|
|
765
|
+
this.initConfig = _config_0;
|
|
766
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
767
|
+
const _config_2 = client$1.resolveUserAgentConfig(_config_1);
|
|
768
|
+
const _config_3 = retry.resolveRetryConfig(_config_2);
|
|
769
|
+
const _config_4 = config.resolveRegionConfig(_config_3);
|
|
770
|
+
const _config_5 = client$1.resolveHostHeaderConfig(_config_4);
|
|
771
|
+
const _config_6 = endpoints.resolveEndpointConfig(_config_5);
|
|
772
|
+
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
|
|
773
|
+
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
774
|
+
this.config = _config_8;
|
|
775
|
+
this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));
|
|
776
|
+
this.middlewareStack.use(client$1.getUserAgentPlugin(this.config));
|
|
777
|
+
this.middlewareStack.use(retry.getRetryPlugin(this.config));
|
|
778
|
+
this.middlewareStack.use(protocols.getContentLengthPlugin(this.config));
|
|
779
|
+
this.middlewareStack.use(client$1.getHostHeaderPlugin(this.config));
|
|
780
|
+
this.middlewareStack.use(client$1.getLoggerPlugin(this.config));
|
|
781
|
+
this.middlewareStack.use(client$1.getRecursionDetectionPlugin(this.config));
|
|
782
|
+
this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
783
|
+
httpAuthSchemeParametersProvider: defaultSTSHttpAuthSchemeParametersProvider,
|
|
784
|
+
identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
|
|
785
|
+
"aws.auth#sigv4": config.credentials,
|
|
786
|
+
"aws.auth#sigv4a": config.credentials,
|
|
787
|
+
}),
|
|
788
|
+
}));
|
|
789
|
+
this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
|
|
790
|
+
}
|
|
791
|
+
destroy() {
|
|
792
|
+
super.destroy();
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
class AssumeRoleCommand extends client.Command
|
|
797
|
+
.classBuilder()
|
|
798
|
+
.ep(commonParams)
|
|
799
|
+
.m(function (Command, cs, config, o) {
|
|
800
|
+
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
801
|
+
})
|
|
802
|
+
.s("AWSSecurityTokenServiceV20110615", "AssumeRole", {})
|
|
803
|
+
.n("STSClient", "AssumeRoleCommand")
|
|
804
|
+
.sc(AssumeRole$)
|
|
805
|
+
.build() {
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
class AssumeRoleWithWebIdentityCommand extends client.Command
|
|
809
|
+
.classBuilder()
|
|
810
|
+
.ep(commonParams)
|
|
811
|
+
.m(function (Command, cs, config, o) {
|
|
812
|
+
return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
813
|
+
})
|
|
814
|
+
.s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {})
|
|
815
|
+
.n("STSClient", "AssumeRoleWithWebIdentityCommand")
|
|
816
|
+
.sc(AssumeRoleWithWebIdentity$)
|
|
817
|
+
.build() {
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
const commands = {
|
|
821
|
+
AssumeRoleCommand,
|
|
822
|
+
AssumeRoleWithWebIdentityCommand,
|
|
823
|
+
};
|
|
824
|
+
class STS extends STSClient {
|
|
825
|
+
}
|
|
826
|
+
client.createAggregatedClient(commands, STS);
|
|
827
|
+
|
|
828
|
+
const getAccountIdFromAssumedRoleUser = (assumedRoleUser) => {
|
|
829
|
+
if (typeof assumedRoleUser?.Arn === "string") {
|
|
830
|
+
const arnComponents = assumedRoleUser.Arn.split(":");
|
|
831
|
+
if (arnComponents.length > 4 && arnComponents[4] !== "") {
|
|
832
|
+
return arnComponents[4];
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
return undefined;
|
|
836
|
+
};
|
|
837
|
+
const resolveRegion = async (_region, _parentRegion, credentialProviderLogger, loaderConfig = {}) => {
|
|
838
|
+
const region = typeof _region === "function" ? await _region() : _region;
|
|
839
|
+
const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion;
|
|
840
|
+
let stsDefaultRegion = "";
|
|
841
|
+
const resolvedRegion = region ?? parentRegion ?? (stsDefaultRegion = await client$1.stsRegionDefaultResolver(loaderConfig)());
|
|
842
|
+
credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (credential provider clientConfig)`, `${parentRegion} (contextual client)`, `${stsDefaultRegion} (STS default: AWS_REGION, profile region, or us-east-1)`);
|
|
843
|
+
return resolvedRegion;
|
|
844
|
+
};
|
|
845
|
+
const getDefaultRoleAssumer$1 = (stsOptions, STSClient) => {
|
|
846
|
+
let stsClient;
|
|
847
|
+
let closureSourceCreds;
|
|
848
|
+
return async (sourceCreds, params) => {
|
|
849
|
+
closureSourceCreds = sourceCreds;
|
|
850
|
+
if (!stsClient) {
|
|
851
|
+
const { logger = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId, } = stsOptions;
|
|
852
|
+
const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, {
|
|
853
|
+
logger,
|
|
854
|
+
profile,
|
|
855
|
+
});
|
|
856
|
+
const isCompatibleRequestHandler = !isH2(requestHandler);
|
|
857
|
+
stsClient = new STSClient({
|
|
858
|
+
...stsOptions,
|
|
859
|
+
userAgentAppId,
|
|
860
|
+
profile,
|
|
861
|
+
credentialDefaultProvider: () => async () => closureSourceCreds,
|
|
862
|
+
region: resolvedRegion,
|
|
863
|
+
requestHandler: isCompatibleRequestHandler ? requestHandler : undefined,
|
|
864
|
+
logger: logger,
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleCommand(params));
|
|
868
|
+
if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
|
|
869
|
+
throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);
|
|
870
|
+
}
|
|
871
|
+
const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);
|
|
872
|
+
const credentials = {
|
|
873
|
+
accessKeyId: Credentials.AccessKeyId,
|
|
874
|
+
secretAccessKey: Credentials.SecretAccessKey,
|
|
875
|
+
sessionToken: Credentials.SessionToken,
|
|
876
|
+
expiration: Credentials.Expiration,
|
|
877
|
+
...(Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }),
|
|
878
|
+
...(accountId && { accountId }),
|
|
879
|
+
};
|
|
880
|
+
client$1.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i");
|
|
881
|
+
return credentials;
|
|
882
|
+
};
|
|
883
|
+
};
|
|
884
|
+
const getDefaultRoleAssumerWithWebIdentity$1 = (stsOptions, STSClient) => {
|
|
885
|
+
let stsClient;
|
|
886
|
+
return async (params) => {
|
|
887
|
+
if (!stsClient) {
|
|
888
|
+
const { logger = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId, } = stsOptions;
|
|
889
|
+
const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, {
|
|
890
|
+
logger,
|
|
891
|
+
profile,
|
|
892
|
+
});
|
|
893
|
+
const isCompatibleRequestHandler = !isH2(requestHandler);
|
|
894
|
+
stsClient = new STSClient({
|
|
895
|
+
...stsOptions,
|
|
896
|
+
userAgentAppId,
|
|
897
|
+
profile,
|
|
898
|
+
region: resolvedRegion,
|
|
899
|
+
requestHandler: isCompatibleRequestHandler ? requestHandler : undefined,
|
|
900
|
+
logger: logger,
|
|
901
|
+
});
|
|
902
|
+
}
|
|
903
|
+
const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
|
|
904
|
+
if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
|
|
905
|
+
throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);
|
|
906
|
+
}
|
|
907
|
+
const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);
|
|
908
|
+
const credentials = {
|
|
909
|
+
accessKeyId: Credentials.AccessKeyId,
|
|
910
|
+
secretAccessKey: Credentials.SecretAccessKey,
|
|
911
|
+
sessionToken: Credentials.SessionToken,
|
|
912
|
+
expiration: Credentials.Expiration,
|
|
913
|
+
...(Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }),
|
|
914
|
+
...(accountId && { accountId }),
|
|
915
|
+
};
|
|
916
|
+
if (accountId) {
|
|
917
|
+
client$1.setCredentialFeature(credentials, "RESOLVED_ACCOUNT_ID", "T");
|
|
918
|
+
}
|
|
919
|
+
client$1.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k");
|
|
920
|
+
return credentials;
|
|
921
|
+
};
|
|
922
|
+
};
|
|
923
|
+
const isH2 = (requestHandler) => {
|
|
924
|
+
return requestHandler?.metadata?.handlerProtocol === "h2";
|
|
925
|
+
};
|
|
926
|
+
|
|
927
|
+
const getCustomizableStsClientCtor = (baseCtor, customizations) => {
|
|
928
|
+
if (!customizations)
|
|
929
|
+
return baseCtor;
|
|
930
|
+
else
|
|
931
|
+
return class CustomizableSTSClient extends baseCtor {
|
|
932
|
+
constructor(config) {
|
|
933
|
+
super(config);
|
|
934
|
+
for (const customization of customizations) {
|
|
935
|
+
this.middlewareStack.use(customization);
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
};
|
|
939
|
+
};
|
|
940
|
+
const getDefaultRoleAssumer = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumer$1(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins));
|
|
941
|
+
const getDefaultRoleAssumerWithWebIdentity = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity$1(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins));
|
|
942
|
+
const decorateDefaultCredentialProvider = (provider) => (input) => provider({
|
|
943
|
+
roleAssumer: getDefaultRoleAssumer(input),
|
|
944
|
+
roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input),
|
|
945
|
+
...input,
|
|
946
|
+
});
|
|
947
|
+
|
|
948
|
+
__webpack_unused_export__ = client.Command;
|
|
949
|
+
__webpack_unused_export__ = client.Client;
|
|
950
|
+
__webpack_unused_export__ = AssumeRole$;
|
|
951
|
+
__webpack_unused_export__ = AssumeRoleCommand;
|
|
952
|
+
__webpack_unused_export__ = AssumeRoleRequest$;
|
|
953
|
+
__webpack_unused_export__ = AssumeRoleResponse$;
|
|
954
|
+
__webpack_unused_export__ = AssumeRoleWithWebIdentity$;
|
|
955
|
+
__webpack_unused_export__ = AssumeRoleWithWebIdentityCommand;
|
|
956
|
+
__webpack_unused_export__ = AssumeRoleWithWebIdentityRequest$;
|
|
957
|
+
__webpack_unused_export__ = AssumeRoleWithWebIdentityResponse$;
|
|
958
|
+
__webpack_unused_export__ = AssumedRoleUser$;
|
|
959
|
+
__webpack_unused_export__ = Credentials$;
|
|
960
|
+
__webpack_unused_export__ = ExpiredTokenException;
|
|
961
|
+
__webpack_unused_export__ = ExpiredTokenException$;
|
|
962
|
+
__webpack_unused_export__ = IDPCommunicationErrorException;
|
|
963
|
+
__webpack_unused_export__ = IDPCommunicationErrorException$;
|
|
964
|
+
__webpack_unused_export__ = IDPRejectedClaimException;
|
|
965
|
+
__webpack_unused_export__ = IDPRejectedClaimException$;
|
|
966
|
+
__webpack_unused_export__ = InvalidIdentityTokenException;
|
|
967
|
+
__webpack_unused_export__ = InvalidIdentityTokenException$;
|
|
968
|
+
__webpack_unused_export__ = MalformedPolicyDocumentException;
|
|
969
|
+
__webpack_unused_export__ = MalformedPolicyDocumentException$;
|
|
970
|
+
__webpack_unused_export__ = PackedPolicyTooLargeException;
|
|
971
|
+
__webpack_unused_export__ = PackedPolicyTooLargeException$;
|
|
972
|
+
__webpack_unused_export__ = PolicyDescriptorType$;
|
|
973
|
+
__webpack_unused_export__ = ProvidedContext$;
|
|
974
|
+
__webpack_unused_export__ = RegionDisabledException;
|
|
975
|
+
__webpack_unused_export__ = RegionDisabledException$;
|
|
976
|
+
__webpack_unused_export__ = STS;
|
|
977
|
+
__webpack_unused_export__ = STSClient;
|
|
978
|
+
__webpack_unused_export__ = STSServiceException;
|
|
979
|
+
__webpack_unused_export__ = STSServiceException$;
|
|
980
|
+
__webpack_unused_export__ = Tag$;
|
|
981
|
+
__webpack_unused_export__ = decorateDefaultCredentialProvider;
|
|
982
|
+
__webpack_unused_export__ = errorTypeRegistries;
|
|
983
|
+
exports.getDefaultRoleAssumer = getDefaultRoleAssumer;
|
|
984
|
+
exports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity;
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
/***/ })
|
|
988
|
+
|
|
989
|
+
};
|
|
990
|
+
;
|