cdk-cost-analyzer 0.1.50 → 0.1.52

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.
@@ -3,789 +3,242 @@ exports.id = 136;
3
3
  exports.ids = [136];
4
4
  exports.modules = {
5
5
 
6
- /***/ 7445:
6
+ /***/ 1136:
7
7
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8
8
 
9
+ var __webpack_unused_export__;
9
10
 
10
11
 
11
- var protocolHttp = __webpack_require__(2356);
12
- var smithyClient = __webpack_require__(1411);
13
- var toStream = __webpack_require__(2136);
14
- var utilArnParser = __webpack_require__(6369);
15
- var protocols = __webpack_require__(7288);
16
- var schema = __webpack_require__(6890);
17
- var signatureV4 = __webpack_require__(5118);
18
- var utilConfigProvider = __webpack_require__(6716);
19
- var client = __webpack_require__(5152);
12
+ var client$1 = __webpack_require__(5152);
20
13
  var core = __webpack_require__(402);
21
- var utilMiddleware = __webpack_require__(6324);
14
+ var client = __webpack_require__(2658);
15
+ var config = __webpack_require__(7291);
16
+ var endpoints = __webpack_require__(2085);
17
+ var protocols = __webpack_require__(3422);
18
+ var retry = __webpack_require__(3609);
19
+ var schema = __webpack_require__(6890);
20
+ var httpAuthSchemes = __webpack_require__(7523);
21
+ var signatureV4MultiRegion = __webpack_require__(5785);
22
+ var serde = __webpack_require__(2430);
23
+ var nodeHttpHandler = __webpack_require__(1279);
24
+ var protocols$1 = __webpack_require__(7288);
22
25
 
23
- const CONTENT_LENGTH_HEADER = "content-length";
24
- const DECODED_CONTENT_LENGTH_HEADER = "x-amz-decoded-content-length";
25
- function checkContentLengthHeader() {
26
- return (next, context) => async (args) => {
27
- const { request } = args;
28
- if (protocolHttp.HttpRequest.isInstance(request)) {
29
- if (!(CONTENT_LENGTH_HEADER in request.headers) && !(DECODED_CONTENT_LENGTH_HEADER in request.headers)) {
30
- const message = `Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.`;
31
- if (typeof context?.logger?.warn === "function" && !(context.logger instanceof smithyClient.NoOpLogger)) {
32
- context.logger.warn(message);
33
- }
34
- else {
35
- console.warn(message);
36
- }
37
- }
38
- }
39
- return next({ ...args });
40
- };
41
- }
42
- const checkContentLengthHeaderMiddlewareOptions = {
43
- step: "finalizeRequest",
44
- tags: ["CHECK_CONTENT_LENGTH_HEADER"],
45
- name: "getCheckContentLengthHeaderPlugin",
46
- override: true,
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
+ ],
47
73
  };
48
- const getCheckContentLengthHeaderPlugin = (unused) => ({
49
- applyToStack: (clientStack) => {
50
- clientStack.add(checkContentLengthHeader(), checkContentLengthHeaderMiddlewareOptions);
51
- },
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"],
52
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;
53
184
 
54
- const regionRedirectEndpointMiddleware = (config) => {
55
- return (next, context) => async (args) => {
56
- const originalRegion = await config.region();
57
- const regionProviderRef = config.region;
58
- let unlock = () => { };
59
- if (context.__s3RegionRedirect) {
60
- Object.defineProperty(config, "region", {
61
- writable: false,
62
- value: async () => {
63
- return context.__s3RegionRedirect;
64
- },
65
- });
66
- unlock = () => Object.defineProperty(config, "region", {
67
- writable: true,
68
- value: regionProviderRef,
69
- });
70
- }
71
- try {
72
- const result = await next(args);
73
- if (context.__s3RegionRedirect) {
74
- unlock();
75
- const region = await config.region();
76
- if (originalRegion !== region) {
77
- throw new Error("Region was not restored following S3 region redirect.");
78
- }
79
- }
80
- return result;
81
- }
82
- catch (e) {
83
- unlock();
84
- throw e;
85
- }
86
- };
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);
87
197
  };
88
- const regionRedirectEndpointMiddlewareOptions = {
89
- tags: ["REGION_REDIRECT", "S3"],
90
- name: "regionRedirectEndpointMiddleware",
91
- override: true,
92
- relation: "before",
93
- toMiddleware: "endpointV2Middleware",
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
+ };
94
206
  };
95
-
96
- function regionRedirectMiddleware(clientConfig) {
97
- return (next, context) => async (args) => {
98
- try {
99
- return await next(args);
100
- }
101
- catch (err) {
102
- if (clientConfig.followRegionRedirects) {
103
- const statusCode = err?.$metadata?.httpStatusCode;
104
- const isHeadBucket = context.commandName === "HeadBucketCommand";
105
- const bucketRegionHeader = err?.$response?.headers?.["x-amz-bucket-region"];
106
- if (bucketRegionHeader) {
107
- if (statusCode === 301 ||
108
- (statusCode === 400 && (err?.name === "IllegalLocationConstraintException" || isHeadBucket))) {
109
- try {
110
- const actualRegion = bucketRegionHeader;
111
- context.logger?.debug(`Redirecting from ${await clientConfig.region()} to ${actualRegion}`);
112
- context.__s3RegionRedirect = actualRegion;
113
- }
114
- catch (e) {
115
- throw new Error("Region redirect failed: " + e);
116
- }
117
- return next(args);
118
- }
119
- }
120
- }
121
- throw err;
122
- }
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
+ }),
123
221
  };
124
222
  }
125
- const regionRedirectMiddlewareOptions = {
126
- step: "initialize",
127
- tags: ["REGION_REDIRECT", "S3"],
128
- name: "regionRedirectMiddleware",
129
- override: true,
130
- };
131
- const getRegionRedirectMiddlewarePlugin = (clientConfig) => ({
132
- applyToStack: (clientStack) => {
133
- clientStack.add(regionRedirectMiddleware(clientConfig), regionRedirectMiddlewareOptions);
134
- clientStack.addRelativeTo(regionRedirectEndpointMiddleware(clientConfig), regionRedirectEndpointMiddlewareOptions);
135
- },
136
- });
137
-
138
- const s3ExpiresMiddleware = (config) => {
139
- return (next, context) => async (args) => {
140
- const result = await next(args);
141
- const { response } = result;
142
- if (protocolHttp.HttpResponse.isInstance(response)) {
143
- if (response.headers.expires) {
144
- response.headers.expiresstring = response.headers.expires;
145
- try {
146
- smithyClient.parseRfc7231DateTime(response.headers.expires);
147
- }
148
- catch (e) {
149
- context.logger?.warn(`AWS SDK Warning for ${context.clientName}::${context.commandName} response parsing (${response.headers.expires}): ${e}`);
150
- delete response.headers.expires;
151
- }
152
- }
153
- }
154
- return result;
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
+ }),
155
236
  };
156
- };
157
- const s3ExpiresMiddlewareOptions = {
158
- tags: ["S3"],
159
- name: "s3ExpiresMiddleware",
160
- override: true,
161
- relation: "after",
162
- toMiddleware: "deserializerMiddleware",
163
- };
164
- const getS3ExpiresMiddlewarePlugin = (clientConfig) => ({
165
- applyToStack: (clientStack) => {
166
- clientStack.addRelativeTo(s3ExpiresMiddleware(), s3ExpiresMiddlewareOptions);
167
- },
168
- });
169
-
170
- class S3ExpressIdentityCache {
171
- data;
172
- lastPurgeTime = Date.now();
173
- static EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS = 30_000;
174
- constructor(data = {}) {
175
- this.data = data;
176
- }
177
- get(key) {
178
- const entry = this.data[key];
179
- if (!entry) {
180
- return;
181
- }
182
- return entry;
183
- }
184
- set(key, entry) {
185
- this.data[key] = entry;
186
- return entry;
187
- }
188
- delete(key) {
189
- delete this.data[key];
190
- }
191
- async purgeExpired() {
192
- const now = Date.now();
193
- if (this.lastPurgeTime + S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS > now) {
194
- return;
195
- }
196
- for (const key in this.data) {
197
- const entry = this.data[key];
198
- if (!entry.isRefreshing) {
199
- const credential = await entry.identity;
200
- if (credential.expiration) {
201
- if (credential.expiration.getTime() < now) {
202
- delete this.data[key];
203
- }
204
- }
205
- }
206
- }
207
- }
208
237
  }
