@aws-sdk/client-sts 3.901.0 → 3.907.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist-cjs/index.js +1354 -1502
  2. package/package.json +6 -6
package/dist-cjs/index.js CHANGED
@@ -1,1547 +1,1399 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ 'use strict';
21
2
 
22
- // src/index.ts
23
- var index_exports = {};
24
- __export(index_exports, {
25
- AssumeRoleCommand: () => AssumeRoleCommand,
26
- AssumeRoleResponseFilterSensitiveLog: () => AssumeRoleResponseFilterSensitiveLog,
27
- AssumeRoleWithSAMLCommand: () => AssumeRoleWithSAMLCommand,
28
- AssumeRoleWithSAMLRequestFilterSensitiveLog: () => AssumeRoleWithSAMLRequestFilterSensitiveLog,
29
- AssumeRoleWithSAMLResponseFilterSensitiveLog: () => AssumeRoleWithSAMLResponseFilterSensitiveLog,
30
- AssumeRoleWithWebIdentityCommand: () => AssumeRoleWithWebIdentityCommand,
31
- AssumeRoleWithWebIdentityRequestFilterSensitiveLog: () => AssumeRoleWithWebIdentityRequestFilterSensitiveLog,
32
- AssumeRoleWithWebIdentityResponseFilterSensitiveLog: () => AssumeRoleWithWebIdentityResponseFilterSensitiveLog,
33
- AssumeRootCommand: () => AssumeRootCommand,
34
- AssumeRootResponseFilterSensitiveLog: () => AssumeRootResponseFilterSensitiveLog,
35
- ClientInputEndpointParameters: () => import_EndpointParameters10.ClientInputEndpointParameters,
36
- CredentialsFilterSensitiveLog: () => CredentialsFilterSensitiveLog,
37
- DecodeAuthorizationMessageCommand: () => DecodeAuthorizationMessageCommand,
38
- ExpiredTokenException: () => ExpiredTokenException,
39
- GetAccessKeyInfoCommand: () => GetAccessKeyInfoCommand,
40
- GetCallerIdentityCommand: () => GetCallerIdentityCommand,
41
- GetFederationTokenCommand: () => GetFederationTokenCommand,
42
- GetFederationTokenResponseFilterSensitiveLog: () => GetFederationTokenResponseFilterSensitiveLog,
43
- GetSessionTokenCommand: () => GetSessionTokenCommand,
44
- GetSessionTokenResponseFilterSensitiveLog: () => GetSessionTokenResponseFilterSensitiveLog,
45
- IDPCommunicationErrorException: () => IDPCommunicationErrorException,
46
- IDPRejectedClaimException: () => IDPRejectedClaimException,
47
- InvalidAuthorizationMessageException: () => InvalidAuthorizationMessageException,
48
- InvalidIdentityTokenException: () => InvalidIdentityTokenException,
49
- MalformedPolicyDocumentException: () => MalformedPolicyDocumentException,
50
- PackedPolicyTooLargeException: () => PackedPolicyTooLargeException,
51
- RegionDisabledException: () => RegionDisabledException,
52
- STS: () => STS,
53
- STSServiceException: () => STSServiceException,
54
- decorateDefaultCredentialProvider: () => decorateDefaultCredentialProvider,
55
- getDefaultRoleAssumer: () => getDefaultRoleAssumer2,
56
- getDefaultRoleAssumerWithWebIdentity: () => getDefaultRoleAssumerWithWebIdentity2
57
- });
58
- module.exports = __toCommonJS(index_exports);
59
- __reExport(index_exports, require("././STSClient"), module.exports);
60
-
61
- // src/STS.ts
62
-
63
-
64
- // src/commands/AssumeRoleCommand.ts
65
- var import_middleware_endpoint = require("@smithy/middleware-endpoint");
66
- var import_middleware_serde = require("@smithy/middleware-serde");
67
-
68
- var import_EndpointParameters = require("./endpoint/EndpointParameters");
69
-
70
- // src/models/models_0.ts
3
+ var STSClient = require('./STSClient');
4
+ var smithyClient = require('@smithy/smithy-client');
5
+ var middlewareEndpoint = require('@smithy/middleware-endpoint');
6
+ var middlewareSerde = require('@smithy/middleware-serde');
7
+ var EndpointParameters = require('./endpoint/EndpointParameters');
8
+ var core = require('@aws-sdk/core');
9
+ var protocolHttp = require('@smithy/protocol-http');
10
+ var client = require('@aws-sdk/core/client');
71
11
 
12
+ class STSServiceException extends smithyClient.ServiceException {
13
+ constructor(options) {
14
+ super(options);
15
+ Object.setPrototypeOf(this, STSServiceException.prototype);
16
+ }
17
+ }
72
18
 
73
- // src/models/STSServiceException.ts
74
- var import_smithy_client = require("@smithy/smithy-client");
75
- var STSServiceException = class _STSServiceException extends import_smithy_client.ServiceException {
76
- static {
77
- __name(this, "STSServiceException");
78
- }
79
- /**
80
- * @internal
81
- */
82
- constructor(options) {
83
- super(options);
84
- Object.setPrototypeOf(this, _STSServiceException.prototype);
85
- }
86
- };
19
+ class ExpiredTokenException extends STSServiceException {
20
+ name = "ExpiredTokenException";
21
+ $fault = "client";
22
+ constructor(opts) {
23
+ super({
24
+ name: "ExpiredTokenException",
25
+ $fault: "client",
26
+ ...opts,
27
+ });
28
+ Object.setPrototypeOf(this, ExpiredTokenException.prototype);
29
+ }
30
+ }
31
+ class MalformedPolicyDocumentException extends STSServiceException {
32
+ name = "MalformedPolicyDocumentException";
33
+ $fault = "client";
34
+ constructor(opts) {
35
+ super({
36
+ name: "MalformedPolicyDocumentException",
37
+ $fault: "client",
38
+ ...opts,
39
+ });
40
+ Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype);
41
+ }
42
+ }
43
+ class PackedPolicyTooLargeException extends STSServiceException {
44
+ name = "PackedPolicyTooLargeException";
45
+ $fault = "client";
46
+ constructor(opts) {
47
+ super({
48
+ name: "PackedPolicyTooLargeException",
49
+ $fault: "client",
50
+ ...opts,
51
+ });
52
+ Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype);
53
+ }
54
+ }
55
+ class RegionDisabledException extends STSServiceException {
56
+ name = "RegionDisabledException";
57
+ $fault = "client";
58
+ constructor(opts) {
59
+ super({
60
+ name: "RegionDisabledException",
61
+ $fault: "client",
62
+ ...opts,
63
+ });
64
+ Object.setPrototypeOf(this, RegionDisabledException.prototype);
65
+ }
66
+ }
67
+ class IDPRejectedClaimException extends STSServiceException {
68
+ name = "IDPRejectedClaimException";
69
+ $fault = "client";
70
+ constructor(opts) {
71
+ super({
72
+ name: "IDPRejectedClaimException",
73
+ $fault: "client",
74
+ ...opts,
75
+ });
76
+ Object.setPrototypeOf(this, IDPRejectedClaimException.prototype);
77
+ }
78
+ }
79
+ class InvalidIdentityTokenException extends STSServiceException {
80
+ name = "InvalidIdentityTokenException";
81
+ $fault = "client";
82
+ constructor(opts) {
83
+ super({
84
+ name: "InvalidIdentityTokenException",
85
+ $fault: "client",
86
+ ...opts,
87
+ });
88
+ Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype);
89
+ }
90
+ }
91
+ class IDPCommunicationErrorException extends STSServiceException {
92
+ name = "IDPCommunicationErrorException";
93
+ $fault = "client";
94
+ constructor(opts) {
95
+ super({
96
+ name: "IDPCommunicationErrorException",
97
+ $fault: "client",
98
+ ...opts,
99
+ });
100
+ Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype);
101
+ }
102
+ }
103
+ class InvalidAuthorizationMessageException extends STSServiceException {
104
+ name = "InvalidAuthorizationMessageException";
105
+ $fault = "client";
106
+ constructor(opts) {
107
+ super({
108
+ name: "InvalidAuthorizationMessageException",
109
+ $fault: "client",
110
+ ...opts,
111
+ });
112
+ Object.setPrototypeOf(this, InvalidAuthorizationMessageException.prototype);
113
+ }
114
+ }
115
+ const CredentialsFilterSensitiveLog = (obj) => ({
116
+ ...obj,
117
+ ...(obj.SecretAccessKey && { SecretAccessKey: smithyClient.SENSITIVE_STRING }),
118
+ });
119
+ const AssumeRoleResponseFilterSensitiveLog = (obj) => ({
120
+ ...obj,
121
+ ...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
122
+ });
123
+ const AssumeRoleWithSAMLRequestFilterSensitiveLog = (obj) => ({
124
+ ...obj,
125
+ ...(obj.SAMLAssertion && { SAMLAssertion: smithyClient.SENSITIVE_STRING }),
126
+ });
127
+ const AssumeRoleWithSAMLResponseFilterSensitiveLog = (obj) => ({
128
+ ...obj,
129
+ ...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
130
+ });
131
+ const AssumeRoleWithWebIdentityRequestFilterSensitiveLog = (obj) => ({
132
+ ...obj,
133
+ ...(obj.WebIdentityToken && { WebIdentityToken: smithyClient.SENSITIVE_STRING }),
134
+ });
135
+ const AssumeRoleWithWebIdentityResponseFilterSensitiveLog = (obj) => ({
136
+ ...obj,
137
+ ...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
138
+ });
139
+ const AssumeRootResponseFilterSensitiveLog = (obj) => ({
140
+ ...obj,
141
+ ...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
142
+ });
143
+ const GetFederationTokenResponseFilterSensitiveLog = (obj) => ({
144
+ ...obj,
145
+ ...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
146
+ });
147
+ const GetSessionTokenResponseFilterSensitiveLog = (obj) => ({
148
+ ...obj,
149
+ ...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
150
+ });
87
151
 
