@karmaniverous/get-dotenv 7.0.0 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AwsRestJsonProtocol-DeiE3wkO.mjs → AwsRestJsonProtocol-Bh3OvjNM.mjs} +158 -81
- package/dist/chunks/{createCli-B9-MIwWj.mjs → createCli-wmAcTdWR.mjs} +4 -4
- package/dist/chunks/{externalDataInterceptor-gi2RH4ez.mjs → externalDataInterceptor-BBvsYwZE.mjs} +2 -2
- package/dist/chunks/{getSSOTokenFromFile-BfAhZf_d.mjs → getSSOTokenFromFile-BSeYpbLi.mjs} +4 -4
- package/dist/chunks/{index-98yxYe1W.mjs → index-BZrYAvLs.mjs} +281 -205
- package/dist/chunks/{index-CAtxK29A.mjs → index-BhMXFr37.mjs} +12 -9
- package/dist/chunks/{index-DY7wYcXW.mjs → index-C-9h7h7x.mjs} +14 -17
- package/dist/chunks/{index-AssUn9IY.mjs → index-CGG9e0xu.mjs} +11157 -8059
- package/dist/chunks/{index-CMSCF_uw.mjs → index-CQoEnkSc.mjs} +493 -254
- package/dist/chunks/{index-xRi3oKvY.mjs → index-CnnI9zSQ.mjs} +10 -12
- package/dist/chunks/{index-D8S1lJ24.mjs → index-DLciMnJ6.mjs} +271 -181
- package/dist/chunks/{index-B6r8O7PJ.mjs → index-DmynYewb.mjs} +14 -17
- package/dist/chunks/{index-C21RHLO4.mjs → index-DyRIwYWf.mjs} +33 -18
- package/dist/chunks/{index-mPj0Vhpw.mjs → index-GcL_Hrrr.mjs} +13 -15
- package/dist/chunks/{index-DfvhftMN.mjs → index-aUz_8rS_.mjs} +29 -28
- package/dist/chunks/index-cIL2r09o.mjs +31 -0
- package/dist/chunks/{index-Ccay5Db0.mjs → index-tlD9zcww.mjs} +16 -19
- package/dist/chunks/{loadSso-C-y9gQEz.mjs → loadSso-9hx2nl0k.mjs} +242 -180
- package/dist/chunks/{package-DiDNabNr.mjs → package-DbbYaehr.mjs} +1 -1
- package/dist/chunks/{parseKnownFiles-KczcjlE0.mjs → parseKnownFiles-CewXrtbo.mjs} +1 -1
- package/dist/chunks/{readDotenvCascade-HLU7FsEQ.mjs → readDotenvCascade-Dgx4SC1p.mjs} +3 -7
- package/dist/chunks/{readMergedOptions-D6niy_Ep.mjs → readMergedOptions-atT1xkoe.mjs} +5 -3
- package/dist/chunks/{resolveCliOptions-PWF1aEM9.mjs → resolveCliOptions-BLSqCGm7.mjs} +1 -1
- package/dist/chunks/{sdk-stream-mixin-blFikF4G.mjs → sdk-stream-mixin-CMdQ7nO8.mjs} +145 -5
- package/dist/chunks/{spawnEnv-5kdIVv0x.mjs → spawnEnv-CKgnHGpr.mjs} +5 -5
- package/dist/chunks/{types-Bp3u5-IH.mjs → types-BdKCfPRW.mjs} +1 -1
- package/dist/cli.mjs +12 -14
- package/dist/cliHost.mjs +5 -5
- package/dist/env-overlay.mjs +2 -2
- package/dist/getdotenv.cli.mjs +12 -14
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +16 -18
- package/dist/plugins-aws.mjs +3 -3
- package/dist/plugins-batch.mjs +3 -3
- package/dist/plugins-cmd.mjs +5 -5
- package/dist/plugins-init.mjs +4 -4
- package/dist/plugins.mjs +11 -13
- package/package.json +1 -1
- package/dist/chunks/index-DtdHVcXz.mjs +0 -27
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { p as packageInfo } from './package-
|
|
3
|
-
import '
|
|
1
|
+
import { ar as loadConfig, q as NODE_REGION_CONFIG_FILE_OPTIONS, r as NODE_REGION_CONFIG_OPTIONS, B as BinaryDecisionDiagram, l as EndpointCache, $ as decideEndpoint, Q as awsEndpointFunctions, Z as customEndpointFunctions, aE as resolveAwsSdkSigV4Config, aD as resolveAwsSdkSigV4AConfig, au as normalizeProvider, ap as getSmithyContext, aK as resolveParams, O as SignatureV4MultiRegion, M as ServiceException, T as TypeRegistry, aT as toUtf8, a8 as fromUtf8, aA as parseUrl, A as AwsQueryProtocol, x as NoOpLogger, b as AwsSdkSigV4Signer, a as AwsSdkSigV4ASigner, w as NoAuthSigner, aR as toBase64, a6 as fromBase64, a1 as emitWarningIfUnsupportedVersion, aG as resolveDefaultsModeConfig, a2 as emitWarningIfUnsupportedVersion$1, aQ as streamCollector, V as calculateBodyLength, N as NODE_APP_ID_CONFIG_OPTIONS, v as NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, u as NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, t as NODE_SIGV4A_CONFIG_OPTIONS, H as Hash, s as NODE_RETRY_MODE_CONFIG_OPTIONS, D as DEFAULT_RETRY_MODE, y as NodeHttpHandler, p as NODE_MAX_ATTEMPT_CONFIG_OPTIONS, Y as createDefaultUserAgentProvider, o as NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, as as loadConfigsForDefaultMode, aa as getAwsRegionExtensionConfiguration, ad as getDefaultExtensionConfiguration, ai as getHttpHandlerExtensionConfiguration, aC as resolveAwsRegionExtensionConfiguration, aF as resolveDefaultRuntimeConfig, aJ as resolveHttpHandlerRuntimeConfig, c as Client, aN as resolveUserAgentConfig, aM as resolveRetryConfig, aL as resolveRegionConfig, aH as resolveEndpointConfig, ao as getSchemaSerdePlugin, aq as getUserAgentPlugin, an as getRetryPlugin, ac as getContentLengthPlugin, ag as getHostHeaderPlugin, ak as getLoggerPlugin, am as getRecursionDetectionPlugin, ah as getHttpAuthSchemeEndpointRuleSetPlugin, f as DefaultIdentityProviderConfig, aj as getHttpSigningPlugin, aI as resolveHostHeaderConfig, d as Command, ae as getEndpointPlugin, aO as setCredentialFeature } from './index-CGG9e0xu.mjs';
|
|
2
|
+
import { p as packageInfo } from './package-DbbYaehr.mjs';
|
|
3
|
+
import 'node:crypto';
|
|
4
|
+
import './readMergedOptions-atT1xkoe.mjs';
|
|
4
5
|
import 'zod';
|
|
5
6
|
import '@commander-js/extra-typings';
|
|
6
|
-
import './readDotenvCascade-
|
|
7
|
+
import './readDotenvCascade-Dgx4SC1p.mjs';
|
|
7
8
|
import 'fs-extra';
|
|
8
9
|
import 'radash';
|
|
9
10
|
import 'node:buffer';
|
|
@@ -18,14 +19,12 @@ import './loader-CE4HSRN4.mjs';
|
|
|
18
19
|
import 'package-directory';
|
|
19
20
|
import 'yaml';
|
|
20
21
|
import 'execa';
|
|
21
|
-
import '
|
|
22
|
-
import 'os';
|
|
22
|
+
import 'node:os';
|
|
23
23
|
import 'node:fs/promises';
|
|
24
|
-
import '
|
|
25
|
-
import 'https';
|
|
26
|
-
import 'stream';
|
|
27
|
-
import 'process';
|
|
24
|
+
import 'node:stream';
|
|
28
25
|
import 'node:fs';
|
|
26
|
+
import 'node:https';
|
|
27
|
+
import 'node:process';
|
|
29
28
|
|
|
30
29
|
function stsRegionDefaultResolver(loaderConfig = {}) {
|
|
31
30
|
return loadConfig({
|
|
@@ -39,7 +38,179 @@ function stsRegionDefaultResolver(loaderConfig = {}) {
|
|
|
39
38
|
}, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig });
|
|
40
39
|
}
|
|
41
40
|
|
|
42
|
-
const
|
|
41
|
+
const q = "ref";
|
|
42
|
+
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];
|
|
43
|
+
const _data = {
|
|
44
|
+
conditions: [
|
|
45
|
+
[c, [l]],
|
|
46
|
+
[c, p],
|
|
47
|
+
["aws.partition", p, d],
|
|
48
|
+
[e, [{ [q]: "UseFIPS" }, b]],
|
|
49
|
+
[e, [{ [q]: "UseDualStack" }, b]],
|
|
50
|
+
[f, [m, "aws-global"]],
|
|
51
|
+
[e, [{ [q]: "UseGlobalEndpoint" }, b]],
|
|
52
|
+
[f, [m, "eu-central-1"]],
|
|
53
|
+
[e, [{ fn: g, argv: [n, "supportsDualStack"] }, b]],
|
|
54
|
+
[e, [{ fn: g, argv: [n, "supportsFIPS"] }, b]],
|
|
55
|
+
[f, [m, "ap-south-1"]],
|
|
56
|
+
[f, [m, "eu-north-1"]],
|
|
57
|
+
[f, [m, "eu-west-1"]],
|
|
58
|
+
[f, [m, "eu-west-2"]],
|
|
59
|
+
[f, [m, "eu-west-3"]],
|
|
60
|
+
[f, [m, "sa-east-1"]],
|
|
61
|
+
[f, [m, h]],
|
|
62
|
+
[f, [m, "us-east-2"]],
|
|
63
|
+
[f, [m, "us-west-2"]],
|
|
64
|
+
[f, [m, "us-west-1"]],
|
|
65
|
+
[f, [m, "ca-central-1"]],
|
|
66
|
+
[f, [m, "ap-southeast-1"]],
|
|
67
|
+
[f, [m, "ap-northeast-1"]],
|
|
68
|
+
[f, [m, "ap-southeast-2"]],
|
|
69
|
+
[f, [{ fn: g, argv: [n, "name"] }, "aws-us-gov"]],
|
|
70
|
+
],
|
|
71
|
+
results: [
|
|
72
|
+
[a],
|
|
73
|
+
["https://sts.amazonaws.com", { authSchemes: [{ name: i, signingName: j, signingRegion: h }] }],
|
|
74
|
+
[k, { authSchemes: [{ name: i, signingName: j, signingRegion: "{Region}" }] }],
|
|
75
|
+
[a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
|
|
76
|
+
[a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
|
|
77
|
+
[l, o],
|
|
78
|
+
["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", o],
|
|
79
|
+
[a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
|
|
80
|
+
["https://sts.{Region}.amazonaws.com", o],
|
|
81
|
+
["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", o],
|
|
82
|
+
[a, "FIPS is enabled but this partition does not support FIPS"],
|
|
83
|
+
["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", o],
|
|
84
|
+
[a, "DualStack is enabled but this partition does not support DualStack"],
|
|
85
|
+
[k, o],
|
|
86
|
+
[a, "Invalid Configuration: Missing Region"],
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
const root = 2;
|
|
90
|
+
const r = 100_000_000;
|
|
91
|
+
const nodes = new Int32Array([
|
|
92
|
+
-1,
|
|
93
|
+
1,
|
|
94
|
+
-1,
|
|
95
|
+
0,
|
|
96
|
+
30,
|
|
97
|
+
3,
|
|
98
|
+
1,
|
|
99
|
+
4,
|
|
100
|
+
r + 14,
|
|
101
|
+
2,
|
|
102
|
+
5,
|
|
103
|
+
r + 14,
|
|
104
|
+
3,
|
|
105
|
+
25,
|
|
106
|
+
6,
|
|
107
|
+
4,
|
|
108
|
+
24,
|
|
109
|
+
7,
|
|
110
|
+
5,
|
|
111
|
+
r + 1,
|
|
112
|
+
8,
|
|
113
|
+
6,
|
|
114
|
+
9,
|
|
115
|
+
r + 13,
|
|
116
|
+
7,
|
|
117
|
+
r + 1,
|
|
118
|
+
10,
|
|
119
|
+
10,
|
|
120
|
+
r + 1,
|
|
121
|
+
11,
|
|
122
|
+
11,
|
|
123
|
+
r + 1,
|
|
124
|
+
12,
|
|
125
|
+
12,
|
|
126
|
+
r + 1,
|
|
127
|
+
13,
|
|
128
|
+
13,
|
|
129
|
+
r + 1,
|
|
130
|
+
14,
|
|
131
|
+
14,
|
|
132
|
+
r + 1,
|
|
133
|
+
15,
|
|
134
|
+
15,
|
|
135
|
+
r + 1,
|
|
136
|
+
16,
|
|
137
|
+
16,
|
|
138
|
+
r + 1,
|
|
139
|
+
17,
|
|
140
|
+
17,
|
|
141
|
+
r + 1,
|
|
142
|
+
18,
|
|
143
|
+
18,
|
|
144
|
+
r + 1,
|
|
145
|
+
19,
|
|
146
|
+
19,
|
|
147
|
+
r + 1,
|
|
148
|
+
20,
|
|
149
|
+
20,
|
|
150
|
+
r + 1,
|
|
151
|
+
21,
|
|
152
|
+
21,
|
|
153
|
+
r + 1,
|
|
154
|
+
22,
|
|
155
|
+
22,
|
|
156
|
+
r + 1,
|
|
157
|
+
23,
|
|
158
|
+
23,
|
|
159
|
+
r + 1,
|
|
160
|
+
r + 2,
|
|
161
|
+
8,
|
|
162
|
+
r + 11,
|
|
163
|
+
r + 12,
|
|
164
|
+
4,
|
|
165
|
+
28,
|
|
166
|
+
26,
|
|
167
|
+
9,
|
|
168
|
+
27,
|
|
169
|
+
r + 10,
|
|
170
|
+
24,
|
|
171
|
+
r + 8,
|
|
172
|
+
r + 9,
|
|
173
|
+
8,
|
|
174
|
+
29,
|
|
175
|
+
r + 7,
|
|
176
|
+
9,
|
|
177
|
+
r + 6,
|
|
178
|
+
r + 7,
|
|
179
|
+
3,
|
|
180
|
+
r + 3,
|
|
181
|
+
31,
|
|
182
|
+
4,
|
|
183
|
+
r + 4,
|
|
184
|
+
r + 5,
|
|
185
|
+
]);
|
|
186
|
+
const bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
|
|
187
|
+
|
|
188
|
+
const cache = new EndpointCache({
|
|
189
|
+
size: 50,
|
|
190
|
+
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"],
|
|
191
|
+
});
|
|
192
|
+
const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
193
|
+
return cache.get(endpointParams, () => decideEndpoint(bdd, {
|
|
194
|
+
endpointParams: endpointParams,
|
|
195
|
+
logger: context.logger,
|
|
196
|
+
}));
|
|
197
|
+
};
|
|
198
|
+
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
199
|
+
|
|
200
|
+
const createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
|
|
201
|
+
if (!input) {
|
|
202
|
+
throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");
|
|
203
|
+
}
|
|
204
|
+
const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
|
|
205
|
+
const instructionsFn = getSmithyContext(context)?.commandInstance?.constructor
|
|
206
|
+
?.getEndpointParameterInstructions;
|
|
207
|
+
if (!instructionsFn) {
|
|
208
|
+
throw new Error(`getEndpointParameterInstructions() is not defined on '${context.commandName}'`);
|
|
209
|
+
}
|
|
210
|
+
const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config);
|
|
211
|
+
return Object.assign(defaultParameters, endpointParameters);
|
|
212
|
+
};
|
|
213
|
+
const _defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
43
214
|
return {
|
|
44
215
|
operation: getSmithyContext(context).operation,
|
|
45
216
|
region: (await normalizeProvider(config.region)()) ||
|
|
@@ -48,6 +219,7 @@ const defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input
|
|
|
48
219
|
})(),
|
|
49
220
|
};
|
|
50
221
|
};
|
|
222
|
+
const defaultSTSHttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultSTSHttpAuthSchemeParametersProvider);
|
|
51
223
|
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
52
224
|
return {
|
|
53
225
|
schemeId: "aws.auth#sigv4",
|
|
@@ -63,30 +235,93 @@ function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
|
63
235
|
}),
|
|
64
236
|
};
|
|
65
237
|
}
|
|
238
|
+
function createAwsAuthSigv4aHttpAuthOption(authParameters) {
|
|
239
|
+
return {
|
|
240
|
+
schemeId: "aws.auth#sigv4a",
|
|
241
|
+
signingProperties: {
|
|
242
|
+
name: "sts",
|
|
243
|
+
region: authParameters.region,
|
|
244
|
+
},
|
|
245
|
+
propertiesExtractor: (config, context) => ({
|
|
246
|
+
signingProperties: {
|
|
247
|
+
config,
|
|
248
|
+
context,
|
|
249
|
+
},
|
|
250
|
+
}),
|
|
251
|
+
};
|
|
252
|
+
}
|
|
66
253
|
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
|
|
67
254
|
return {
|
|
68
255
|
schemeId: "smithy.api#noAuth",
|
|
69
256
|
};
|
|
70
257
|
}
|
|
71
|
-
const
|
|
258
|
+
const createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
|
|
259
|
+
const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
|
|
260
|
+
const endpoint = defaultEndpointResolver(authParameters);
|
|
261
|
+
const authSchemes = endpoint.properties?.authSchemes;
|
|
262
|
+
if (!authSchemes) {
|
|
263
|
+
return defaultHttpAuthSchemeResolver(authParameters);
|
|
264
|
+
}
|
|
265
|
+
const options = [];
|
|
266
|
+
for (const scheme of authSchemes) {
|
|
267
|
+
const { name: resolvedName, properties = {}, ...rest } = scheme;
|
|
268
|
+
const name = resolvedName.toLowerCase();
|
|
269
|
+
if (resolvedName !== name) {
|
|
270
|
+
console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`);
|
|
271
|
+
}
|
|
272
|
+
let schemeId;
|
|
273
|
+
if (name === "sigv4a") {
|
|
274
|
+
schemeId = "aws.auth#sigv4a";
|
|
275
|
+
const sigv4Present = authSchemes.find((s) => {
|
|
276
|
+
const name = s.name.toLowerCase();
|
|
277
|
+
return name !== "sigv4a" && name.startsWith("sigv4");
|
|
278
|
+
});
|
|
279
|
+
if (SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) {
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
else if (name.startsWith("sigv4")) {
|
|
284
|
+
schemeId = "aws.auth#sigv4";
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`);
|
|
288
|
+
}
|
|
289
|
+
const createOption = createHttpAuthOptionFunctions[schemeId];
|
|
290
|
+
if (!createOption) {
|
|
291
|
+
throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`);
|
|
292
|
+
}
|
|
293
|
+
const option = createOption(authParameters);
|
|
294
|
+
option.schemeId = schemeId;
|
|
295
|
+
option.signingProperties = { ...(option.signingProperties || {}), ...rest, ...properties };
|
|
296
|
+
options.push(option);
|
|
297
|
+
}
|
|
298
|
+
return options;
|
|
299
|
+
};
|
|
300
|
+
return endpointRuleSetHttpAuthSchemeProvider;
|
|
301
|
+
};
|
|
302
|
+
const _defaultSTSHttpAuthSchemeProvider = (authParameters) => {
|
|
72
303
|
const options = [];
|
|
73
304
|
switch (authParameters.operation) {
|
|
74
305
|
case "AssumeRoleWithWebIdentity": {
|
|
75
306
|
options.push(createSmithyApiNoAuthHttpAuthOption());
|
|
307
|
+
options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
|
|
76
308
|
break;
|
|
77
309
|
}
|
|
78
310
|
default: {
|
|
79
311
|
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
312
|
+
options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
|
|
80
313
|
}
|
|
81
314
|
}
|
|
82
315
|
return options;
|
|
83
316
|
};
|
|
84
|
-
const
|
|
85
|
-
|
|
317
|
+
const defaultSTSHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultSTSHttpAuthSchemeProvider, {
|
|
318
|
+
"aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
|
|
319
|
+
"aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
|
|
320
|
+
"smithy.api#noAuth": createSmithyApiNoAuthHttpAuthOption,
|
|
86
321
|
});
|
|
87
322
|
const resolveHttpAuthSchemeConfig = (config) => {
|
|
88
|
-
const config_0 =
|
|
89
|
-
const config_1 =
|
|
323
|
+
const config_0 = resolveAwsSdkSigV4Config(config);
|
|
324
|
+
const config_1 = resolveAwsSdkSigV4AConfig(config_0);
|
|
90
325
|
return Object.assign(config_1, {
|
|
91
326
|
authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
|
|
92
327
|
});
|
|
@@ -108,188 +343,6 @@ const commonParams = {
|
|
|
108
343
|
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
109
344
|
};
|
|
110
345
|
|
|
111
|
-
const F = "required", G = "type", H = "fn", I = "argv", J = "ref";
|
|
112
|
-
const a = false, b = true, c = "booleanEquals", d = "stringEquals", e = "sigv4", f = "sts", g = "us-east-1", h = "endpoint", i = "https://sts.{Region}.{PartitionResult#dnsSuffix}", j = "tree", k = "error", l = "getAttr", m = { [F]: false, [G]: "string" }, n = { [F]: true, "default": false, [G]: "boolean" }, o = { [J]: "Endpoint" }, p = { [H]: "isSet", [I]: [{ [J]: "Region" }] }, q = { [J]: "Region" }, r = { [H]: "aws.partition", [I]: [q], "assign": "PartitionResult" }, s = { [J]: "UseFIPS" }, t = { [J]: "UseDualStack" }, u = { "url": "https://sts.amazonaws.com", "properties": { "authSchemes": [{ "name": e, "signingName": f, "signingRegion": g }] }, "headers": {} }, v = {}, w = { "conditions": [{ [H]: d, [I]: [q, "aws-global"] }], [h]: u, [G]: h }, x = { [H]: c, [I]: [s, true] }, y = { [H]: c, [I]: [t, true] }, z = { [H]: l, [I]: [{ [J]: "PartitionResult" }, "supportsFIPS"] }, A = { [J]: "PartitionResult" }, B = { [H]: c, [I]: [true, { [H]: l, [I]: [A, "supportsDualStack"] }] }, C = [{ [H]: "isSet", [I]: [o] }], D = [x], E = [y];
|
|
113
|
-
const _data = { parameters: { Region: m, UseDualStack: n, UseFIPS: n, Endpoint: m, UseGlobalEndpoint: n }, rules: [{ conditions: [{ [H]: c, [I]: [{ [J]: "UseGlobalEndpoint" }, b] }, { [H]: "not", [I]: C }, p, r, { [H]: c, [I]: [s, a] }, { [H]: c, [I]: [t, a] }], rules: [{ conditions: [{ [H]: d, [I]: [q, "ap-northeast-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-south-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-southeast-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "ap-southeast-2"] }], endpoint: u, [G]: h }, w, { conditions: [{ [H]: d, [I]: [q, "ca-central-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-central-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-north-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-2"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "eu-west-3"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "sa-east-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, g] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-east-2"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-west-1"] }], endpoint: u, [G]: h }, { conditions: [{ [H]: d, [I]: [q, "us-west-2"] }], endpoint: u, [G]: h }, { endpoint: { url: i, properties: { authSchemes: [{ name: e, signingName: f, signingRegion: "{Region}" }] }, headers: v }, [G]: h }], [G]: j }, { conditions: C, rules: [{ conditions: D, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G]: k }, { conditions: E, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G]: k }, { endpoint: { url: o, properties: v, headers: v }, [G]: h }], [G]: j }, { conditions: [p], rules: [{ conditions: [r], rules: [{ conditions: [x, y], rules: [{ conditions: [{ [H]: c, [I]: [b, z] }, B], rules: [{ endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G]: k }], [G]: j }, { conditions: D, rules: [{ conditions: [{ [H]: c, [I]: [z, b] }], rules: [{ conditions: [{ [H]: d, [I]: [{ [H]: l, [I]: [A, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v, headers: v }, [G]: h }, { endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "FIPS is enabled but this partition does not support FIPS", [G]: k }], [G]: j }, { conditions: E, rules: [{ conditions: [B], rules: [{ endpoint: { url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v, headers: v }, [G]: h }], [G]: j }, { error: "DualStack is enabled but this partition does not support DualStack", [G]: k }], [G]: j }, w, { endpoint: { url: i, properties: v, headers: v }, [G]: h }], [G]: j }], [G]: j }, { error: "Invalid Configuration: Missing Region", [G]: k }] };
|
|
114
|
-
const ruleSet = _data;
|
|
115
|
-
|
|
116
|
-
const cache = new EndpointCache({
|
|
117
|
-
size: 50,
|
|
118
|
-
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"],
|
|
119
|
-
});
|
|
120
|
-
const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
121
|
-
return cache.get(endpointParams, () => resolveEndpoint(ruleSet, {
|
|
122
|
-
endpointParams: endpointParams,
|
|
123
|
-
logger: context.logger,
|
|
124
|
-
}));
|
|
125
|
-
};
|
|
126
|
-
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
127
|
-
|
|
128
|
-
const getRuntimeConfig$1 = (config) => {
|
|
129
|
-
return {
|
|
130
|
-
apiVersion: "2011-06-15",
|
|
131
|
-
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
132
|
-
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
133
|
-
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
134
|
-
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
135
|
-
extensions: config?.extensions ?? [],
|
|
136
|
-
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSTSHttpAuthSchemeProvider,
|
|
137
|
-
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
138
|
-
{
|
|
139
|
-
schemeId: "aws.auth#sigv4",
|
|
140
|
-
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
141
|
-
signer: new AwsSdkSigV4Signer(),
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
schemeId: "smithy.api#noAuth",
|
|
145
|
-
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
146
|
-
signer: new NoAuthSigner(),
|
|
147
|
-
},
|
|
148
|
-
],
|
|
149
|
-
logger: config?.logger ?? new NoOpLogger(),
|
|
150
|
-
protocol: config?.protocol ?? AwsQueryProtocol,
|
|
151
|
-
protocolSettings: config?.protocolSettings ?? {
|
|
152
|
-
defaultNamespace: "com.amazonaws.sts",
|
|
153
|
-
xmlNamespace: "https://sts.amazonaws.com/doc/2011-06-15/",
|
|
154
|
-
version: "2011-06-15",
|
|
155
|
-
serviceTarget: "AWSSecurityTokenServiceV20110615",
|
|
156
|
-
},
|
|
157
|
-
serviceId: config?.serviceId ?? "STS",
|
|
158
|
-
urlParser: config?.urlParser ?? parseUrl,
|
|
159
|
-
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
160
|
-
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
const getRuntimeConfig = (config) => {
|
|
165
|
-
emitWarningIfUnsupportedVersion(process.version);
|
|
166
|
-
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
167
|
-
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
168
|
-
const clientSharedValues = getRuntimeConfig$1(config);
|
|
169
|
-
emitWarningIfUnsupportedVersion$1(process.version);
|
|
170
|
-
const loaderConfig = {
|
|
171
|
-
profile: config?.profile,
|
|
172
|
-
logger: clientSharedValues.logger,
|
|
173
|
-
};
|
|
174
|
-
return {
|
|
175
|
-
...clientSharedValues,
|
|
176
|
-
...config,
|
|
177
|
-
runtime: "node",
|
|
178
|
-
defaultsMode,
|
|
179
|
-
authSchemePreference: config?.authSchemePreference ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
180
|
-
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
181
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
182
|
-
createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
183
|
-
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
184
|
-
{
|
|
185
|
-
schemeId: "aws.auth#sigv4",
|
|
186
|
-
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") ||
|
|
187
|
-
(async (idProps) => await config.credentialDefaultProvider(idProps?.__config || {})()),
|
|
188
|
-
signer: new AwsSdkSigV4Signer(),
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
schemeId: "smithy.api#noAuth",
|
|
192
|
-
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
193
|
-
signer: new NoAuthSigner(),
|
|
194
|
-
},
|
|
195
|
-
],
|
|
196
|
-
maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
197
|
-
region: config?.region ??
|
|
198
|
-
loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
199
|
-
requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
200
|
-
retryMode: config?.retryMode ??
|
|
201
|
-
loadConfig({
|
|
202
|
-
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
203
|
-
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
204
|
-
}, config),
|
|
205
|
-
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
206
|
-
streamCollector: config?.streamCollector ?? streamCollector,
|
|
207
|
-
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
208
|
-
useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
209
|
-
userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
210
|
-
};
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
214
|
-
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
215
|
-
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
216
|
-
let _credentials = runtimeConfig.credentials;
|
|
217
|
-
return {
|
|
218
|
-
setHttpAuthScheme(httpAuthScheme) {
|
|
219
|
-
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
220
|
-
if (index === -1) {
|
|
221
|
-
_httpAuthSchemes.push(httpAuthScheme);
|
|
222
|
-
}
|
|
223
|
-
else {
|
|
224
|
-
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
httpAuthSchemes() {
|
|
228
|
-
return _httpAuthSchemes;
|
|
229
|
-
},
|
|
230
|
-
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
231
|
-
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
232
|
-
},
|
|
233
|
-
httpAuthSchemeProvider() {
|
|
234
|
-
return _httpAuthSchemeProvider;
|
|
235
|
-
},
|
|
236
|
-
setCredentials(credentials) {
|
|
237
|
-
_credentials = credentials;
|
|
238
|
-
},
|
|
239
|
-
credentials() {
|
|
240
|
-
return _credentials;
|
|
241
|
-
},
|
|
242
|
-
};
|
|
243
|
-
};
|
|
244
|
-
const resolveHttpAuthRuntimeConfig = (config) => {
|
|
245
|
-
return {
|
|
246
|
-
httpAuthSchemes: config.httpAuthSchemes(),
|
|
247
|
-
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
248
|
-
credentials: config.credentials(),
|
|
249
|
-
};
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
253
|
-
const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
|
|
254
|
-
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
255
|
-
return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
class STSClient extends Client {
|
|
259
|
-
config;
|
|
260
|
-
constructor(...[configuration]) {
|
|
261
|
-
const _config_0 = getRuntimeConfig(configuration || {});
|
|
262
|
-
super(_config_0);
|
|
263
|
-
this.initConfig = _config_0;
|
|
264
|
-
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
265
|
-
const _config_2 = resolveUserAgentConfig(_config_1);
|
|
266
|
-
const _config_3 = resolveRetryConfig(_config_2);
|
|
267
|
-
const _config_4 = resolveRegionConfig(_config_3);
|
|
268
|
-
const _config_5 = resolveHostHeaderConfig(_config_4);
|
|
269
|
-
const _config_6 = resolveEndpointConfig(_config_5);
|
|
270
|
-
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
|
|
271
|
-
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
272
|
-
this.config = _config_8;
|
|
273
|
-
this.middlewareStack.use(getSchemaSerdePlugin(this.config));
|
|
274
|
-
this.middlewareStack.use(getUserAgentPlugin(this.config));
|
|
275
|
-
this.middlewareStack.use(getRetryPlugin(this.config));
|
|
276
|
-
this.middlewareStack.use(getContentLengthPlugin(this.config));
|
|
277
|
-
this.middlewareStack.use(getHostHeaderPlugin(this.config));
|
|
278
|
-
this.middlewareStack.use(getLoggerPlugin(this.config));
|
|
279
|
-
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
|
|
280
|
-
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
281
|
-
httpAuthSchemeParametersProvider: defaultSTSHttpAuthSchemeParametersProvider,
|
|
282
|
-
identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
|
|
283
|
-
"aws.auth#sigv4": config.credentials,
|
|
284
|
-
}),
|
|
285
|
-
}));
|
|
286
|
-
this.middlewareStack.use(getHttpSigningPlugin(this.config));
|
|
287
|
-
}
|
|
288
|
-
destroy() {
|
|
289
|
-
super.destroy();
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
346
|
class STSServiceException extends ServiceException {
|
|
294
347
|
constructor(options) {
|
|
295
348
|
super(options);
|
|
@@ -372,6 +425,7 @@ class InvalidIdentityTokenException extends STSServiceException {
|
|
|
372
425
|
class IDPCommunicationErrorException extends STSServiceException {
|
|
373
426
|
name = "IDPCommunicationErrorException";
|
|
374
427
|
$fault = "client";
|
|
428
|
+
$retryable = {};
|
|
375
429
|
constructor(opts) {
|
|
376
430
|
super({
|
|
377
431
|
name: "IDPCommunicationErrorException",
|
|
@@ -441,49 +495,10 @@ const _pDLT = "policyDescriptorListType";
|
|
|
441
495
|
const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sts";
|
|
442
496
|
const _tLT = "tagListType";
|
|
443
497
|
const n0 = "com.amazonaws.sts";
|
|
444
|
-
|
|
445
|
-
var
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
3,
|
|
449
|
-
n0,
|
|
450
|
-
_ARR,
|
|
451
|
-
0,
|
|
452
|
-
[_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC],
|
|
453
|
-
[0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType],
|
|
454
|
-
];
|
|
455
|
-
var AssumeRoleResponse$ = [
|
|
456
|
-
3,
|
|
457
|
-
n0,
|
|
458
|
-
_ARRs,
|
|
459
|
-
0,
|
|
460
|
-
[_C, _ARU, _PPS, _SI],
|
|
461
|
-
[[() => Credentials$, 0], () => AssumedRoleUser$, 1, 0],
|
|
462
|
-
];
|
|
463
|
-
var AssumeRoleWithWebIdentityRequest$ = [
|
|
464
|
-
3,
|
|
465
|
-
n0,
|
|
466
|
-
_ARWWIR,
|
|
467
|
-
0,
|
|
468
|
-
[_RA, _RSN, _WIT, _PI, _PA, _P, _DS],
|
|
469
|
-
[0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1],
|
|
470
|
-
];
|
|
471
|
-
var AssumeRoleWithWebIdentityResponse$ = [
|
|
472
|
-
3,
|
|
473
|
-
n0,
|
|
474
|
-
_ARWWIRs,
|
|
475
|
-
0,
|
|
476
|
-
[_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI],
|
|
477
|
-
[[() => Credentials$, 0], 0, () => AssumedRoleUser$, 1, 0, 0, 0],
|
|
478
|
-
];
|
|
479
|
-
var Credentials$ = [
|
|
480
|
-
3,
|
|
481
|
-
n0,
|
|
482
|
-
_C,
|
|
483
|
-
0,
|
|
484
|
-
[_AKI, _SAK, _ST, _E],
|
|
485
|
-
[0, [() => accessKeySecretType, 0], 0, 4],
|
|
486
|
-
];
|
|
498
|
+
const _s_registry = TypeRegistry.for(_s);
|
|
499
|
+
var STSServiceException$ = [-3, _s, "STSServiceException", 0, [], []];
|
|
500
|
+
_s_registry.registerError(STSServiceException$, STSServiceException);
|
|
501
|
+
const n0_registry = TypeRegistry.for(n0);
|
|
487
502
|
var ExpiredTokenException$ = [
|
|
488
503
|
-3,
|
|
489
504
|
n0,
|
|
@@ -492,7 +507,7 @@ var ExpiredTokenException$ = [
|
|
|
492
507
|
[_m],
|
|
493
508
|
[0],
|
|
494
509
|
];
|
|
495
|
-
|
|
510
|
+
n0_registry.registerError(ExpiredTokenException$, ExpiredTokenException);
|
|
496
511
|
var IDPCommunicationErrorException$ = [
|
|
497
512
|
-3,
|
|
498
513
|
n0,
|
|
@@ -501,7 +516,7 @@ var IDPCommunicationErrorException$ = [
|
|
|
501
516
|
[_m],
|
|
502
517
|
[0],
|
|
503
518
|
];
|
|
504
|
-
|
|
519
|
+
n0_registry.registerError(IDPCommunicationErrorException$, IDPCommunicationErrorException);
|
|
505
520
|
var IDPRejectedClaimException$ = [
|
|
506
521
|
-3,
|
|
507
522
|
n0,
|
|
@@ -510,7 +525,7 @@ var IDPRejectedClaimException$ = [
|
|
|
510
525
|
[_m],
|
|
511
526
|
[0],
|
|
512
527
|
];
|
|
513
|
-
|
|
528
|
+
n0_registry.registerError(IDPRejectedClaimException$, IDPRejectedClaimException);
|
|
514
529
|
var InvalidIdentityTokenException$ = [
|
|
515
530
|
-3,
|
|
516
531
|
n0,
|
|
@@ -519,7 +534,7 @@ var InvalidIdentityTokenException$ = [
|
|
|
519
534
|
[_m],
|
|
520
535
|
[0],
|
|
521
536
|
];
|
|
522
|
-
|
|
537
|
+
n0_registry.registerError(InvalidIdentityTokenException$, InvalidIdentityTokenException);
|
|
523
538
|
var MalformedPolicyDocumentException$ = [
|
|
524
539
|
-3,
|
|
525
540
|
n0,
|
|
@@ -528,7 +543,7 @@ var MalformedPolicyDocumentException$ = [
|
|
|
528
543
|
[_m],
|
|
529
544
|
[0],
|
|
530
545
|
];
|
|
531
|
-
|
|
546
|
+
n0_registry.registerError(MalformedPolicyDocumentException$, MalformedPolicyDocumentException);
|
|
532
547
|
var PackedPolicyTooLargeException$ = [
|
|
533
548
|
-3,
|
|
534
549
|
n0,
|
|
@@ -537,9 +552,7 @@ var PackedPolicyTooLargeException$ = [
|
|
|
537
552
|
[_m],
|
|
538
553
|
[0],
|
|
539
554
|
];
|
|
540
|
-
|
|
541
|
-
var PolicyDescriptorType$ = [3, n0, _PDT, 0, [_a], [0]];
|
|
542
|
-
var ProvidedContext$ = [3, n0, _PCr, 0, [_PAr, _CA], [0, 0]];
|
|
555
|
+
n0_registry.registerError(PackedPolicyTooLargeException$, PackedPolicyTooLargeException);
|
|
543
556
|
var RegionDisabledException$ = [
|
|
544
557
|
-3,
|
|
545
558
|
n0,
|
|
@@ -548,10 +561,57 @@ var RegionDisabledException$ = [
|
|
|
548
561
|
[_m],
|
|
549
562
|
[0],
|
|
550
563
|
];
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
var
|
|
554
|
-
|
|
564
|
+
n0_registry.registerError(RegionDisabledException$, RegionDisabledException);
|
|
565
|
+
const errorTypeRegistries = [_s_registry, n0_registry];
|
|
566
|
+
var accessKeySecretType = [0, n0, _aKST, 8, 0];
|
|
567
|
+
var clientTokenType = [0, n0, _cTT, 8, 0];
|
|
568
|
+
var AssumedRoleUser$ = [3, n0, _ARU, 0, [_ARI, _A], [0, 0], 2];
|
|
569
|
+
var AssumeRoleRequest$ = [
|
|
570
|
+
3,
|
|
571
|
+
n0,
|
|
572
|
+
_ARR,
|
|
573
|
+
0,
|
|
574
|
+
[_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC],
|
|
575
|
+
[0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType],
|
|
576
|
+
2,
|
|
577
|
+
];
|
|
578
|
+
var AssumeRoleResponse$ = [
|
|
579
|
+
3,
|
|
580
|
+
n0,
|
|
581
|
+
_ARRs,
|
|
582
|
+
0,
|
|
583
|
+
[_C, _ARU, _PPS, _SI],
|
|
584
|
+
[[() => Credentials$, 0], () => AssumedRoleUser$, 1, 0],
|
|
585
|
+
];
|
|
586
|
+
var AssumeRoleWithWebIdentityRequest$ = [
|
|
587
|
+
3,
|
|
588
|
+
n0,
|
|
589
|
+
_ARWWIR,
|
|
590
|
+
0,
|
|
591
|
+
[_RA, _RSN, _WIT, _PI, _PA, _P, _DS],
|
|
592
|
+
[0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1],
|
|
593
|
+
3,
|
|
594
|
+
];
|
|
595
|
+
var AssumeRoleWithWebIdentityResponse$ = [
|
|
596
|
+
3,
|
|
597
|
+
n0,
|
|
598
|
+
_ARWWIRs,
|
|
599
|
+
0,
|
|
600
|
+
[_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI],
|
|
601
|
+
[[() => Credentials$, 0], 0, () => AssumedRoleUser$, 1, 0, 0, 0],
|
|
602
|
+
];
|
|
603
|
+
var Credentials$ = [
|
|
604
|
+
3,
|
|
605
|
+
n0,
|
|
606
|
+
_C,
|
|
607
|
+
0,
|
|
608
|
+
[_AKI, _SAK, _ST, _E],
|
|
609
|
+
[0, [() => accessKeySecretType, 0], 0, 4],
|
|
610
|
+
4,
|
|
611
|
+
];
|
|
612
|
+
var PolicyDescriptorType$ = [3, n0, _PDT, 0, [_a], [0]];
|
|
613
|
+
var ProvidedContext$ = [3, n0, _PCr, 0, [_PAr, _CA], [0, 0]];
|
|
614
|
+
var Tag$ = [3, n0, _Ta, 0, [_K, _V], [0, 0], 2];
|
|
555
615
|
var policyDescriptorListType = [1, n0, _pDLT, 0, () => PolicyDescriptorType$];
|
|
556
616
|
var ProvidedContextsListType = [1, n0, _PCLT, 0, () => ProvidedContext$];
|
|
557
617
|
var tagListType = [1, n0, _tLT, 0, () => Tag$];
|
|
@@ -565,6 +625,185 @@ var AssumeRoleWithWebIdentity$ = [
|
|
|
565
625
|
() => AssumeRoleWithWebIdentityResponse$,
|
|
566
626
|
];
|
|
567
627
|
|
|
628
|
+
const getRuntimeConfig$1 = (config) => {
|
|
629
|
+
return {
|
|
630
|
+
apiVersion: "2011-06-15",
|
|
631
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
632
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
633
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
634
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
635
|
+
extensions: config?.extensions ?? [],
|
|
636
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSTSHttpAuthSchemeProvider,
|
|
637
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
638
|
+
{
|
|
639
|
+
schemeId: "aws.auth#sigv4",
|
|
640
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
641
|
+
signer: new AwsSdkSigV4Signer(),
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
schemeId: "aws.auth#sigv4a",
|
|
645
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
|
|
646
|
+
signer: new AwsSdkSigV4ASigner(),
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
schemeId: "smithy.api#noAuth",
|
|
650
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
651
|
+
signer: new NoAuthSigner(),
|
|
652
|
+
},
|
|
653
|
+
],
|
|
654
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
655
|
+
protocol: config?.protocol ?? AwsQueryProtocol,
|
|
656
|
+
protocolSettings: config?.protocolSettings ?? {
|
|
657
|
+
defaultNamespace: "com.amazonaws.sts",
|
|
658
|
+
errorTypeRegistries,
|
|
659
|
+
xmlNamespace: "https://sts.amazonaws.com/doc/2011-06-15/",
|
|
660
|
+
version: "2011-06-15",
|
|
661
|
+
serviceTarget: "AWSSecurityTokenServiceV20110615",
|
|
662
|
+
},
|
|
663
|
+
serviceId: config?.serviceId ?? "STS",
|
|
664
|
+
signerConstructor: config?.signerConstructor ?? SignatureV4MultiRegion,
|
|
665
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
666
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
667
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
668
|
+
};
|
|
669
|
+
};
|
|
670
|
+
|
|
671
|
+
const getRuntimeConfig = (config) => {
|
|
672
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
673
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
674
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
675
|
+
const clientSharedValues = getRuntimeConfig$1(config);
|
|
676
|
+
emitWarningIfUnsupportedVersion$1(process.version);
|
|
677
|
+
const loaderConfig = {
|
|
678
|
+
profile: config?.profile,
|
|
679
|
+
logger: clientSharedValues.logger,
|
|
680
|
+
};
|
|
681
|
+
return {
|
|
682
|
+
...clientSharedValues,
|
|
683
|
+
...config,
|
|
684
|
+
runtime: "node",
|
|
685
|
+
defaultsMode,
|
|
686
|
+
authSchemePreference: config?.authSchemePreference ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
687
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
688
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
689
|
+
createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
690
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
691
|
+
{
|
|
692
|
+
schemeId: "aws.auth#sigv4",
|
|
693
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") ||
|
|
694
|
+
(async (idProps) => await config.credentialDefaultProvider(idProps?.__config || {})()),
|
|
695
|
+
signer: new AwsSdkSigV4Signer(),
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
schemeId: "aws.auth#sigv4a",
|
|
699
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
|
|
700
|
+
signer: new AwsSdkSigV4ASigner(),
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
schemeId: "smithy.api#noAuth",
|
|
704
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
705
|
+
signer: new NoAuthSigner(),
|
|
706
|
+
},
|
|
707
|
+
],
|
|
708
|
+
maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
709
|
+
region: config?.region ??
|
|
710
|
+
loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
711
|
+
requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
712
|
+
retryMode: config?.retryMode ??
|
|
713
|
+
loadConfig({
|
|
714
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
715
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
716
|
+
}, config),
|
|
717
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
718
|
+
sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadConfig(NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig),
|
|
719
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
720
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
721
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
722
|
+
userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
723
|
+
};
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
727
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
728
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
729
|
+
let _credentials = runtimeConfig.credentials;
|
|
730
|
+
return {
|
|
731
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
732
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
733
|
+
if (index === -1) {
|
|
734
|
+
_httpAuthSchemes.push(httpAuthScheme);
|
|
735
|
+
}
|
|
736
|
+
else {
|
|
737
|
+
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
httpAuthSchemes() {
|
|
741
|
+
return _httpAuthSchemes;
|
|
742
|
+
},
|
|
743
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
744
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
745
|
+
},
|
|
746
|
+
httpAuthSchemeProvider() {
|
|
747
|
+
return _httpAuthSchemeProvider;
|
|
748
|
+
},
|
|
749
|
+
setCredentials(credentials) {
|
|
750
|
+
_credentials = credentials;
|
|
751
|
+
},
|
|
752
|
+
credentials() {
|
|
753
|
+
return _credentials;
|
|
754
|
+
},
|
|
755
|
+
};
|
|
756
|
+
};
|
|
757
|
+
const resolveHttpAuthRuntimeConfig = (config) => {
|
|
758
|
+
return {
|
|
759
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
760
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
761
|
+
credentials: config.credentials(),
|
|
762
|
+
};
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
766
|
+
const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
|
|
767
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
768
|
+
return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
|
|
769
|
+
};
|
|
770
|
+
|
|
771
|
+
class STSClient extends Client {
|
|
772
|
+
config;
|
|
773
|
+
constructor(...[configuration]) {
|
|
774
|
+
const _config_0 = getRuntimeConfig(configuration || {});
|
|
775
|
+
super(_config_0);
|
|
776
|
+
this.initConfig = _config_0;
|
|
777
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
778
|
+
const _config_2 = resolveUserAgentConfig(_config_1);
|
|
779
|
+
const _config_3 = resolveRetryConfig(_config_2);
|
|
780
|
+
const _config_4 = resolveRegionConfig(_config_3);
|
|
781
|
+
const _config_5 = resolveHostHeaderConfig(_config_4);
|
|
782
|
+
const _config_6 = resolveEndpointConfig(_config_5);
|
|
783
|
+
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
|
|
784
|
+
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
785
|
+
this.config = _config_8;
|
|
786
|
+
this.middlewareStack.use(getSchemaSerdePlugin(this.config));
|
|
787
|
+
this.middlewareStack.use(getUserAgentPlugin(this.config));
|
|
788
|
+
this.middlewareStack.use(getRetryPlugin(this.config));
|
|
789
|
+
this.middlewareStack.use(getContentLengthPlugin(this.config));
|
|
790
|
+
this.middlewareStack.use(getHostHeaderPlugin(this.config));
|
|
791
|
+
this.middlewareStack.use(getLoggerPlugin(this.config));
|
|
792
|
+
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
|
|
793
|
+
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
794
|
+
httpAuthSchemeParametersProvider: defaultSTSHttpAuthSchemeParametersProvider,
|
|
795
|
+
identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
|
|
796
|
+
"aws.auth#sigv4": config.credentials,
|
|
797
|
+
"aws.auth#sigv4a": config.credentials,
|
|
798
|
+
}),
|
|
799
|
+
}));
|
|
800
|
+
this.middlewareStack.use(getHttpSigningPlugin(this.config));
|
|
801
|
+
}
|
|
802
|
+
destroy() {
|
|
803
|
+
super.destroy();
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
|
|
568
807
|
class AssumeRoleCommand extends Command
|
|
569
808
|
.classBuilder()
|
|
570
809
|
.ep(commonParams)
|
|
@@ -704,4 +943,4 @@ const getCustomizableStsClientCtor = (baseCtor, customizations) => {
|
|
|
704
943
|
const getDefaultRoleAssumer = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumer$1(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins));
|
|
705
944
|
const getDefaultRoleAssumerWithWebIdentity = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity$1(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins));
|
|
706
945
|
|
|
707
|
-
export { Command as $Command, AssumeRole$, AssumeRoleCommand, AssumeRoleRequest$, AssumeRoleResponse$, AssumeRoleWithWebIdentity$, AssumeRoleWithWebIdentityCommand, AssumeRoleWithWebIdentityRequest$, AssumeRoleWithWebIdentityResponse$, AssumedRoleUser$, Credentials$, ExpiredTokenException, ExpiredTokenException$, IDPCommunicationErrorException, IDPCommunicationErrorException$, IDPRejectedClaimException, IDPRejectedClaimException$, InvalidIdentityTokenException, InvalidIdentityTokenException$, MalformedPolicyDocumentException, MalformedPolicyDocumentException$, PackedPolicyTooLargeException, PackedPolicyTooLargeException$, PolicyDescriptorType$, ProvidedContext$, RegionDisabledException, RegionDisabledException$, STSClient, STSServiceException, STSServiceException$, Tag$, Client as __Client, getDefaultRoleAssumer, getDefaultRoleAssumerWithWebIdentity };
|
|
946
|
+
export { Command as $Command, AssumeRole$, AssumeRoleCommand, AssumeRoleRequest$, AssumeRoleResponse$, AssumeRoleWithWebIdentity$, AssumeRoleWithWebIdentityCommand, AssumeRoleWithWebIdentityRequest$, AssumeRoleWithWebIdentityResponse$, AssumedRoleUser$, Credentials$, ExpiredTokenException, ExpiredTokenException$, IDPCommunicationErrorException, IDPCommunicationErrorException$, IDPRejectedClaimException, IDPRejectedClaimException$, InvalidIdentityTokenException, InvalidIdentityTokenException$, MalformedPolicyDocumentException, MalformedPolicyDocumentException$, PackedPolicyTooLargeException, PackedPolicyTooLargeException$, PolicyDescriptorType$, ProvidedContext$, RegionDisabledException, RegionDisabledException$, STSClient, STSServiceException, STSServiceException$, Tag$, Client as __Client, errorTypeRegistries, getDefaultRoleAssumer, getDefaultRoleAssumerWithWebIdentity };
|