209
-
210
- class S3ExpressIdentityCacheEntry {
211
- _identity;
212
- isRefreshing;
213
- accessed;
214
- constructor(_identity, isRefreshing = false, accessed = Date.now()) {
215
- this._identity = _identity;
216
- this.isRefreshing = isRefreshing;
217
- this.accessed = accessed;
218
- }
219
- get identity() {
220
- this.accessed = Date.now();
221
- return this._identity;
222
- }
223
- }
224
-
225
- class S3ExpressIdentityProviderImpl {
226
- createSessionFn;
227
- cache;
228
- static REFRESH_WINDOW_MS = 60_000;
229
- constructor(createSessionFn, cache = new S3ExpressIdentityCache()) {
230
- this.createSessionFn = createSessionFn;
231
- this.cache = cache;
232
- }
233
- async getS3ExpressIdentity(awsIdentity, identityProperties) {
234
- const key = identityProperties.Bucket;
235
- const { cache } = this;
236
- const entry = cache.get(key);
237
- if (entry) {
238
- return entry.identity.then((identity) => {
239
- const isExpired = (identity.expiration?.getTime() ?? 0) < Date.now();
240
- if (isExpired) {
241
- return cache.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity;
242
- }
243
- const isExpiringSoon = (identity.expiration?.getTime() ?? 0) < Date.now() + S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS;
244
- if (isExpiringSoon && !entry.isRefreshing) {
245
- entry.isRefreshing = true;
246
- this.getIdentity(key).then((id) => {
247
- cache.set(key, new S3ExpressIdentityCacheEntry(Promise.resolve(id)));
248
- });
249
- }
250
- return identity;
251
- });
252
- }
253
- return cache.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity;
254
- }
255
- async getIdentity(key) {
256
- await this.cache.purgeExpired().catch((error) => {
257
- console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error);
258
- });
259
- const session = await this.createSessionFn(key);
260
- if (!session.Credentials?.AccessKeyId || !session.Credentials?.SecretAccessKey) {
261
- throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");
262
- }
263
- const identity = {
264
- accessKeyId: session.Credentials.AccessKeyId,
265
- secretAccessKey: session.Credentials.SecretAccessKey,
266
- sessionToken: session.Credentials.SessionToken,
267
- expiration: session.Credentials.Expiration ? new Date(session.Credentials.Expiration) : undefined,
268
- };
269
- return identity;
270
- }
271
- }
272
-
273
- const S3_EXPRESS_BUCKET_TYPE = "Directory";
274
- const S3_EXPRESS_BACKEND = "S3Express";
275
- const S3_EXPRESS_AUTH_SCHEME = "sigv4-s3express";
276
- const SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token";
277
- const SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase();
278
- const NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH";
279
- const NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME = "s3_disable_express_session_auth";
280
- const NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = {
281
- environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME, utilConfigProvider.SelectorType.ENV),
282
- configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME, utilConfigProvider.SelectorType.CONFIG),
283
- default: false,
284
- };
285
-
286
- class SignatureV4S3Express extends signatureV4.SignatureV4 {
287
- async signWithCredentials(requestToSign, credentials, options) {
288
- const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
289
- requestToSign.headers[SESSION_TOKEN_HEADER] = credentials.sessionToken;
290
- const privateAccess = this;
291
- setSingleOverride(privateAccess, credentialsWithoutSessionToken);
292
- return privateAccess.signRequest(requestToSign, options ?? {});
293
- }
294
- async presignWithCredentials(requestToSign, credentials, options) {
295
- const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
296
- delete requestToSign.headers[SESSION_TOKEN_HEADER];
297
- requestToSign.headers[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
298
- requestToSign.query = requestToSign.query ?? {};
299
- requestToSign.query[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
300
- const privateAccess = this;
301
- setSingleOverride(privateAccess, credentialsWithoutSessionToken);
302
- return this.presign(requestToSign, options);
303
- }
304
- }
305
- function getCredentialsWithoutSessionToken(credentials) {
306
- const credentialsWithoutSessionToken = {
307
- accessKeyId: credentials.accessKeyId,
308
- secretAccessKey: credentials.secretAccessKey,
309
- expiration: credentials.expiration,
310
- };
311
- return credentialsWithoutSessionToken;
312
- }
313
- function setSingleOverride(privateAccess, credentialsWithoutSessionToken) {
314
- const id = setTimeout(() => {
315
- throw new Error("SignatureV4S3Express credential override was created but not called.");
316
- }, 10);
317
- const currentCredentialProvider = privateAccess.credentialProvider;
318
- const overrideCredentialsProviderOnce = () => {
319
- clearTimeout(id);
320
- privateAccess.credentialProvider = currentCredentialProvider;
321
- return Promise.resolve(credentialsWithoutSessionToken);
322
- };
323
- privateAccess.credentialProvider = overrideCredentialsProviderOnce;
324
- }
325
-
326
- const s3ExpressMiddleware = (options) => {
327
- return (next, context) => async (args) => {
328
- if (context.endpointV2) {
329
- const endpoint = context.endpointV2;
330
- const isS3ExpressAuth = endpoint.properties?.authSchemes?.[0]?.name === S3_EXPRESS_AUTH_SCHEME;
331
- const isS3ExpressBucket = endpoint.properties?.backend === S3_EXPRESS_BACKEND ||
332
- endpoint.properties?.bucketType === S3_EXPRESS_BUCKET_TYPE;
333
- if (isS3ExpressBucket) {
334
- client.setFeature(context, "S3_EXPRESS_BUCKET", "J");
335
- context.isS3ExpressBucket = true;
336
- }
337
- if (isS3ExpressAuth) {
338
- const requestBucket = args.input.Bucket;
339
- if (requestBucket) {
340
- const s3ExpressIdentity = await options.s3ExpressIdentityProvider.getS3ExpressIdentity(await options.credentials(), {
341
- Bucket: requestBucket,
342
- });
343
- context.s3ExpressIdentity = s3ExpressIdentity;
344
- if (protocolHttp.HttpRequest.isInstance(args.request) && s3ExpressIdentity.sessionToken) {
345
- args.request.headers[SESSION_TOKEN_HEADER] = s3ExpressIdentity.sessionToken;
346
- }
347
- }
348
- }
349
- }
350
- return next(args);
351
- };
352
- };
353
- const s3ExpressMiddlewareOptions = {
354
- name: "s3ExpressMiddleware",
355
- step: "build",
356
- tags: ["S3", "S3_EXPRESS"],
357
- override: true,
358
- };
359
- const getS3ExpressPlugin = (options) => ({
360
- applyToStack: (clientStack) => {
361
- clientStack.add(s3ExpressMiddleware(options), s3ExpressMiddlewareOptions);
362
- },
363
- });
364
-
365
- const signS3Express = async (s3ExpressIdentity, signingOptions, request, sigV4MultiRegionSigner) => {
366
- const signedRequest = await sigV4MultiRegionSigner.signWithCredentials(request, s3ExpressIdentity, {});
367
- if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) {
368
- throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");
369
- }
370
- return signedRequest;
371
- };
372
-
373
- const defaultErrorHandler = (signingProperties) => (error) => {
374
- throw error;
375
- };
376
- const defaultSuccessHandler = (httpResponse, signingProperties) => { };
377
- const s3ExpressHttpSigningMiddlewareOptions = core.httpSigningMiddlewareOptions;
378
- const s3ExpressHttpSigningMiddleware = (config) => (next, context) => async (args) => {
379
- if (!protocolHttp.HttpRequest.isInstance(args.request)) {
380
- return next(args);
381
- }
382
- const smithyContext = utilMiddleware.getSmithyContext(context);
383
- const scheme = smithyContext.selectedHttpAuthScheme;
384
- if (!scheme) {
385
- throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
386
- }
387
- const { httpAuthOption: { signingProperties = {} }, identity, signer, } = scheme;
388
- let request;
389
- if (context.s3ExpressIdentity) {
390
- request = await signS3Express(context.s3ExpressIdentity, signingProperties, args.request, await config.signer());
391
- }
392
- else {
393
- request = await signer.sign(args.request, identity, signingProperties);
394
- }
395
- const output = await next({
396
- ...args,
397
- request,
398
- }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
399
- (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
400
- return output;
401
- };
402
- const getS3ExpressHttpSigningPlugin = (config) => ({
403
- applyToStack: (clientStack) => {
404
- clientStack.addRelativeTo(s3ExpressHttpSigningMiddleware(config), core.httpSigningMiddlewareOptions);
405
- },
406
- });
407
-
408
- const resolveS3Config = (input, { session, }) => {
409
- const [s3ClientProvider, CreateSessionCommandCtor] = session;
410
- const { forcePathStyle, useAccelerateEndpoint, disableMultiregionAccessPoints, followRegionRedirects, s3ExpressIdentityProvider, bucketEndpoint, expectContinueHeader, } = input;
411
- return Object.assign(input, {
412
- forcePathStyle: forcePathStyle ?? false,
413
- useAccelerateEndpoint: useAccelerateEndpoint ?? false,
414
- disableMultiregionAccessPoints: disableMultiregionAccessPoints ?? false,
415
- followRegionRedirects: followRegionRedirects ?? false,
416
- s3ExpressIdentityProvider: s3ExpressIdentityProvider ??
417
- new S3ExpressIdentityProviderImpl(async (key) => s3ClientProvider().send(new CreateSessionCommandCtor({
418
- Bucket: key,
419
- }))),
420
- bucketEndpoint: bucketEndpoint ?? false,
421
- expectContinueHeader: expectContinueHeader ?? 2_097_152,
422
- });
423
- };
424
-
425
- const THROW_IF_EMPTY_BODY = {
426
- CopyObjectCommand: true,
427
- UploadPartCopyCommand: true,
428
- CompleteMultipartUploadCommand: true,
429
- };
430
- const throw200ExceptionsMiddleware = (config) => (next, context) => async (args) => {
431
- const result = await next(args);
432
- const { response } = result;
433
- if (!protocolHttp.HttpResponse.isInstance(response)) {
434
- return result;
435
- }
436
- const { statusCode, body } = response;
437
- if (statusCode < 200 || statusCode >= 300) {
438
- return result;
439
- }
440
- const bodyBytes = await collectBody(body, config);
441
- response.body = toStream.toStream(bodyBytes);
442
- if (bodyBytes.length === 0 && THROW_IF_EMPTY_BODY[context.commandName]) {
443
- const err = new Error("S3 aborted request");
444
- err.$metadata = {
445
- httpStatusCode: 503,
446
- };
447
- err.name = "InternalError";
448
- throw err;
449
- }
450
- const bodyStringTail = config.utf8Encoder(bodyBytes.subarray(bodyBytes.length - 16));
451
- if (bodyStringTail && bodyStringTail.endsWith("</Error>")) {
452
- response.statusCode = 503;
453
- }
454
- return result;
455
- };
456
- const collectBody = (streamBody = new Uint8Array(), context) => {
457
- if (streamBody instanceof Uint8Array) {
458
- return Promise.resolve(streamBody);
459
- }
460
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
461
- };
462
- const throw200ExceptionsMiddlewareOptions = {
463
- relation: "after",
464
- toMiddleware: "deserializerMiddleware",
465
- tags: ["THROW_200_EXCEPTIONS", "S3"],
466
- name: "throw200ExceptionsMiddleware",
467
- override: true,
468
- };
469
- const getThrow200ExceptionsPlugin = (config) => ({
470
- applyToStack: (clientStack) => {
471
- clientStack.addRelativeTo(throw200ExceptionsMiddleware(config), throw200ExceptionsMiddlewareOptions);
472
- },
473
- });
474
-
475
- function bucketEndpointMiddleware(options) {
476
- return (next, context) => async (args) => {
477
- if (options.bucketEndpoint) {
478
- const endpoint = context.endpointV2;
479
- if (endpoint) {
480
- const bucket = args.input.Bucket;
481
- if (typeof bucket === "string") {
482
- try {
483
- const bucketEndpointUrl = new URL(bucket);
484
- context.endpointV2 = {
485
- ...endpoint,
486
- url: bucketEndpointUrl,
487
- };
488
- }
489
- catch (e) {
490
- const warning = `@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${bucket} could not be parsed as URL.`;
491
- if (context.logger?.constructor?.name === "NoOpLogger") {
492
- console.warn(warning);
493
- }
494
- else {
495
- context.logger?.warn?.(warning);
496
- }
497
- throw e;
498
- }
499
- }
500
- }
501
- }
502
- return next(args);
503
- };
504
- }
505
- const bucketEndpointMiddlewareOptions = {
506
- name: "bucketEndpointMiddleware",
507
- override: true,
508
- relation: "after",
509
- toMiddleware: "endpointV2Middleware",
510
- };
511
-
512
- function validateBucketNameMiddleware({ bucketEndpoint }) {
513
- return (next) => async (args) => {
514
- const { input: { Bucket }, } = args;
515
- if (!bucketEndpoint && typeof Bucket === "string" && !utilArnParser.validate(Bucket) && Bucket.indexOf("/") >= 0) {
516
- const err = new Error(`Bucket name shouldn't contain '/', received '${Bucket}'`);
517
- err.name = "InvalidBucketName";
518
- throw err;
519
- }
520
- return next({ ...args });
521
- };
522
- }
523
- const validateBucketNameMiddlewareOptions = {
524
- step: "initialize",
525
- tags: ["VALIDATE_BUCKET_NAME"],
526
- name: "validateBucketNameMiddleware",
527
- override: true,
528
- };
529
- const getValidateBucketNamePlugin = (options) => ({
530
- applyToStack: (clientStack) => {
531
- clientStack.add(validateBucketNameMiddleware(options), validateBucketNameMiddlewareOptions);
532
- clientStack.addRelativeTo(bucketEndpointMiddleware(options), bucketEndpointMiddlewareOptions);
533
- },
534
- });
535
-
536
- class S3RestXmlProtocol extends protocols.AwsRestXmlProtocol {
537
- async serializeRequest(operationSchema, input, context) {
538
- const request = await super.serializeRequest(operationSchema, input, context);
539
- const ns = schema.NormalizedSchema.of(operationSchema.input);
540
- const staticStructureSchema = ns.getSchema();
541
- let bucketMemberIndex = 0;
542
- const requiredMemberCount = staticStructureSchema[6] ?? 0;
543
- if (input && typeof input === "object") {
544
- for (const [memberName, memberNs] of ns.structIterator()) {
545
- if (++bucketMemberIndex > requiredMemberCount) {
546
- break;
547
- }
548
- if (memberName === "Bucket") {
549
- if (!input.Bucket && memberNs.getMergedTraits().httpLabel) {
550
- throw new Error(`No value provided for input HTTP label: Bucket.`);
551
- }
552
- break;
553
- }
554
- }
555
- }
556
- return request;
557
- }
558
- }
559
-
560
- exports.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS;
561
- exports.S3ExpressIdentityCache = S3ExpressIdentityCache;
562
- exports.S3ExpressIdentityCacheEntry = S3ExpressIdentityCacheEntry;
563
- exports.S3ExpressIdentityProviderImpl = S3ExpressIdentityProviderImpl;
564
- exports.S3RestXmlProtocol = S3RestXmlProtocol;
565
- exports.SignatureV4S3Express = SignatureV4S3Express;
566
- exports.checkContentLengthHeader = checkContentLengthHeader;
567
- exports.checkContentLengthHeaderMiddlewareOptions = checkContentLengthHeaderMiddlewareOptions;
568
- exports.getCheckContentLengthHeaderPlugin = getCheckContentLengthHeaderPlugin;
569
- exports.getRegionRedirectMiddlewarePlugin = getRegionRedirectMiddlewarePlugin;
570
- exports.getS3ExpiresMiddlewarePlugin = getS3ExpiresMiddlewarePlugin;
571
- exports.getS3ExpressHttpSigningPlugin = getS3ExpressHttpSigningPlugin;
572
- exports.getS3ExpressPlugin = getS3ExpressPlugin;
573
- exports.getThrow200ExceptionsPlugin = getThrow200ExceptionsPlugin;
574
- exports.getValidateBucketNamePlugin = getValidateBucketNamePlugin;
575
- exports.regionRedirectEndpointMiddleware = regionRedirectEndpointMiddleware;
576
- exports.regionRedirectEndpointMiddlewareOptions = regionRedirectEndpointMiddlewareOptions;
577
- exports.regionRedirectMiddleware = regionRedirectMiddleware;
578
- exports.regionRedirectMiddlewareOptions = regionRedirectMiddlewareOptions;
579
- exports.resolveS3Config = resolveS3Config;
580
- exports.s3ExpiresMiddleware = s3ExpiresMiddleware;
581
- exports.s3ExpiresMiddlewareOptions = s3ExpiresMiddlewareOptions;
582
- exports.s3ExpressHttpSigningMiddleware = s3ExpressHttpSigningMiddleware;
583
- exports.s3ExpressHttpSigningMiddlewareOptions = s3ExpressHttpSigningMiddlewareOptions;
584
- exports.s3ExpressMiddleware = s3ExpressMiddleware;
585
- exports.s3ExpressMiddlewareOptions = s3ExpressMiddlewareOptions;
586
- exports.throw200ExceptionsMiddleware = throw200ExceptionsMiddleware;
587
- exports.throw200ExceptionsMiddlewareOptions = throw200ExceptionsMiddlewareOptions;
588
- exports.validateBucketNameMiddleware = validateBucketNameMiddleware;
589
- exports.validateBucketNameMiddlewareOptions = validateBucketNameMiddlewareOptions;
590
-
591
-
592
- /***/ }),
593
-
594
- /***/ 2136:
595
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
596
-
597
-
598
- Object.defineProperty(exports, "__esModule", ({ value: true }));
599
- exports.toStream = toStream;
600
- const node_stream_1 = __webpack_require__(7075);
601
- function toStream(bytes) {
602
- return node_stream_1.Readable.from(Buffer.from(bytes));
603
- }
604
-
605
-
606
- /***/ }),
607
-
608
- /***/ 3723:
609
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
610
-
611
-
612
- Object.defineProperty(exports, "__esModule", ({ value: true }));
613
- exports.STSClient = exports.__Client = void 0;
614
- const middleware_host_header_1 = __webpack_require__(2590);
615
- const middleware_logger_1 = __webpack_require__(5242);
616
- const middleware_recursion_detection_1 = __webpack_require__(1568);
617
- const middleware_user_agent_1 = __webpack_require__(2959);
618
- const config_resolver_1 = __webpack_require__(9316);
619
- const core_1 = __webpack_require__(402);
620
- const schema_1 = __webpack_require__(6890);
621
- const middleware_content_length_1 = __webpack_require__(7212);
622
- const middleware_endpoint_1 = __webpack_require__(99);
623
- const middleware_retry_1 = __webpack_require__(9618);
624
- const smithy_client_1 = __webpack_require__(1411);
625
- Object.defineProperty(exports, "__Client", ({ enumerable: true, get: function () { return smithy_client_1.Client; } }));
626
- const httpAuthSchemeProvider_1 = __webpack_require__(7851);
627
- const EndpointParameters_1 = __webpack_require__(6811);
628
- const runtimeConfig_1 = __webpack_require__(6578);
629
- const runtimeExtensions_1 = __webpack_require__(7742);
630
- class STSClient extends smithy_client_1.Client {
631
- config;
632
- constructor(...[configuration]) {
633
- const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {});
634
- super(_config_0);
635
- this.initConfig = _config_0;
636
- const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0);
637
- const _config_2 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_1);
638
- const _config_3 = (0, middleware_retry_1.resolveRetryConfig)(_config_2);
639
- const _config_4 = (0, config_resolver_1.resolveRegionConfig)(_config_3);
640
- const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4);
641
- const _config_6 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_5);
642
- const _config_7 = (0, httpAuthSchemeProvider_1.resolveHttpAuthSchemeConfig)(_config_6);
643
- const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []);
644
- this.config = _config_8;
645
- this.middlewareStack.use((0, schema_1.getSchemaSerdePlugin)(this.config));
646
- this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
647
- this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
648
- this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
649
- this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config));
650
- this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config));
651
- this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config));
652
- this.middlewareStack.use((0, core_1.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
653
- httpAuthSchemeParametersProvider: httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeParametersProvider,
654
- identityProviderConfigProvider: async (config) => new core_1.DefaultIdentityProviderConfig({
655
- "aws.auth#sigv4": config.credentials,
656
- "aws.auth#sigv4a": config.credentials,
657
- }),
658
- }));
659
- this.middlewareStack.use((0, core_1.getHttpSigningPlugin)(this.config));
660
- }
661
- destroy() {
662
- super.destroy();
663
- }
664
- }
665
- exports.STSClient = STSClient;
666
-
667
-
668
- /***/ }),
669
-
670
- /***/ 4532:
671
- /***/ ((__unused_webpack_module, exports) => {
672
-
673
-
674
- Object.defineProperty(exports, "__esModule", ({ value: true }));
675
- exports.resolveHttpAuthRuntimeConfig = exports.getHttpAuthExtensionConfiguration = void 0;
676
- const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
677
- const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
678
- let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
679
- let _credentials = runtimeConfig.credentials;
680
- return {
681
- setHttpAuthScheme(httpAuthScheme) {
682
- const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
683
- if (index === -1) {
684
- _httpAuthSchemes.push(httpAuthScheme);
685
- }
686
- else {
687
- _httpAuthSchemes.splice(index, 1, httpAuthScheme);
688
- }
689
- },
690
- httpAuthSchemes() {
691
- return _httpAuthSchemes;
692
- },
693
- setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
694
- _httpAuthSchemeProvider = httpAuthSchemeProvider;
695
- },
696
- httpAuthSchemeProvider() {
697
- return _httpAuthSchemeProvider;
698
- },
699
- setCredentials(credentials) {
700
- _credentials = credentials;
701
- },
702
- credentials() {
703
- return _credentials;
704
- },
705
- };
706
- };
707
- exports.getHttpAuthExtensionConfiguration = getHttpAuthExtensionConfiguration;
708
- const resolveHttpAuthRuntimeConfig = (config) => {
709
- return {
710
- httpAuthSchemes: config.httpAuthSchemes(),
711
- httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
712
- credentials: config.credentials(),
713
- };
714
- };
715
- exports.resolveHttpAuthRuntimeConfig = resolveHttpAuthRuntimeConfig;
716
-
717
-
718
- /***/ }),
719
-
720
- /***/ 7851:
721
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
722
-
723
-
724
- Object.defineProperty(exports, "__esModule", ({ value: true }));
725
- exports.resolveHttpAuthSchemeConfig = exports.resolveStsAuthConfig = exports.defaultSTSHttpAuthSchemeProvider = exports.defaultSTSHttpAuthSchemeParametersProvider = void 0;
726
- const httpAuthSchemes_1 = __webpack_require__(7523);
727
- const signature_v4_multi_region_1 = __webpack_require__(5785);
728
- const middleware_endpoint_1 = __webpack_require__(99);
729
- const util_middleware_1 = __webpack_require__(6324);
730
- const endpointResolver_1 = __webpack_require__(9765);
731
- const STSClient_1 = __webpack_require__(3723);
732
- const createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
733
- if (!input) {
734
- throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");
735
- }
736
- const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
737
- const instructionsFn = (0, util_middleware_1.getSmithyContext)(context)?.commandInstance?.constructor
738
- ?.getEndpointParameterInstructions;
739
- if (!instructionsFn) {
740
- throw new Error(`getEndpointParameterInstructions() is not defined on '${context.commandName}'`);
741
- }
742
- const endpointParameters = await (0, middleware_endpoint_1.resolveParams)(input, { getEndpointParameterInstructions: instructionsFn }, config);
743
- return Object.assign(defaultParameters, endpointParameters);
744
- };
745
- const _defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {
746
- return {
747
- operation: (0, util_middleware_1.getSmithyContext)(context).operation,
748
- region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
749
- (() => {
750
- throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
751
- })(),
752
- };
753
- };
754
- exports.defaultSTSHttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultSTSHttpAuthSchemeParametersProvider);
755
- function createAwsAuthSigv4HttpAuthOption(authParameters) {
756
- return {
757
- schemeId: "aws.auth#sigv4",
758
- signingProperties: {
759
- name: "sts",
760
- region: authParameters.region,
761
- },
762
- propertiesExtractor: (config, context) => ({
763
- signingProperties: {
764
- config,
765
- context,
766
- },
767
- }),
768
- };
769
- }
770
- function createAwsAuthSigv4aHttpAuthOption(authParameters) {
771
- return {
772
- schemeId: "aws.auth#sigv4a",
773
- signingProperties: {
774
- name: "sts",
775
- region: authParameters.region,
776
- },
777
- propertiesExtractor: (config, context) => ({
778
- signingProperties: {
779
- config,
780
- context,
781
- },
782
- }),
783
- };
784
- }
785
- function createSmithyApiNoAuthHttpAuthOption(authParameters) {
786
- return {
787
- schemeId: "smithy.api#noAuth",
788
- };
238
+ function createSmithyApiNoAuthHttpAuthOption(authParameters) {
239
+ return {
240
+ schemeId: "smithy.api#noAuth",
241
+ };
789
242
  }
790
243
  const createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
791
244
  const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
@@ -808,7 +261,7 @@ const createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver, de
808
261
  const name = s.name.toLowerCase();
809
262
  return name !== "sigv4a" && name.startsWith("sigv4");
810
263
  });
