@aws-sdk/client-sts 3.312.0 → 3.316.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/STS.js +12 -112
- package/dist-cjs/protocols/Aws_query.js +17 -24
- package/dist-es/STS.js +12 -112
- package/dist-es/protocols/Aws_query.js +18 -25
- package/dist-types/STS.d.ts +19 -577
- package/dist-types/ts3.4/STS.d.ts +2 -1
- package/package.json +5 -5
package/dist-cjs/STS.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.STS = void 0;
|
|
4
|
+
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
4
5
|
const AssumeRoleCommand_1 = require("./commands/AssumeRoleCommand");
|
|
5
6
|
const AssumeRoleWithSAMLCommand_1 = require("./commands/AssumeRoleWithSAMLCommand");
|
|
6
7
|
const AssumeRoleWithWebIdentityCommand_1 = require("./commands/AssumeRoleWithWebIdentityCommand");
|
|
@@ -10,118 +11,17 @@ const GetCallerIdentityCommand_1 = require("./commands/GetCallerIdentityCommand"
|
|
|
10
11
|
const GetFederationTokenCommand_1 = require("./commands/GetFederationTokenCommand");
|
|
11
12
|
const GetSessionTokenCommand_1 = require("./commands/GetSessionTokenCommand");
|
|
12
13
|
const STSClient_1 = require("./STSClient");
|
|
14
|
+
const commands = {
|
|
15
|
+
AssumeRoleCommand: AssumeRoleCommand_1.AssumeRoleCommand,
|
|
16
|
+
AssumeRoleWithSAMLCommand: AssumeRoleWithSAMLCommand_1.AssumeRoleWithSAMLCommand,
|
|
17
|
+
AssumeRoleWithWebIdentityCommand: AssumeRoleWithWebIdentityCommand_1.AssumeRoleWithWebIdentityCommand,
|
|
18
|
+
DecodeAuthorizationMessageCommand: DecodeAuthorizationMessageCommand_1.DecodeAuthorizationMessageCommand,
|
|
19
|
+
GetAccessKeyInfoCommand: GetAccessKeyInfoCommand_1.GetAccessKeyInfoCommand,
|
|
20
|
+
GetCallerIdentityCommand: GetCallerIdentityCommand_1.GetCallerIdentityCommand,
|
|
21
|
+
GetFederationTokenCommand: GetFederationTokenCommand_1.GetFederationTokenCommand,
|
|
22
|
+
GetSessionTokenCommand: GetSessionTokenCommand_1.GetSessionTokenCommand,
|
|
23
|
+
};
|
|
13
24
|
class STS extends STSClient_1.STSClient {
|
|
14
|
-
assumeRole(args, optionsOrCb, cb) {
|
|
15
|
-
const command = new AssumeRoleCommand_1.AssumeRoleCommand(args);
|
|
16
|
-
if (typeof optionsOrCb === "function") {
|
|
17
|
-
this.send(command, optionsOrCb);
|
|
18
|
-
}
|
|
19
|
-
else if (typeof cb === "function") {
|
|
20
|
-
if (typeof optionsOrCb !== "object")
|
|
21
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
22
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
return this.send(command, optionsOrCb);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
assumeRoleWithSAML(args, optionsOrCb, cb) {
|
|
29
|
-
const command = new AssumeRoleWithSAMLCommand_1.AssumeRoleWithSAMLCommand(args);
|
|
30
|
-
if (typeof optionsOrCb === "function") {
|
|
31
|
-
this.send(command, optionsOrCb);
|
|
32
|
-
}
|
|
33
|
-
else if (typeof cb === "function") {
|
|
34
|
-
if (typeof optionsOrCb !== "object")
|
|
35
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
36
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
return this.send(command, optionsOrCb);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
assumeRoleWithWebIdentity(args, optionsOrCb, cb) {
|
|
43
|
-
const command = new AssumeRoleWithWebIdentityCommand_1.AssumeRoleWithWebIdentityCommand(args);
|
|
44
|
-
if (typeof optionsOrCb === "function") {
|
|
45
|
-
this.send(command, optionsOrCb);
|
|
46
|
-
}
|
|
47
|
-
else if (typeof cb === "function") {
|
|
48
|
-
if (typeof optionsOrCb !== "object")
|
|
49
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
50
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
return this.send(command, optionsOrCb);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
decodeAuthorizationMessage(args, optionsOrCb, cb) {
|
|
57
|
-
const command = new DecodeAuthorizationMessageCommand_1.DecodeAuthorizationMessageCommand(args);
|
|
58
|
-
if (typeof optionsOrCb === "function") {
|
|
59
|
-
this.send(command, optionsOrCb);
|
|
60
|
-
}
|
|
61
|
-
else if (typeof cb === "function") {
|
|
62
|
-
if (typeof optionsOrCb !== "object")
|
|
63
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
64
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
return this.send(command, optionsOrCb);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
getAccessKeyInfo(args, optionsOrCb, cb) {
|
|
71
|
-
const command = new GetAccessKeyInfoCommand_1.GetAccessKeyInfoCommand(args);
|
|
72
|
-
if (typeof optionsOrCb === "function") {
|
|
73
|
-
this.send(command, optionsOrCb);
|
|
74
|
-
}
|
|
75
|
-
else if (typeof cb === "function") {
|
|
76
|
-
if (typeof optionsOrCb !== "object")
|
|
77
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
78
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
return this.send(command, optionsOrCb);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
getCallerIdentity(args, optionsOrCb, cb) {
|
|
85
|
-
const command = new GetCallerIdentityCommand_1.GetCallerIdentityCommand(args);
|
|
86
|
-
if (typeof optionsOrCb === "function") {
|
|
87
|
-
this.send(command, optionsOrCb);
|
|
88
|
-
}
|
|
89
|
-
else if (typeof cb === "function") {
|
|
90
|
-
if (typeof optionsOrCb !== "object")
|
|
91
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
92
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
return this.send(command, optionsOrCb);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
getFederationToken(args, optionsOrCb, cb) {
|
|
99
|
-
const command = new GetFederationTokenCommand_1.GetFederationTokenCommand(args);
|
|
100
|
-
if (typeof optionsOrCb === "function") {
|
|
101
|
-
this.send(command, optionsOrCb);
|
|
102
|
-
}
|
|
103
|
-
else if (typeof cb === "function") {
|
|
104
|
-
if (typeof optionsOrCb !== "object")
|
|
105
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
106
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
return this.send(command, optionsOrCb);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
getSessionToken(args, optionsOrCb, cb) {
|
|
113
|
-
const command = new GetSessionTokenCommand_1.GetSessionTokenCommand(args);
|
|
114
|
-
if (typeof optionsOrCb === "function") {
|
|
115
|
-
this.send(command, optionsOrCb);
|
|
116
|
-
}
|
|
117
|
-
else if (typeof cb === "function") {
|
|
118
|
-
if (typeof optionsOrCb !== "object")
|
|
119
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
120
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
return this.send(command, optionsOrCb);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
25
|
}
|
|
127
26
|
exports.STS = STS;
|
|
27
|
+
(0, smithy_client_1.createAggregatedClient)(commands, STS);
|
|
@@ -105,7 +105,7 @@ const de_AssumeRoleCommand = async (output, context) => {
|
|
|
105
105
|
$metadata: deserializeMetadata(output),
|
|
106
106
|
...contents,
|
|
107
107
|
};
|
|
108
|
-
return
|
|
108
|
+
return response;
|
|
109
109
|
};
|
|
110
110
|
exports.de_AssumeRoleCommand = de_AssumeRoleCommand;
|
|
111
111
|
const de_AssumeRoleCommandError = async (output, context) => {
|
|
@@ -129,10 +129,9 @@ const de_AssumeRoleCommandError = async (output, context) => {
|
|
|
129
129
|
throw await de_RegionDisabledExceptionRes(parsedOutput, context);
|
|
130
130
|
default:
|
|
131
131
|
const parsedBody = parsedOutput.body;
|
|
132
|
-
|
|
132
|
+
return throwDefaultError({
|
|
133
133
|
output,
|
|
134
134
|
parsedBody: parsedBody.Error,
|
|
135
|
-
exceptionCtor: STSServiceException_1.STSServiceException,
|
|
136
135
|
errorCode,
|
|
137
136
|
});
|
|
138
137
|
}
|
|
@@ -148,7 +147,7 @@ const de_AssumeRoleWithSAMLCommand = async (output, context) => {
|
|
|
148
147
|
$metadata: deserializeMetadata(output),
|
|
149
148
|
...contents,
|
|
150
149
|
};
|
|
151
|
-
return
|
|
150
|
+
return response;
|
|
152
151
|
};
|
|
153
152
|
exports.de_AssumeRoleWithSAMLCommand = de_AssumeRoleWithSAMLCommand;
|
|
154
153
|
const de_AssumeRoleWithSAMLCommandError = async (output, context) => {
|
|
@@ -178,10 +177,9 @@ const de_AssumeRoleWithSAMLCommandError = async (output, context) => {
|
|
|
178
177
|
throw await de_RegionDisabledExceptionRes(parsedOutput, context);
|
|
179
178
|
default:
|
|
180
179
|
const parsedBody = parsedOutput.body;
|
|
181
|
-
|
|
180
|
+
return throwDefaultError({
|
|
182
181
|
output,
|
|
183
182
|
parsedBody: parsedBody.Error,
|
|
184
|
-
exceptionCtor: STSServiceException_1.STSServiceException,
|
|
185
183
|
errorCode,
|
|
186
184
|
});
|
|
187
185
|
}
|
|
@@ -197,7 +195,7 @@ const de_AssumeRoleWithWebIdentityCommand = async (output, context) => {
|
|
|
197
195
|
$metadata: deserializeMetadata(output),
|
|
198
196
|
...contents,
|
|
199
197
|
};
|
|
200
|
-
return
|
|
198
|
+
return response;
|
|
201
199
|
};
|
|
202
200
|
exports.de_AssumeRoleWithWebIdentityCommand = de_AssumeRoleWithWebIdentityCommand;
|
|
203
201
|
const de_AssumeRoleWithWebIdentityCommandError = async (output, context) => {
|
|
@@ -230,10 +228,9 @@ const de_AssumeRoleWithWebIdentityCommandError = async (output, context) => {
|
|
|
230
228
|
throw await de_RegionDisabledExceptionRes(parsedOutput, context);
|
|
231
229
|
default:
|
|
232
230
|
const parsedBody = parsedOutput.body;
|
|
233
|
-
|
|
231
|
+
return throwDefaultError({
|
|
234
232
|
output,
|
|
235
233
|
parsedBody: parsedBody.Error,
|
|
236
|
-
exceptionCtor: STSServiceException_1.STSServiceException,
|
|
237
234
|
errorCode,
|
|
238
235
|
});
|
|
239
236
|
}
|
|
@@ -249,7 +246,7 @@ const de_DecodeAuthorizationMessageCommand = async (output, context) => {
|
|
|
249
246
|
$metadata: deserializeMetadata(output),
|
|
250
247
|
...contents,
|
|
251
248
|
};
|
|
252
|
-
return
|
|
249
|
+
return response;
|
|
253
250
|
};
|
|
254
251
|
exports.de_DecodeAuthorizationMessageCommand = de_DecodeAuthorizationMessageCommand;
|
|
255
252
|
const de_DecodeAuthorizationMessageCommandError = async (output, context) => {
|
|
@@ -264,10 +261,9 @@ const de_DecodeAuthorizationMessageCommandError = async (output, context) => {
|
|
|
264
261
|
throw await de_InvalidAuthorizationMessageExceptionRes(parsedOutput, context);
|
|
265
262
|
default:
|
|
266
263
|
const parsedBody = parsedOutput.body;
|
|
267
|
-
|
|
264
|
+
return throwDefaultError({
|
|
268
265
|
output,
|
|
269
266
|
parsedBody: parsedBody.Error,
|
|
270
|
-
exceptionCtor: STSServiceException_1.STSServiceException,
|
|
271
267
|
errorCode,
|
|
272
268
|
});
|
|
273
269
|
}
|
|
@@ -283,7 +279,7 @@ const de_GetAccessKeyInfoCommand = async (output, context) => {
|
|
|
283
279
|
$metadata: deserializeMetadata(output),
|
|
284
280
|
...contents,
|
|
285
281
|
};
|
|
286
|
-
return
|
|
282
|
+
return response;
|
|
287
283
|
};
|
|
288
284
|
exports.de_GetAccessKeyInfoCommand = de_GetAccessKeyInfoCommand;
|
|
289
285
|
const de_GetAccessKeyInfoCommandError = async (output, context) => {
|
|
@@ -293,10 +289,9 @@ const de_GetAccessKeyInfoCommandError = async (output, context) => {
|
|
|
293
289
|
};
|
|
294
290
|
const errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
295
291
|
const parsedBody = parsedOutput.body;
|
|
296
|
-
|
|
292
|
+
return throwDefaultError({
|
|
297
293
|
output,
|
|
298
294
|
parsedBody: parsedBody.Error,
|
|
299
|
-
exceptionCtor: STSServiceException_1.STSServiceException,
|
|
300
295
|
errorCode,
|
|
301
296
|
});
|
|
302
297
|
};
|
|
@@ -311,7 +306,7 @@ const de_GetCallerIdentityCommand = async (output, context) => {
|
|
|
311
306
|
$metadata: deserializeMetadata(output),
|
|
312
307
|
...contents,
|
|
313
308
|
};
|
|
314
|
-
return
|
|
309
|
+
return response;
|
|
315
310
|
};
|
|
316
311
|
exports.de_GetCallerIdentityCommand = de_GetCallerIdentityCommand;
|
|
317
312
|
const de_GetCallerIdentityCommandError = async (output, context) => {
|
|
@@ -321,10 +316,9 @@ const de_GetCallerIdentityCommandError = async (output, context) => {
|
|
|
321
316
|
};
|
|
322
317
|
const errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
323
318
|
const parsedBody = parsedOutput.body;
|
|
324
|
-
|
|
319
|
+
return throwDefaultError({
|
|
325
320
|
output,
|
|
326
321
|
parsedBody: parsedBody.Error,
|
|
327
|
-
exceptionCtor: STSServiceException_1.STSServiceException,
|
|
328
322
|
errorCode,
|
|
329
323
|
});
|
|
330
324
|
};
|
|
@@ -339,7 +333,7 @@ const de_GetFederationTokenCommand = async (output, context) => {
|
|
|
339
333
|
$metadata: deserializeMetadata(output),
|
|
340
334
|
...contents,
|
|
341
335
|
};
|
|
342
|
-
return
|
|
336
|
+
return response;
|
|
343
337
|
};
|
|
344
338
|
exports.de_GetFederationTokenCommand = de_GetFederationTokenCommand;
|
|
345
339
|
const de_GetFederationTokenCommandError = async (output, context) => {
|
|
@@ -360,10 +354,9 @@ const de_GetFederationTokenCommandError = async (output, context) => {
|
|
|
360
354
|
throw await de_RegionDisabledExceptionRes(parsedOutput, context);
|
|
361
355
|
default:
|
|
362
356
|
const parsedBody = parsedOutput.body;
|
|
363
|
-
|
|
357
|
+
return throwDefaultError({
|
|
364
358
|
output,
|
|
365
359
|
parsedBody: parsedBody.Error,
|
|
366
|
-
exceptionCtor: STSServiceException_1.STSServiceException,
|
|
367
360
|
errorCode,
|
|
368
361
|
});
|
|
369
362
|
}
|
|
@@ -379,7 +372,7 @@ const de_GetSessionTokenCommand = async (output, context) => {
|
|
|
379
372
|
$metadata: deserializeMetadata(output),
|
|
380
373
|
...contents,
|
|
381
374
|
};
|
|
382
|
-
return
|
|
375
|
+
return response;
|
|
383
376
|
};
|
|
384
377
|
exports.de_GetSessionTokenCommand = de_GetSessionTokenCommand;
|
|
385
378
|
const de_GetSessionTokenCommandError = async (output, context) => {
|
|
@@ -394,10 +387,9 @@ const de_GetSessionTokenCommandError = async (output, context) => {
|
|
|
394
387
|
throw await de_RegionDisabledExceptionRes(parsedOutput, context);
|
|
395
388
|
default:
|
|
396
389
|
const parsedBody = parsedOutput.body;
|
|
397
|
-
|
|
390
|
+
return throwDefaultError({
|
|
398
391
|
output,
|
|
399
392
|
parsedBody: parsedBody.Error,
|
|
400
|
-
exceptionCtor: STSServiceException_1.STSServiceException,
|
|
401
393
|
errorCode,
|
|
402
394
|
});
|
|
403
395
|
}
|
|
@@ -940,6 +932,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
|
940
932
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
941
933
|
};
|
|
942
934
|
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
935
|
+
const throwDefaultError = (0, smithy_client_1.withBaseException)(STSServiceException_1.STSServiceException);
|
|
943
936
|
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
944
937
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
945
938
|
const contents = {
|
package/dist-es/STS.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createAggregatedClient } from "@aws-sdk/smithy-client";
|
|
1
2
|
import { AssumeRoleCommand } from "./commands/AssumeRoleCommand";
|
|
2
3
|
import { AssumeRoleWithSAMLCommand, } from "./commands/AssumeRoleWithSAMLCommand";
|
|
3
4
|
import { AssumeRoleWithWebIdentityCommand, } from "./commands/AssumeRoleWithWebIdentityCommand";
|
|
@@ -7,117 +8,16 @@ import { GetCallerIdentityCommand, } from "./commands/GetCallerIdentityCommand";
|
|
|
7
8
|
import { GetFederationTokenCommand, } from "./commands/GetFederationTokenCommand";
|
|
8
9
|
import { GetSessionTokenCommand, } from "./commands/GetSessionTokenCommand";
|
|
9
10
|
import { STSClient } from "./STSClient";
|
|
11
|
+
const commands = {
|
|
12
|
+
AssumeRoleCommand,
|
|
13
|
+
AssumeRoleWithSAMLCommand,
|
|
14
|
+
AssumeRoleWithWebIdentityCommand,
|
|
15
|
+
DecodeAuthorizationMessageCommand,
|
|
16
|
+
GetAccessKeyInfoCommand,
|
|
17
|
+
GetCallerIdentityCommand,
|
|
18
|
+
GetFederationTokenCommand,
|
|
19
|
+
GetSessionTokenCommand,
|
|
20
|
+
};
|
|
10
21
|
export class STS extends STSClient {
|
|
11
|
-
assumeRole(args, optionsOrCb, cb) {
|
|
12
|
-
const command = new AssumeRoleCommand(args);
|
|
13
|
-
if (typeof optionsOrCb === "function") {
|
|
14
|
-
this.send(command, optionsOrCb);
|
|
15
|
-
}
|
|
16
|
-
else if (typeof cb === "function") {
|
|
17
|
-
if (typeof optionsOrCb !== "object")
|
|
18
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
19
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
return this.send(command, optionsOrCb);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
assumeRoleWithSAML(args, optionsOrCb, cb) {
|
|
26
|
-
const command = new AssumeRoleWithSAMLCommand(args);
|
|
27
|
-
if (typeof optionsOrCb === "function") {
|
|
28
|
-
this.send(command, optionsOrCb);
|
|
29
|
-
}
|
|
30
|
-
else if (typeof cb === "function") {
|
|
31
|
-
if (typeof optionsOrCb !== "object")
|
|
32
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
33
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
return this.send(command, optionsOrCb);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
assumeRoleWithWebIdentity(args, optionsOrCb, cb) {
|
|
40
|
-
const command = new AssumeRoleWithWebIdentityCommand(args);
|
|
41
|
-
if (typeof optionsOrCb === "function") {
|
|
42
|
-
this.send(command, optionsOrCb);
|
|
43
|
-
}
|
|
44
|
-
else if (typeof cb === "function") {
|
|
45
|
-
if (typeof optionsOrCb !== "object")
|
|
46
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
47
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
return this.send(command, optionsOrCb);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
decodeAuthorizationMessage(args, optionsOrCb, cb) {
|
|
54
|
-
const command = new DecodeAuthorizationMessageCommand(args);
|
|
55
|
-
if (typeof optionsOrCb === "function") {
|
|
56
|
-
this.send(command, optionsOrCb);
|
|
57
|
-
}
|
|
58
|
-
else if (typeof cb === "function") {
|
|
59
|
-
if (typeof optionsOrCb !== "object")
|
|
60
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
61
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
return this.send(command, optionsOrCb);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
getAccessKeyInfo(args, optionsOrCb, cb) {
|
|
68
|
-
const command = new GetAccessKeyInfoCommand(args);
|
|
69
|
-
if (typeof optionsOrCb === "function") {
|
|
70
|
-
this.send(command, optionsOrCb);
|
|
71
|
-
}
|
|
72
|
-
else if (typeof cb === "function") {
|
|
73
|
-
if (typeof optionsOrCb !== "object")
|
|
74
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
75
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
return this.send(command, optionsOrCb);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
getCallerIdentity(args, optionsOrCb, cb) {
|
|
82
|
-
const command = new GetCallerIdentityCommand(args);
|
|
83
|
-
if (typeof optionsOrCb === "function") {
|
|
84
|
-
this.send(command, optionsOrCb);
|
|
85
|
-
}
|
|
86
|
-
else if (typeof cb === "function") {
|
|
87
|
-
if (typeof optionsOrCb !== "object")
|
|
88
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
89
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
return this.send(command, optionsOrCb);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
getFederationToken(args, optionsOrCb, cb) {
|
|
96
|
-
const command = new GetFederationTokenCommand(args);
|
|
97
|
-
if (typeof optionsOrCb === "function") {
|
|
98
|
-
this.send(command, optionsOrCb);
|
|
99
|
-
}
|
|
100
|
-
else if (typeof cb === "function") {
|
|
101
|
-
if (typeof optionsOrCb !== "object")
|
|
102
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
103
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
return this.send(command, optionsOrCb);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
getSessionToken(args, optionsOrCb, cb) {
|
|
110
|
-
const command = new GetSessionTokenCommand(args);
|
|
111
|
-
if (typeof optionsOrCb === "function") {
|
|
112
|
-
this.send(command, optionsOrCb);
|
|
113
|
-
}
|
|
114
|
-
else if (typeof cb === "function") {
|
|
115
|
-
if (typeof optionsOrCb !== "object")
|
|
116
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
117
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
return this.send(command, optionsOrCb);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
22
|
}
|
|
23
|
+
createAggregatedClient(commands, STS);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
|
-
import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, getValueFromTextNode as __getValueFromTextNode, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, strictParseInt32 as __strictParseInt32,
|
|
2
|
+
import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, getValueFromTextNode as __getValueFromTextNode, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, strictParseInt32 as __strictParseInt32, withBaseException, } from "@aws-sdk/smithy-client";
|
|
3
3
|
import { XMLParser } from "fast-xml-parser";
|
|
4
4
|
import { ExpiredTokenException, IDPCommunicationErrorException, IDPRejectedClaimException, InvalidAuthorizationMessageException, InvalidIdentityTokenException, MalformedPolicyDocumentException, PackedPolicyTooLargeException, RegionDisabledException, } from "../models/models_0";
|
|
5
5
|
import { STSServiceException as __BaseException } from "../models/STSServiceException";
|
|
@@ -94,7 +94,7 @@ export const de_AssumeRoleCommand = async (output, context) => {
|
|
|
94
94
|
$metadata: deserializeMetadata(output),
|
|
95
95
|
...contents,
|
|
96
96
|
};
|
|
97
|
-
return
|
|
97
|
+
return response;
|
|
98
98
|
};
|
|
99
99
|
const de_AssumeRoleCommandError = async (output, context) => {
|
|
100
100
|
const parsedOutput = {
|
|
@@ -117,10 +117,9 @@ const de_AssumeRoleCommandError = async (output, context) => {
|
|
|
117
117
|
throw await de_RegionDisabledExceptionRes(parsedOutput, context);
|
|
118
118
|
default:
|
|
119
119
|
const parsedBody = parsedOutput.body;
|
|
120
|
-
throwDefaultError({
|
|
120
|
+
return throwDefaultError({
|
|
121
121
|
output,
|
|
122
122
|
parsedBody: parsedBody.Error,
|
|
123
|
-
exceptionCtor: __BaseException,
|
|
124
123
|
errorCode,
|
|
125
124
|
});
|
|
126
125
|
}
|
|
@@ -136,7 +135,7 @@ export const de_AssumeRoleWithSAMLCommand = async (output, context) => {
|
|
|
136
135
|
$metadata: deserializeMetadata(output),
|
|
137
136
|
...contents,
|
|
138
137
|
};
|
|
139
|
-
return
|
|
138
|
+
return response;
|
|
140
139
|
};
|
|
141
140
|
const de_AssumeRoleWithSAMLCommandError = async (output, context) => {
|
|
142
141
|
const parsedOutput = {
|
|
@@ -165,10 +164,9 @@ const de_AssumeRoleWithSAMLCommandError = async (output, context) => {
|
|
|
165
164
|
throw await de_RegionDisabledExceptionRes(parsedOutput, context);
|
|
166
165
|
default:
|
|
167
166
|
const parsedBody = parsedOutput.body;
|
|
168
|
-
throwDefaultError({
|
|
167
|
+
return throwDefaultError({
|
|
169
168
|
output,
|
|
170
169
|
parsedBody: parsedBody.Error,
|
|
171
|
-
exceptionCtor: __BaseException,
|
|
172
170
|
errorCode,
|
|
173
171
|
});
|
|
174
172
|
}
|
|
@@ -184,7 +182,7 @@ export const de_AssumeRoleWithWebIdentityCommand = async (output, context) => {
|
|
|
184
182
|
$metadata: deserializeMetadata(output),
|
|
185
183
|
...contents,
|
|
186
184
|
};
|
|
187
|
-
return
|
|
185
|
+
return response;
|
|
188
186
|
};
|
|
189
187
|
const de_AssumeRoleWithWebIdentityCommandError = async (output, context) => {
|
|
190
188
|
const parsedOutput = {
|
|
@@ -216,10 +214,9 @@ const de_AssumeRoleWithWebIdentityCommandError = async (output, context) => {
|
|
|
216
214
|
throw await de_RegionDisabledExceptionRes(parsedOutput, context);
|
|
217
215
|
default:
|
|
218
216
|
const parsedBody = parsedOutput.body;
|
|
219
|
-
throwDefaultError({
|
|
217
|
+
return throwDefaultError({
|
|
220
218
|
output,
|
|
221
219
|
parsedBody: parsedBody.Error,
|
|
222
|
-
exceptionCtor: __BaseException,
|
|
223
220
|
errorCode,
|
|
224
221
|
});
|
|
225
222
|
}
|
|
@@ -235,7 +232,7 @@ export const de_DecodeAuthorizationMessageCommand = async (output, context) => {
|
|
|
235
232
|
$metadata: deserializeMetadata(output),
|
|
236
233
|
...contents,
|
|
237
234
|
};
|
|
238
|
-
return
|
|
235
|
+
return response;
|
|
239
236
|
};
|
|
240
237
|
const de_DecodeAuthorizationMessageCommandError = async (output, context) => {
|
|
241
238
|
const parsedOutput = {
|
|
@@ -249,10 +246,9 @@ const de_DecodeAuthorizationMessageCommandError = async (output, context) => {
|
|
|
249
246
|
throw await de_InvalidAuthorizationMessageExceptionRes(parsedOutput, context);
|
|
250
247
|
default:
|
|
251
248
|
const parsedBody = parsedOutput.body;
|
|
252
|
-
throwDefaultError({
|
|
249
|
+
return throwDefaultError({
|
|
253
250
|
output,
|
|
254
251
|
parsedBody: parsedBody.Error,
|
|
255
|
-
exceptionCtor: __BaseException,
|
|
256
252
|
errorCode,
|
|
257
253
|
});
|
|
258
254
|
}
|
|
@@ -268,7 +264,7 @@ export const de_GetAccessKeyInfoCommand = async (output, context) => {
|
|
|
268
264
|
$metadata: deserializeMetadata(output),
|
|
269
265
|
...contents,
|
|
270
266
|
};
|
|
271
|
-
return
|
|
267
|
+
return response;
|
|
272
268
|
};
|
|
273
269
|
const de_GetAccessKeyInfoCommandError = async (output, context) => {
|
|
274
270
|
const parsedOutput = {
|
|
@@ -277,10 +273,9 @@ const de_GetAccessKeyInfoCommandError = async (output, context) => {
|
|
|
277
273
|
};
|
|
278
274
|
const errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
279
275
|
const parsedBody = parsedOutput.body;
|
|
280
|
-
throwDefaultError({
|
|
276
|
+
return throwDefaultError({
|
|
281
277
|
output,
|
|
282
278
|
parsedBody: parsedBody.Error,
|
|
283
|
-
exceptionCtor: __BaseException,
|
|
284
279
|
errorCode,
|
|
285
280
|
});
|
|
286
281
|
};
|
|
@@ -295,7 +290,7 @@ export const de_GetCallerIdentityCommand = async (output, context) => {
|
|
|
295
290
|
$metadata: deserializeMetadata(output),
|
|
296
291
|
...contents,
|
|
297
292
|
};
|
|
298
|
-
return
|
|
293
|
+
return response;
|
|
299
294
|
};
|
|
300
295
|
const de_GetCallerIdentityCommandError = async (output, context) => {
|
|
301
296
|
const parsedOutput = {
|
|
@@ -304,10 +299,9 @@ const de_GetCallerIdentityCommandError = async (output, context) => {
|
|
|
304
299
|
};
|
|
305
300
|
const errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
306
301
|
const parsedBody = parsedOutput.body;
|
|
307
|
-
throwDefaultError({
|
|
302
|
+
return throwDefaultError({
|
|
308
303
|
output,
|
|
309
304
|
parsedBody: parsedBody.Error,
|
|
310
|
-
exceptionCtor: __BaseException,
|
|
311
305
|
errorCode,
|
|
312
306
|
});
|
|
313
307
|
};
|
|
@@ -322,7 +316,7 @@ export const de_GetFederationTokenCommand = async (output, context) => {
|
|
|
322
316
|
$metadata: deserializeMetadata(output),
|
|
323
317
|
...contents,
|
|
324
318
|
};
|
|
325
|
-
return
|
|
319
|
+
return response;
|
|
326
320
|
};
|
|
327
321
|
const de_GetFederationTokenCommandError = async (output, context) => {
|
|
328
322
|
const parsedOutput = {
|
|
@@ -342,10 +336,9 @@ const de_GetFederationTokenCommandError = async (output, context) => {
|
|
|
342
336
|
throw await de_RegionDisabledExceptionRes(parsedOutput, context);
|
|
343
337
|
default:
|
|
344
338
|
const parsedBody = parsedOutput.body;
|
|
345
|
-
throwDefaultError({
|
|
339
|
+
return throwDefaultError({
|
|
346
340
|
output,
|
|
347
341
|
parsedBody: parsedBody.Error,
|
|
348
|
-
exceptionCtor: __BaseException,
|
|
349
342
|
errorCode,
|
|
350
343
|
});
|
|
351
344
|
}
|
|
@@ -361,7 +354,7 @@ export const de_GetSessionTokenCommand = async (output, context) => {
|
|
|
361
354
|
$metadata: deserializeMetadata(output),
|
|
362
355
|
...contents,
|
|
363
356
|
};
|
|
364
|
-
return
|
|
357
|
+
return response;
|
|
365
358
|
};
|
|
366
359
|
const de_GetSessionTokenCommandError = async (output, context) => {
|
|
367
360
|
const parsedOutput = {
|
|
@@ -375,10 +368,9 @@ const de_GetSessionTokenCommandError = async (output, context) => {
|
|
|
375
368
|
throw await de_RegionDisabledExceptionRes(parsedOutput, context);
|
|
376
369
|
default:
|
|
377
370
|
const parsedBody = parsedOutput.body;
|
|
378
|
-
throwDefaultError({
|
|
371
|
+
return throwDefaultError({
|
|
379
372
|
output,
|
|
380
373
|
parsedBody: parsedBody.Error,
|
|
381
|
-
exceptionCtor: __BaseException,
|
|
382
374
|
errorCode,
|
|
383
375
|
});
|
|
384
376
|
}
|
|
@@ -921,6 +913,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
|
921
913
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
922
914
|
};
|
|
923
915
|
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
916
|
+
const throwDefaultError = withBaseException(__BaseException);
|
|
924
917
|
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
925
918
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
926
919
|
const contents = {
|