88
- // src/models/models_0.ts
89
- var ExpiredTokenException = class _ExpiredTokenException extends STSServiceException {
90
- static {
91
- __name(this, "ExpiredTokenException");
92
- }
93
- name = "ExpiredTokenException";
94
- $fault = "client";
95
- /**
96
- * @internal
97
- */
98
- constructor(opts) {
99
- super({
100
- name: "ExpiredTokenException",
101
- $fault: "client",
102
- ...opts
103
- });
104
- Object.setPrototypeOf(this, _ExpiredTokenException.prototype);
105
- }
106
- };
107
- var MalformedPolicyDocumentException = class _MalformedPolicyDocumentException extends STSServiceException {
108
- static {
109
- __name(this, "MalformedPolicyDocumentException");
110
- }
111
- name = "MalformedPolicyDocumentException";
112
- $fault = "client";
113
- /**
114
- * @internal
115
- */
116
- constructor(opts) {
117
- super({
118
- name: "MalformedPolicyDocumentException",
119
- $fault: "client",
120
- ...opts
152
+ const se_AssumeRoleCommand = async (input, context) => {
153
+ const headers = SHARED_HEADERS;
154
+ let body;
155
+ body = buildFormUrlencodedString({
156
+ ...se_AssumeRoleRequest(input),
157
+ [_A]: _AR,
158
+ [_V]: _,
121
159
  });
122
- Object.setPrototypeOf(this, _MalformedPolicyDocumentException.prototype);
123
- }
124
- };
125
- var PackedPolicyTooLargeException = class _PackedPolicyTooLargeException extends STSServiceException {
126
- static {
127
- __name(this, "PackedPolicyTooLargeException");
128
- }
129
- name = "PackedPolicyTooLargeException";
130
- $fault = "client";
131
- /**
132
- * @internal
133
- */
134
- constructor(opts) {
135
- super({
136
- name: "PackedPolicyTooLargeException",
137
- $fault: "client",
138
- ...opts
139
- });
140
- Object.setPrototypeOf(this, _PackedPolicyTooLargeException.prototype);
141
- }
142
- };
143
- var RegionDisabledException = class _RegionDisabledException extends STSServiceException {
144
- static {
145
- __name(this, "RegionDisabledException");
146
- }
147
- name = "RegionDisabledException";
148
- $fault = "client";
149
- /**
150
- * @internal
151
- */
152
- constructor(opts) {
153
- super({
154
- name: "RegionDisabledException",
155
- $fault: "client",
156
- ...opts
157
- });
158
- Object.setPrototypeOf(this, _RegionDisabledException.prototype);
159
- }
160
- };
161
- var IDPRejectedClaimException = class _IDPRejectedClaimException extends STSServiceException {
162
- static {
163
- __name(this, "IDPRejectedClaimException");
164
- }
165
- name = "IDPRejectedClaimException";
166
- $fault = "client";
167
- /**
168
- * @internal
169
- */
170
- constructor(opts) {
171
- super({
172
- name: "IDPRejectedClaimException",
173
- $fault: "client",
174
- ...opts
160
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
161
+ };
162
+ const se_AssumeRoleWithSAMLCommand = async (input, context) => {
163
+ const headers = SHARED_HEADERS;
164
+ let body;
165
+ body = buildFormUrlencodedString({
166
+ ...se_AssumeRoleWithSAMLRequest(input),
167
+ [_A]: _ARWSAML,
168
+ [_V]: _,
175
169
  });
176
- Object.setPrototypeOf(this, _IDPRejectedClaimException.prototype);
177
- }
178
- };
179
- var InvalidIdentityTokenException = class _InvalidIdentityTokenException extends STSServiceException {
180
- static {
181
- __name(this, "InvalidIdentityTokenException");
182
- }
183
- name = "InvalidIdentityTokenException";
184
- $fault = "client";
185
- /**
186
- * @internal
187
- */
188
- constructor(opts) {
189
- super({
190
- name: "InvalidIdentityTokenException",
191
- $fault: "client",
192
- ...opts
170
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
171
+ };
172
+ const se_AssumeRoleWithWebIdentityCommand = async (input, context) => {
173
+ const headers = SHARED_HEADERS;
174
+ let body;
175
+ body = buildFormUrlencodedString({
176
+ ...se_AssumeRoleWithWebIdentityRequest(input),
177
+ [_A]: _ARWWI,
178
+ [_V]: _,
193
179
  });
194
- Object.setPrototypeOf(this, _InvalidIdentityTokenException.prototype);
195
- }
196
- };
197
- var IDPCommunicationErrorException = class _IDPCommunicationErrorException extends STSServiceException {
198
- static {
199
- __name(this, "IDPCommunicationErrorException");
200
- }
201
- name = "IDPCommunicationErrorException";
202
- $fault = "client";
203
- /**
204
- * @internal
205
- */
206
- constructor(opts) {
207
- super({
208
- name: "IDPCommunicationErrorException",
209
- $fault: "client",
210
- ...opts
180
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
181
+ };
182
+ const se_AssumeRootCommand = async (input, context) => {
183
+ const headers = SHARED_HEADERS;
184
+ let body;
185
+ body = buildFormUrlencodedString({
186
+ ...se_AssumeRootRequest(input),
187
+ [_A]: _ARs,
188
+ [_V]: _,
211
189
  });
212
- Object.setPrototypeOf(this, _IDPCommunicationErrorException.prototype);
213
- }
214
- };
215
- var InvalidAuthorizationMessageException = class _InvalidAuthorizationMessageException extends STSServiceException {
216
- static {
217
- __name(this, "InvalidAuthorizationMessageException");
218
- }
219
- name = "InvalidAuthorizationMessageException";
220
- $fault = "client";
221
- /**
222
- * @internal
223
- */
224
- constructor(opts) {
225
- super({
226
- name: "InvalidAuthorizationMessageException",
227
- $fault: "client",
228
- ...opts
190
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
191
+ };
192
+ const se_DecodeAuthorizationMessageCommand = async (input, context) => {
193
+ const headers = SHARED_HEADERS;
194
+ let body;
195
+ body = buildFormUrlencodedString({
196
+ ...se_DecodeAuthorizationMessageRequest(input),
197
+ [_A]: _DAM,
198
+ [_V]: _,
229
199
  });
230
- Object.setPrototypeOf(this, _InvalidAuthorizationMessageException.prototype);
231
- }
232
- };
233
- var CredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
234
- ...obj,
235
- ...obj.SecretAccessKey && { SecretAccessKey: import_smithy_client.SENSITIVE_STRING }
236
- }), "CredentialsFilterSensitiveLog");
237
- var AssumeRoleResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
238
- ...obj,
239
- ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
240
- }), "AssumeRoleResponseFilterSensitiveLog");
241
- var AssumeRoleWithSAMLRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
242
- ...obj,
243
- ...obj.SAMLAssertion && { SAMLAssertion: import_smithy_client.SENSITIVE_STRING }
244
- }), "AssumeRoleWithSAMLRequestFilterSensitiveLog");
245
- var AssumeRoleWithSAMLResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
246
- ...obj,
247
- ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
248
- }), "AssumeRoleWithSAMLResponseFilterSensitiveLog");
249
- var AssumeRoleWithWebIdentityRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
250
- ...obj,
251
- ...obj.WebIdentityToken && { WebIdentityToken: import_smithy_client.SENSITIVE_STRING }
252
- }), "AssumeRoleWithWebIdentityRequestFilterSensitiveLog");
253
- var AssumeRoleWithWebIdentityResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
254
- ...obj,
255
- ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
256
- }), "AssumeRoleWithWebIdentityResponseFilterSensitiveLog");
257
- var AssumeRootResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
258
- ...obj,
259
- ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
260
- }), "AssumeRootResponseFilterSensitiveLog");
261
- var GetFederationTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
262
- ...obj,
263
- ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
264
- }), "GetFederationTokenResponseFilterSensitiveLog");
265
- var GetSessionTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
266
- ...obj,
267
- ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
268
- }), "GetSessionTokenResponseFilterSensitiveLog");
269
-
270
- // src/protocols/Aws_query.ts
271
- var import_core = require("@aws-sdk/core");
272
- var import_protocol_http = require("@smithy/protocol-http");
273
-
274
- var se_AssumeRoleCommand = /* @__PURE__ */ __name(async (input, context) => {
275
- const headers = SHARED_HEADERS;
276
- let body;
277
- body = buildFormUrlencodedString({
278
- ...se_AssumeRoleRequest(input, context),
279
- [_A]: _AR,
280
- [_V]: _
281
- });
282
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
283
- }, "se_AssumeRoleCommand");
284
- var se_AssumeRoleWithSAMLCommand = /* @__PURE__ */ __name(async (input, context) => {
285
- const headers = SHARED_HEADERS;
286
- let body;
287
- body = buildFormUrlencodedString({
288
- ...se_AssumeRoleWithSAMLRequest(input, context),
289
- [_A]: _ARWSAML,
290
- [_V]: _
291
- });
292
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
293
- }, "se_AssumeRoleWithSAMLCommand");
294
- var se_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (input, context) => {
295
- const headers = SHARED_HEADERS;
296
- let body;
297
- body = buildFormUrlencodedString({
298
- ...se_AssumeRoleWithWebIdentityRequest(input, context),
299
- [_A]: _ARWWI,
300
- [_V]: _
301
- });
302
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
303
- }, "se_AssumeRoleWithWebIdentityCommand");
304
- var se_AssumeRootCommand = /* @__PURE__ */ __name(async (input, context) => {
305
- const headers = SHARED_HEADERS;
306
- let body;
307
- body = buildFormUrlencodedString({
308
- ...se_AssumeRootRequest(input, context),
309
- [_A]: _ARs,
310
- [_V]: _
311
- });
312
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
313
- }, "se_AssumeRootCommand");
314
- var se_DecodeAuthorizationMessageCommand = /* @__PURE__ */ __name(async (input, context) => {
315
- const headers = SHARED_HEADERS;
316
- let body;
317
- body = buildFormUrlencodedString({
318
- ...se_DecodeAuthorizationMessageRequest(input, context),
319
- [_A]: _DAM,
320
- [_V]: _
321
- });
322
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
323
- }, "se_DecodeAuthorizationMessageCommand");
324
- var se_GetAccessKeyInfoCommand = /* @__PURE__ */ __name(async (input, context) => {
325
- const headers = SHARED_HEADERS;
326
- let body;
327
- body = buildFormUrlencodedString({
328
- ...se_GetAccessKeyInfoRequest(input, context),
329
- [_A]: _GAKI,
330
- [_V]: _
331
- });
332
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
333
- }, "se_GetAccessKeyInfoCommand");
334
- var se_GetCallerIdentityCommand = /* @__PURE__ */ __name(async (input, context) => {
335
- const headers = SHARED_HEADERS;
336
- let body;
337
- body = buildFormUrlencodedString({
338
- ...se_GetCallerIdentityRequest(input, context),
339
- [_A]: _GCI,
340
- [_V]: _
341
- });
342
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
343
- }, "se_GetCallerIdentityCommand");
344
- var se_GetFederationTokenCommand = /* @__PURE__ */ __name(async (input, context) => {
345
- const headers = SHARED_HEADERS;
346
- let body;
347
- body = buildFormUrlencodedString({
348
- ...se_GetFederationTokenRequest(input, context),
349
- [_A]: _GFT,
350
- [_V]: _
351
- });
352
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
353
- }, "se_GetFederationTokenCommand");
354
- var se_GetSessionTokenCommand = /* @__PURE__ */ __name(async (input, context) => {
355
- const headers = SHARED_HEADERS;
356
- let body;
357
- body = buildFormUrlencodedString({
358
- ...se_GetSessionTokenRequest(input, context),
359
- [_A]: _GST,
360
- [_V]: _
361
- });
362
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
363
- }, "se_GetSessionTokenCommand");
364
- var de_AssumeRoleCommand = /* @__PURE__ */ __name(async (output, context) => {
365
- if (output.statusCode >= 300) {
366
- return de_CommandError(output, context);
367
- }
368
- const data = await (0, import_core.parseXmlBody)(output.body, context);
369
- let contents = {};
370
- contents = de_AssumeRoleResponse(data.AssumeRoleResult, context);
371
- const response = {
372
- $metadata: deserializeMetadata(output),
373
- ...contents
374
- };
375
- return response;
376
- }, "de_AssumeRoleCommand");
377
- var de_AssumeRoleWithSAMLCommand = /* @__PURE__ */ __name(async (output, context) => {
378
- if (output.statusCode >= 300) {
379
- return de_CommandError(output, context);
380
- }
381
- const data = await (0, import_core.parseXmlBody)(output.body, context);
382
- let contents = {};
383
- contents = de_AssumeRoleWithSAMLResponse(data.AssumeRoleWithSAMLResult, context);
384
- const response = {
385
- $metadata: deserializeMetadata(output),
386
- ...contents
387
- };
388
- return response;
389
- }, "de_AssumeRoleWithSAMLCommand");
390
- var de_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (output, context) => {
391
- if (output.statusCode >= 300) {
392
- return de_CommandError(output, context);
393
- }
394
- const data = await (0, import_core.parseXmlBody)(output.body, context);
395
- let contents = {};
396
- contents = de_AssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult, context);
397
- const response = {
398
- $metadata: deserializeMetadata(output),
399
- ...contents
400
- };
401
- return response;
402
- }, "de_AssumeRoleWithWebIdentityCommand");
403
- var de_AssumeRootCommand = /* @__PURE__ */ __name(async (output, context) => {
404
- if (output.statusCode >= 300) {
405
- return de_CommandError(output, context);
406
- }
407
- const data = await (0, import_core.parseXmlBody)(output.body, context);
408
- let contents = {};
409
- contents = de_AssumeRootResponse(data.AssumeRootResult, context);
410
- const response = {
411
- $metadata: deserializeMetadata(output),
412
- ...contents
413
- };
414
- return response;
415
- }, "de_AssumeRootCommand");
416
- var de_DecodeAuthorizationMessageCommand = /* @__PURE__ */ __name(async (output, context) => {
417
- if (output.statusCode >= 300) {
418
- return de_CommandError(output, context);
419
- }
420
- const data = await (0, import_core.parseXmlBody)(output.body, context);
421
- let contents = {};
422
- contents = de_DecodeAuthorizationMessageResponse(data.DecodeAuthorizationMessageResult, context);
423
- const response = {
424
- $metadata: deserializeMetadata(output),
425
- ...contents
426
- };
427
- return response;
428
- }, "de_DecodeAuthorizationMessageCommand");
429
- var de_GetAccessKeyInfoCommand = /* @__PURE__ */ __name(async (output, context) => {
430
- if (output.statusCode >= 300) {
431
- return de_CommandError(output, context);
432
- }
433
- const data = await (0, import_core.parseXmlBody)(output.body, context);
434
- let contents = {};
435
- contents = de_GetAccessKeyInfoResponse(data.GetAccessKeyInfoResult, context);
436
- const response = {
437
- $metadata: deserializeMetadata(output),
438
- ...contents
439
- };
440
- return response;
441
- }, "de_GetAccessKeyInfoCommand");
442
- var de_GetCallerIdentityCommand = /* @__PURE__ */ __name(async (output, context) => {
443
- if (output.statusCode >= 300) {
444
- return de_CommandError(output, context);
445
- }
446
- const data = await (0, import_core.parseXmlBody)(output.body, context);
447
- let contents = {};
448
- contents = de_GetCallerIdentityResponse(data.GetCallerIdentityResult, context);
449
- const response = {
450
- $metadata: deserializeMetadata(output),
451
- ...contents
452
- };
453
- return response;
454
- }, "de_GetCallerIdentityCommand");
455
- var de_GetFederationTokenCommand = /* @__PURE__ */ __name(async (output, context) => {
456
- if (output.statusCode >= 300) {
457
- return de_CommandError(output, context);
458
- }
459
- const data = await (0, import_core.parseXmlBody)(output.body, context);
460
- let contents = {};
461
- contents = de_GetFederationTokenResponse(data.GetFederationTokenResult, context);
462
- const response = {
463
- $metadata: deserializeMetadata(output),
464
- ...contents
465
- };
466
- return response;
467
- }, "de_GetFederationTokenCommand");
468
- var de_GetSessionTokenCommand = /* @__PURE__ */ __name(async (output, context) => {
469
- if (output.statusCode >= 300) {
470
- return de_CommandError(output, context);
471
- }
472
- const data = await (0, import_core.parseXmlBody)(output.body, context);
473
- let contents = {};
474
- contents = de_GetSessionTokenResponse(data.GetSessionTokenResult, context);
475
- const response = {
476
- $metadata: deserializeMetadata(output),
477
- ...contents
478
- };
479
- return response;
480
- }, "de_GetSessionTokenCommand");
481
- var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
482
- const parsedOutput = {
483
- ...output,
484
- body: await (0, import_core.parseXmlErrorBody)(output.body, context)
485
- };
486
- const errorCode = loadQueryErrorCode(output, parsedOutput.body);
487
- switch (errorCode) {
488
- case "ExpiredTokenException":
489
- case "com.amazonaws.sts#ExpiredTokenException":
490
- throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
491
- case "MalformedPolicyDocument":
492
- case "com.amazonaws.sts#MalformedPolicyDocumentException":
493
- throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
494
- case "PackedPolicyTooLarge":
495
- case "com.amazonaws.sts#PackedPolicyTooLargeException":
496
- throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context);
497
- case "RegionDisabledException":
498
- case "com.amazonaws.sts#RegionDisabledException":
499
- throw await de_RegionDisabledExceptionRes(parsedOutput, context);
500
- case "IDPRejectedClaim":
501
- case "com.amazonaws.sts#IDPRejectedClaimException":
502
- throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context);
503
- case "InvalidIdentityToken":
504
- case "com.amazonaws.sts#InvalidIdentityTokenException":
505
- throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context);
506
- case "IDPCommunicationError":
507
- case "com.amazonaws.sts#IDPCommunicationErrorException":
508
- throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context);
509
- case "InvalidAuthorizationMessageException":
510
- case "com.amazonaws.sts#InvalidAuthorizationMessageException":
511
- throw await de_InvalidAuthorizationMessageExceptionRes(parsedOutput, context);
512
- default:
513
- const parsedBody = parsedOutput.body;
514
- return throwDefaultError({
515
- output,
516
- parsedBody: parsedBody.Error,
517
- errorCode
518
- });
519
- }
520
- }, "de_CommandError");
521
- var de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
522
- const body = parsedOutput.body;
523
- const deserialized = de_ExpiredTokenException(body.Error, context);
524
- const exception = new ExpiredTokenException({
525
- $metadata: deserializeMetadata(parsedOutput),
526
- ...deserialized
527
- });
528
- return (0, import_smithy_client.decorateServiceException)(exception, body);
529
- }, "de_ExpiredTokenExceptionRes");
530
- var de_IDPCommunicationErrorExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
531
- const body = parsedOutput.body;
532
- const deserialized = de_IDPCommunicationErrorException(body.Error, context);
533
- const exception = new IDPCommunicationErrorException({
534
- $metadata: deserializeMetadata(parsedOutput),
535
- ...deserialized
536
- });
537
- return (0, import_smithy_client.decorateServiceException)(exception, body);
538
- }, "de_IDPCommunicationErrorExceptionRes");
539
- var de_IDPRejectedClaimExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
540
- const body = parsedOutput.body;
541
- const deserialized = de_IDPRejectedClaimException(body.Error, context);
542
- const exception = new IDPRejectedClaimException({
543
- $metadata: deserializeMetadata(parsedOutput),
544
- ...deserialized
545
- });
546
- return (0, import_smithy_client.decorateServiceException)(exception, body);
547
- }, "de_IDPRejectedClaimExceptionRes");
548
- var de_InvalidAuthorizationMessageExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
549
- const body = parsedOutput.body;
550
- const deserialized = de_InvalidAuthorizationMessageException(body.Error, context);
551
- const exception = new InvalidAuthorizationMessageException({
552
- $metadata: deserializeMetadata(parsedOutput),
553
- ...deserialized
554
- });
555
- return (0, import_smithy_client.decorateServiceException)(exception, body);
556
- }, "de_InvalidAuthorizationMessageExceptionRes");
557
- var de_InvalidIdentityTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
558
- const body = parsedOutput.body;
559
- const deserialized = de_InvalidIdentityTokenException(body.Error, context);
560
- const exception = new InvalidIdentityTokenException({
561
- $metadata: deserializeMetadata(parsedOutput),
562
- ...deserialized
563
- });
564
- return (0, import_smithy_client.decorateServiceException)(exception, body);
565
- }, "de_InvalidIdentityTokenExceptionRes");
566
- var de_MalformedPolicyDocumentExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
567
- const body = parsedOutput.body;
568
- const deserialized = de_MalformedPolicyDocumentException(body.Error, context);
569
- const exception = new MalformedPolicyDocumentException({
570
- $metadata: deserializeMetadata(parsedOutput),
571
- ...deserialized
572
- });
573
- return (0, import_smithy_client.decorateServiceException)(exception, body);
574
- }, "de_MalformedPolicyDocumentExceptionRes");
575
- var de_PackedPolicyTooLargeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
576
- const body = parsedOutput.body;
577
- const deserialized = de_PackedPolicyTooLargeException(body.Error, context);
578
- const exception = new PackedPolicyTooLargeException({
579
- $metadata: deserializeMetadata(parsedOutput),
580
- ...deserialized
581
- });
582
- return (0, import_smithy_client.decorateServiceException)(exception, body);
583
- }, "de_PackedPolicyTooLargeExceptionRes");
584
- var de_RegionDisabledExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
585
- const body = parsedOutput.body;
586
- const deserialized = de_RegionDisabledException(body.Error, context);
587
- const exception = new RegionDisabledException({
588
- $metadata: deserializeMetadata(parsedOutput),
589
- ...deserialized
590
- });
591
- return (0, import_smithy_client.decorateServiceException)(exception, body);
592
- }, "de_RegionDisabledExceptionRes");
593
- var se_AssumeRoleRequest = /* @__PURE__ */ __name((input, context) => {
594
- const entries = {};
595
- if (input[_RA] != null) {
596
- entries[_RA] = input[_RA];
597
- }
598
- if (input[_RSN] != null) {
599
- entries[_RSN] = input[_RSN];
600
- }
601
- if (input[_PA] != null) {
602
- const memberEntries = se_policyDescriptorListType(input[_PA], context);
603
- if (input[_PA]?.length === 0) {
604
- entries.PolicyArns = [];
605
- }
606
- Object.entries(memberEntries).forEach(([key, value]) => {
607
- const loc = `PolicyArns.${key}`;
608
- entries[loc] = value;
200
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
201
+ };
202
+ const se_GetAccessKeyInfoCommand = async (input, context) => {
203
+ const headers = SHARED_HEADERS;
204
+ let body;
205
+ body = buildFormUrlencodedString({
206
+ ...se_GetAccessKeyInfoRequest(input),
207
+ [_A]: _GAKI,
208
+ [_V]: _,
609
209
  });
610
- }
611
- if (input[_P] != null) {
612
- entries[_P] = input[_P];
613
- }
614
- if (input[_DS] != null) {
615
- entries[_DS] = input[_DS];
616
- }
617
- if (input[_T] != null) {
618
- const memberEntries = se_tagListType(input[_T], context);
619
- if (input[_T]?.length === 0) {
620
- entries.Tags = [];
621
- }
622
- Object.entries(memberEntries).forEach(([key, value]) => {
623
- const loc = `Tags.${key}`;
624
- entries[loc] = value;
210
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
211
+ };
212
+ const se_GetCallerIdentityCommand = async (input, context) => {
213
+ const headers = SHARED_HEADERS;
214
+ let body;
215
+ body = buildFormUrlencodedString({
216
+ ...se_GetCallerIdentityRequest(),
217
+ [_A]: _GCI,
218
+ [_V]: _,
625
219
  });
626
- }
627
- if (input[_TTK] != null) {
628
- const memberEntries = se_tagKeyListType(input[_TTK], context);
629
- if (input[_TTK]?.length === 0) {
630
- entries.TransitiveTagKeys = [];
631
- }
632
- Object.entries(memberEntries).forEach(([key, value]) => {
633
- const loc = `TransitiveTagKeys.${key}`;
634
- entries[loc] = value;
220
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
221
+ };
222
+ const se_GetFederationTokenCommand = async (input, context) => {
223
+ const headers = SHARED_HEADERS;
224
+ let body;
225
+ body = buildFormUrlencodedString({
226
+ ...se_GetFederationTokenRequest(input),
227
+ [_A]: _GFT,
228
+ [_V]: _,
635
229
  });
636
- }
637
- if (input[_EI] != null) {
638
- entries[_EI] = input[_EI];
639
- }
640
- if (input[_SN] != null) {
641
- entries[_SN] = input[_SN];
642
- }
643
- if (input[_TC] != null) {
644
- entries[_TC] = input[_TC];
645
- }
646
- if (input[_SI] != null) {
647
- entries[_SI] = input[_SI];
648
- }
649
- if (input[_PC] != null) {
650
- const memberEntries = se_ProvidedContextsListType(input[_PC], context);
651
- if (input[_PC]?.length === 0) {
652
- entries.ProvidedContexts = [];
653
- }
654
- Object.entries(memberEntries).forEach(([key, value]) => {
655
- const loc = `ProvidedContexts.${key}`;
656
- entries[loc] = value;
230
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
231
+ };
232
+ const se_GetSessionTokenCommand = async (input, context) => {
233
+ const headers = SHARED_HEADERS;
234
+ let body;
235
+ body = buildFormUrlencodedString({
236
+ ...se_GetSessionTokenRequest(input),
237
+ [_A]: _GST,
238
+ [_V]: _,
657
239
  });
658
- }
659
- return entries;
660
- }, "se_AssumeRoleRequest");
661
- var se_AssumeRoleWithSAMLRequest = /* @__PURE__ */ __name((input, context) => {
662
- const entries = {};
663
- if (input[_RA] != null) {
664
- entries[_RA] = input[_RA];
665
- }
666
- if (input[_PAr] != null) {
667
- entries[_PAr] = input[_PAr];
668
- }
669
- if (input[_SAMLA] != null) {
670
- entries[_SAMLA] = input[_SAMLA];
671
- }
672
- if (input[_PA] != null) {
673
- const memberEntries = se_policyDescriptorListType(input[_PA], context);
674
- if (input[_PA]?.length === 0) {
675
- entries.PolicyArns = [];
676
- }
677
- Object.entries(memberEntries).forEach(([key, value]) => {
678
- const loc = `PolicyArns.${key}`;
679
- entries[loc] = value;
240
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
241
+ };
242
+ const de_AssumeRoleCommand = async (output, context) => {
243
+ if (output.statusCode >= 300) {
244
+ return de_CommandError(output, context);
245
+ }
246
+ const data = await core.parseXmlBody(output.body, context);
247
+ let contents = {};
248
+ contents = de_AssumeRoleResponse(data.AssumeRoleResult);
249
+ const response = {
250
+ $metadata: deserializeMetadata(output),
251
+ ...contents,
252
+ };
253
+ return response;
254
+ };
255
+ const de_AssumeRoleWithSAMLCommand = async (output, context) => {
256
+ if (output.statusCode >= 300) {
257
+ return de_CommandError(output, context);
258
+ }
259
+ const data = await core.parseXmlBody(output.body, context);
260
+ let contents = {};
261
+ contents = de_AssumeRoleWithSAMLResponse(data.AssumeRoleWithSAMLResult);
262
+ const response = {
263
+ $metadata: deserializeMetadata(output),
264
+ ...contents,
265
+ };
266
+ return response;
267
+ };
268
+ const de_AssumeRoleWithWebIdentityCommand = async (output, context) => {
269
+ if (output.statusCode >= 300) {
270
+ return de_CommandError(output, context);
271
+ }
272
+ const data = await core.parseXmlBody(output.body, context);
273
+ let contents = {};
274
+ contents = de_AssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult);
275
+ const response = {
276
+ $metadata: deserializeMetadata(output),
277
+ ...contents,
278
+ };
279
+ return response;
280
+ };
281
+ const de_AssumeRootCommand = async (output, context) => {
282
+ if (output.statusCode >= 300) {
283
+ return de_CommandError(output, context);
284
+ }
285
+ const data = await core.parseXmlBody(output.body, context);
286
+ let contents = {};
287
+ contents = de_AssumeRootResponse(data.AssumeRootResult);
288
+ const response = {
289
+ $metadata: deserializeMetadata(output),
290
+ ...contents,
291
+ };
292
+ return response;
293
+ };
294
+ const de_DecodeAuthorizationMessageCommand = async (output, context) => {
295
+ if (output.statusCode >= 300) {
296
+ return de_CommandError(output, context);
297
+ }
298
+ const data = await core.parseXmlBody(output.body, context);
299
+ let contents = {};
300
+ contents = de_DecodeAuthorizationMessageResponse(data.DecodeAuthorizationMessageResult);
301
+ const response = {
302
+ $metadata: deserializeMetadata(output),
303
+ ...contents,
304
+ };
305
+ return response;
306
+ };
307
+ const de_GetAccessKeyInfoCommand = async (output, context) => {
308
+ if (output.statusCode >= 300) {
309
+ return de_CommandError(output, context);
310
+ }
311
+ const data = await core.parseXmlBody(output.body, context);
312
+ let contents = {};
313
+ contents = de_GetAccessKeyInfoResponse(data.GetAccessKeyInfoResult);
314
+ const response = {
315
+ $metadata: deserializeMetadata(output),
316
+ ...contents,
317
+ };
318
+ return response;
319
+ };
320
+ const de_GetCallerIdentityCommand = async (output, context) => {
321
+ if (output.statusCode >= 300) {
322
+ return de_CommandError(output, context);
323
+ }
324
+ const data = await core.parseXmlBody(output.body, context);
325
+ let contents = {};
326
+ contents = de_GetCallerIdentityResponse(data.GetCallerIdentityResult);
327
+ const response = {
328
+ $metadata: deserializeMetadata(output),
329
+ ...contents,
330
+ };
331
+ return response;
332
+ };
333
+ const de_GetFederationTokenCommand = async (output, context) => {
334
+ if (output.statusCode >= 300) {
335
+ return de_CommandError(output, context);
336
+ }
337
+ const data = await core.parseXmlBody(output.body, context);
338
+ let contents = {};
339
+ contents = de_GetFederationTokenResponse(data.GetFederationTokenResult);
340
+ const response = {
341
+ $metadata: deserializeMetadata(output),
342
+ ...contents,
343
+ };
344
+ return response;
345
+ };
346
+ const de_GetSessionTokenCommand = async (output, context) => {
347
+ if (output.statusCode >= 300) {
348
+ return de_CommandError(output, context);
349
+ }
350
+ const data = await core.parseXmlBody(output.body, context);
351
+ let contents = {};
352
+ contents = de_GetSessionTokenResponse(data.GetSessionTokenResult);
353
+ const response = {
354
+ $metadata: deserializeMetadata(output),
355
+ ...contents,
356
+ };
357
+ return response;
358
+ };
359
+ const de_CommandError = async (output, context) => {
360
+ const parsedOutput = {
361
+ ...output,
362
+ body: await core.parseXmlErrorBody(output.body, context),
363
+ };
364
+ const errorCode = loadQueryErrorCode(output, parsedOutput.body);
365
+ switch (errorCode) {
366
+ case "ExpiredTokenException":
367
+ case "com.amazonaws.sts#ExpiredTokenException":
368
+ throw await de_ExpiredTokenExceptionRes(parsedOutput);
369
+ case "MalformedPolicyDocument":
370
+ case "com.amazonaws.sts#MalformedPolicyDocumentException":
371
+ throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput);
372
+ case "PackedPolicyTooLarge":
373
+ case "com.amazonaws.sts#PackedPolicyTooLargeException":
374
+ throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput);
375
+ case "RegionDisabledException":
376
+ case "com.amazonaws.sts#RegionDisabledException":
377
+ throw await de_RegionDisabledExceptionRes(parsedOutput);
378
+ case "IDPRejectedClaim":
379
+ case "com.amazonaws.sts#IDPRejectedClaimException":
380
+ throw await de_IDPRejectedClaimExceptionRes(parsedOutput);
381
+ case "InvalidIdentityToken":
382
+ case "com.amazonaws.sts#InvalidIdentityTokenException":
383
+ throw await de_InvalidIdentityTokenExceptionRes(parsedOutput);
384
+ case "IDPCommunicationError":
385
+ case "com.amazonaws.sts#IDPCommunicationErrorException":
386
+ throw await de_IDPCommunicationErrorExceptionRes(parsedOutput);
387
+ case "InvalidAuthorizationMessageException":
388
+ case "com.amazonaws.sts#InvalidAuthorizationMessageException":
389
+ throw await de_InvalidAuthorizationMessageExceptionRes(parsedOutput);
390
+ default:
391
+ const parsedBody = parsedOutput.body;
392
+ return throwDefaultError({
393
+ output,
394
+ parsedBody: parsedBody.Error,
395
+ errorCode,
396
+ });
397
+ }
398
+ };
399
+ const de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
400
+ const body = parsedOutput.body;
401
+ const deserialized = de_ExpiredTokenException(body.Error);
402
+ const exception = new ExpiredTokenException({
403
+ $metadata: deserializeMetadata(parsedOutput),
404
+ ...deserialized,
680
405
  });
681
- }
682
- if (input[_P] != null) {
683
- entries[_P] = input[_P];
684
- }
685
- if (input[_DS] != null) {
686
- entries[_DS] = input[_DS];
687
- }
688
- return entries;
689
- }, "se_AssumeRoleWithSAMLRequest");
690
- var se_AssumeRoleWithWebIdentityRequest = /* @__PURE__ */ __name((input, context) => {
691
- const entries = {};
692
- if (input[_RA] != null) {
693
- entries[_RA] = input[_RA];
694
- }
695
- if (input[_RSN] != null) {
696
- entries[_RSN] = input[_RSN];
697
- }
698
- if (input[_WIT] != null) {
699
- entries[_WIT] = input[_WIT];
700
- }
701
- if (input[_PI] != null) {
702
- entries[_PI] = input[_PI];
703
- }
704
- if (input[_PA] != null) {
705
- const memberEntries = se_policyDescriptorListType(input[_PA], context);
706
- if (input[_PA]?.length === 0) {
707
- entries.PolicyArns = [];
708
- }
709
- Object.entries(memberEntries).forEach(([key, value]) => {
710
- const loc = `PolicyArns.${key}`;
711
- entries[loc] = value;
406
+ return smithyClient.decorateServiceException(exception, body);
407
+ };
408
+ const de_IDPCommunicationErrorExceptionRes = async (parsedOutput, context) => {
409
+ const body = parsedOutput.body;
410
+ const deserialized = de_IDPCommunicationErrorException(body.Error);
411
+ const exception = new IDPCommunicationErrorException({
412
+ $metadata: deserializeMetadata(parsedOutput),
413
+ ...deserialized,
712
414
  });
713
- }
714
- if (input[_P] != null) {
715
- entries[_P] = input[_P];
716
- }
717
- if (input[_DS] != null) {
718
- entries[_DS] = input[_DS];
719
- }
720
- return entries;
721
- }, "se_AssumeRoleWithWebIdentityRequest");
722
- var se_AssumeRootRequest = /* @__PURE__ */ __name((input, context) => {
723
- const entries = {};
724
- if (input[_TP] != null) {
725
- entries[_TP] = input[_TP];
726
- }
727
- if (input[_TPA] != null) {
728
- const memberEntries = se_PolicyDescriptorType(input[_TPA], context);
729
- Object.entries(memberEntries).forEach(([key, value]) => {
730
- const loc = `TaskPolicyArn.${key}`;
731
- entries[loc] = value;
415
+ return smithyClient.decorateServiceException(exception, body);
416
+ };
417
+ const de_IDPRejectedClaimExceptionRes = async (parsedOutput, context) => {
418
+ const body = parsedOutput.body;
419
+ const deserialized = de_IDPRejectedClaimException(body.Error);
420
+ const exception = new IDPRejectedClaimException({
421
+ $metadata: deserializeMetadata(parsedOutput),
422
+ ...deserialized,
732
423
  });
733
- }
734
- if (input[_DS] != null) {
735
- entries[_DS] = input[_DS];
736
- }
737
- return entries;
738
- }, "se_AssumeRootRequest");
739
- var se_DecodeAuthorizationMessageRequest = /* @__PURE__ */ __name((input, context) => {
740
- const entries = {};
741
- if (input[_EM] != null) {
742
- entries[_EM] = input[_EM];
743
- }
744
- return entries;
745
- }, "se_DecodeAuthorizationMessageRequest");
746
- var se_GetAccessKeyInfoRequest = /* @__PURE__ */ __name((input, context) => {
747
- const entries = {};
748
- if (input[_AKI] != null) {
749
- entries[_AKI] = input[_AKI];
750
- }
751
- return entries;
752
- }, "se_GetAccessKeyInfoRequest");
753
- var se_GetCallerIdentityRequest = /* @__PURE__ */ __name((input, context) => {
754
- const entries = {};
755
- return entries;
756
- }, "se_GetCallerIdentityRequest");
757
- var se_GetFederationTokenRequest = /* @__PURE__ */ __name((input, context) => {
758
- const entries = {};
759
- if (input[_N] != null) {
760
- entries[_N] = input[_N];
761
- }
762
- if (input[_P] != null) {
763
- entries[_P] = input[_P];
764
- }
765
- if (input[_PA] != null) {
766
- const memberEntries = se_policyDescriptorListType(input[_PA], context);
767
- if (input[_PA]?.length === 0) {
768
- entries.PolicyArns = [];
769
- }
770
- Object.entries(memberEntries).forEach(([key, value]) => {
771
- const loc = `PolicyArns.${key}`;
772
- entries[loc] = value;
424
+ return smithyClient.decorateServiceException(exception, body);
425
+ };
426
+ const de_InvalidAuthorizationMessageExceptionRes = async (parsedOutput, context) => {
427
+ const body = parsedOutput.body;
428
+ const deserialized = de_InvalidAuthorizationMessageException(body.Error);
429
+ const exception = new InvalidAuthorizationMessageException({
430
+ $metadata: deserializeMetadata(parsedOutput),
431
+ ...deserialized,
773
432
  });
774
- }
775
- if (input[_DS] != null) {
776
- entries[_DS] = input[_DS];
777
- }
778
- if (input[_T] != null) {
779
- const memberEntries = se_tagListType(input[_T], context);
780
- if (input[_T]?.length === 0) {
781
- entries.Tags = [];
782
- }
783
- Object.entries(memberEntries).forEach(([key, value]) => {
784
- const loc = `Tags.${key}`;
785
- entries[loc] = value;
433
+ return smithyClient.decorateServiceException(exception, body);
434
+ };
435
+ const de_InvalidIdentityTokenExceptionRes = async (parsedOutput, context) => {
436
+ const body = parsedOutput.body;
437
+ const deserialized = de_InvalidIdentityTokenException(body.Error);
438
+ const exception = new InvalidIdentityTokenException({
439
+ $metadata: deserializeMetadata(parsedOutput),
440
+ ...deserialized,
786
441
  });
787
- }
788
- return entries;
789
- }, "se_GetFederationTokenRequest");
790
- var se_GetSessionTokenRequest = /* @__PURE__ */ __name((input, context) => {
791
- const entries = {};
792
- if (input[_DS] != null) {
793
- entries[_DS] = input[_DS];
794
- }
795
- if (input[_SN] != null) {
796
- entries[_SN] = input[_SN];
797
- }
798
- if (input[_TC] != null) {
799
- entries[_TC] = input[_TC];
800
- }
801
- return entries;
802
- }, "se_GetSessionTokenRequest");
803
- var se_policyDescriptorListType = /* @__PURE__ */ __name((input, context) => {
804
- const entries = {};
805
- let counter = 1;
806
- for (const entry of input) {
807
- if (entry === null) {
808
- continue;
809
- }
810
- const memberEntries = se_PolicyDescriptorType(entry, context);
811
- Object.entries(memberEntries).forEach(([key, value]) => {
812
- entries[`member.${counter}.${key}`] = value;
442
+ return smithyClient.decorateServiceException(exception, body);
443
+ };
444
+ const de_MalformedPolicyDocumentExceptionRes = async (parsedOutput, context) => {
445
+ const body = parsedOutput.body;
446
+ const deserialized = de_MalformedPolicyDocumentException(body.Error);
447
+ const exception = new MalformedPolicyDocumentException({
448
+ $metadata: deserializeMetadata(parsedOutput),
449
+ ...deserialized,
813
450
  });
814
- counter++;
815
- }
816
- return entries;
817
- }, "se_policyDescriptorListType");
818
- var se_PolicyDescriptorType = /* @__PURE__ */ __name((input, context) => {
819
- const entries = {};
820
- if (input[_a] != null) {
821
- entries[_a] = input[_a];
822
- }
823
- return entries;
824
- }, "se_PolicyDescriptorType");
825
- var se_ProvidedContext = /* @__PURE__ */ __name((input, context) => {
826
- const entries = {};
827
- if (input[_PAro] != null) {
828
- entries[_PAro] = input[_PAro];
829
- }
830
- if (input[_CA] != null) {
831
- entries[_CA] = input[_CA];
832
- }
833
- return entries;
834
- }, "se_ProvidedContext");
835
- var se_ProvidedContextsListType = /* @__PURE__ */ __name((input, context) => {
836
- const entries = {};
837
- let counter = 1;
838
- for (const entry of input) {
839
- if (entry === null) {
840
- continue;
841
- }
842
- const memberEntries = se_ProvidedContext(entry, context);
843
- Object.entries(memberEntries).forEach(([key, value]) => {
844
- entries[`member.${counter}.${key}`] = value;
451
+ return smithyClient.decorateServiceException(exception, body);
452
+ };
453
+ const de_PackedPolicyTooLargeExceptionRes = async (parsedOutput, context) => {
454
+ const body = parsedOutput.body;
455
+ const deserialized = de_PackedPolicyTooLargeException(body.Error);
456
+ const exception = new PackedPolicyTooLargeException({
457
+ $metadata: deserializeMetadata(parsedOutput),
458
+ ...deserialized,
845
459
  });
846
- counter++;
847
- }
848
- return entries;
849
- }, "se_ProvidedContextsListType");
850
- var se_Tag = /* @__PURE__ */ __name((input, context) => {
851
- const entries = {};
852
- if (input[_K] != null) {
853
- entries[_K] = input[_K];
854
- }
855
- if (input[_Va] != null) {
856
- entries[_Va] = input[_Va];
857
- }
858
- return entries;
859
- }, "se_Tag");
860
- var se_tagKeyListType = /* @__PURE__ */ __name((input, context) => {
861
- const entries = {};
862
- let counter = 1;
863
- for (const entry of input) {
864
- if (entry === null) {
865
- continue;
866
- }
867
- entries[`member.${counter}`] = entry;
868
- counter++;
869
- }
870
- return entries;
871
- }, "se_tagKeyListType");
872
- var se_tagListType = /* @__PURE__ */ __name((input, context) => {
873
- const entries = {};
874
- let counter = 1;
875
- for (const entry of input) {
876
- if (entry === null) {
877
- continue;
878
- }
879
- const memberEntries = se_Tag(entry, context);
880
- Object.entries(memberEntries).forEach(([key, value]) => {
881
- entries[`member.${counter}.${key}`] = value;
460
+ return smithyClient.decorateServiceException(exception, body);
461
+ };
462
+ const de_RegionDisabledExceptionRes = async (parsedOutput, context) => {
463
+ const body = parsedOutput.body;
464
+ const deserialized = de_RegionDisabledException(body.Error);
465
+ const exception = new RegionDisabledException({
466
+ $metadata: deserializeMetadata(parsedOutput),
467
+ ...deserialized,
882
468
  });
883
- counter++;
884
- }
885
- return entries;
886
- }, "se_tagListType");
887
- var de_AssumedRoleUser = /* @__PURE__ */ __name((output, context) => {
888
- const contents = {};
889
- if (output[_ARI] != null) {
890
- contents[_ARI] = (0, import_smithy_client.expectString)(output[_ARI]);
891
- }
892
- if (output[_Ar] != null) {
893
- contents[_Ar] = (0, import_smithy_client.expectString)(output[_Ar]);
894
- }
895
- return contents;
896
- }, "de_AssumedRoleUser");
897
- var de_AssumeRoleResponse = /* @__PURE__ */ __name((output, context) => {
898
- const contents = {};
899
- if (output[_C] != null) {
900
- contents[_C] = de_Credentials(output[_C], context);
901
- }
902
- if (output[_ARU] != null) {
903
- contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
904
- }
905
- if (output[_PPS] != null) {
906
- contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]);
907
- }
908
- if (output[_SI] != null) {
909
- contents[_SI] = (0, import_smithy_client.expectString)(output[_SI]);
910
- }
911
- return contents;
912
- }, "de_AssumeRoleResponse");
913
- var de_AssumeRoleWithSAMLResponse = /* @__PURE__ */ __name((output, context) => {
914
- const contents = {};
915
- if (output[_C] != null) {
916
- contents[_C] = de_Credentials(output[_C], context);
917
- }
918
- if (output[_ARU] != null) {
919
- contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
920
- }
921
- if (output[_PPS] != null) {
922
- contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]);
923
- }
924
- if (output[_S] != null) {
925
- contents[_S] = (0, import_smithy_client.expectString)(output[_S]);
926
- }
927
- if (output[_ST] != null) {
928
- contents[_ST] = (0, import_smithy_client.expectString)(output[_ST]);
929
- }
930
- if (output[_I] != null) {
931
- contents[_I] = (0, import_smithy_client.expectString)(output[_I]);
932
- }
933
- if (output[_Au] != null) {
934
- contents[_Au] = (0, import_smithy_client.expectString)(output[_Au]);
935
- }
936
- if (output[_NQ] != null) {
937
- contents[_NQ] = (0, import_smithy_client.expectString)(output[_NQ]);
938
- }
939
- if (output[_SI] != null) {
940
- contents[_SI] = (0, import_smithy_client.expectString)(output[_SI]);
941
- }
942
- return contents;
943
- }, "de_AssumeRoleWithSAMLResponse");
944
- var de_AssumeRoleWithWebIdentityResponse = /* @__PURE__ */ __name((output, context) => {
945
- const contents = {};
946
- if (output[_C] != null) {
947
- contents[_C] = de_Credentials(output[_C], context);
948
- }
949
- if (output[_SFWIT] != null) {
950
- contents[_SFWIT] = (0, import_smithy_client.expectString)(output[_SFWIT]);
951
- }
952
- if (output[_ARU] != null) {
953
- contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
954
- }
955
- if (output[_PPS] != null) {
956
- contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]);
957
- }
958
- if (output[_Pr] != null) {
959
- contents[_Pr] = (0, import_smithy_client.expectString)(output[_Pr]);
960
- }
961
- if (output[_Au] != null) {
962
- contents[_Au] = (0, import_smithy_client.expectString)(output[_Au]);
963
- }
964
- if (output[_SI] != null) {
965
- contents[_SI] = (0, import_smithy_client.expectString)(output[_SI]);
966
- }
967
- return contents;
968
- }, "de_AssumeRoleWithWebIdentityResponse");
969
- var de_AssumeRootResponse = /* @__PURE__ */ __name((output, context) => {
970
- const contents = {};
971
- if (output[_C] != null) {
972
- contents[_C] = de_Credentials(output[_C], context);
973
- }
974
- if (output[_SI] != null) {
975
- contents[_SI] = (0, import_smithy_client.expectString)(output[_SI]);
976
- }
977
- return contents;
978
- }, "de_AssumeRootResponse");
979
- var de_Credentials = /* @__PURE__ */ __name((output, context) => {
980
- const contents = {};
981
- if (output[_AKI] != null) {
982
- contents[_AKI] = (0, import_smithy_client.expectString)(output[_AKI]);
983
- }
984
- if (output[_SAK] != null) {
985
- contents[_SAK] = (0, import_smithy_client.expectString)(output[_SAK]);
986
- }
987
- if (output[_STe] != null) {
988
- contents[_STe] = (0, import_smithy_client.expectString)(output[_STe]);
989
- }
990
- if (output[_E] != null) {
991
- contents[_E] = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(output[_E]));
992
- }
993
- return contents;
994
- }, "de_Credentials");
995
- var de_DecodeAuthorizationMessageResponse = /* @__PURE__ */ __name((output, context) => {
996
- const contents = {};
997
- if (output[_DM] != null) {
998
- contents[_DM] = (0, import_smithy_client.expectString)(output[_DM]);
999
- }
1000
- return contents;
1001
- }, "de_DecodeAuthorizationMessageResponse");
1002
- var de_ExpiredTokenException = /* @__PURE__ */ __name((output, context) => {
1003
- const contents = {};
1004
- if (output[_m] != null) {
1005
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
1006
- }
1007
- return contents;
1008
- }, "de_ExpiredTokenException");
1009
- var de_FederatedUser = /* @__PURE__ */ __name((output, context) => {
1010
- const contents = {};
1011
- if (output[_FUI] != null) {
1012
- contents[_FUI] = (0, import_smithy_client.expectString)(output[_FUI]);
1013
- }
1014
- if (output[_Ar] != null) {
1015
- contents[_Ar] = (0, import_smithy_client.expectString)(output[_Ar]);
1016
- }
1017
- return contents;
1018
- }, "de_FederatedUser");
1019
- var de_GetAccessKeyInfoResponse = /* @__PURE__ */ __name((output, context) => {
1020
- const contents = {};
1021
- if (output[_Ac] != null) {
1022
- contents[_Ac] = (0, import_smithy_client.expectString)(output[_Ac]);
1023
- }
1024
- return contents;
1025
- }, "de_GetAccessKeyInfoResponse");
1026
- var de_GetCallerIdentityResponse = /* @__PURE__ */ __name((output, context) => {
1027
- const contents = {};
1028
- if (output[_UI] != null) {
1029
- contents[_UI] = (0, import_smithy_client.expectString)(output[_UI]);
1030
- }
1031
- if (output[_Ac] != null) {
1032
- contents[_Ac] = (0, import_smithy_client.expectString)(output[_Ac]);
1033
- }
1034
- if (output[_Ar] != null) {
1035
- contents[_Ar] = (0, import_smithy_client.expectString)(output[_Ar]);
1036
- }
1037
- return contents;
1038
- }, "de_GetCallerIdentityResponse");
1039
- var de_GetFederationTokenResponse = /* @__PURE__ */ __name((output, context) => {
1040
- const contents = {};
1041
- if (output[_C] != null) {
1042
- contents[_C] = de_Credentials(output[_C], context);
1043
- }
1044
- if (output[_FU] != null) {
1045
- contents[_FU] = de_FederatedUser(output[_FU], context);
1046
- }
1047
- if (output[_PPS] != null) {
1048
- contents[_PPS] = (0, import_smithy_client.strictParseInt32)(output[_PPS]);
1049
- }
1050
- return contents;
1051
- }, "de_GetFederationTokenResponse");
1052
- var de_GetSessionTokenResponse = /* @__PURE__ */ __name((output, context) => {
1053
- const contents = {};
1054
- if (output[_C] != null) {
1055
- contents[_C] = de_Credentials(output[_C], context);
1056
- }
1057
- return contents;
1058
- }, "de_GetSessionTokenResponse");
1059
- var de_IDPCommunicationErrorException = /* @__PURE__ */ __name((output, context) => {
1060
- const contents = {};
1061
- if (output[_m] != null) {
1062
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
1063
- }
1064
- return contents;
1065
- }, "de_IDPCommunicationErrorException");
1066
- var de_IDPRejectedClaimException = /* @__PURE__ */ __name((output, context) => {
1067
- const contents = {};
1068
- if (output[_m] != null) {
1069
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
1070
- }
1071
- return contents;
1072
- }, "de_IDPRejectedClaimException");
1073
- var de_InvalidAuthorizationMessageException = /* @__PURE__ */ __name((output, context) => {
1074
- const contents = {};
1075
- if (output[_m] != null) {
1076
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
1077
- }
1078
- return contents;
1079
- }, "de_InvalidAuthorizationMessageException");
1080
- var de_InvalidIdentityTokenException = /* @__PURE__ */ __name((output, context) => {
1081
- const contents = {};
1082
- if (output[_m] != null) {
1083
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
1084
- }
1085
- return contents;
1086
- }, "de_InvalidIdentityTokenException");
1087
- var de_MalformedPolicyDocumentException = /* @__PURE__ */ __name((output, context) => {
1088
- const contents = {};
1089
- if (output[_m] != null) {
1090
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
1091
- }
1092
- return contents;
1093
- }, "de_MalformedPolicyDocumentException");
1094
- var de_PackedPolicyTooLargeException = /* @__PURE__ */ __name((output, context) => {
1095
- const contents = {};
1096
- if (output[_m] != null) {
1097
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
1098
- }
1099
- return contents;
1100
- }, "de_PackedPolicyTooLargeException");
1101
- var de_RegionDisabledException = /* @__PURE__ */ __name((output, context) => {
1102
- const contents = {};
1103
- if (output[_m] != null) {
1104
- contents[_m] = (0, import_smithy_client.expectString)(output[_m]);
1105
- }
1106
- return contents;
1107
- }, "de_RegionDisabledException");
1108
- var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1109
- httpStatusCode: output.statusCode,
1110
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1111
- extendedRequestId: output.headers["x-amz-id-2"],
1112
- cfId: output.headers["x-amz-cf-id"]
1113
- }), "deserializeMetadata");
1114
- var throwDefaultError = (0, import_smithy_client.withBaseException)(STSServiceException);
1115
- var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
1116
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1117
- const contents = {
1118
- protocol,
1119
- hostname,
1120
- port,
1121
- method: "POST",
1122
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1123
- headers
1124
- };
1125
- if (resolvedHostname !== void 0) {
1126
- contents.hostname = resolvedHostname;
1127
- }
1128
- if (body !== void 0) {
1129
- contents.body = body;
1130
- }
1131
- return new import_protocol_http.HttpRequest(contents);
1132
- }, "buildHttpRpcRequest");
1133
- var SHARED_HEADERS = {
1134
- "content-type": "application/x-www-form-urlencoded"
1135
- };
1136
- var _ = "2011-06-15";
1137
- var _A = "Action";
1138
- var _AKI = "AccessKeyId";
1139
- var _AR = "AssumeRole";
1140
- var _ARI = "AssumedRoleId";
1141
- var _ARU = "AssumedRoleUser";
1142
- var _ARWSAML = "AssumeRoleWithSAML";
1143
- var _ARWWI = "AssumeRoleWithWebIdentity";
1144
- var _ARs = "AssumeRoot";
1145
- var _Ac = "Account";
1146
- var _Ar = "Arn";
1147
- var _Au = "Audience";
1148
- var _C = "Credentials";
1149
- var _CA = "ContextAssertion";
1150
- var _DAM = "DecodeAuthorizationMessage";
1151
- var _DM = "DecodedMessage";
1152
- var _DS = "DurationSeconds";
1153
- var _E = "Expiration";
1154
- var _EI = "ExternalId";
1155
- var _EM = "EncodedMessage";
1156
- var _FU = "FederatedUser";
1157
- var _FUI = "FederatedUserId";
1158
- var _GAKI = "GetAccessKeyInfo";
1159
- var _GCI = "GetCallerIdentity";
1160
- var _GFT = "GetFederationToken";
1161
- var _GST = "GetSessionToken";
1162
- var _I = "Issuer";
1163
- var _K = "Key";
1164
- var _N = "Name";
1165
- var _NQ = "NameQualifier";
1166
- var _P = "Policy";
1167
- var _PA = "PolicyArns";
1168
- var _PAr = "PrincipalArn";
1169
- var _PAro = "ProviderArn";
1170
- var _PC = "ProvidedContexts";
1171
- var _PI = "ProviderId";
1172
- var _PPS = "PackedPolicySize";
1173
- var _Pr = "Provider";
1174
- var _RA = "RoleArn";
1175
- var _RSN = "RoleSessionName";
1176
- var _S = "Subject";
1177
- var _SAK = "SecretAccessKey";
1178
- var _SAMLA = "SAMLAssertion";
1179
- var _SFWIT = "SubjectFromWebIdentityToken";
1180
- var _SI = "SourceIdentity";
1181
- var _SN = "SerialNumber";
1182
- var _ST = "SubjectType";
1183
- var _STe = "SessionToken";
1184
- var _T = "Tags";
1185
- var _TC = "TokenCode";
1186
- var _TP = "TargetPrincipal";
1187
- var _TPA = "TaskPolicyArn";
1188
- var _TTK = "TransitiveTagKeys";
1189
- var _UI = "UserId";
1190
- var _V = "Version";
1191
- var _Va = "Value";
1192
- var _WIT = "WebIdentityToken";
1193
- var _a = "arn";
1194
- var _m = "message";
1195
- var buildFormUrlencodedString = /* @__PURE__ */ __name((formEntries) => Object.entries(formEntries).map(([key, value]) => (0, import_smithy_client.extendedEncodeURIComponent)(key) + "=" + (0, import_smithy_client.extendedEncodeURIComponent)(value)).join("&"), "buildFormUrlencodedString");
1196
- var loadQueryErrorCode = /* @__PURE__ */ __name((output, data) => {
1197
- if (data.Error?.Code !== void 0) {
1198
- return data.Error.Code;
1199
- }
1200
- if (output.statusCode == 404) {
1201
- return "NotFound";
1202
- }
1203
- }, "loadQueryErrorCode");
1204
-
1205
- // src/commands/AssumeRoleCommand.ts
1206
- var AssumeRoleCommand = class extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters.commonParams).m(function(Command, cs, config, o) {
1207
- return [
1208
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1209
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1210
- ];
1211
- }).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").f(void 0, AssumeRoleResponseFilterSensitiveLog).ser(se_AssumeRoleCommand).de(de_AssumeRoleCommand).build() {
1212
- static {
1213
- __name(this, "AssumeRoleCommand");
1214
- }
469
+ return smithyClient.decorateServiceException(exception, body);
1215
470
  };
1216
-
1217
- // src/commands/AssumeRoleWithSAMLCommand.ts
1218
-
1219
-
1220
-
1221
- var import_EndpointParameters2 = require("./endpoint/EndpointParameters");
1222
- var AssumeRoleWithSAMLCommand = class extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters2.commonParams).m(function(Command, cs, config, o) {
1223
- return [
1224
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1225
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1226
- ];
1227
- }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithSAML", {}).n("STSClient", "AssumeRoleWithSAMLCommand").f(AssumeRoleWithSAMLRequestFilterSensitiveLog, AssumeRoleWithSAMLResponseFilterSensitiveLog).ser(se_AssumeRoleWithSAMLCommand).de(de_AssumeRoleWithSAMLCommand).build() {
1228
- static {
1229
- __name(this, "AssumeRoleWithSAMLCommand");
1230
- }
471
+ const se_AssumeRoleRequest = (input, context) => {
472
+ const entries = {};
473
+ if (input[_RA] != null) {
474
+ entries[_RA] = input[_RA];
475
+ }
476
+ if (input[_RSN] != null) {
477
+ entries[_RSN] = input[_RSN];
478
+ }
479
+ if (input[_PA] != null) {
480
+ const memberEntries = se_policyDescriptorListType(input[_PA]);
481
+ if (input[_PA]?.length === 0) {
482
+ entries.PolicyArns = [];
483
+ }
484
+ Object.entries(memberEntries).forEach(([key, value]) => {
485
+ const loc = `PolicyArns.${key}`;
486
+ entries[loc] = value;
487
+ });
488
+ }
489
+ if (input[_P] != null) {
490
+ entries[_P] = input[_P];
491
+ }
492
+ if (input[_DS] != null) {
493
+ entries[_DS] = input[_DS];
494
+ }
495
+ if (input[_T] != null) {
496
+ const memberEntries = se_tagListType(input[_T]);
497
+ if (input[_T]?.length === 0) {
498
+ entries.Tags = [];
499
+ }
500
+ Object.entries(memberEntries).forEach(([key, value]) => {
501
+ const loc = `Tags.${key}`;
502
+ entries[loc] = value;
503
+ });
504
+ }
505
+ if (input[_TTK] != null) {
506
+ const memberEntries = se_tagKeyListType(input[_TTK]);
507
+ if (input[_TTK]?.length === 0) {
508
+ entries.TransitiveTagKeys = [];
509
+ }
510
+ Object.entries(memberEntries).forEach(([key, value]) => {
511
+ const loc = `TransitiveTagKeys.${key}`;
512
+ entries[loc] = value;
513
+ });
514
+ }
515
+ if (input[_EI] != null) {
516
+ entries[_EI] = input[_EI];
517
+ }
518
+ if (input[_SN] != null) {
519
+ entries[_SN] = input[_SN];
520
+ }
521
+ if (input[_TC] != null) {
522
+ entries[_TC] = input[_TC];
523
+ }
524
+ if (input[_SI] != null) {
525
+ entries[_SI] = input[_SI];
526
+ }
527
+ if (input[_PC] != null) {
528
+ const memberEntries = se_ProvidedContextsListType(input[_PC]);
529
+ if (input[_PC]?.length === 0) {
530
+ entries.ProvidedContexts = [];
531
+ }
532
+ Object.entries(memberEntries).forEach(([key, value]) => {
533
+ const loc = `ProvidedContexts.${key}`;
534
+ entries[loc] = value;
535
+ });
536
+ }
537
+ return entries;
1231
538
  };
1232
-
1233
- // src/commands/AssumeRoleWithWebIdentityCommand.ts
1234
-
1235
-
1236
-
1237
- var import_EndpointParameters3 = require("./endpoint/EndpointParameters");
1238
- var AssumeRoleWithWebIdentityCommand = class extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters3.commonParams).m(function(Command, cs, config, o) {
1239
- return [
1240
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1241
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1242
- ];
1243
- }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").f(AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog).ser(se_AssumeRoleWithWebIdentityCommand).de(de_AssumeRoleWithWebIdentityCommand).build() {
1244
- static {
1245
- __name(this, "AssumeRoleWithWebIdentityCommand");
1246
- }
539
+ const se_AssumeRoleWithSAMLRequest = (input, context) => {
540
+ const entries = {};
541
+ if (input[_RA] != null) {
542
+ entries[_RA] = input[_RA];
543
+ }
544
+ if (input[_PAr] != null) {
545
+ entries[_PAr] = input[_PAr];
546
+ }
547
+ if (input[_SAMLA] != null) {
548
+ entries[_SAMLA] = input[_SAMLA];
549
+ }
550
+ if (input[_PA] != null) {
551
+ const memberEntries = se_policyDescriptorListType(input[_PA]);
552
+ if (input[_PA]?.length === 0) {
553
+ entries.PolicyArns = [];
554
+ }
555
+ Object.entries(memberEntries).forEach(([key, value]) => {
556
+ const loc = `PolicyArns.${key}`;
557
+ entries[loc] = value;
558
+ });
559
+ }
560
+ if (input[_P] != null) {
561
+ entries[_P] = input[_P];
562
+ }
563
+ if (input[_DS] != null) {
564
+ entries[_DS] = input[_DS];
565
+ }
566
+ return entries;
1247
567
  };
1248
-
1249
- // src/commands/AssumeRootCommand.ts
1250
-
1251
-
1252
-
1253
- var import_EndpointParameters4 = require("./endpoint/EndpointParameters");
1254
- var AssumeRootCommand = class extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters4.commonParams).m(function(Command, cs, config, o) {
1255
- return [
1256
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1257
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1258
- ];
1259
- }).s("AWSSecurityTokenServiceV20110615", "AssumeRoot", {}).n("STSClient", "AssumeRootCommand").f(void 0, AssumeRootResponseFilterSensitiveLog).ser(se_AssumeRootCommand).de(de_AssumeRootCommand).build() {
1260
- static {
1261
- __name(this, "AssumeRootCommand");
1262
- }
568
+ const se_AssumeRoleWithWebIdentityRequest = (input, context) => {
569
+ const entries = {};
570
+ if (input[_RA] != null) {
571
+ entries[_RA] = input[_RA];
572
+ }
573
+ if (input[_RSN] != null) {
574
+ entries[_RSN] = input[_RSN];
575
+ }
576
+ if (input[_WIT] != null) {
577
+ entries[_WIT] = input[_WIT];
578
+ }
579
+ if (input[_PI] != null) {
580
+ entries[_PI] = input[_PI];
581
+ }
582
+ if (input[_PA] != null) {
583
+ const memberEntries = se_policyDescriptorListType(input[_PA]);
584
+ if (input[_PA]?.length === 0) {
585
+ entries.PolicyArns = [];
586
+ }
587
+ Object.entries(memberEntries).forEach(([key, value]) => {
588
+ const loc = `PolicyArns.${key}`;
589
+ entries[loc] = value;
590
+ });
591
+ }
592
+ if (input[_P] != null) {
593
+ entries[_P] = input[_P];
594
+ }
595
+ if (input[_DS] != null) {
596
+ entries[_DS] = input[_DS];
597
+ }
598
+ return entries;
1263
599
  };
1264
-
1265
- // src/commands/DecodeAuthorizationMessageCommand.ts
1266
-
1267
-
1268
-
1269
- var import_EndpointParameters5 = require("./endpoint/EndpointParameters");
1270
- var DecodeAuthorizationMessageCommand = class extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters5.commonParams).m(function(Command, cs, config, o) {
1271
- return [
1272
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1273
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1274
- ];
1275
- }).s("AWSSecurityTokenServiceV20110615", "DecodeAuthorizationMessage", {}).n("STSClient", "DecodeAuthorizationMessageCommand").f(void 0, void 0).ser(se_DecodeAuthorizationMessageCommand).de(de_DecodeAuthorizationMessageCommand).build() {
1276
- static {
1277
- __name(this, "DecodeAuthorizationMessageCommand");
1278
- }
600
+ const se_AssumeRootRequest = (input, context) => {
601
+ const entries = {};
602
+ if (input[_TP] != null) {
603
+ entries[_TP] = input[_TP];
604
+ }
605
+ if (input[_TPA] != null) {
606
+ const memberEntries = se_PolicyDescriptorType(input[_TPA]);
607
+ Object.entries(memberEntries).forEach(([key, value]) => {
608
+ const loc = `TaskPolicyArn.${key}`;
609
+ entries[loc] = value;
610
+ });
611
+ }
612
+ if (input[_DS] != null) {
613
+ entries[_DS] = input[_DS];
614
+ }
615
+ return entries;
1279
616
  };
1280
-
1281
- // src/commands/GetAccessKeyInfoCommand.ts
1282
-
1283
-
1284
-
1285
- var import_EndpointParameters6 = require("./endpoint/EndpointParameters");
1286
- var GetAccessKeyInfoCommand = class extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters6.commonParams).m(function(Command, cs, config, o) {
1287
- return [
1288
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1289
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1290
- ];
1291
- }).s("AWSSecurityTokenServiceV20110615", "GetAccessKeyInfo", {}).n("STSClient", "GetAccessKeyInfoCommand").f(void 0, void 0).ser(se_GetAccessKeyInfoCommand).de(de_GetAccessKeyInfoCommand).build() {
1292
- static {
1293
- __name(this, "GetAccessKeyInfoCommand");
1294
- }
617
+ const se_DecodeAuthorizationMessageRequest = (input, context) => {
618
+ const entries = {};
619
+ if (input[_EM] != null) {
620
+ entries[_EM] = input[_EM];
621
+ }
622
+ return entries;
1295
623
  };
1296
-
1297
- // src/commands/GetCallerIdentityCommand.ts
1298
-
1299
-
1300
-
1301
- var import_EndpointParameters7 = require("./endpoint/EndpointParameters");
1302
- var GetCallerIdentityCommand = class extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters7.commonParams).m(function(Command, cs, config, o) {
1303
- return [
1304
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1305
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1306
- ];
1307
- }).s("AWSSecurityTokenServiceV20110615", "GetCallerIdentity", {}).n("STSClient", "GetCallerIdentityCommand").f(void 0, void 0).ser(se_GetCallerIdentityCommand).de(de_GetCallerIdentityCommand).build() {
1308
- static {
1309
- __name(this, "GetCallerIdentityCommand");
1310
- }
624
+ const se_GetAccessKeyInfoRequest = (input, context) => {
625
+ const entries = {};
626
+ if (input[_AKI] != null) {
627
+ entries[_AKI] = input[_AKI];
628
+ }
629
+ return entries;
630
+ };
631
+ const se_GetCallerIdentityRequest = (input, context) => {
632
+ const entries = {};
633
+ return entries;
634
+ };
635
+ const se_GetFederationTokenRequest = (input, context) => {
636
+ const entries = {};
637
+ if (input[_N] != null) {
638
+ entries[_N] = input[_N];
639
+ }
640
+ if (input[_P] != null) {
641
+ entries[_P] = input[_P];
642
+ }
643
+ if (input[_PA] != null) {
644
+ const memberEntries = se_policyDescriptorListType(input[_PA]);
645
+ if (input[_PA]?.length === 0) {
646
+ entries.PolicyArns = [];
647
+ }
648
+ Object.entries(memberEntries).forEach(([key, value]) => {
649
+ const loc = `PolicyArns.${key}`;
650
+ entries[loc] = value;
651
+ });
652
+ }
653
+ if (input[_DS] != null) {
654
+ entries[_DS] = input[_DS];
655
+ }
656
+ if (input[_T] != null) {
657
+ const memberEntries = se_tagListType(input[_T]);
658
+ if (input[_T]?.length === 0) {
659
+ entries.Tags = [];
660
+ }
661
+ Object.entries(memberEntries).forEach(([key, value]) => {
662
+ const loc = `Tags.${key}`;
663
+ entries[loc] = value;
664
+ });
665
+ }
666
+ return entries;
667
+ };
668
+ const se_GetSessionTokenRequest = (input, context) => {
669
+ const entries = {};
670
+ if (input[_DS] != null) {
671
+ entries[_DS] = input[_DS];
672
+ }
673
+ if (input[_SN] != null) {
674
+ entries[_SN] = input[_SN];
675
+ }
676
+ if (input[_TC] != null) {
677
+ entries[_TC] = input[_TC];
678
+ }
679
+ return entries;
680
+ };
681
+ const se_policyDescriptorListType = (input, context) => {
682
+ const entries = {};
683
+ let counter = 1;
684
+ for (const entry of input) {
685
+ if (entry === null) {
686
+ continue;
687
+ }
688
+ const memberEntries = se_PolicyDescriptorType(entry);
689
+ Object.entries(memberEntries).forEach(([key, value]) => {
690
+ entries[`member.${counter}.${key}`] = value;
691
+ });
692
+ counter++;
693
+ }
694
+ return entries;
695
+ };
696
+ const se_PolicyDescriptorType = (input, context) => {
697
+ const entries = {};
698
+ if (input[_a] != null) {
699
+ entries[_a] = input[_a];
700
+ }
701
+ return entries;
702
+ };
703
+ const se_ProvidedContext = (input, context) => {
704
+ const entries = {};
705
+ if (input[_PAro] != null) {
706
+ entries[_PAro] = input[_PAro];
707
+ }
708
+ if (input[_CA] != null) {
709
+ entries[_CA] = input[_CA];
710
+ }
711
+ return entries;
712
+ };
713
+ const se_ProvidedContextsListType = (input, context) => {
714
+ const entries = {};
715
+ let counter = 1;
716
+ for (const entry of input) {
717
+ if (entry === null) {
718
+ continue;
719
+ }
720
+ const memberEntries = se_ProvidedContext(entry);
721
+ Object.entries(memberEntries).forEach(([key, value]) => {
722
+ entries[`member.${counter}.${key}`] = value;
723
+ });
724
+ counter++;
725
+ }
726
+ return entries;
727
+ };
728
+ const se_Tag = (input, context) => {
729
+ const entries = {};
730
+ if (input[_K] != null) {
731
+ entries[_K] = input[_K];
732
+ }
733
+ if (input[_Va] != null) {
734
+ entries[_Va] = input[_Va];
735
+ }
736
+ return entries;
737
+ };
738
+ const se_tagKeyListType = (input, context) => {
739
+ const entries = {};
740
+ let counter = 1;
741
+ for (const entry of input) {
742
+ if (entry === null) {
743
+ continue;
744
+ }
745
+ entries[`member.${counter}`] = entry;
746
+ counter++;
747
+ }
748
+ return entries;
749
+ };
750
+ const se_tagListType = (input, context) => {
751
+ const entries = {};
752
+ let counter = 1;
753
+ for (const entry of input) {
754
+ if (entry === null) {
755
+ continue;
756
+ }
757
+ const memberEntries = se_Tag(entry);
758
+ Object.entries(memberEntries).forEach(([key, value]) => {
759
+ entries[`member.${counter}.${key}`] = value;
760
+ });
761
+ counter++;
762
+ }
763
+ return entries;
764
+ };
765
+ const de_AssumedRoleUser = (output, context) => {
766
+ const contents = {};
767
+ if (output[_ARI] != null) {
768
+ contents[_ARI] = smithyClient.expectString(output[_ARI]);
769
+ }
770
+ if (output[_Ar] != null) {
771
+ contents[_Ar] = smithyClient.expectString(output[_Ar]);
772
+ }
773
+ return contents;
774
+ };
775
+ const de_AssumeRoleResponse = (output, context) => {
776
+ const contents = {};
777
+ if (output[_C] != null) {
778
+ contents[_C] = de_Credentials(output[_C]);
779
+ }
780
+ if (output[_ARU] != null) {
781
+ contents[_ARU] = de_AssumedRoleUser(output[_ARU]);
782
+ }
783
+ if (output[_PPS] != null) {
784
+ contents[_PPS] = smithyClient.strictParseInt32(output[_PPS]);
785
+ }
786
+ if (output[_SI] != null) {
787
+ contents[_SI] = smithyClient.expectString(output[_SI]);
788
+ }
789
+ return contents;
790
+ };
791
+ const de_AssumeRoleWithSAMLResponse = (output, context) => {
792
+ const contents = {};
793
+ if (output[_C] != null) {
794
+ contents[_C] = de_Credentials(output[_C]);
795
+ }
796
+ if (output[_ARU] != null) {
797
+ contents[_ARU] = de_AssumedRoleUser(output[_ARU]);
798
+ }
799
+ if (output[_PPS] != null) {
800
+ contents[_PPS] = smithyClient.strictParseInt32(output[_PPS]);
801
+ }
802
+ if (output[_S] != null) {
803
+ contents[_S] = smithyClient.expectString(output[_S]);
804
+ }
805
+ if (output[_ST] != null) {
806
+ contents[_ST] = smithyClient.expectString(output[_ST]);
807
+ }
808
+ if (output[_I] != null) {
809
+ contents[_I] = smithyClient.expectString(output[_I]);
810
+ }
811
+ if (output[_Au] != null) {
812
+ contents[_Au] = smithyClient.expectString(output[_Au]);
813
+ }
814
+ if (output[_NQ] != null) {
815
+ contents[_NQ] = smithyClient.expectString(output[_NQ]);
816
+ }
817
+ if (output[_SI] != null) {
818
+ contents[_SI] = smithyClient.expectString(output[_SI]);
819
+ }
820
+ return contents;
821
+ };
822
+ const de_AssumeRoleWithWebIdentityResponse = (output, context) => {
823
+ const contents = {};
824
+ if (output[_C] != null) {
825
+ contents[_C] = de_Credentials(output[_C]);
826
+ }
827
+ if (output[_SFWIT] != null) {
828
+ contents[_SFWIT] = smithyClient.expectString(output[_SFWIT]);
829
+ }
830
+ if (output[_ARU] != null) {
831
+ contents[_ARU] = de_AssumedRoleUser(output[_ARU]);
832
+ }
833
+ if (output[_PPS] != null) {
834
+ contents[_PPS] = smithyClient.strictParseInt32(output[_PPS]);
835
+ }
836
+ if (output[_Pr] != null) {
837
+ contents[_Pr] = smithyClient.expectString(output[_Pr]);
838
+ }
839
+ if (output[_Au] != null) {
840
+ contents[_Au] = smithyClient.expectString(output[_Au]);
841
+ }
842
+ if (output[_SI] != null) {
843
+ contents[_SI] = smithyClient.expectString(output[_SI]);
844
+ }
845
+ return contents;
846
+ };
847
+ const de_AssumeRootResponse = (output, context) => {
848
+ const contents = {};
849
+ if (output[_C] != null) {
850
+ contents[_C] = de_Credentials(output[_C]);
851
+ }
852
+ if (output[_SI] != null) {
853
+ contents[_SI] = smithyClient.expectString(output[_SI]);
854
+ }
855
+ return contents;
856
+ };
857
+ const de_Credentials = (output, context) => {
858
+ const contents = {};
859
+ if (output[_AKI] != null) {
860
+ contents[_AKI] = smithyClient.expectString(output[_AKI]);
861
+ }
862
+ if (output[_SAK] != null) {
863
+ contents[_SAK] = smithyClient.expectString(output[_SAK]);
864
+ }
865
+ if (output[_STe] != null) {
866
+ contents[_STe] = smithyClient.expectString(output[_STe]);
867
+ }
868
+ if (output[_E] != null) {
869
+ contents[_E] = smithyClient.expectNonNull(smithyClient.parseRfc3339DateTimeWithOffset(output[_E]));
870
+ }
871
+ return contents;
872
+ };
873
+ const de_DecodeAuthorizationMessageResponse = (output, context) => {
874
+ const contents = {};
875
+ if (output[_DM] != null) {
876
+ contents[_DM] = smithyClient.expectString(output[_DM]);
877
+ }
878
+ return contents;
879
+ };
880
+ const de_ExpiredTokenException = (output, context) => {
881
+ const contents = {};
882
+ if (output[_m] != null) {
883
+ contents[_m] = smithyClient.expectString(output[_m]);
884
+ }
885
+ return contents;
886
+ };
887
+ const de_FederatedUser = (output, context) => {
888
+ const contents = {};
889
+ if (output[_FUI] != null) {
890
+ contents[_FUI] = smithyClient.expectString(output[_FUI]);
891
+ }
892
+ if (output[_Ar] != null) {
893
+ contents[_Ar] = smithyClient.expectString(output[_Ar]);
894
+ }
895
+ return contents;
896
+ };
897
+ const de_GetAccessKeyInfoResponse = (output, context) => {
898
+ const contents = {};
899
+ if (output[_Ac] != null) {
900
+ contents[_Ac] = smithyClient.expectString(output[_Ac]);
901
+ }
902
+ return contents;
903
+ };
904
+ const de_GetCallerIdentityResponse = (output, context) => {
905
+ const contents = {};
906
+ if (output[_UI] != null) {
907
+ contents[_UI] = smithyClient.expectString(output[_UI]);
908
+ }
909
+ if (output[_Ac] != null) {
910
+ contents[_Ac] = smithyClient.expectString(output[_Ac]);
911
+ }
912
+ if (output[_Ar] != null) {
913
+ contents[_Ar] = smithyClient.expectString(output[_Ar]);
914
+ }
915
+ return contents;
916
+ };
917
+ const de_GetFederationTokenResponse = (output, context) => {
918
+ const contents = {};
919
+ if (output[_C] != null) {
920
+ contents[_C] = de_Credentials(output[_C]);
921
+ }
922
+ if (output[_FU] != null) {
923
+ contents[_FU] = de_FederatedUser(output[_FU]);
924
+ }
925
+ if (output[_PPS] != null) {
926
+ contents[_PPS] = smithyClient.strictParseInt32(output[_PPS]);
927
+ }
928
+ return contents;
929
+ };
930
+ const de_GetSessionTokenResponse = (output, context) => {
931
+ const contents = {};
932
+ if (output[_C] != null) {
933
+ contents[_C] = de_Credentials(output[_C]);
934
+ }
935
+ return contents;
936
+ };
937
+ const de_IDPCommunicationErrorException = (output, context) => {
938
+ const contents = {};
939
+ if (output[_m] != null) {
940
+ contents[_m] = smithyClient.expectString(output[_m]);
941
+ }
942
+ return contents;
943
+ };
944
+ const de_IDPRejectedClaimException = (output, context) => {
945
+ const contents = {};
946
+ if (output[_m] != null) {
947
+ contents[_m] = smithyClient.expectString(output[_m]);
948
+ }
949
+ return contents;
950
+ };
951
+ const de_InvalidAuthorizationMessageException = (output, context) => {
952
+ const contents = {};
953
+ if (output[_m] != null) {
954
+ contents[_m] = smithyClient.expectString(output[_m]);
955
+ }
956
+ return contents;
957
+ };
958
+ const de_InvalidIdentityTokenException = (output, context) => {
959
+ const contents = {};
960
+ if (output[_m] != null) {
961
+ contents[_m] = smithyClient.expectString(output[_m]);
962
+ }
963
+ return contents;
964
+ };
965
+ const de_MalformedPolicyDocumentException = (output, context) => {
966
+ const contents = {};
967
+ if (output[_m] != null) {
968
+ contents[_m] = smithyClient.expectString(output[_m]);
969
+ }
970
+ return contents;
971
+ };
972
+ const de_PackedPolicyTooLargeException = (output, context) => {
973
+ const contents = {};
974
+ if (output[_m] != null) {
975
+ contents[_m] = smithyClient.expectString(output[_m]);
976
+ }
977
+ return contents;
978
+ };
979
+ const de_RegionDisabledException = (output, context) => {
980
+ const contents = {};
981
+ if (output[_m] != null) {
982
+ contents[_m] = smithyClient.expectString(output[_m]);
983
+ }
984
+ return contents;
985
+ };
986
+ const deserializeMetadata = (output) => ({
987
+ httpStatusCode: output.statusCode,
988
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
989
+ extendedRequestId: output.headers["x-amz-id-2"],
990
+ cfId: output.headers["x-amz-cf-id"],
991
+ });
992
+ const throwDefaultError = smithyClient.withBaseException(STSServiceException);
993
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
994
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
995
+ const contents = {
996
+ protocol,
997
+ hostname,
998
+ port,
999
+ method: "POST",
1000
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1001
+ headers,
1002
+ };
1003
+ if (body !== undefined) {
1004
+ contents.body = body;
1005
+ }
1006
+ return new protocolHttp.HttpRequest(contents);
1007
+ };
1008
+ const SHARED_HEADERS = {
1009
+ "content-type": "application/x-www-form-urlencoded",
1010
+ };
1011
+ const _ = "2011-06-15";
1012
+ const _A = "Action";
1013
+ const _AKI = "AccessKeyId";
1014
+ const _AR = "AssumeRole";
1015
+ const _ARI = "AssumedRoleId";
1016
+ const _ARU = "AssumedRoleUser";
1017
+ const _ARWSAML = "AssumeRoleWithSAML";
1018
+ const _ARWWI = "AssumeRoleWithWebIdentity";
1019
+ const _ARs = "AssumeRoot";
1020
+ const _Ac = "Account";
1021
+ const _Ar = "Arn";
1022
+ const _Au = "Audience";
1023
+ const _C = "Credentials";
1024
+ const _CA = "ContextAssertion";
1025
+ const _DAM = "DecodeAuthorizationMessage";
1026
+ const _DM = "DecodedMessage";
1027
+ const _DS = "DurationSeconds";
1028
+ const _E = "Expiration";
1029
+ const _EI = "ExternalId";
1030
+ const _EM = "EncodedMessage";
1031
+ const _FU = "FederatedUser";
1032
+ const _FUI = "FederatedUserId";
1033
+ const _GAKI = "GetAccessKeyInfo";
1034
+ const _GCI = "GetCallerIdentity";
1035
+ const _GFT = "GetFederationToken";
1036
+ const _GST = "GetSessionToken";
1037
+ const _I = "Issuer";
1038
+ const _K = "Key";
1039
+ const _N = "Name";
1040
+ const _NQ = "NameQualifier";
1041
+ const _P = "Policy";
1042
+ const _PA = "PolicyArns";
1043
+ const _PAr = "PrincipalArn";
1044
+ const _PAro = "ProviderArn";
1045
+ const _PC = "ProvidedContexts";
1046
+ const _PI = "ProviderId";
1047
+ const _PPS = "PackedPolicySize";
1048
+ const _Pr = "Provider";
1049
+ const _RA = "RoleArn";
1050
+ const _RSN = "RoleSessionName";
1051
+ const _S = "Subject";
1052
+ const _SAK = "SecretAccessKey";
1053
+ const _SAMLA = "SAMLAssertion";
1054
+ const _SFWIT = "SubjectFromWebIdentityToken";
1055
+ const _SI = "SourceIdentity";
1056
+ const _SN = "SerialNumber";
1057
+ const _ST = "SubjectType";
1058
+ const _STe = "SessionToken";
1059
+ const _T = "Tags";
1060
+ const _TC = "TokenCode";
1061
+ const _TP = "TargetPrincipal";
1062
+ const _TPA = "TaskPolicyArn";
1063
+ const _TTK = "TransitiveTagKeys";
1064
+ const _UI = "UserId";
1065
+ const _V = "Version";
1066
+ const _Va = "Value";
1067
+ const _WIT = "WebIdentityToken";
1068
+ const _a = "arn";
1069
+ const _m = "message";
1070
+ const buildFormUrlencodedString = (formEntries) => Object.entries(formEntries)
1071
+ .map(([key, value]) => smithyClient.extendedEncodeURIComponent(key) + "=" + smithyClient.extendedEncodeURIComponent(value))
1072
+ .join("&");
1073
+ const loadQueryErrorCode = (output, data) => {
1074
+ if (data.Error?.Code !== undefined) {
1075
+ return data.Error.Code;
1076
+ }
1077
+ if (output.statusCode == 404) {
1078
+ return "NotFound";
1079
+ }
1311
1080
  };
1312
1081
 
1313
- // src/commands/GetFederationTokenCommand.ts
1082
+ class AssumeRoleCommand extends smithyClient.Command
1083
+ .classBuilder()
1084
+ .ep(EndpointParameters.commonParams)
1085
+ .m(function (Command, cs, config, o) {
1086
+ return [
1087
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
1088
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1089
+ ];
1090
+ })
1091
+ .s("AWSSecurityTokenServiceV20110615", "AssumeRole", {})
1092
+ .n("STSClient", "AssumeRoleCommand")
1093
+ .f(void 0, AssumeRoleResponseFilterSensitiveLog)
1094
+ .ser(se_AssumeRoleCommand)
1095
+ .de(de_AssumeRoleCommand)
1096
+ .build() {
1097
+ }
1314
1098
 
1099
+ class AssumeRoleWithSAMLCommand extends smithyClient.Command
1100
+ .classBuilder()
1101
+ .ep(EndpointParameters.commonParams)
1102
+ .m(function (Command, cs, config, o) {
1103
+ return [
1104
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
1105
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1106
+ ];
1107
+ })
1108
+ .s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithSAML", {})
1109
+ .n("STSClient", "AssumeRoleWithSAMLCommand")
1110
+ .f(AssumeRoleWithSAMLRequestFilterSensitiveLog, AssumeRoleWithSAMLResponseFilterSensitiveLog)
1111
+ .ser(se_AssumeRoleWithSAMLCommand)
1112
+ .de(de_AssumeRoleWithSAMLCommand)
1113
+ .build() {
1114
+ }
1315
1115
 
1116
+ class AssumeRoleWithWebIdentityCommand extends smithyClient.Command
1117
+ .classBuilder()
1118
+ .ep(EndpointParameters.commonParams)
1119
+ .m(function (Command, cs, config, o) {
1120
+ return [
1121
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
1122
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1123
+ ];
1124
+ })
1125
+ .s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {})
1126
+ .n("STSClient", "AssumeRoleWithWebIdentityCommand")
1127
+ .f(AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog)
1128
+ .ser(se_AssumeRoleWithWebIdentityCommand)
1129
+ .de(de_AssumeRoleWithWebIdentityCommand)
1130
+ .build() {
1131
+ }
1316
1132
 
1317
- var import_EndpointParameters8 = require("./endpoint/EndpointParameters");
1318
- var GetFederationTokenCommand = class extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters8.commonParams).m(function(Command, cs, config, o) {
1319
- return [
1320
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1321
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1322
- ];
1323
- }).s("AWSSecurityTokenServiceV20110615", "GetFederationToken", {}).n("STSClient", "GetFederationTokenCommand").f(void 0, GetFederationTokenResponseFilterSensitiveLog).ser(se_GetFederationTokenCommand).de(de_GetFederationTokenCommand).build() {
1324
- static {
1325
- __name(this, "GetFederationTokenCommand");
1326
- }
1327
- };
1133
+ class AssumeRootCommand extends smithyClient.Command
1134
+ .classBuilder()
1135
+ .ep(EndpointParameters.commonParams)
1136
+ .m(function (Command, cs, config, o) {
1137
+ return [
1138
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
1139
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1140
+ ];
1141
+ })
1142
+ .s("AWSSecurityTokenServiceV20110615", "AssumeRoot", {})
1143
+ .n("STSClient", "AssumeRootCommand")
1144
+ .f(void 0, AssumeRootResponseFilterSensitiveLog)
1145
+ .ser(se_AssumeRootCommand)
1146
+ .de(de_AssumeRootCommand)
1147
+ .build() {
1148
+ }
1328
1149
 
1329
- // src/commands/GetSessionTokenCommand.ts
1150
+ class DecodeAuthorizationMessageCommand extends smithyClient.Command
1151
+ .classBuilder()
1152
+ .ep(EndpointParameters.commonParams)
1153
+ .m(function (Command, cs, config, o) {
1154
+ return [
1155
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
1156
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1157
+ ];
1158
+ })
1159
+ .s("AWSSecurityTokenServiceV20110615", "DecodeAuthorizationMessage", {})
1160
+ .n("STSClient", "DecodeAuthorizationMessageCommand")
1161
+ .f(void 0, void 0)
1162
+ .ser(se_DecodeAuthorizationMessageCommand)
1163
+ .de(de_DecodeAuthorizationMessageCommand)
1164
+ .build() {
1165
+ }
1330
1166
 
1167
+ class GetAccessKeyInfoCommand extends smithyClient.Command
1168
+ .classBuilder()
1169
+ .ep(EndpointParameters.commonParams)
1170
+ .m(function (Command, cs, config, o) {
1171
+ return [
1172
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
1173
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1174
+ ];
1175
+ })
1176
+ .s("AWSSecurityTokenServiceV20110615", "GetAccessKeyInfo", {})
1177
+ .n("STSClient", "GetAccessKeyInfoCommand")
1178
+ .f(void 0, void 0)
1179
+ .ser(se_GetAccessKeyInfoCommand)
1180
+ .de(de_GetAccessKeyInfoCommand)
1181
+ .build() {
1182
+ }
1331
1183
 
1184
+ class GetCallerIdentityCommand extends smithyClient.Command
1185
+ .classBuilder()
1186
+ .ep(EndpointParameters.commonParams)
1187
+ .m(function (Command, cs, config, o) {
1188
+ return [
1189
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
1190
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1191
+ ];
1192
+ })
1193
+ .s("AWSSecurityTokenServiceV20110615", "GetCallerIdentity", {})
1194
+ .n("STSClient", "GetCallerIdentityCommand")
1195
+ .f(void 0, void 0)
1196
+ .ser(se_GetCallerIdentityCommand)
1197
+ .de(de_GetCallerIdentityCommand)
1198
+ .build() {
1199
+ }
1332
1200
 
1333
- var import_EndpointParameters9 = require("./endpoint/EndpointParameters");
1334
- var GetSessionTokenCommand = class extends import_smithy_client.Command.classBuilder().ep(import_EndpointParameters9.commonParams).m(function(Command, cs, config, o) {
1335
- return [
1336
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1337
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1338
- ];
1339
- }).s("AWSSecurityTokenServiceV20110615", "GetSessionToken", {}).n("STSClient", "GetSessionTokenCommand").f(void 0, GetSessionTokenResponseFilterSensitiveLog).ser(se_GetSessionTokenCommand).de(de_GetSessionTokenCommand).build() {
1340
- static {
1341
- __name(this, "GetSessionTokenCommand");
1342
- }
1343
- };
1201
+ class GetFederationTokenCommand extends smithyClient.Command
1202
+ .classBuilder()
1203
+ .ep(EndpointParameters.commonParams)
1204
+ .m(function (Command, cs, config, o) {
1205
+ return [
1206
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
1207
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1208
+ ];
1209
+ })
1210
+ .s("AWSSecurityTokenServiceV20110615", "GetFederationToken", {})
1211
+ .n("STSClient", "GetFederationTokenCommand")
1212
+ .f(void 0, GetFederationTokenResponseFilterSensitiveLog)
1213
+ .ser(se_GetFederationTokenCommand)
1214
+ .de(de_GetFederationTokenCommand)
1215
+ .build() {
1216
+ }
1344
1217
 
1345
- // src/STS.ts
1346
- var import_STSClient = require("././STSClient");
1347
- var commands = {
1348
- AssumeRoleCommand,
1349
- AssumeRoleWithSAMLCommand,
1350
- AssumeRoleWithWebIdentityCommand,
1351
- AssumeRootCommand,
1352
- DecodeAuthorizationMessageCommand,
1353
- GetAccessKeyInfoCommand,
1354
- GetCallerIdentityCommand,
1355
- GetFederationTokenCommand,
1356
- GetSessionTokenCommand
1357
- };
1358
- var STS = class extends import_STSClient.STSClient {
1359
- static {
1360
- __name(this, "STS");
1361
- }
1362
- };
1363
- (0, import_smithy_client.createAggregatedClient)(commands, STS);
1218
+ class GetSessionTokenCommand extends smithyClient.Command
1219
+ .classBuilder()
1220
+ .ep(EndpointParameters.commonParams)
1221
+ .m(function (Command, cs, config, o) {
1222
+ return [
1223
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
1224
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
1225
+ ];
1226
+ })
1227
+ .s("AWSSecurityTokenServiceV20110615", "GetSessionToken", {})
1228
+ .n("STSClient", "GetSessionTokenCommand")
1229
+ .f(void 0, GetSessionTokenResponseFilterSensitiveLog)
1230
+ .ser(se_GetSessionTokenCommand)
1231
+ .de(de_GetSessionTokenCommand)
1232
+ .build() {
1233
+ }
1364
1234
 
1365
- // src/index.ts
1366
- var import_EndpointParameters10 = require("./endpoint/EndpointParameters");
1235
+ const commands = {
1236
+ AssumeRoleCommand,
1237
+ AssumeRoleWithSAMLCommand,
1238
+ AssumeRoleWithWebIdentityCommand,
1239
+ AssumeRootCommand,
1240
+ DecodeAuthorizationMessageCommand,
1241
+ GetAccessKeyInfoCommand,
1242
+ GetCallerIdentityCommand,
1243
+ GetFederationTokenCommand,
1244
+ GetSessionTokenCommand,
1245
+ };
1246
+ class STS extends STSClient.STSClient {
1247
+ }
1248
+ smithyClient.createAggregatedClient(commands, STS);
1367
1249
 
1368
- // src/defaultStsRoleAssumers.ts
1369
- var import_client = require("@aws-sdk/core/client");
1370
- var ASSUME_ROLE_DEFAULT_REGION = "us-east-1";
1371
- var getAccountIdFromAssumedRoleUser = /* @__PURE__ */ __name((assumedRoleUser) => {
1372
- if (typeof assumedRoleUser?.Arn === "string") {
1373
- const arnComponents = assumedRoleUser.Arn.split(":");
1374
- if (arnComponents.length > 4 && arnComponents[4] !== "") {
1375
- return arnComponents[4];
1376
- }
1377
- }
1378
- return void 0;
1379
- }, "getAccountIdFromAssumedRoleUser");
1380
- var resolveRegion = /* @__PURE__ */ __name(async (_region, _parentRegion, credentialProviderLogger) => {
1381
- const region = typeof _region === "function" ? await _region() : _region;
1382
- const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion;
1383
- credentialProviderLogger?.debug?.(
1384
- "@aws-sdk/client-sts::resolveRegion",
1385
- "accepting first of:",
1386
- `${region} (provider)`,
1387
- `${parentRegion} (parent client)`,
1388
- `${ASSUME_ROLE_DEFAULT_REGION} (STS default)`
1389
- );
1390
- return region ?? parentRegion ?? ASSUME_ROLE_DEFAULT_REGION;
1391
- }, "resolveRegion");
1392
- var getDefaultRoleAssumer = /* @__PURE__ */ __name((stsOptions, STSClient3) => {
1393
- let stsClient;
1394
- let closureSourceCreds;
1395
- return async (sourceCreds, params) => {
1396
- closureSourceCreds = sourceCreds;
1397
- if (!stsClient) {
1398
- const {
1399
- logger = stsOptions?.parentClientConfig?.logger,
1400
- region,
1401
- requestHandler = stsOptions?.parentClientConfig?.requestHandler,
1402
- credentialProviderLogger
1403
- } = stsOptions;
1404
- const resolvedRegion = await resolveRegion(
1405
- region,
1406
- stsOptions?.parentClientConfig?.region,
1407
- credentialProviderLogger
1408
- );
1409
- const isCompatibleRequestHandler = !isH2(requestHandler);
1410
- stsClient = new STSClient3({
1411
- profile: stsOptions?.parentClientConfig?.profile,
1412
- // A hack to make sts client uses the credential in current closure.
1413
- credentialDefaultProvider: /* @__PURE__ */ __name(() => async () => closureSourceCreds, "credentialDefaultProvider"),
1414
- region: resolvedRegion,
1415
- requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
1416
- logger
1417
- });
1418
- }
1419
- const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleCommand(params));
1420
- if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) {
1421
- throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);
1422
- }
1423
- const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser2);
1424
- const credentials = {
1425
- accessKeyId: Credentials2.AccessKeyId,
1426
- secretAccessKey: Credentials2.SecretAccessKey,
1427
- sessionToken: Credentials2.SessionToken,
1428
- expiration: Credentials2.Expiration,
1429
- // TODO(credentialScope): access normally when shape is updated.
1430
- ...Credentials2.CredentialScope && { credentialScope: Credentials2.CredentialScope },
1431
- ...accountId && { accountId }
1432
- };
1433
- (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i");
1434
- return credentials;
1435
- };
1436
- }, "getDefaultRoleAssumer");
1437
- var getDefaultRoleAssumerWithWebIdentity = /* @__PURE__ */ __name((stsOptions, STSClient3) => {
1438
- let stsClient;
1439
- return async (params) => {
1440
- if (!stsClient) {
1441
- const {
1442
- logger = stsOptions?.parentClientConfig?.logger,
1443
- region,
1444
- requestHandler = stsOptions?.parentClientConfig?.requestHandler,
1445
- credentialProviderLogger
1446
- } = stsOptions;
1447
- const resolvedRegion = await resolveRegion(
1448
- region,
1449
- stsOptions?.parentClientConfig?.region,
1450
- credentialProviderLogger
1451
- );
1452
- const isCompatibleRequestHandler = !isH2(requestHandler);
1453
- stsClient = new STSClient3({
1454
- profile: stsOptions?.parentClientConfig?.profile,
1455
- region: resolvedRegion,
1456
- requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
1457
- logger
1458
- });
1459
- }
1460
- const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
1461
- if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) {
1462
- throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);
1463
- }
1464
- const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser2);
1465
- const credentials = {
1466
- accessKeyId: Credentials2.AccessKeyId,
1467
- secretAccessKey: Credentials2.SecretAccessKey,
1468
- sessionToken: Credentials2.SessionToken,
1469
- expiration: Credentials2.Expiration,
1470
- // TODO(credentialScope): access normally when shape is updated.
1471
- ...Credentials2.CredentialScope && { credentialScope: Credentials2.CredentialScope },
1472
- ...accountId && { accountId }
1250
+ const ASSUME_ROLE_DEFAULT_REGION = "us-east-1";
1251
+ const getAccountIdFromAssumedRoleUser = (assumedRoleUser) => {
1252
+ if (typeof assumedRoleUser?.Arn === "string") {
1253
+ const arnComponents = assumedRoleUser.Arn.split(":");
1254
+ if (arnComponents.length > 4 && arnComponents[4] !== "") {
1255
+ return arnComponents[4];
1256
+ }
1257
+ }
1258
+ return undefined;
1259
+ };
1260
+ const resolveRegion = async (_region, _parentRegion, credentialProviderLogger) => {
1261
+ const region = typeof _region === "function" ? await _region() : _region;
1262
+ const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion;
1263
+ credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (provider)`, `${parentRegion} (parent client)`, `${ASSUME_ROLE_DEFAULT_REGION} (STS default)`);
1264
+ return region ?? parentRegion ?? ASSUME_ROLE_DEFAULT_REGION;
1265
+ };
1266
+ const getDefaultRoleAssumer$1 = (stsOptions, STSClient) => {
1267
+ let stsClient;
1268
+ let closureSourceCreds;
1269
+ return async (sourceCreds, params) => {
1270
+ closureSourceCreds = sourceCreds;
1271
+ if (!stsClient) {
1272
+ const { logger = stsOptions?.parentClientConfig?.logger, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, } = stsOptions;
1273
+ const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger);
1274
+ const isCompatibleRequestHandler = !isH2(requestHandler);
1275
+ stsClient = new STSClient({
1276
+ profile: stsOptions?.parentClientConfig?.profile,
1277
+ credentialDefaultProvider: () => async () => closureSourceCreds,
1278
+ region: resolvedRegion,
1279
+ requestHandler: isCompatibleRequestHandler ? requestHandler : undefined,
1280
+ logger: logger,
1281
+ });
1282
+ }
1283
+ const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleCommand(params));
1284
+ if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
1285
+ throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);
1286
+ }
1287
+ const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);
1288
+ const credentials = {
1289
+ accessKeyId: Credentials.AccessKeyId,
1290
+ secretAccessKey: Credentials.SecretAccessKey,
1291
+ sessionToken: Credentials.SessionToken,
1292
+ expiration: Credentials.Expiration,
1293
+ ...(Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }),
1294
+ ...(accountId && { accountId }),
1295
+ };
1296
+ client.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i");
1297
+ return credentials;
1473
1298
  };
1474
- if (accountId) {
1475
- (0, import_client.setCredentialFeature)(credentials, "RESOLVED_ACCOUNT_ID", "T");
1476
- }
1477
- (0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k");
1478
- return credentials;
1479
- };
1480
- }, "getDefaultRoleAssumerWithWebIdentity");
1481
- var isH2 = /* @__PURE__ */ __name((requestHandler) => {
1482
- return requestHandler?.metadata?.handlerProtocol === "h2";
1483
- }, "isH2");
1484
-
1485
- // src/defaultRoleAssumers.ts
1486
- var import_STSClient2 = require("././STSClient");
1487
- var getCustomizableStsClientCtor = /* @__PURE__ */ __name((baseCtor, customizations) => {
1488
- if (!customizations) return baseCtor;
1489
- else
1490
- return class CustomizableSTSClient extends baseCtor {
1491
- static {
1492
- __name(this, "CustomizableSTSClient");
1493
- }
1494
- constructor(config) {
1495
- super(config);
1496
- for (const customization of customizations) {
1497
- this.middlewareStack.use(customization);
1299
+ };
1300
+ const getDefaultRoleAssumerWithWebIdentity$1 = (stsOptions, STSClient) => {
1301
+ let stsClient;
1302
+ return async (params) => {
1303
+ if (!stsClient) {
1304
+ const { logger = stsOptions?.parentClientConfig?.logger, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, } = stsOptions;
1305
+ const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger);
1306
+ const isCompatibleRequestHandler = !isH2(requestHandler);
1307
+ stsClient = new STSClient({
1308
+ profile: stsOptions?.parentClientConfig?.profile,
1309
+ region: resolvedRegion,
1310
+ requestHandler: isCompatibleRequestHandler ? requestHandler : undefined,
1311
+ logger: logger,
1312
+ });
1498
1313
  }
1499
- }
1314
+ const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
1315
+ if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
1316
+ throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);
1317
+ }
1318
+ const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);
1319
+ const credentials = {
1320
+ accessKeyId: Credentials.AccessKeyId,
1321
+ secretAccessKey: Credentials.SecretAccessKey,
1322
+ sessionToken: Credentials.SessionToken,
1323
+ expiration: Credentials.Expiration,
1324
+ ...(Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }),
1325
+ ...(accountId && { accountId }),
1326
+ };
1327
+ if (accountId) {
1328
+ client.setCredentialFeature(credentials, "RESOLVED_ACCOUNT_ID", "T");
1329
+ }
1330
+ client.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k");
1331
+ return credentials;
1500
1332
  };
1501
- }, "getCustomizableStsClientCtor");
1502
- var getDefaultRoleAssumer2 = /* @__PURE__ */ __name((stsOptions = {}, stsPlugins) => getDefaultRoleAssumer(stsOptions, getCustomizableStsClientCtor(import_STSClient2.STSClient, stsPlugins)), "getDefaultRoleAssumer");
1503
- var getDefaultRoleAssumerWithWebIdentity2 = /* @__PURE__ */ __name((stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity(stsOptions, getCustomizableStsClientCtor(import_STSClient2.STSClient, stsPlugins)), "getDefaultRoleAssumerWithWebIdentity");
1504
- var decorateDefaultCredentialProvider = /* @__PURE__ */ __name((provider) => (input) => provider({
1505
- roleAssumer: getDefaultRoleAssumer2(input),
1506
- roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity2(input),
1507
- ...input
1508
- }), "decorateDefaultCredentialProvider");
1509
- // Annotate the CommonJS export names for ESM import in node:
1333
+ };
1334
+ const isH2 = (requestHandler) => {
1335
+ return requestHandler?.metadata?.handlerProtocol === "h2";
1336
+ };
1510
1337
 
1511
- 0 && (module.exports = {
1512
- STSServiceException,
1513
- __Client,
1514
- STSClient,
1515
- STS,
1516
- $Command,
1517
- AssumeRoleCommand,
1518
- AssumeRoleWithSAMLCommand,
1519
- AssumeRoleWithWebIdentityCommand,
1520
- AssumeRootCommand,
1521
- DecodeAuthorizationMessageCommand,
1522
- GetAccessKeyInfoCommand,
1523
- GetCallerIdentityCommand,
1524
- GetFederationTokenCommand,
1525
- GetSessionTokenCommand,
1526
- ExpiredTokenException,
1527
- MalformedPolicyDocumentException,
1528
- PackedPolicyTooLargeException,
1529
- RegionDisabledException,
1530
- IDPRejectedClaimException,
1531
- InvalidIdentityTokenException,
1532
- IDPCommunicationErrorException,
1533
- InvalidAuthorizationMessageException,
1534
- CredentialsFilterSensitiveLog,
1535
- AssumeRoleResponseFilterSensitiveLog,
1536
- AssumeRoleWithSAMLRequestFilterSensitiveLog,
1537
- AssumeRoleWithSAMLResponseFilterSensitiveLog,
1538
- AssumeRoleWithWebIdentityRequestFilterSensitiveLog,
1539
- AssumeRoleWithWebIdentityResponseFilterSensitiveLog,
1540
- AssumeRootResponseFilterSensitiveLog,
1541
- GetFederationTokenResponseFilterSensitiveLog,
1542
- GetSessionTokenResponseFilterSensitiveLog,
1543
- getDefaultRoleAssumer,
1544
- getDefaultRoleAssumerWithWebIdentity,
1545
- decorateDefaultCredentialProvider
1338
+ const getCustomizableStsClientCtor = (baseCtor, customizations) => {
1339
+ if (!customizations)
1340
+ return baseCtor;
1341
+ else
1342
+ return class CustomizableSTSClient extends baseCtor {
1343
+ constructor(config) {
1344
+ super(config);
1345
+ for (const customization of customizations) {
1346
+ this.middlewareStack.use(customization);
1347
+ }
1348
+ }
1349
+ };
1350
+ };
1351
+ const getDefaultRoleAssumer = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumer$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins));
1352
+ const getDefaultRoleAssumerWithWebIdentity = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins));
1353
+ const decorateDefaultCredentialProvider = (provider) => (input) => provider({
1354
+ roleAssumer: getDefaultRoleAssumer(input),
1355
+ roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input),
1356
+ ...input,
1546
1357
  });
1547
1358
 
1359
+ Object.defineProperty(exports, "$Command", {
1360
+ enumerable: true,
1361
+ get: function () { return smithyClient.Command; }
1362
+ });
1363
+ exports.AssumeRoleCommand = AssumeRoleCommand;
1364
+ exports.AssumeRoleResponseFilterSensitiveLog = AssumeRoleResponseFilterSensitiveLog;
1365
+ exports.AssumeRoleWithSAMLCommand = AssumeRoleWithSAMLCommand;
1366
+ exports.AssumeRoleWithSAMLRequestFilterSensitiveLog = AssumeRoleWithSAMLRequestFilterSensitiveLog;
1367
+ exports.AssumeRoleWithSAMLResponseFilterSensitiveLog = AssumeRoleWithSAMLResponseFilterSensitiveLog;
1368
+ exports.AssumeRoleWithWebIdentityCommand = AssumeRoleWithWebIdentityCommand;
1369
+ exports.AssumeRoleWithWebIdentityRequestFilterSensitiveLog = AssumeRoleWithWebIdentityRequestFilterSensitiveLog;
1370
+ exports.AssumeRoleWithWebIdentityResponseFilterSensitiveLog = AssumeRoleWithWebIdentityResponseFilterSensitiveLog;
1371
+ exports.AssumeRootCommand = AssumeRootCommand;
1372
+ exports.AssumeRootResponseFilterSensitiveLog = AssumeRootResponseFilterSensitiveLog;
1373
+ exports.CredentialsFilterSensitiveLog = CredentialsFilterSensitiveLog;
1374
+ exports.DecodeAuthorizationMessageCommand = DecodeAuthorizationMessageCommand;
1375
+ exports.ExpiredTokenException = ExpiredTokenException;
1376
+ exports.GetAccessKeyInfoCommand = GetAccessKeyInfoCommand;
1377
+ exports.GetCallerIdentityCommand = GetCallerIdentityCommand;
1378
+ exports.GetFederationTokenCommand = GetFederationTokenCommand;
1379
+ exports.GetFederationTokenResponseFilterSensitiveLog = GetFederationTokenResponseFilterSensitiveLog;
1380
+ exports.GetSessionTokenCommand = GetSessionTokenCommand;
1381
+ exports.GetSessionTokenResponseFilterSensitiveLog = GetSessionTokenResponseFilterSensitiveLog;
1382
+ exports.IDPCommunicationErrorException = IDPCommunicationErrorException;
1383
+ exports.IDPRejectedClaimException = IDPRejectedClaimException;
1384
+ exports.InvalidAuthorizationMessageException = InvalidAuthorizationMessageException;
1385
+ exports.InvalidIdentityTokenException = InvalidIdentityTokenException;
1386
+ exports.MalformedPolicyDocumentException = MalformedPolicyDocumentException;
1387
+ exports.PackedPolicyTooLargeException = PackedPolicyTooLargeException;
1388
+ exports.RegionDisabledException = RegionDisabledException;
1389
+ exports.STS = STS;
1390
+ exports.STSServiceException = STSServiceException;
1391
+ exports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider;
1392
+ exports.getDefaultRoleAssumer = getDefaultRoleAssumer;
1393
+ exports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity;
1394
+ Object.keys(STSClient).forEach(function (k) {
1395
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
1396
+ enumerable: true,
1397
+ get: function () { return STSClient[k]; }
1398
+ });
1399
+ });