811
- if (signature_v4_multi_region_1.SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) {
264
+ if (signatureV4MultiRegion.SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) {
812
265
  continue;
813
266
  }
814
267
  }
@@ -835,7 +288,7 @@ const _defaultSTSHttpAuthSchemeProvider = (authParameters) => {
835
288
  const options = [];
836
289
  switch (authParameters.operation) {
837
290
  case "AssumeRoleWithWebIdentity": {
838
- options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
291
+ options.push(createSmithyApiNoAuthHttpAuthOption());
839
292
  options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
840
293
  break;
841
294
  }
@@ -846,34 +299,19 @@ const _defaultSTSHttpAuthSchemeProvider = (authParameters) => {
846
299
  }
847
300
  return options;
848
301
  };
849
- exports.defaultSTSHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(endpointResolver_1.defaultEndpointResolver, _defaultSTSHttpAuthSchemeProvider, {
302
+ const defaultSTSHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultSTSHttpAuthSchemeProvider, {
850
303
  "aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
851
304
  "aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
852
305
  "smithy.api#noAuth": createSmithyApiNoAuthHttpAuthOption,
853
306
  });
854
- const resolveStsAuthConfig = (input) => Object.assign(input, {
855
- stsClientCtor: STSClient_1.STSClient,
856
- });
857
- exports.resolveStsAuthConfig = resolveStsAuthConfig;
858
307
  const resolveHttpAuthSchemeConfig = (config) => {
859
- const config_0 = (0, exports.resolveStsAuthConfig)(config);
860
- const config_1 = (0, httpAuthSchemes_1.resolveAwsSdkSigV4Config)(config_0);
861
- const config_2 = (0, httpAuthSchemes_1.resolveAwsSdkSigV4AConfig)(config_1);
862
- return Object.assign(config_2, {
863
- authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),
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 ?? []),
864
312
  });
865
313
  };
866
- exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
867
-
868
-
869
- /***/ }),
870
314
 
871
- /***/ 6811:
872
- /***/ ((__unused_webpack_module, exports) => {
873
-
874
-
875
- Object.defineProperty(exports, "__esModule", ({ value: true }));
876
- exports.commonParams = exports.resolveClientEndpointParameters = void 0;
877
315
  const resolveClientEndpointParameters = (options) => {
878
316
  return Object.assign(options, {
879
317
  useDualstackEndpoint: options.useDualstackEndpoint ?? false,
@@ -882,8 +320,7 @@ const resolveClientEndpointParameters = (options) => {
882
320
  defaultSigningName: "sts",
883
321
  });
884
322
  };
885
- exports.resolveClientEndpointParameters = resolveClientEndpointParameters;
886
- exports.commonParams = {
323
+ const commonParams = {
887
324
  UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
888
325
  UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
889
326
  Endpoint: { type: "builtInParams", name: "endpoint" },
@@ -891,227 +328,492 @@ exports.commonParams = {
891
328
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
892
329
  };
893
330
 
331
+ var version = "3.997.8";
332
+ var packageInfo = {
333
+ version: version};
894
334
 
895
- /***/ }),
896
-
897
- /***/ 2050:
898
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
899
-
335
+ class STSServiceException extends client.ServiceException {
336
+ constructor(options) {
337
+ super(options);
338
+ Object.setPrototypeOf(this, STSServiceException.prototype);
339
+ }
340
+ }
900
341
 
901
- Object.defineProperty(exports, "__esModule", ({ value: true }));
902
- exports.bdd = void 0;
903
- const util_endpoints_1 = __webpack_require__(9674);
904
- const q = "ref";
905
- 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];
906
- const _data = {
907
- conditions: [
908
- [c, [l]],
909
- [c, p],
910
- ["aws.partition", p, d],
911
- [e, [{ [q]: "UseFIPS" }, b]],
912
- [e, [{ [q]: "UseDualStack" }, b]],
913
- [f, [m, "aws-global"]],
914
- [e, [{ [q]: "UseGlobalEndpoint" }, b]],
915
- [f, [m, "eu-central-1"]],
916
- [e, [{ fn: g, argv: [n, "supportsDualStack"] }, b]],
917
- [e, [{ fn: g, argv: [n, "supportsFIPS"] }, b]],
918
- [f, [m, "ap-south-1"]],
919
- [f, [m, "eu-north-1"]],
920
- [f, [m, "eu-west-1"]],
921
- [f, [m, "eu-west-2"]],
922
- [f, [m, "eu-west-3"]],
923
- [f, [m, "sa-east-1"]],
924
- [f, [m, h]],
925
- [f, [m, "us-east-2"]],
926
- [f, [m, "us-west-2"]],
927
- [f, [m, "us-west-1"]],
928
- [f, [m, "ca-central-1"]],
929
- [f, [m, "ap-southeast-1"]],
930
- [f, [m, "ap-northeast-1"]],
931
- [f, [m, "ap-southeast-2"]],
932
- [f, [{ fn: g, argv: [n, "name"] }, "aws-us-gov"]],
933
- ],
934
- results: [
935
- [a],
936
- ["https://sts.amazonaws.com", { authSchemes: [{ name: i, signingName: j, signingRegion: h }] }],
937
- [k, { authSchemes: [{ name: i, signingName: j, signingRegion: "{Region}" }] }],
938
- [a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
939
- [a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
940
- [l, o],
941
- ["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", o],
942
- [a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
943
- ["https://sts.{Region}.amazonaws.com", o],
944
- ["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", o],
945
- [a, "FIPS is enabled but this partition does not support FIPS"],
946
- ["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", o],
947
- [a, "DualStack is enabled but this partition does not support DualStack"],
948
- [k, o],
949
- [a, "Invalid Configuration: Missing Region"],
950
- ],
951
- };
952
- const root = 2;
953
- const r = 100_000_000;
954
- const nodes = new Int32Array([
955
- -1,
956
- 1,
957
- -1,
958
- 0,
959
- 30,
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$ = [
960
559
  3,
961
- 1,
962
- 4,
963
- r + 14,
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],
964
565
  2,
965
- 5,
966
- r + 14,
566
+ ];
567
+ var AssumeRoleResponse$ = [
967
568
  3,
968
- 25,
969
- 6,
970
- 4,
971
- 24,
972
- 7,
973
- 5,
974
- r + 1,
975
- 8,
976
- 6,
977
- 9,
978
- r + 13,
979
- 7,
980
- r + 1,
981
- 10,
982
- 10,
983
- r + 1,
984
- 11,
985
- 11,
986
- r + 1,
987
- 12,
988
- 12,
989
- r + 1,
990
- 13,
991
- 13,
992
- r + 1,
993
- 14,
994
- 14,
995
- r + 1,
996
- 15,
997
- 15,
998
- r + 1,
999
- 16,
1000
- 16,
1001
- r + 1,
1002
- 17,
1003
- 17,
1004
- r + 1,
1005
- 18,
1006
- 18,
1007
- r + 1,
1008
- 19,
1009
- 19,
1010
- r + 1,
1011
- 20,
1012
- 20,
1013
- r + 1,
1014
- 21,
1015
- 21,
1016
- r + 1,
1017
- 22,
1018
- 22,
1019
- r + 1,
1020
- 23,
1021
- 23,
1022
- r + 1,
1023
- r + 2,
1024
- 8,
1025
- r + 11,
1026
- r + 12,
1027
- 4,
1028
- 28,
1029
- 26,
1030
- 9,
1031
- 27,
1032
- r + 10,
1033
- 24,
1034
- r + 8,
1035
- r + 9,
1036
- 8,
1037
- 29,
1038
- r + 7,
1039
- 9,
1040
- r + 6,
1041
- r + 7,
569
+ n0,
570
+ _ARRs,
571
+ 0,
572
+ [_C, _ARU, _PPS, _SI],
573
+ [[() => Credentials$, 0], () => AssumedRoleUser$, 1, 0],
574
+ ];
575
+ var AssumeRoleWithWebIdentityRequest$ = [
1042
576
  3,
1043
- r + 3,
1044
- 31,
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],
1045
599
  4,
1046
- r + 4,
1047
- r + 5,
1048
- ]);
1049
- exports.bdd = util_endpoints_1.BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
1050
-
1051
-
1052
- /***/ }),
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
+ ];
1053
616
 
1054
- /***/ 9765:
1055
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
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
+ };
1056
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
+ };
1057
714
 
1058
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1059
- exports.defaultEndpointResolver = void 0;
1060
- const util_endpoints_1 = __webpack_require__(3068);
1061
- const util_endpoints_2 = __webpack_require__(9674);
1062
- const bdd_1 = __webpack_require__(2050);
1063
- const cache = new util_endpoints_2.EndpointCache({
1064
- size: 50,
1065
- params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"],
1066
- });
1067
- const defaultEndpointResolver = (endpointParams, context = {}) => {
1068
- return cache.get(endpointParams, () => (0, util_endpoints_2.decideEndpoint)(bdd_1.bdd, {
1069
- endpointParams: endpointParams,
1070
- logger: context.logger,
1071
- }));
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
+ };
1072
752
  };
1073
- exports.defaultEndpointResolver = defaultEndpointResolver;
1074
- util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;
1075
-
1076
-
1077
- /***/ }),
1078
-
1079
- /***/ 1136:
1080
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1081
-
1082
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
+ };
1083
759
 
1084
- var STSClient = __webpack_require__(3723);
1085
- var smithyClient = __webpack_require__(1411);
1086
- var middlewareEndpoint = __webpack_require__(99);
1087
- var EndpointParameters = __webpack_require__(6811);
1088
- var schemas_0 = __webpack_require__(1684);
1089
- var errors = __webpack_require__(1688);
1090
- var client = __webpack_require__(5152);
1091
- var regionConfigResolver = __webpack_require__(6463);
1092
- var STSServiceException = __webpack_require__(7171);
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
+ }
1093
795
 
1094
- class AssumeRoleCommand extends smithyClient.Command
796
+ class AssumeRoleCommand extends client.Command
1095
797
  .classBuilder()
1096
- .ep(EndpointParameters.commonParams)
798
+ .ep(commonParams)
1097
799
  .m(function (Command, cs, config, o) {
1098
- return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
800
+ return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
1099
801
  })
1100
802
  .s("AWSSecurityTokenServiceV20110615", "AssumeRole", {})
1101
803
  .n("STSClient", "AssumeRoleCommand")
1102
- .sc(schemas_0.AssumeRole$)
804
+ .sc(AssumeRole$)
1103
805
  .build() {
1104
806
  }
1105
807
 
1106
- class AssumeRoleWithWebIdentityCommand extends smithyClient.Command
808
+ class AssumeRoleWithWebIdentityCommand extends client.Command
1107
809
  .classBuilder()
1108
- .ep(EndpointParameters.commonParams)
810
+ .ep(commonParams)
1109
811
  .m(function (Command, cs, config, o) {
1110
- return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
812
+ return [endpoints.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
1111
813
  })
1112
814
  .s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {})
1113
815
  .n("STSClient", "AssumeRoleWithWebIdentityCommand")
1114
- .sc(schemas_0.AssumeRoleWithWebIdentity$)
816
+ .sc(AssumeRoleWithWebIdentity$)
1115
817
  .build() {
1116
818
  }
1117
819
 
@@ -1119,9 +821,9 @@ const commands = {
1119
821
  AssumeRoleCommand,
1120
822
  AssumeRoleWithWebIdentityCommand,
1121
823
  };
1122
- class STS extends STSClient.STSClient {
824
+ class STS extends STSClient {
1123
825
  }
1124
- smithyClient.createAggregatedClient(commands, STS);
826
+ client.createAggregatedClient(commands, STS);
1125
827
 
1126
828
  const getAccountIdFromAssumedRoleUser = (assumedRoleUser) => {
1127
829
  if (typeof assumedRoleUser?.Arn === "string") {
@@ -1136,7 +838,7 @@ const resolveRegion = async (_region, _parentRegion, credentialProviderLogger, l
1136
838
  const region = typeof _region === "function" ? await _region() : _region;
1137
839
  const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion;
1138
840
  let stsDefaultRegion = "";
1139
- const resolvedRegion = region ?? parentRegion ?? (stsDefaultRegion = await regionConfigResolver.stsRegionDefaultResolver(loaderConfig)());
841
+ const resolvedRegion = region ?? parentRegion ?? (stsDefaultRegion = await client$1.stsRegionDefaultResolver(loaderConfig)());
1140
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)`);
1141
843
  return resolvedRegion;
1142
844
  };
@@ -1175,7 +877,7 @@ const getDefaultRoleAssumer$1 = (stsOptions, STSClient) => {
1175
877
  ...(Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }),
1176
878
  ...(accountId && { accountId }),
1177
879
  };
1178
- client.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i");
880
+ client$1.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i");
1179
881
  return credentials;
1180
882
  };
1181
883
  };
@@ -1196,580 +898,90 @@ const getDefaultRoleAssumerWithWebIdentity$1 = (stsOptions, STSClient) => {
1196
898
  region: resolvedRegion,
1197
899
  requestHandler: isCompatibleRequestHandler ? requestHandler : undefined,
1198
900
  logger: logger,
1199
- });
1200
- }
1201
- const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
1202
- if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
1203
- throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);
1204
- }
1205
- const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);
1206
- const credentials = {
1207
- accessKeyId: Credentials.AccessKeyId,
1208
- secretAccessKey: Credentials.SecretAccessKey,
1209
- sessionToken: Credentials.SessionToken,
1210
- expiration: Credentials.Expiration,
1211
- ...(Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }),
1212
- ...(accountId && { accountId }),
1213
- };
1214
- if (accountId) {
1215
- client.setCredentialFeature(credentials, "RESOLVED_ACCOUNT_ID", "T");
1216
- }
1217
- client.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k");
1218
- return credentials;
1219
- };
1220
- };
1221
- const isH2 = (requestHandler) => {
1222
- return requestHandler?.metadata?.handlerProtocol === "h2";
1223
- };
1224
-
1225
- const getCustomizableStsClientCtor = (baseCtor, customizations) => {
1226
- if (!customizations)
1227
- return baseCtor;
1228
- else
1229
- return class CustomizableSTSClient extends baseCtor {
1230
- constructor(config) {
1231
- super(config);
1232
- for (const customization of customizations) {
1233
- this.middlewareStack.use(customization);
1234
- }
1235
- }
1236
- };
1237
- };
1238
- const getDefaultRoleAssumer = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumer$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins));
1239
- const getDefaultRoleAssumerWithWebIdentity = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins));
1240
- const decorateDefaultCredentialProvider = (provider) => (input) => provider({
1241
- roleAssumer: getDefaultRoleAssumer(input),
1242
- roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input),
1243
- ...input,
1244
- });
1245
-
1246
- exports.$Command = smithyClient.Command;
1247
- exports.STSServiceException = STSServiceException.STSServiceException;
1248
- exports.AssumeRoleCommand = AssumeRoleCommand;
1249
- exports.AssumeRoleWithWebIdentityCommand = AssumeRoleWithWebIdentityCommand;
1250
- exports.STS = STS;
1251
- exports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider;
1252
- exports.getDefaultRoleAssumer = getDefaultRoleAssumer;
1253
- exports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity;
1254
- Object.prototype.hasOwnProperty.call(STSClient, '__proto__') &&
1255
- !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
1256
- Object.defineProperty(exports, '__proto__', {
1257
- enumerable: true,
1258
- value: STSClient['__proto__']
1259
- });
1260
-
1261
- Object.keys(STSClient).forEach(function (k) {
1262
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = STSClient[k];
1263
- });
1264
- Object.prototype.hasOwnProperty.call(schemas_0, '__proto__') &&
1265
- !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
1266
- Object.defineProperty(exports, '__proto__', {
1267
- enumerable: true,
1268
- value: schemas_0['__proto__']
1269
- });
1270
-
1271
- Object.keys(schemas_0).forEach(function (k) {
1272
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemas_0[k];
1273
- });
1274
- Object.prototype.hasOwnProperty.call(errors, '__proto__') &&
1275
- !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
1276
- Object.defineProperty(exports, '__proto__', {
1277
- enumerable: true,
1278
- value: errors['__proto__']
1279
- });
1280
-
1281
- Object.keys(errors).forEach(function (k) {
1282
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = errors[k];
1283
- });
1284
-
1285
-
1286
- /***/ }),
1287
-
1288
- /***/ 7171:
1289
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1290
-
1291
-
1292
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1293
- exports.STSServiceException = exports.__ServiceException = void 0;
1294
- const smithy_client_1 = __webpack_require__(1411);
1295
- Object.defineProperty(exports, "__ServiceException", ({ enumerable: true, get: function () { return smithy_client_1.ServiceException; } }));
1296
- class STSServiceException extends smithy_client_1.ServiceException {
1297
- constructor(options) {
1298
- super(options);
1299
- Object.setPrototypeOf(this, STSServiceException.prototype);
1300
- }
1301
- }
1302
- exports.STSServiceException = STSServiceException;
1303
-
1304
-
1305
- /***/ }),
1306
-
1307
- /***/ 1688:
1308
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1309
-
1310
-
1311
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1312
- exports.IDPCommunicationErrorException = exports.InvalidIdentityTokenException = exports.IDPRejectedClaimException = exports.RegionDisabledException = exports.PackedPolicyTooLargeException = exports.MalformedPolicyDocumentException = exports.ExpiredTokenException = void 0;
1313
- const STSServiceException_1 = __webpack_require__(7171);
1314
- class ExpiredTokenException extends STSServiceException_1.STSServiceException {
1315
- name = "ExpiredTokenException";
1316
- $fault = "client";
1317
- constructor(opts) {
1318
- super({
1319
- name: "ExpiredTokenException",
1320
- $fault: "client",
1321
- ...opts,
1322
- });
1323
- Object.setPrototypeOf(this, ExpiredTokenException.prototype);
1324
- }
1325
- }
1326
- exports.ExpiredTokenException = ExpiredTokenException;
1327
- class MalformedPolicyDocumentException extends STSServiceException_1.STSServiceException {
1328
- name = "MalformedPolicyDocumentException";
1329
- $fault = "client";
1330
- constructor(opts) {
1331
- super({
1332
- name: "MalformedPolicyDocumentException",
1333
- $fault: "client",
1334
- ...opts,
1335
- });
1336
- Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype);
1337
- }
1338
- }
1339
- exports.MalformedPolicyDocumentException = MalformedPolicyDocumentException;
1340
- class PackedPolicyTooLargeException extends STSServiceException_1.STSServiceException {
1341
- name = "PackedPolicyTooLargeException";
1342
- $fault = "client";
1343
- constructor(opts) {
1344
- super({
1345
- name: "PackedPolicyTooLargeException",
1346
- $fault: "client",
1347
- ...opts,
1348
- });
1349
- Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype);
1350
- }
1351
- }
1352
- exports.PackedPolicyTooLargeException = PackedPolicyTooLargeException;
1353
- class RegionDisabledException extends STSServiceException_1.STSServiceException {
1354
- name = "RegionDisabledException";
1355
- $fault = "client";
1356
- constructor(opts) {
1357
- super({
1358
- name: "RegionDisabledException",
1359
- $fault: "client",
1360
- ...opts,
1361
- });
1362
- Object.setPrototypeOf(this, RegionDisabledException.prototype);
1363
- }
1364
- }
1365
- exports.RegionDisabledException = RegionDisabledException;
1366
- class IDPRejectedClaimException extends STSServiceException_1.STSServiceException {
1367
- name = "IDPRejectedClaimException";
1368
- $fault = "client";
1369
- constructor(opts) {
1370
- super({
1371
- name: "IDPRejectedClaimException",
1372
- $fault: "client",
1373
- ...opts,
1374
- });
1375
- Object.setPrototypeOf(this, IDPRejectedClaimException.prototype);
1376
- }
1377
- }
1378
- exports.IDPRejectedClaimException = IDPRejectedClaimException;
1379
- class InvalidIdentityTokenException extends STSServiceException_1.STSServiceException {
1380
- name = "InvalidIdentityTokenException";
1381
- $fault = "client";
1382
- constructor(opts) {
1383
- super({
1384
- name: "InvalidIdentityTokenException",
1385
- $fault: "client",
1386
- ...opts,
1387
- });
1388
- Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype);
1389
- }
1390
- }
1391
- exports.InvalidIdentityTokenException = InvalidIdentityTokenException;
1392
- class IDPCommunicationErrorException extends STSServiceException_1.STSServiceException {
1393
- name = "IDPCommunicationErrorException";
1394
- $fault = "client";
1395
- $retryable = {};
1396
- constructor(opts) {
1397
- super({
1398
- name: "IDPCommunicationErrorException",
1399
- $fault: "client",
1400
- ...opts,
1401
- });
1402
- Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype);
1403
- }
1404
- }
1405
- exports.IDPCommunicationErrorException = IDPCommunicationErrorException;
1406
-
1407
-
1408
- /***/ }),
1409
-
1410
- /***/ 6578:
1411
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1412
-
1413
-
1414
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1415
- exports.getRuntimeConfig = void 0;
1416
- const tslib_1 = __webpack_require__(1860);
1417
- const package_json_1 = tslib_1.__importDefault(__webpack_require__(9955));
1418
- const client_1 = __webpack_require__(5152);
1419
- const httpAuthSchemes_1 = __webpack_require__(7523);
1420
- const util_user_agent_node_1 = __webpack_require__(1656);
1421
- const config_resolver_1 = __webpack_require__(9316);
1422
- const core_1 = __webpack_require__(402);
1423
- const hash_node_1 = __webpack_require__(5092);
1424
- const middleware_retry_1 = __webpack_require__(9618);
1425
- const node_config_provider_1 = __webpack_require__(5704);
1426
- const node_http_handler_1 = __webpack_require__(1279);
1427
- const smithy_client_1 = __webpack_require__(1411);
1428
- const util_body_length_node_1 = __webpack_require__(3638);
1429
- const util_defaults_mode_node_1 = __webpack_require__(5435);
1430
- const util_retry_1 = __webpack_require__(5518);
1431
- const runtimeConfig_shared_1 = __webpack_require__(4443);
1432
- const getRuntimeConfig = (config) => {
1433
- (0, smithy_client_1.emitWarningIfUnsupportedVersion)(process.version);
1434
- const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
1435
- const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
1436
- const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
1437
- (0, client_1.emitWarningIfUnsupportedVersion)(process.version);
1438
- const loaderConfig = {
1439
- profile: config?.profile,
1440
- logger: clientSharedValues.logger,
1441
- };
1442
- return {
1443
- ...clientSharedValues,
1444
- ...config,
1445
- runtime: "node",
1446
- defaultsMode,
1447
- authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(httpAuthSchemes_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
1448
- bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
1449
- defaultUserAgentProvider: config?.defaultUserAgentProvider ??
1450
- (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
1451
- httpAuthSchemes: config?.httpAuthSchemes ?? [
1452
- {
1453
- schemeId: "aws.auth#sigv4",
1454
- identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") ||
1455
- (async (idProps) => await config.credentialDefaultProvider(idProps?.__config || {})()),
1456
- signer: new httpAuthSchemes_1.AwsSdkSigV4Signer(),
1457
- },
1458
- {
1459
- schemeId: "aws.auth#sigv4a",
1460
- identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
1461
- signer: new httpAuthSchemes_1.AwsSdkSigV4ASigner(),
1462
- },
1463
- {
1464
- schemeId: "smithy.api#noAuth",
1465
- identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
1466
- signer: new core_1.NoAuthSigner(),
1467
- },
1468
- ],
1469
- maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
1470
- region: config?.region ??
1471
- (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
1472
- requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
1473
- retryMode: config?.retryMode ??
1474
- (0, node_config_provider_1.loadConfig)({
1475
- ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
1476
- default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
1477
- }, config),
1478
- sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
1479
- sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? (0, node_config_provider_1.loadConfig)(httpAuthSchemes_1.NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig),
1480
- streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
1481
- useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
1482
- useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
1483
- userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
1484
- };
1485
- };
1486
- exports.getRuntimeConfig = getRuntimeConfig;
1487
-
1488
-
1489
- /***/ }),
1490
-
1491
- /***/ 4443:
1492
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1493
-
1494
-
1495
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1496
- exports.getRuntimeConfig = void 0;
1497
- const httpAuthSchemes_1 = __webpack_require__(7523);
1498
- const protocols_1 = __webpack_require__(7288);
1499
- const signature_v4_multi_region_1 = __webpack_require__(5785);
1500
- const core_1 = __webpack_require__(402);
1501
- const smithy_client_1 = __webpack_require__(1411);
1502
- const url_parser_1 = __webpack_require__(4494);
1503
- const util_base64_1 = __webpack_require__(8385);
1504
- const util_utf8_1 = __webpack_require__(1577);
1505
- const httpAuthSchemeProvider_1 = __webpack_require__(7851);
1506
- const endpointResolver_1 = __webpack_require__(9765);
1507
- const schemas_0_1 = __webpack_require__(1684);
1508
- const getRuntimeConfig = (config) => {
1509
- return {
1510
- apiVersion: "2011-06-15",
1511
- base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
1512
- base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
1513
- disableHostPrefix: config?.disableHostPrefix ?? false,
1514
- endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
1515
- extensions: config?.extensions ?? [],
1516
- httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeProvider,
1517
- httpAuthSchemes: config?.httpAuthSchemes ?? [
1518
- {
1519
- schemeId: "aws.auth#sigv4",
1520
- identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
1521
- signer: new httpAuthSchemes_1.AwsSdkSigV4Signer(),
1522
- },
1523
- {
1524
- schemeId: "aws.auth#sigv4a",
1525
- identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
1526
- signer: new httpAuthSchemes_1.AwsSdkSigV4ASigner(),
1527
- },
1528
- {
1529
- schemeId: "smithy.api#noAuth",
1530
- identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
1531
- signer: new core_1.NoAuthSigner(),
1532
- },
1533
- ],
1534
- logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
1535
- protocol: config?.protocol ?? protocols_1.AwsQueryProtocol,
1536
- protocolSettings: config?.protocolSettings ?? {
1537
- defaultNamespace: "com.amazonaws.sts",
1538
- errorTypeRegistries: schemas_0_1.errorTypeRegistries,
1539
- xmlNamespace: "https://sts.amazonaws.com/doc/2011-06-15/",
1540
- version: "2011-06-15",
1541
- serviceTarget: "AWSSecurityTokenServiceV20110615",
1542
- },
1543
- serviceId: config?.serviceId ?? "STS",
1544
- signerConstructor: config?.signerConstructor ?? signature_v4_multi_region_1.SignatureV4MultiRegion,
1545
- urlParser: config?.urlParser ?? url_parser_1.parseUrl,
1546
- utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
1547
- utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
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;
1548
921
  };
1549
922
  };
1550
- exports.getRuntimeConfig = getRuntimeConfig;
1551
-
1552
-
1553
- /***/ }),
1554
-
1555
- /***/ 7742:
1556
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1557
-
1558
-
1559
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1560
- exports.resolveRuntimeExtensions = void 0;
1561
- const region_config_resolver_1 = __webpack_require__(6463);
1562
- const protocol_http_1 = __webpack_require__(2356);
1563
- const smithy_client_1 = __webpack_require__(1411);
1564
- const httpAuthExtensionConfiguration_1 = __webpack_require__(4532);
1565
- const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
1566
- const extensionConfiguration = Object.assign((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig), (0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig), (0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig));
1567
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
1568
- return Object.assign(runtimeConfig, (0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), (0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration));
923
+ const isH2 = (requestHandler) => {
924
+ return requestHandler?.metadata?.handlerProtocol === "h2";
1569
925
  };
1570
- exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
1571
-
1572
-
1573
- /***/ }),
1574
-
1575
- /***/ 1684:
1576
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1577
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
+ });
1578
947
 
1579
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1580
- exports.AssumeRoleWithWebIdentity$ = exports.AssumeRole$ = exports.Tag$ = exports.ProvidedContext$ = exports.PolicyDescriptorType$ = exports.Credentials$ = exports.AssumeRoleWithWebIdentityResponse$ = exports.AssumeRoleWithWebIdentityRequest$ = exports.AssumeRoleResponse$ = exports.AssumeRoleRequest$ = exports.AssumedRoleUser$ = exports.errorTypeRegistries = exports.RegionDisabledException$ = exports.PackedPolicyTooLargeException$ = exports.MalformedPolicyDocumentException$ = exports.InvalidIdentityTokenException$ = exports.IDPRejectedClaimException$ = exports.IDPCommunicationErrorException$ = exports.ExpiredTokenException$ = exports.STSServiceException$ = void 0;
1581
- const _A = "Arn";
1582
- const _AKI = "AccessKeyId";
1583
- const _AR = "AssumeRole";
1584
- const _ARI = "AssumedRoleId";
1585
- const _ARR = "AssumeRoleRequest";
1586
- const _ARRs = "AssumeRoleResponse";
1587
- const _ARU = "AssumedRoleUser";
1588
- const _ARWWI = "AssumeRoleWithWebIdentity";
1589
- const _ARWWIR = "AssumeRoleWithWebIdentityRequest";
1590
- const _ARWWIRs = "AssumeRoleWithWebIdentityResponse";
1591
- const _Au = "Audience";
1592
- const _C = "Credentials";
1593
- const _CA = "ContextAssertion";
1594
- const _DS = "DurationSeconds";
1595
- const _E = "Expiration";
1596
- const _EI = "ExternalId";
1597
- const _ETE = "ExpiredTokenException";
1598
- const _IDPCEE = "IDPCommunicationErrorException";
1599
- const _IDPRCE = "IDPRejectedClaimException";
1600
- const _IITE = "InvalidIdentityTokenException";
1601
- const _K = "Key";
1602
- const _MPDE = "MalformedPolicyDocumentException";
1603
- const _P = "Policy";
1604
- const _PA = "PolicyArns";
1605
- const _PAr = "ProviderArn";
1606
- const _PC = "ProvidedContexts";
1607
- const _PCLT = "ProvidedContextsListType";
1608
- const _PCr = "ProvidedContext";
1609
- const _PDT = "PolicyDescriptorType";
1610
- const _PI = "ProviderId";
1611
- const _PPS = "PackedPolicySize";
1612
- const _PPTLE = "PackedPolicyTooLargeException";
1613
- const _Pr = "Provider";
1614
- const _RA = "RoleArn";
1615
- const _RDE = "RegionDisabledException";
1616
- const _RSN = "RoleSessionName";
1617
- const _SAK = "SecretAccessKey";
1618
- const _SFWIT = "SubjectFromWebIdentityToken";
1619
- const _SI = "SourceIdentity";
1620
- const _SN = "SerialNumber";
1621
- const _ST = "SessionToken";
1622
- const _T = "Tags";
1623
- const _TC = "TokenCode";
1624
- const _TTK = "TransitiveTagKeys";
1625
- const _Ta = "Tag";
1626
- const _V = "Value";
1627
- const _WIT = "WebIdentityToken";
1628
- const _a = "arn";
1629
- const _aKST = "accessKeySecretType";
1630
- const _aQE = "awsQueryError";
1631
- const _c = "client";
1632
- const _cTT = "clientTokenType";
1633
- const _e = "error";
1634
- const _hE = "httpError";
1635
- const _m = "message";
1636
- const _pDLT = "policyDescriptorListType";
1637
- const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sts";
1638
- const _tLT = "tagListType";
1639
- const n0 = "com.amazonaws.sts";
1640
- const schema_1 = __webpack_require__(6890);
1641
- const errors_1 = __webpack_require__(1688);
1642
- const STSServiceException_1 = __webpack_require__(7171);
1643
- const _s_registry = schema_1.TypeRegistry.for(_s);
1644
- exports.STSServiceException$ = [-3, _s, "STSServiceException", 0, [], []];
1645
- _s_registry.registerError(exports.STSServiceException$, STSServiceException_1.STSServiceException);
1646
- const n0_registry = schema_1.TypeRegistry.for(n0);
1647
- exports.ExpiredTokenException$ = [
1648
- -3,
1649
- n0,
1650
- _ETE,
1651
- { [_aQE]: [`ExpiredTokenException`, 400], [_e]: _c, [_hE]: 400 },
1652
- [_m],
1653
- [0],
1654
- ];
1655
- n0_registry.registerError(exports.ExpiredTokenException$, errors_1.ExpiredTokenException);
1656
- exports.IDPCommunicationErrorException$ = [
1657
- -3,
1658
- n0,
1659
- _IDPCEE,
1660
- { [_aQE]: [`IDPCommunicationError`, 400], [_e]: _c, [_hE]: 400 },
1661
- [_m],
1662
- [0],
1663
- ];
1664
- n0_registry.registerError(exports.IDPCommunicationErrorException$, errors_1.IDPCommunicationErrorException);
1665
- exports.IDPRejectedClaimException$ = [
1666
- -3,
1667
- n0,
1668
- _IDPRCE,
1669
- { [_aQE]: [`IDPRejectedClaim`, 403], [_e]: _c, [_hE]: 403 },
1670
- [_m],
1671
- [0],
1672
- ];
1673
- n0_registry.registerError(exports.IDPRejectedClaimException$, errors_1.IDPRejectedClaimException);
1674
- exports.InvalidIdentityTokenException$ = [
1675
- -3,
1676
- n0,
1677
- _IITE,
1678
- { [_aQE]: [`InvalidIdentityToken`, 400], [_e]: _c, [_hE]: 400 },
1679
- [_m],
1680
- [0],
1681
- ];
1682
- n0_registry.registerError(exports.InvalidIdentityTokenException$, errors_1.InvalidIdentityTokenException);
1683
- exports.MalformedPolicyDocumentException$ = [
1684
- -3,
1685
- n0,
1686
- _MPDE,
1687
- { [_aQE]: [`MalformedPolicyDocument`, 400], [_e]: _c, [_hE]: 400 },
1688
- [_m],
1689
- [0],
1690
- ];
1691
- n0_registry.registerError(exports.MalformedPolicyDocumentException$, errors_1.MalformedPolicyDocumentException);
1692
- exports.PackedPolicyTooLargeException$ = [
1693
- -3,
1694
- n0,
1695
- _PPTLE,
1696
- { [_aQE]: [`PackedPolicyTooLarge`, 400], [_e]: _c, [_hE]: 400 },
1697
- [_m],
1698
- [0],
1699
- ];
1700
- n0_registry.registerError(exports.PackedPolicyTooLargeException$, errors_1.PackedPolicyTooLargeException);
1701
- exports.RegionDisabledException$ = [
1702
- -3,
1703
- n0,
1704
- _RDE,
1705
- { [_aQE]: [`RegionDisabledException`, 403], [_e]: _c, [_hE]: 403 },
1706
- [_m],
1707
- [0],
1708
- ];
1709
- n0_registry.registerError(exports.RegionDisabledException$, errors_1.RegionDisabledException);
1710
- exports.errorTypeRegistries = [_s_registry, n0_registry];
1711
- var accessKeySecretType = [0, n0, _aKST, 8, 0];
1712
- var clientTokenType = [0, n0, _cTT, 8, 0];
1713
- exports.AssumedRoleUser$ = [3, n0, _ARU, 0, [_ARI, _A], [0, 0], 2];
1714
- exports.AssumeRoleRequest$ = [
1715
- 3,
1716
- n0,
1717
- _ARR,
1718
- 0,
1719
- [_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC],
1720
- [0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType],
1721
- 2,
1722
- ];
1723
- exports.AssumeRoleResponse$ = [
1724
- 3,
1725
- n0,
1726
- _ARRs,
1727
- 0,
1728
- [_C, _ARU, _PPS, _SI],
1729
- [[() => exports.Credentials$, 0], () => exports.AssumedRoleUser$, 1, 0],
1730
- ];
1731
- exports.AssumeRoleWithWebIdentityRequest$ = [
1732
- 3,
1733
- n0,
1734
- _ARWWIR,
1735
- 0,
1736
- [_RA, _RSN, _WIT, _PI, _PA, _P, _DS],
1737
- [0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1],
1738
- 3,
1739
- ];
1740
- exports.AssumeRoleWithWebIdentityResponse$ = [
1741
- 3,
1742
- n0,
1743
- _ARWWIRs,
1744
- 0,
1745
- [_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI],
1746
- [[() => exports.Credentials$, 0], 0, () => exports.AssumedRoleUser$, 1, 0, 0, 0],
1747
- ];
1748
- exports.Credentials$ = [
1749
- 3,
1750
- n0,
1751
- _C,
1752
- 0,
1753
- [_AKI, _SAK, _ST, _E],
1754
- [0, [() => accessKeySecretType, 0], 0, 4],
1755
- 4,
1756
- ];
1757
- exports.PolicyDescriptorType$ = [3, n0, _PDT, 0, [_a], [0]];
1758
- exports.ProvidedContext$ = [3, n0, _PCr, 0, [_PAr, _CA], [0, 0]];
1759
- exports.Tag$ = [3, n0, _Ta, 0, [_K, _V], [0, 0], 2];
1760
- var policyDescriptorListType = [1, n0, _pDLT, 0, () => exports.PolicyDescriptorType$];
1761
- var ProvidedContextsListType = [1, n0, _PCLT, 0, () => exports.ProvidedContext$];
1762
- var tagKeyListType = (/* unused pure expression or super */ null && (64 | 0));
1763
- var tagListType = [1, n0, _tLT, 0, () => exports.Tag$];
1764
- exports.AssumeRole$ = [9, n0, _AR, 0, () => exports.AssumeRoleRequest$, () => exports.AssumeRoleResponse$];
1765
- exports.AssumeRoleWithWebIdentity$ = [
1766
- 9,
1767
- n0,
1768
- _ARWWI,
1769
- 0,
1770
- () => exports.AssumeRoleWithWebIdentityRequest$,
1771
- () => exports.AssumeRoleWithWebIdentityResponse$,
1772
- ];
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;
1773
985
 
1774
986
 
1775
987
  /***/ }),
@@ -1779,13 +991,48 @@ exports.AssumeRoleWithWebIdentity$ = [
1779
991
 
1780
992
 
1781
993
 
1782
- var middlewareSdkS3 = __webpack_require__(7445);
1783
994
  var signatureV4 = __webpack_require__(5118);
1784
995
 
1785
996
  const signatureV4CrtContainer = {
1786
997
  CrtSignerV4: null,
1787
998
  };
1788
999
 
1000
+ const SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token";
1001
+ const SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase();
1002
+ class SignatureV4SignWithCredentials extends signatureV4.SignatureV4 {
1003
+ async signWithCredentials(requestToSign, credentials, options) {
1004
+ const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
1005
+ requestToSign.headers[SESSION_TOKEN_HEADER] = credentials.sessionToken;
1006
+ const privateAccess = this;
1007
+ setSingleOverride(privateAccess, credentialsWithoutSessionToken);
1008
+ return privateAccess.signRequest(requestToSign, options ?? {});
1009
+ }
1010
+ async presignWithCredentials(requestToSign, credentials, options) {
1011
+ const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
1012
+ delete requestToSign.headers[SESSION_TOKEN_HEADER];
1013
+ requestToSign.headers[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
1014
+ requestToSign.query = requestToSign.query ?? {};
1015
+ requestToSign.query[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
1016
+ const privateAccess = this;
1017
+ setSingleOverride(privateAccess, credentialsWithoutSessionToken);
1018
+ return this.presign(requestToSign, options);
1019
+ }
1020
+ }
1021
+ function getCredentialsWithoutSessionToken(credentials) {
1022
+ return {
1023
+ accessKeyId: credentials.accessKeyId,
1024
+ secretAccessKey: credentials.secretAccessKey,
1025
+ expiration: credentials.expiration,
1026
+ };
1027
+ }
1028
+ function setSingleOverride(privateAccess, credentialsWithoutSessionToken) {
1029
+ const currentCredentialProvider = privateAccess.credentialProvider;
1030
+ privateAccess.credentialProvider = () => {
1031
+ privateAccess.credentialProvider = currentCredentialProvider;
1032
+ return Promise.resolve(credentialsWithoutSessionToken);
1033
+ };
1034
+ }
1035
+
1789
1036
  class SignatureV4MultiRegion {
1790
1037
  sigv4aSigner;
1791
1038
  sigv4Signer;
@@ -1800,7 +1047,7 @@ class SignatureV4MultiRegion {
1800
1047
  return "none";
1801
1048
  }
1802
1049
  constructor(options) {
1803
- this.sigv4Signer = new middlewareSdkS3.SignatureV4S3Express(options);
1050
+ this.sigv4Signer = new SignatureV4SignWithCredentials(options);
1804
1051
  this.signerOptions = options;
1805
1052
  }
1806
1053
  async sign(requestToSign, options = {}) {
@@ -1897,50 +1144,10 @@ class SignatureV4MultiRegion {
1897
1144
  }
1898
1145
 
1899
1146
  exports.SignatureV4MultiRegion = SignatureV4MultiRegion;
1147
+ exports.SignatureV4SignWithCredentials = SignatureV4SignWithCredentials;
1900
1148
  exports.signatureV4CrtContainer = signatureV4CrtContainer;
1901
1149
 
1902
1150
 
1903
- /***/ }),
1904
-
1905
- /***/ 6369:
1906
- /***/ ((__unused_webpack_module, exports) => {
1907
-
1908
-
1909
-
1910
- const validate = (str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6;
1911
- const parse = (arn) => {
1912
- const segments = arn.split(":");
1913
- if (segments.length < 6 || segments[0] !== "arn")
1914
- throw new Error("Malformed ARN");
1915
- const [, partition, service, region, accountId, ...resource] = segments;
1916
- return {
1917
- partition,
1918
- service,
1919
- region,
1920
- accountId,
1921
- resource: resource.join(":"),
1922
- };
1923
- };
1924
- const build = (arnObject) => {
1925
- const { partition = "aws", service, region, accountId, resource } = arnObject;
1926
- if ([service, region, accountId, resource].some((segment) => typeof segment !== "string")) {
1927
- throw new Error("Input ARN object is invalid");
1928
- }
1929
- return `arn:${partition}:${service}:${region}:${accountId}:${resource}`;
1930
- };
1931
-
1932
- exports.build = build;
1933
- exports.parse = parse;
1934
- exports.validate = validate;
1935
-
1936
-
1937
- /***/ }),
1938
-
1939
- /***/ 9955:
1940
- /***/ ((module) => {
1941
-
1942
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/nested-clients","version":"3.997.3","description":"Nested clients for AWS SDK packages.","main":"./dist-cjs/index.js","module":"./dist-es/index.js","types":"./dist-types/index.d.ts","scripts":{"build":"yarn lint && concurrently \'yarn:build:types\' \'yarn:build:es\' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline nested-clients","build:es":"tsc -p tsconfig.es.json","build:include:deps":"yarn g:turbo run build -F=\\"$npm_package_name\\"","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo","lint":"node ../../scripts/validation/submodules-linter.js --pkg nested-clients","test":"yarn g:vitest run","test:watch":"yarn g:vitest watch"},"engines":{"node":">=20.0.0"},"sideEffects":false,"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","dependencies":{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"^3.974.5","@aws-sdk/middleware-host-header":"^3.972.10","@aws-sdk/middleware-logger":"^3.972.10","@aws-sdk/middleware-recursion-detection":"^3.972.11","@aws-sdk/middleware-user-agent":"^3.972.35","@aws-sdk/region-config-resolver":"^3.972.13","@aws-sdk/signature-v4-multi-region":"^3.996.22","@aws-sdk/types":"^3.973.8","@aws-sdk/util-endpoints":"^3.996.8","@aws-sdk/util-user-agent-browser":"^3.972.10","@aws-sdk/util-user-agent-node":"^3.973.21","@smithy/config-resolver":"^4.4.17","@smithy/core":"^3.23.17","@smithy/fetch-http-handler":"^5.3.17","@smithy/hash-node":"^4.2.14","@smithy/invalid-dependency":"^4.2.14","@smithy/middleware-content-length":"^4.2.14","@smithy/middleware-endpoint":"^4.4.32","@smithy/middleware-retry":"^4.5.5","@smithy/middleware-serde":"^4.2.20","@smithy/middleware-stack":"^4.2.14","@smithy/node-config-provider":"^4.3.14","@smithy/node-http-handler":"^4.6.1","@smithy/protocol-http":"^5.3.14","@smithy/smithy-client":"^4.12.13","@smithy/types":"^4.14.1","@smithy/url-parser":"^4.2.14","@smithy/util-base64":"^4.3.2","@smithy/util-body-length-browser":"^4.2.2","@smithy/util-body-length-node":"^4.2.3","@smithy/util-defaults-mode-browser":"^4.3.49","@smithy/util-defaults-mode-node":"^4.2.54","@smithy/util-endpoints":"^3.4.2","@smithy/util-middleware":"^4.2.14","@smithy/util-retry":"^4.3.4","@smithy/util-utf8":"^4.2.2","tslib":"^2.6.2"},"devDependencies":{"concurrently":"7.0.0","downlevel-dts":"0.10.1","premove":"4.0.0","typescript":"~5.8.3"},"typesVersions":{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["./cognito-identity.d.ts","./cognito-identity.js","./signin.d.ts","./signin.js","./sso-oidc.d.ts","./sso-oidc.js","./sso.d.ts","./sso.js","./sts.d.ts","./sts.js","dist-*/**"],"browser":{"./dist-es/submodules/cognito-identity/runtimeConfig":"./dist-es/submodules/cognito-identity/runtimeConfig.browser","./dist-es/submodules/signin/runtimeConfig":"./dist-es/submodules/signin/runtimeConfig.browser","./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sso/runtimeConfig":"./dist-es/submodules/sso/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},"react-native":{},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"packages/nested-clients"},"exports":{"./package.json":"./package.json","./sso-oidc":{"types":"./dist-types/submodules/sso-oidc/index.d.ts","module":"./dist-es/submodules/sso-oidc/index.js","node":"./dist-cjs/submodules/sso-oidc/index.js","import":"./dist-es/submodules/sso-oidc/index.js","require":"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{"types":"./dist-types/submodules/sts/index.d.ts","module":"./dist-es/submodules/sts/index.js","node":"./dist-cjs/submodules/sts/index.js","import":"./dist-es/submodules/sts/index.js","require":"./dist-cjs/submodules/sts/index.js"},"./signin":{"types":"./dist-types/submodules/signin/index.d.ts","module":"./dist-es/submodules/signin/index.js","node":"./dist-cjs/submodules/signin/index.js","import":"./dist-es/submodules/signin/index.js","require":"./dist-cjs/submodules/signin/index.js"},"./cognito-identity":{"types":"./dist-types/submodules/cognito-identity/index.d.ts","module":"./dist-es/submodules/cognito-identity/index.js","node":"./dist-cjs/submodules/cognito-identity/index.js","import":"./dist-es/submodules/cognito-identity/index.js","require":"./dist-cjs/submodules/cognito-identity/index.js"},"./sso":{"types":"./dist-types/submodules/sso/index.d.ts","module":"./dist-es/submodules/sso/index.js","node":"./dist-cjs/submodules/sso/index.js","import":"./dist-es/submodules/sso/index.js","require":"./dist-cjs/submodules/sso/index.js"}}}');
1943
-
1944
1151
  /***/ })
1945
1152
 
1946
1153
  };