@jjrawlins/cdk-iam-policy-builder-helper 0.0.52 → 0.0.53
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/.jsii +3 -3
- package/cdk-iam-policy-builder-helper/jsii/jsii.go +2 -2
- package/cdk-iam-policy-builder-helper/version +1 -1
- package/node_modules/@aws-sdk/client-iam/dist-cjs/index.js +13439 -13574
- package/node_modules/@aws-sdk/client-iam/package.json +5 -5
- package/node_modules/@aws-sdk/client-sso/dist-cjs/index.js +478 -596
- package/node_modules/@aws-sdk/client-sso/package.json +4 -4
- package/node_modules/@aws-sdk/core/dist-cjs/index.js +1969 -6
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/account-id-endpoint/index.js +48 -88
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +35 -74
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +273 -365
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +1581 -1863
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +2 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +2 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js +3 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +2 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-types/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/ConfigurableSerdeContext.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonCodec.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeDeserializer.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeSerializer.d.ts +2 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/QuerySerializerSettings.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/xml/XmlCodec.d.ts +1 -1
- package/node_modules/@aws-sdk/core/package.json +1 -1
- package/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js +38 -73
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +194 -259
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +72 -132
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js +71 -107
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +176 -249
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-CVy8iqsZ.js +14 -0
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +16 -25
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js +170 -203
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/index.js +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +583 -858
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +795 -928
- package/node_modules/@aws-sdk/nested-clients/package.json +4 -4
- package/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +147 -222
- package/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +50 -94
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +5 -3
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +32 -30
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +133 -202
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +126 -34
- package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +5 -3
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +4 -4
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +3 -3
- package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js +19 -17
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js +4 -4
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js +5 -6
- package/node_modules/@smithy/core/dist-es/submodules/schema/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +82 -176
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js +22 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js +110 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js +4 -26
- package/node_modules/@smithy/core/dist-types/submodules/schema/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts +5 -24
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/sentinels.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/translateTraits.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/schema-serde-lib/schema-date-utils.d.ts +47 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +5 -24
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/sentinels.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/translateTraits.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/schema-serde-lib/schema-date-utils.d.ts +47 -0
- package/node_modules/@smithy/core/package.json +3 -3
- package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
- package/node_modules/@smithy/middleware-endpoint/package.json +2 -2
- package/node_modules/@smithy/middleware-retry/package.json +2 -2
- package/node_modules/@smithy/smithy-client/package.json +4 -4
- package/node_modules/@smithy/util-base64/dist-cjs/constants.browser.js +9 -32
- package/node_modules/@smithy/util-base64/dist-es/constants.browser.js +9 -28
- package/node_modules/@smithy/util-base64/dist-types/constants.browser.d.ts +5 -6
- package/node_modules/@smithy/util-base64/dist-types/ts3.4/constants.browser.d.ts +5 -6
- package/node_modules/@smithy/util-base64/package.json +1 -1
- package/node_modules/@smithy/util-body-length-node/dist-cjs/index.js +8 -6
- package/node_modules/@smithy/util-body-length-node/dist-es/calculateBodyLength.js +8 -6
- package/node_modules/@smithy/util-body-length-node/package.json +1 -1
- package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.js +11 -9
- package/node_modules/@smithy/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.js +11 -8
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -3
- package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
- package/node_modules/@smithy/util-stream/dist-cjs/index.js +3 -5
- package/node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js +3 -5
- package/node_modules/@smithy/util-stream/dist-types/blob/Uint8ArrayBlobAdapter.d.ts +1 -0
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/blob/Uint8ArrayBlobAdapter.d.ts +1 -0
- package/node_modules/@smithy/util-stream/package.json +3 -3
- package/package.json +3 -3
|
@@ -1,951 +1,818 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
ClientInputEndpointParameters: () => import_EndpointParameters3.ClientInputEndpointParameters,
|
|
31
|
-
CredentialsFilterSensitiveLog: () => CredentialsFilterSensitiveLog,
|
|
32
|
-
ExpiredTokenException: () => ExpiredTokenException,
|
|
33
|
-
IDPCommunicationErrorException: () => IDPCommunicationErrorException,
|
|
34
|
-
IDPRejectedClaimException: () => IDPRejectedClaimException,
|
|
35
|
-
InvalidIdentityTokenException: () => InvalidIdentityTokenException,
|
|
36
|
-
MalformedPolicyDocumentException: () => MalformedPolicyDocumentException,
|
|
37
|
-
PackedPolicyTooLargeException: () => PackedPolicyTooLargeException,
|
|
38
|
-
RegionDisabledException: () => RegionDisabledException,
|
|
39
|
-
STS: () => STS,
|
|
40
|
-
STSServiceException: () => STSServiceException,
|
|
41
|
-
decorateDefaultCredentialProvider: () => decorateDefaultCredentialProvider,
|
|
42
|
-
getDefaultRoleAssumer: () => getDefaultRoleAssumer2,
|
|
43
|
-
getDefaultRoleAssumerWithWebIdentity: () => getDefaultRoleAssumerWithWebIdentity2
|
|
44
|
-
});
|
|
45
|
-
module.exports = __toCommonJS(index_exports);
|
|
46
|
-
__reExport(index_exports, require("./STSClient"), module.exports);
|
|
47
|
-
|
|
48
|
-
// src/submodules/sts/STS.ts
|
|
49
|
-
var import_smithy_client6 = require("@smithy/smithy-client");
|
|
50
|
-
|
|
51
|
-
// src/submodules/sts/commands/AssumeRoleCommand.ts
|
|
52
|
-
var import_middleware_endpoint = require("@smithy/middleware-endpoint");
|
|
53
|
-
var import_middleware_serde = require("@smithy/middleware-serde");
|
|
54
|
-
var import_smithy_client4 = require("@smithy/smithy-client");
|
|
55
|
-
var import_EndpointParameters = require("./endpoint/EndpointParameters");
|
|
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');
|
|
56
11
|
|
|
57
|
-
|
|
58
|
-
|
|
12
|
+
class STSServiceException extends smithyClient.ServiceException {
|
|
13
|
+
constructor(options) {
|
|
14
|
+
super(options);
|
|
15
|
+
Object.setPrototypeOf(this, STSServiceException.prototype);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
59
18
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
19
|
+
const CredentialsFilterSensitiveLog = (obj) => ({
|
|
20
|
+
...obj,
|
|
21
|
+
...(obj.SecretAccessKey && { SecretAccessKey: smithyClient.SENSITIVE_STRING }),
|
|
22
|
+
});
|
|
23
|
+
const AssumeRoleResponseFilterSensitiveLog = (obj) => ({
|
|
24
|
+
...obj,
|
|
25
|
+
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
|
|
26
|
+
});
|
|
27
|
+
class ExpiredTokenException extends STSServiceException {
|
|
28
|
+
name = "ExpiredTokenException";
|
|
29
|
+
$fault = "client";
|
|
30
|
+
constructor(opts) {
|
|
31
|
+
super({
|
|
32
|
+
name: "ExpiredTokenException",
|
|
33
|
+
$fault: "client",
|
|
34
|
+
...opts,
|
|
35
|
+
});
|
|
36
|
+
Object.setPrototypeOf(this, ExpiredTokenException.prototype);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
class MalformedPolicyDocumentException extends STSServiceException {
|
|
40
|
+
name = "MalformedPolicyDocumentException";
|
|
41
|
+
$fault = "client";
|
|
42
|
+
constructor(opts) {
|
|
43
|
+
super({
|
|
44
|
+
name: "MalformedPolicyDocumentException",
|
|
45
|
+
$fault: "client",
|
|
46
|
+
...opts,
|
|
47
|
+
});
|
|
48
|
+
Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
class PackedPolicyTooLargeException extends STSServiceException {
|
|
52
|
+
name = "PackedPolicyTooLargeException";
|
|
53
|
+
$fault = "client";
|
|
54
|
+
constructor(opts) {
|
|
55
|
+
super({
|
|
56
|
+
name: "PackedPolicyTooLargeException",
|
|
57
|
+
$fault: "client",
|
|
58
|
+
...opts,
|
|
59
|
+
});
|
|
60
|
+
Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
class RegionDisabledException extends STSServiceException {
|
|
64
|
+
name = "RegionDisabledException";
|
|
65
|
+
$fault = "client";
|
|
66
|
+
constructor(opts) {
|
|
67
|
+
super({
|
|
68
|
+
name: "RegionDisabledException",
|
|
69
|
+
$fault: "client",
|
|
70
|
+
...opts,
|
|
71
|
+
});
|
|
72
|
+
Object.setPrototypeOf(this, RegionDisabledException.prototype);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
class IDPRejectedClaimException extends STSServiceException {
|
|
76
|
+
name = "IDPRejectedClaimException";
|
|
77
|
+
$fault = "client";
|
|
78
|
+
constructor(opts) {
|
|
79
|
+
super({
|
|
80
|
+
name: "IDPRejectedClaimException",
|
|
81
|
+
$fault: "client",
|
|
82
|
+
...opts,
|
|
83
|
+
});
|
|
84
|
+
Object.setPrototypeOf(this, IDPRejectedClaimException.prototype);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
class InvalidIdentityTokenException extends STSServiceException {
|
|
88
|
+
name = "InvalidIdentityTokenException";
|
|
89
|
+
$fault = "client";
|
|
90
|
+
constructor(opts) {
|
|
91
|
+
super({
|
|
92
|
+
name: "InvalidIdentityTokenException",
|
|
93
|
+
$fault: "client",
|
|
94
|
+
...opts,
|
|
95
|
+
});
|
|
96
|
+
Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const AssumeRoleWithWebIdentityRequestFilterSensitiveLog = (obj) => ({
|
|
100
|
+
...obj,
|
|
101
|
+
...(obj.WebIdentityToken && { WebIdentityToken: smithyClient.SENSITIVE_STRING }),
|
|
102
|
+
});
|
|
103
|
+
const AssumeRoleWithWebIdentityResponseFilterSensitiveLog = (obj) => ({
|
|
104
|
+
...obj,
|
|
105
|
+
...(obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }),
|
|
106
|
+
});
|
|
107
|
+
class IDPCommunicationErrorException extends STSServiceException {
|
|
108
|
+
name = "IDPCommunicationErrorException";
|
|
109
|
+
$fault = "client";
|
|
110
|
+
constructor(opts) {
|
|
111
|
+
super({
|
|
112
|
+
name: "IDPCommunicationErrorException",
|
|
113
|
+
$fault: "client",
|
|
114
|
+
...opts,
|
|
115
|
+
});
|
|
116
|
+
Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
74
119
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
|
|
83
|
-
}), "AssumeRoleResponseFilterSensitiveLog");
|
|
84
|
-
var ExpiredTokenException = class _ExpiredTokenException extends STSServiceException {
|
|
85
|
-
static {
|
|
86
|
-
__name(this, "ExpiredTokenException");
|
|
87
|
-
}
|
|
88
|
-
name = "ExpiredTokenException";
|
|
89
|
-
$fault = "client";
|
|
90
|
-
/**
|
|
91
|
-
* @internal
|
|
92
|
-
*/
|
|
93
|
-
constructor(opts) {
|
|
94
|
-
super({
|
|
95
|
-
name: "ExpiredTokenException",
|
|
96
|
-
$fault: "client",
|
|
97
|
-
...opts
|
|
98
|
-
});
|
|
99
|
-
Object.setPrototypeOf(this, _ExpiredTokenException.prototype);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
var MalformedPolicyDocumentException = class _MalformedPolicyDocumentException extends STSServiceException {
|
|
103
|
-
static {
|
|
104
|
-
__name(this, "MalformedPolicyDocumentException");
|
|
105
|
-
}
|
|
106
|
-
name = "MalformedPolicyDocumentException";
|
|
107
|
-
$fault = "client";
|
|
108
|
-
/**
|
|
109
|
-
* @internal
|
|
110
|
-
*/
|
|
111
|
-
constructor(opts) {
|
|
112
|
-
super({
|
|
113
|
-
name: "MalformedPolicyDocumentException",
|
|
114
|
-
$fault: "client",
|
|
115
|
-
...opts
|
|
116
|
-
});
|
|
117
|
-
Object.setPrototypeOf(this, _MalformedPolicyDocumentException.prototype);
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
var PackedPolicyTooLargeException = class _PackedPolicyTooLargeException extends STSServiceException {
|
|
121
|
-
static {
|
|
122
|
-
__name(this, "PackedPolicyTooLargeException");
|
|
123
|
-
}
|
|
124
|
-
name = "PackedPolicyTooLargeException";
|
|
125
|
-
$fault = "client";
|
|
126
|
-
/**
|
|
127
|
-
* @internal
|
|
128
|
-
*/
|
|
129
|
-
constructor(opts) {
|
|
130
|
-
super({
|
|
131
|
-
name: "PackedPolicyTooLargeException",
|
|
132
|
-
$fault: "client",
|
|
133
|
-
...opts
|
|
134
|
-
});
|
|
135
|
-
Object.setPrototypeOf(this, _PackedPolicyTooLargeException.prototype);
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
var RegionDisabledException = class _RegionDisabledException extends STSServiceException {
|
|
139
|
-
static {
|
|
140
|
-
__name(this, "RegionDisabledException");
|
|
141
|
-
}
|
|
142
|
-
name = "RegionDisabledException";
|
|
143
|
-
$fault = "client";
|
|
144
|
-
/**
|
|
145
|
-
* @internal
|
|
146
|
-
*/
|
|
147
|
-
constructor(opts) {
|
|
148
|
-
super({
|
|
149
|
-
name: "RegionDisabledException",
|
|
150
|
-
$fault: "client",
|
|
151
|
-
...opts
|
|
120
|
+
const se_AssumeRoleCommand = async (input, context) => {
|
|
121
|
+
const headers = SHARED_HEADERS;
|
|
122
|
+
let body;
|
|
123
|
+
body = buildFormUrlencodedString({
|
|
124
|
+
...se_AssumeRoleRequest(input),
|
|
125
|
+
[_A]: _AR,
|
|
126
|
+
[_V]: _,
|
|
152
127
|
});
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
var IDPRejectedClaimException = class _IDPRejectedClaimException extends STSServiceException {
|
|
157
|
-
static {
|
|
158
|
-
__name(this, "IDPRejectedClaimException");
|
|
159
|
-
}
|
|
160
|
-
name = "IDPRejectedClaimException";
|
|
161
|
-
$fault = "client";
|
|
162
|
-
/**
|
|
163
|
-
* @internal
|
|
164
|
-
*/
|
|
165
|
-
constructor(opts) {
|
|
166
|
-
super({
|
|
167
|
-
name: "IDPRejectedClaimException",
|
|
168
|
-
$fault: "client",
|
|
169
|
-
...opts
|
|
170
|
-
});
|
|
171
|
-
Object.setPrototypeOf(this, _IDPRejectedClaimException.prototype);
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
var InvalidIdentityTokenException = class _InvalidIdentityTokenException extends STSServiceException {
|
|
175
|
-
static {
|
|
176
|
-
__name(this, "InvalidIdentityTokenException");
|
|
177
|
-
}
|
|
178
|
-
name = "InvalidIdentityTokenException";
|
|
179
|
-
$fault = "client";
|
|
180
|
-
/**
|
|
181
|
-
* @internal
|
|
182
|
-
*/
|
|
183
|
-
constructor(opts) {
|
|
184
|
-
super({
|
|
185
|
-
name: "InvalidIdentityTokenException",
|
|
186
|
-
$fault: "client",
|
|
187
|
-
...opts
|
|
188
|
-
});
|
|
189
|
-
Object.setPrototypeOf(this, _InvalidIdentityTokenException.prototype);
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
var AssumeRoleWithWebIdentityRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
193
|
-
...obj,
|
|
194
|
-
...obj.WebIdentityToken && { WebIdentityToken: import_smithy_client2.SENSITIVE_STRING }
|
|
195
|
-
}), "AssumeRoleWithWebIdentityRequestFilterSensitiveLog");
|
|
196
|
-
var AssumeRoleWithWebIdentityResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
197
|
-
...obj,
|
|
198
|
-
...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) }
|
|
199
|
-
}), "AssumeRoleWithWebIdentityResponseFilterSensitiveLog");
|
|
200
|
-
var IDPCommunicationErrorException = class _IDPCommunicationErrorException extends STSServiceException {
|
|
201
|
-
static {
|
|
202
|
-
__name(this, "IDPCommunicationErrorException");
|
|
203
|
-
}
|
|
204
|
-
name = "IDPCommunicationErrorException";
|
|
205
|
-
$fault = "client";
|
|
206
|
-
/**
|
|
207
|
-
* @internal
|
|
208
|
-
*/
|
|
209
|
-
constructor(opts) {
|
|
210
|
-
super({
|
|
211
|
-
name: "IDPCommunicationErrorException",
|
|
212
|
-
$fault: "client",
|
|
213
|
-
...opts
|
|
214
|
-
});
|
|
215
|
-
Object.setPrototypeOf(this, _IDPCommunicationErrorException.prototype);
|
|
216
|
-
}
|
|
128
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
217
129
|
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
let body;
|
|
226
|
-
body = buildFormUrlencodedString({
|
|
227
|
-
...se_AssumeRoleRequest(input, context),
|
|
228
|
-
[_A]: _AR,
|
|
229
|
-
[_V]: _
|
|
230
|
-
});
|
|
231
|
-
return buildHttpRpcRequest(context, headers, "/", void 0, body);
|
|
232
|
-
}, "se_AssumeRoleCommand");
|
|
233
|
-
var se_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
234
|
-
const headers = SHARED_HEADERS;
|
|
235
|
-
let body;
|
|
236
|
-
body = buildFormUrlencodedString({
|
|
237
|
-
...se_AssumeRoleWithWebIdentityRequest(input, context),
|
|
238
|
-
[_A]: _ARWWI,
|
|
239
|
-
[_V]: _
|
|
240
|
-
});
|
|
241
|
-
return buildHttpRpcRequest(context, headers, "/", void 0, body);
|
|
242
|
-
}, "se_AssumeRoleWithWebIdentityCommand");
|
|
243
|
-
var de_AssumeRoleCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
244
|
-
if (output.statusCode >= 300) {
|
|
245
|
-
return de_CommandError(output, context);
|
|
246
|
-
}
|
|
247
|
-
const data = await (0, import_core.parseXmlBody)(output.body, context);
|
|
248
|
-
let contents = {};
|
|
249
|
-
contents = de_AssumeRoleResponse(data.AssumeRoleResult, context);
|
|
250
|
-
const response = {
|
|
251
|
-
$metadata: deserializeMetadata(output),
|
|
252
|
-
...contents
|
|
253
|
-
};
|
|
254
|
-
return response;
|
|
255
|
-
}, "de_AssumeRoleCommand");
|
|
256
|
-
var de_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
257
|
-
if (output.statusCode >= 300) {
|
|
258
|
-
return de_CommandError(output, context);
|
|
259
|
-
}
|
|
260
|
-
const data = await (0, import_core.parseXmlBody)(output.body, context);
|
|
261
|
-
let contents = {};
|
|
262
|
-
contents = de_AssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult, context);
|
|
263
|
-
const response = {
|
|
264
|
-
$metadata: deserializeMetadata(output),
|
|
265
|
-
...contents
|
|
266
|
-
};
|
|
267
|
-
return response;
|
|
268
|
-
}, "de_AssumeRoleWithWebIdentityCommand");
|
|
269
|
-
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
270
|
-
const parsedOutput = {
|
|
271
|
-
...output,
|
|
272
|
-
body: await (0, import_core.parseXmlErrorBody)(output.body, context)
|
|
273
|
-
};
|
|
274
|
-
const errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
275
|
-
switch (errorCode) {
|
|
276
|
-
case "ExpiredTokenException":
|
|
277
|
-
case "com.amazonaws.sts#ExpiredTokenException":
|
|
278
|
-
throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
|
|
279
|
-
case "MalformedPolicyDocument":
|
|
280
|
-
case "com.amazonaws.sts#MalformedPolicyDocumentException":
|
|
281
|
-
throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
|
|
282
|
-
case "PackedPolicyTooLarge":
|
|
283
|
-
case "com.amazonaws.sts#PackedPolicyTooLargeException":
|
|
284
|
-
throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context);
|
|
285
|
-
case "RegionDisabledException":
|
|
286
|
-
case "com.amazonaws.sts#RegionDisabledException":
|
|
287
|
-
throw await de_RegionDisabledExceptionRes(parsedOutput, context);
|
|
288
|
-
case "IDPCommunicationError":
|
|
289
|
-
case "com.amazonaws.sts#IDPCommunicationErrorException":
|
|
290
|
-
throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context);
|
|
291
|
-
case "IDPRejectedClaim":
|
|
292
|
-
case "com.amazonaws.sts#IDPRejectedClaimException":
|
|
293
|
-
throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context);
|
|
294
|
-
case "InvalidIdentityToken":
|
|
295
|
-
case "com.amazonaws.sts#InvalidIdentityTokenException":
|
|
296
|
-
throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context);
|
|
297
|
-
default:
|
|
298
|
-
const parsedBody = parsedOutput.body;
|
|
299
|
-
return throwDefaultError({
|
|
300
|
-
output,
|
|
301
|
-
parsedBody: parsedBody.Error,
|
|
302
|
-
errorCode
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
}, "de_CommandError");
|
|
306
|
-
var de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
307
|
-
const body = parsedOutput.body;
|
|
308
|
-
const deserialized = de_ExpiredTokenException(body.Error, context);
|
|
309
|
-
const exception = new ExpiredTokenException({
|
|
310
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
311
|
-
...deserialized
|
|
312
|
-
});
|
|
313
|
-
return (0, import_smithy_client3.decorateServiceException)(exception, body);
|
|
314
|
-
}, "de_ExpiredTokenExceptionRes");
|
|
315
|
-
var de_IDPCommunicationErrorExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
316
|
-
const body = parsedOutput.body;
|
|
317
|
-
const deserialized = de_IDPCommunicationErrorException(body.Error, context);
|
|
318
|
-
const exception = new IDPCommunicationErrorException({
|
|
319
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
320
|
-
...deserialized
|
|
321
|
-
});
|
|
322
|
-
return (0, import_smithy_client3.decorateServiceException)(exception, body);
|
|
323
|
-
}, "de_IDPCommunicationErrorExceptionRes");
|
|
324
|
-
var de_IDPRejectedClaimExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
325
|
-
const body = parsedOutput.body;
|
|
326
|
-
const deserialized = de_IDPRejectedClaimException(body.Error, context);
|
|
327
|
-
const exception = new IDPRejectedClaimException({
|
|
328
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
329
|
-
...deserialized
|
|
330
|
-
});
|
|
331
|
-
return (0, import_smithy_client3.decorateServiceException)(exception, body);
|
|
332
|
-
}, "de_IDPRejectedClaimExceptionRes");
|
|
333
|
-
var de_InvalidIdentityTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
334
|
-
const body = parsedOutput.body;
|
|
335
|
-
const deserialized = de_InvalidIdentityTokenException(body.Error, context);
|
|
336
|
-
const exception = new InvalidIdentityTokenException({
|
|
337
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
338
|
-
...deserialized
|
|
339
|
-
});
|
|
340
|
-
return (0, import_smithy_client3.decorateServiceException)(exception, body);
|
|
341
|
-
}, "de_InvalidIdentityTokenExceptionRes");
|
|
342
|
-
var de_MalformedPolicyDocumentExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
343
|
-
const body = parsedOutput.body;
|
|
344
|
-
const deserialized = de_MalformedPolicyDocumentException(body.Error, context);
|
|
345
|
-
const exception = new MalformedPolicyDocumentException({
|
|
346
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
347
|
-
...deserialized
|
|
348
|
-
});
|
|
349
|
-
return (0, import_smithy_client3.decorateServiceException)(exception, body);
|
|
350
|
-
}, "de_MalformedPolicyDocumentExceptionRes");
|
|
351
|
-
var de_PackedPolicyTooLargeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
352
|
-
const body = parsedOutput.body;
|
|
353
|
-
const deserialized = de_PackedPolicyTooLargeException(body.Error, context);
|
|
354
|
-
const exception = new PackedPolicyTooLargeException({
|
|
355
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
356
|
-
...deserialized
|
|
357
|
-
});
|
|
358
|
-
return (0, import_smithy_client3.decorateServiceException)(exception, body);
|
|
359
|
-
}, "de_PackedPolicyTooLargeExceptionRes");
|
|
360
|
-
var de_RegionDisabledExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
361
|
-
const body = parsedOutput.body;
|
|
362
|
-
const deserialized = de_RegionDisabledException(body.Error, context);
|
|
363
|
-
const exception = new RegionDisabledException({
|
|
364
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
365
|
-
...deserialized
|
|
366
|
-
});
|
|
367
|
-
return (0, import_smithy_client3.decorateServiceException)(exception, body);
|
|
368
|
-
}, "de_RegionDisabledExceptionRes");
|
|
369
|
-
var se_AssumeRoleRequest = /* @__PURE__ */ __name((input, context) => {
|
|
370
|
-
const entries = {};
|
|
371
|
-
if (input[_RA] != null) {
|
|
372
|
-
entries[_RA] = input[_RA];
|
|
373
|
-
}
|
|
374
|
-
if (input[_RSN] != null) {
|
|
375
|
-
entries[_RSN] = input[_RSN];
|
|
376
|
-
}
|
|
377
|
-
if (input[_PA] != null) {
|
|
378
|
-
const memberEntries = se_policyDescriptorListType(input[_PA], context);
|
|
379
|
-
if (input[_PA]?.length === 0) {
|
|
380
|
-
entries.PolicyArns = [];
|
|
381
|
-
}
|
|
382
|
-
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
383
|
-
const loc = `PolicyArns.${key}`;
|
|
384
|
-
entries[loc] = value;
|
|
130
|
+
const se_AssumeRoleWithWebIdentityCommand = async (input, context) => {
|
|
131
|
+
const headers = SHARED_HEADERS;
|
|
132
|
+
let body;
|
|
133
|
+
body = buildFormUrlencodedString({
|
|
134
|
+
...se_AssumeRoleWithWebIdentityRequest(input),
|
|
135
|
+
[_A]: _ARWWI,
|
|
136
|
+
[_V]: _,
|
|
385
137
|
});
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
138
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
139
|
+
};
|
|
140
|
+
const de_AssumeRoleCommand = async (output, context) => {
|
|
141
|
+
if (output.statusCode >= 300) {
|
|
142
|
+
return de_CommandError(output, context);
|
|
143
|
+
}
|
|
144
|
+
const data = await core.parseXmlBody(output.body, context);
|
|
145
|
+
let contents = {};
|
|
146
|
+
contents = de_AssumeRoleResponse(data.AssumeRoleResult);
|
|
147
|
+
const response = {
|
|
148
|
+
$metadata: deserializeMetadata(output),
|
|
149
|
+
...contents,
|
|
150
|
+
};
|
|
151
|
+
return response;
|
|
152
|
+
};
|
|
153
|
+
const de_AssumeRoleWithWebIdentityCommand = async (output, context) => {
|
|
154
|
+
if (output.statusCode >= 300) {
|
|
155
|
+
return de_CommandError(output, context);
|
|
156
|
+
}
|
|
157
|
+
const data = await core.parseXmlBody(output.body, context);
|
|
158
|
+
let contents = {};
|
|
159
|
+
contents = de_AssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult);
|
|
160
|
+
const response = {
|
|
161
|
+
$metadata: deserializeMetadata(output),
|
|
162
|
+
...contents,
|
|
163
|
+
};
|
|
164
|
+
return response;
|
|
165
|
+
};
|
|
166
|
+
const de_CommandError = async (output, context) => {
|
|
167
|
+
const parsedOutput = {
|
|
168
|
+
...output,
|
|
169
|
+
body: await core.parseXmlErrorBody(output.body, context),
|
|
170
|
+
};
|
|
171
|
+
const errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
172
|
+
switch (errorCode) {
|
|
173
|
+
case "ExpiredTokenException":
|
|
174
|
+
case "com.amazonaws.sts#ExpiredTokenException":
|
|
175
|
+
throw await de_ExpiredTokenExceptionRes(parsedOutput);
|
|
176
|
+
case "MalformedPolicyDocument":
|
|
177
|
+
case "com.amazonaws.sts#MalformedPolicyDocumentException":
|
|
178
|
+
throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput);
|
|
179
|
+
case "PackedPolicyTooLarge":
|
|
180
|
+
case "com.amazonaws.sts#PackedPolicyTooLargeException":
|
|
181
|
+
throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput);
|
|
182
|
+
case "RegionDisabledException":
|
|
183
|
+
case "com.amazonaws.sts#RegionDisabledException":
|
|
184
|
+
throw await de_RegionDisabledExceptionRes(parsedOutput);
|
|
185
|
+
case "IDPCommunicationError":
|
|
186
|
+
case "com.amazonaws.sts#IDPCommunicationErrorException":
|
|
187
|
+
throw await de_IDPCommunicationErrorExceptionRes(parsedOutput);
|
|
188
|
+
case "IDPRejectedClaim":
|
|
189
|
+
case "com.amazonaws.sts#IDPRejectedClaimException":
|
|
190
|
+
throw await de_IDPRejectedClaimExceptionRes(parsedOutput);
|
|
191
|
+
case "InvalidIdentityToken":
|
|
192
|
+
case "com.amazonaws.sts#InvalidIdentityTokenException":
|
|
193
|
+
throw await de_InvalidIdentityTokenExceptionRes(parsedOutput);
|
|
194
|
+
default:
|
|
195
|
+
const parsedBody = parsedOutput.body;
|
|
196
|
+
return throwDefaultError({
|
|
197
|
+
output,
|
|
198
|
+
parsedBody: parsedBody.Error,
|
|
199
|
+
errorCode,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
const de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
|
|
204
|
+
const body = parsedOutput.body;
|
|
205
|
+
const deserialized = de_ExpiredTokenException(body.Error);
|
|
206
|
+
const exception = new ExpiredTokenException({
|
|
207
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
208
|
+
...deserialized,
|
|
401
209
|
});
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
entries[loc] = value;
|
|
210
|
+
return smithyClient.decorateServiceException(exception, body);
|
|
211
|
+
};
|
|
212
|
+
const de_IDPCommunicationErrorExceptionRes = async (parsedOutput, context) => {
|
|
213
|
+
const body = parsedOutput.body;
|
|
214
|
+
const deserialized = de_IDPCommunicationErrorException(body.Error);
|
|
215
|
+
const exception = new IDPCommunicationErrorException({
|
|
216
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
217
|
+
...deserialized,
|
|
411
218
|
});
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
entries[_TC] = input[_TC];
|
|
421
|
-
}
|
|
422
|
-
if (input[_SI] != null) {
|
|
423
|
-
entries[_SI] = input[_SI];
|
|
424
|
-
}
|
|
425
|
-
if (input[_PC] != null) {
|
|
426
|
-
const memberEntries = se_ProvidedContextsListType(input[_PC], context);
|
|
427
|
-
if (input[_PC]?.length === 0) {
|
|
428
|
-
entries.ProvidedContexts = [];
|
|
429
|
-
}
|
|
430
|
-
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
431
|
-
const loc = `ProvidedContexts.${key}`;
|
|
432
|
-
entries[loc] = value;
|
|
219
|
+
return smithyClient.decorateServiceException(exception, body);
|
|
220
|
+
};
|
|
221
|
+
const de_IDPRejectedClaimExceptionRes = async (parsedOutput, context) => {
|
|
222
|
+
const body = parsedOutput.body;
|
|
223
|
+
const deserialized = de_IDPRejectedClaimException(body.Error);
|
|
224
|
+
const exception = new IDPRejectedClaimException({
|
|
225
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
226
|
+
...deserialized,
|
|
433
227
|
});
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
if (input[_RSN] != null) {
|
|
443
|
-
entries[_RSN] = input[_RSN];
|
|
444
|
-
}
|
|
445
|
-
if (input[_WIT] != null) {
|
|
446
|
-
entries[_WIT] = input[_WIT];
|
|
447
|
-
}
|
|
448
|
-
if (input[_PI] != null) {
|
|
449
|
-
entries[_PI] = input[_PI];
|
|
450
|
-
}
|
|
451
|
-
if (input[_PA] != null) {
|
|
452
|
-
const memberEntries = se_policyDescriptorListType(input[_PA], context);
|
|
453
|
-
if (input[_PA]?.length === 0) {
|
|
454
|
-
entries.PolicyArns = [];
|
|
455
|
-
}
|
|
456
|
-
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
457
|
-
const loc = `PolicyArns.${key}`;
|
|
458
|
-
entries[loc] = value;
|
|
228
|
+
return smithyClient.decorateServiceException(exception, body);
|
|
229
|
+
};
|
|
230
|
+
const de_InvalidIdentityTokenExceptionRes = async (parsedOutput, context) => {
|
|
231
|
+
const body = parsedOutput.body;
|
|
232
|
+
const deserialized = de_InvalidIdentityTokenException(body.Error);
|
|
233
|
+
const exception = new InvalidIdentityTokenException({
|
|
234
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
235
|
+
...deserialized,
|
|
459
236
|
});
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
}, "se_AssumeRoleWithWebIdentityRequest");
|
|
469
|
-
var se_policyDescriptorListType = /* @__PURE__ */ __name((input, context) => {
|
|
470
|
-
const entries = {};
|
|
471
|
-
let counter = 1;
|
|
472
|
-
for (const entry of input) {
|
|
473
|
-
if (entry === null) {
|
|
474
|
-
continue;
|
|
475
|
-
}
|
|
476
|
-
const memberEntries = se_PolicyDescriptorType(entry, context);
|
|
477
|
-
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
478
|
-
entries[`member.${counter}.${key}`] = value;
|
|
237
|
+
return smithyClient.decorateServiceException(exception, body);
|
|
238
|
+
};
|
|
239
|
+
const de_MalformedPolicyDocumentExceptionRes = async (parsedOutput, context) => {
|
|
240
|
+
const body = parsedOutput.body;
|
|
241
|
+
const deserialized = de_MalformedPolicyDocumentException(body.Error);
|
|
242
|
+
const exception = new MalformedPolicyDocumentException({
|
|
243
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
244
|
+
...deserialized,
|
|
479
245
|
});
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
}
|
|
489
|
-
return entries;
|
|
490
|
-
}, "se_PolicyDescriptorType");
|
|
491
|
-
var se_ProvidedContext = /* @__PURE__ */ __name((input, context) => {
|
|
492
|
-
const entries = {};
|
|
493
|
-
if (input[_PAr] != null) {
|
|
494
|
-
entries[_PAr] = input[_PAr];
|
|
495
|
-
}
|
|
496
|
-
if (input[_CA] != null) {
|
|
497
|
-
entries[_CA] = input[_CA];
|
|
498
|
-
}
|
|
499
|
-
return entries;
|
|
500
|
-
}, "se_ProvidedContext");
|
|
501
|
-
var se_ProvidedContextsListType = /* @__PURE__ */ __name((input, context) => {
|
|
502
|
-
const entries = {};
|
|
503
|
-
let counter = 1;
|
|
504
|
-
for (const entry of input) {
|
|
505
|
-
if (entry === null) {
|
|
506
|
-
continue;
|
|
507
|
-
}
|
|
508
|
-
const memberEntries = se_ProvidedContext(entry, context);
|
|
509
|
-
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
510
|
-
entries[`member.${counter}.${key}`] = value;
|
|
246
|
+
return smithyClient.decorateServiceException(exception, body);
|
|
247
|
+
};
|
|
248
|
+
const de_PackedPolicyTooLargeExceptionRes = async (parsedOutput, context) => {
|
|
249
|
+
const body = parsedOutput.body;
|
|
250
|
+
const deserialized = de_PackedPolicyTooLargeException(body.Error);
|
|
251
|
+
const exception = new PackedPolicyTooLargeException({
|
|
252
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
253
|
+
...deserialized,
|
|
511
254
|
});
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
}
|
|
521
|
-
if (input[_Va] != null) {
|
|
522
|
-
entries[_Va] = input[_Va];
|
|
523
|
-
}
|
|
524
|
-
return entries;
|
|
525
|
-
}, "se_Tag");
|
|
526
|
-
var se_tagKeyListType = /* @__PURE__ */ __name((input, context) => {
|
|
527
|
-
const entries = {};
|
|
528
|
-
let counter = 1;
|
|
529
|
-
for (const entry of input) {
|
|
530
|
-
if (entry === null) {
|
|
531
|
-
continue;
|
|
532
|
-
}
|
|
533
|
-
entries[`member.${counter}`] = entry;
|
|
534
|
-
counter++;
|
|
535
|
-
}
|
|
536
|
-
return entries;
|
|
537
|
-
}, "se_tagKeyListType");
|
|
538
|
-
var se_tagListType = /* @__PURE__ */ __name((input, context) => {
|
|
539
|
-
const entries = {};
|
|
540
|
-
let counter = 1;
|
|
541
|
-
for (const entry of input) {
|
|
542
|
-
if (entry === null) {
|
|
543
|
-
continue;
|
|
544
|
-
}
|
|
545
|
-
const memberEntries = se_Tag(entry, context);
|
|
546
|
-
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
547
|
-
entries[`member.${counter}.${key}`] = value;
|
|
255
|
+
return smithyClient.decorateServiceException(exception, body);
|
|
256
|
+
};
|
|
257
|
+
const de_RegionDisabledExceptionRes = async (parsedOutput, context) => {
|
|
258
|
+
const body = parsedOutput.body;
|
|
259
|
+
const deserialized = de_RegionDisabledException(body.Error);
|
|
260
|
+
const exception = new RegionDisabledException({
|
|
261
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
262
|
+
...deserialized,
|
|
548
263
|
});
|
|
549
|
-
|
|
550
|
-
}
|
|
551
|
-
return entries;
|
|
552
|
-
}, "se_tagListType");
|
|
553
|
-
var de_AssumedRoleUser = /* @__PURE__ */ __name((output, context) => {
|
|
554
|
-
const contents = {};
|
|
555
|
-
if (output[_ARI] != null) {
|
|
556
|
-
contents[_ARI] = (0, import_smithy_client3.expectString)(output[_ARI]);
|
|
557
|
-
}
|
|
558
|
-
if (output[_Ar] != null) {
|
|
559
|
-
contents[_Ar] = (0, import_smithy_client3.expectString)(output[_Ar]);
|
|
560
|
-
}
|
|
561
|
-
return contents;
|
|
562
|
-
}, "de_AssumedRoleUser");
|
|
563
|
-
var de_AssumeRoleResponse = /* @__PURE__ */ __name((output, context) => {
|
|
564
|
-
const contents = {};
|
|
565
|
-
if (output[_C] != null) {
|
|
566
|
-
contents[_C] = de_Credentials(output[_C], context);
|
|
567
|
-
}
|
|
568
|
-
if (output[_ARU] != null) {
|
|
569
|
-
contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
|
|
570
|
-
}
|
|
571
|
-
if (output[_PPS] != null) {
|
|
572
|
-
contents[_PPS] = (0, import_smithy_client3.strictParseInt32)(output[_PPS]);
|
|
573
|
-
}
|
|
574
|
-
if (output[_SI] != null) {
|
|
575
|
-
contents[_SI] = (0, import_smithy_client3.expectString)(output[_SI]);
|
|
576
|
-
}
|
|
577
|
-
return contents;
|
|
578
|
-
}, "de_AssumeRoleResponse");
|
|
579
|
-
var de_AssumeRoleWithWebIdentityResponse = /* @__PURE__ */ __name((output, context) => {
|
|
580
|
-
const contents = {};
|
|
581
|
-
if (output[_C] != null) {
|
|
582
|
-
contents[_C] = de_Credentials(output[_C], context);
|
|
583
|
-
}
|
|
584
|
-
if (output[_SFWIT] != null) {
|
|
585
|
-
contents[_SFWIT] = (0, import_smithy_client3.expectString)(output[_SFWIT]);
|
|
586
|
-
}
|
|
587
|
-
if (output[_ARU] != null) {
|
|
588
|
-
contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
|
|
589
|
-
}
|
|
590
|
-
if (output[_PPS] != null) {
|
|
591
|
-
contents[_PPS] = (0, import_smithy_client3.strictParseInt32)(output[_PPS]);
|
|
592
|
-
}
|
|
593
|
-
if (output[_Pr] != null) {
|
|
594
|
-
contents[_Pr] = (0, import_smithy_client3.expectString)(output[_Pr]);
|
|
595
|
-
}
|
|
596
|
-
if (output[_Au] != null) {
|
|
597
|
-
contents[_Au] = (0, import_smithy_client3.expectString)(output[_Au]);
|
|
598
|
-
}
|
|
599
|
-
if (output[_SI] != null) {
|
|
600
|
-
contents[_SI] = (0, import_smithy_client3.expectString)(output[_SI]);
|
|
601
|
-
}
|
|
602
|
-
return contents;
|
|
603
|
-
}, "de_AssumeRoleWithWebIdentityResponse");
|
|
604
|
-
var de_Credentials = /* @__PURE__ */ __name((output, context) => {
|
|
605
|
-
const contents = {};
|
|
606
|
-
if (output[_AKI] != null) {
|
|
607
|
-
contents[_AKI] = (0, import_smithy_client3.expectString)(output[_AKI]);
|
|
608
|
-
}
|
|
609
|
-
if (output[_SAK] != null) {
|
|
610
|
-
contents[_SAK] = (0, import_smithy_client3.expectString)(output[_SAK]);
|
|
611
|
-
}
|
|
612
|
-
if (output[_ST] != null) {
|
|
613
|
-
contents[_ST] = (0, import_smithy_client3.expectString)(output[_ST]);
|
|
614
|
-
}
|
|
615
|
-
if (output[_E] != null) {
|
|
616
|
-
contents[_E] = (0, import_smithy_client3.expectNonNull)((0, import_smithy_client3.parseRfc3339DateTimeWithOffset)(output[_E]));
|
|
617
|
-
}
|
|
618
|
-
return contents;
|
|
619
|
-
}, "de_Credentials");
|
|
620
|
-
var de_ExpiredTokenException = /* @__PURE__ */ __name((output, context) => {
|
|
621
|
-
const contents = {};
|
|
622
|
-
if (output[_m] != null) {
|
|
623
|
-
contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
|
|
624
|
-
}
|
|
625
|
-
return contents;
|
|
626
|
-
}, "de_ExpiredTokenException");
|
|
627
|
-
var de_IDPCommunicationErrorException = /* @__PURE__ */ __name((output, context) => {
|
|
628
|
-
const contents = {};
|
|
629
|
-
if (output[_m] != null) {
|
|
630
|
-
contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
|
|
631
|
-
}
|
|
632
|
-
return contents;
|
|
633
|
-
}, "de_IDPCommunicationErrorException");
|
|
634
|
-
var de_IDPRejectedClaimException = /* @__PURE__ */ __name((output, context) => {
|
|
635
|
-
const contents = {};
|
|
636
|
-
if (output[_m] != null) {
|
|
637
|
-
contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
|
|
638
|
-
}
|
|
639
|
-
return contents;
|
|
640
|
-
}, "de_IDPRejectedClaimException");
|
|
641
|
-
var de_InvalidIdentityTokenException = /* @__PURE__ */ __name((output, context) => {
|
|
642
|
-
const contents = {};
|
|
643
|
-
if (output[_m] != null) {
|
|
644
|
-
contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
|
|
645
|
-
}
|
|
646
|
-
return contents;
|
|
647
|
-
}, "de_InvalidIdentityTokenException");
|
|
648
|
-
var de_MalformedPolicyDocumentException = /* @__PURE__ */ __name((output, context) => {
|
|
649
|
-
const contents = {};
|
|
650
|
-
if (output[_m] != null) {
|
|
651
|
-
contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
|
|
652
|
-
}
|
|
653
|
-
return contents;
|
|
654
|
-
}, "de_MalformedPolicyDocumentException");
|
|
655
|
-
var de_PackedPolicyTooLargeException = /* @__PURE__ */ __name((output, context) => {
|
|
656
|
-
const contents = {};
|
|
657
|
-
if (output[_m] != null) {
|
|
658
|
-
contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
|
|
659
|
-
}
|
|
660
|
-
return contents;
|
|
661
|
-
}, "de_PackedPolicyTooLargeException");
|
|
662
|
-
var de_RegionDisabledException = /* @__PURE__ */ __name((output, context) => {
|
|
663
|
-
const contents = {};
|
|
664
|
-
if (output[_m] != null) {
|
|
665
|
-
contents[_m] = (0, import_smithy_client3.expectString)(output[_m]);
|
|
666
|
-
}
|
|
667
|
-
return contents;
|
|
668
|
-
}, "de_RegionDisabledException");
|
|
669
|
-
var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
670
|
-
httpStatusCode: output.statusCode,
|
|
671
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
672
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
673
|
-
cfId: output.headers["x-amz-cf-id"]
|
|
674
|
-
}), "deserializeMetadata");
|
|
675
|
-
var throwDefaultError = (0, import_smithy_client3.withBaseException)(STSServiceException);
|
|
676
|
-
var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
|
|
677
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
678
|
-
const contents = {
|
|
679
|
-
protocol,
|
|
680
|
-
hostname,
|
|
681
|
-
port,
|
|
682
|
-
method: "POST",
|
|
683
|
-
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
684
|
-
headers
|
|
685
|
-
};
|
|
686
|
-
if (resolvedHostname !== void 0) {
|
|
687
|
-
contents.hostname = resolvedHostname;
|
|
688
|
-
}
|
|
689
|
-
if (body !== void 0) {
|
|
690
|
-
contents.body = body;
|
|
691
|
-
}
|
|
692
|
-
return new import_protocol_http.HttpRequest(contents);
|
|
693
|
-
}, "buildHttpRpcRequest");
|
|
694
|
-
var SHARED_HEADERS = {
|
|
695
|
-
"content-type": "application/x-www-form-urlencoded"
|
|
696
|
-
};
|
|
697
|
-
var _ = "2011-06-15";
|
|
698
|
-
var _A = "Action";
|
|
699
|
-
var _AKI = "AccessKeyId";
|
|
700
|
-
var _AR = "AssumeRole";
|
|
701
|
-
var _ARI = "AssumedRoleId";
|
|
702
|
-
var _ARU = "AssumedRoleUser";
|
|
703
|
-
var _ARWWI = "AssumeRoleWithWebIdentity";
|
|
704
|
-
var _Ar = "Arn";
|
|
705
|
-
var _Au = "Audience";
|
|
706
|
-
var _C = "Credentials";
|
|
707
|
-
var _CA = "ContextAssertion";
|
|
708
|
-
var _DS = "DurationSeconds";
|
|
709
|
-
var _E = "Expiration";
|
|
710
|
-
var _EI = "ExternalId";
|
|
711
|
-
var _K = "Key";
|
|
712
|
-
var _P = "Policy";
|
|
713
|
-
var _PA = "PolicyArns";
|
|
714
|
-
var _PAr = "ProviderArn";
|
|
715
|
-
var _PC = "ProvidedContexts";
|
|
716
|
-
var _PI = "ProviderId";
|
|
717
|
-
var _PPS = "PackedPolicySize";
|
|
718
|
-
var _Pr = "Provider";
|
|
719
|
-
var _RA = "RoleArn";
|
|
720
|
-
var _RSN = "RoleSessionName";
|
|
721
|
-
var _SAK = "SecretAccessKey";
|
|
722
|
-
var _SFWIT = "SubjectFromWebIdentityToken";
|
|
723
|
-
var _SI = "SourceIdentity";
|
|
724
|
-
var _SN = "SerialNumber";
|
|
725
|
-
var _ST = "SessionToken";
|
|
726
|
-
var _T = "Tags";
|
|
727
|
-
var _TC = "TokenCode";
|
|
728
|
-
var _TTK = "TransitiveTagKeys";
|
|
729
|
-
var _V = "Version";
|
|
730
|
-
var _Va = "Value";
|
|
731
|
-
var _WIT = "WebIdentityToken";
|
|
732
|
-
var _a = "arn";
|
|
733
|
-
var _m = "message";
|
|
734
|
-
var buildFormUrlencodedString = /* @__PURE__ */ __name((formEntries) => Object.entries(formEntries).map(([key, value]) => (0, import_smithy_client3.extendedEncodeURIComponent)(key) + "=" + (0, import_smithy_client3.extendedEncodeURIComponent)(value)).join("&"), "buildFormUrlencodedString");
|
|
735
|
-
var loadQueryErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
736
|
-
if (data.Error?.Code !== void 0) {
|
|
737
|
-
return data.Error.Code;
|
|
738
|
-
}
|
|
739
|
-
if (output.statusCode == 404) {
|
|
740
|
-
return "NotFound";
|
|
741
|
-
}
|
|
742
|
-
}, "loadQueryErrorCode");
|
|
743
|
-
|
|
744
|
-
// src/submodules/sts/commands/AssumeRoleCommand.ts
|
|
745
|
-
var AssumeRoleCommand = class extends import_smithy_client4.Command.classBuilder().ep(import_EndpointParameters.commonParams).m(function(Command, cs, config, o) {
|
|
746
|
-
return [
|
|
747
|
-
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
748
|
-
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
749
|
-
];
|
|
750
|
-
}).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").f(void 0, AssumeRoleResponseFilterSensitiveLog).ser(se_AssumeRoleCommand).de(de_AssumeRoleCommand).build() {
|
|
751
|
-
static {
|
|
752
|
-
__name(this, "AssumeRoleCommand");
|
|
753
|
-
}
|
|
264
|
+
return smithyClient.decorateServiceException(exception, body);
|
|
754
265
|
};
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
266
|
+
const se_AssumeRoleRequest = (input, context) => {
|
|
267
|
+
const entries = {};
|
|
268
|
+
if (input[_RA] != null) {
|
|
269
|
+
entries[_RA] = input[_RA];
|
|
270
|
+
}
|
|
271
|
+
if (input[_RSN] != null) {
|
|
272
|
+
entries[_RSN] = input[_RSN];
|
|
273
|
+
}
|
|
274
|
+
if (input[_PA] != null) {
|
|
275
|
+
const memberEntries = se_policyDescriptorListType(input[_PA]);
|
|
276
|
+
if (input[_PA]?.length === 0) {
|
|
277
|
+
entries.PolicyArns = [];
|
|
278
|
+
}
|
|
279
|
+
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
280
|
+
const loc = `PolicyArns.${key}`;
|
|
281
|
+
entries[loc] = value;
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
if (input[_P] != null) {
|
|
285
|
+
entries[_P] = input[_P];
|
|
286
|
+
}
|
|
287
|
+
if (input[_DS] != null) {
|
|
288
|
+
entries[_DS] = input[_DS];
|
|
289
|
+
}
|
|
290
|
+
if (input[_T] != null) {
|
|
291
|
+
const memberEntries = se_tagListType(input[_T]);
|
|
292
|
+
if (input[_T]?.length === 0) {
|
|
293
|
+
entries.Tags = [];
|
|
294
|
+
}
|
|
295
|
+
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
296
|
+
const loc = `Tags.${key}`;
|
|
297
|
+
entries[loc] = value;
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
if (input[_TTK] != null) {
|
|
301
|
+
const memberEntries = se_tagKeyListType(input[_TTK]);
|
|
302
|
+
if (input[_TTK]?.length === 0) {
|
|
303
|
+
entries.TransitiveTagKeys = [];
|
|
304
|
+
}
|
|
305
|
+
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
306
|
+
const loc = `TransitiveTagKeys.${key}`;
|
|
307
|
+
entries[loc] = value;
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
if (input[_EI] != null) {
|
|
311
|
+
entries[_EI] = input[_EI];
|
|
312
|
+
}
|
|
313
|
+
if (input[_SN] != null) {
|
|
314
|
+
entries[_SN] = input[_SN];
|
|
315
|
+
}
|
|
316
|
+
if (input[_TC] != null) {
|
|
317
|
+
entries[_TC] = input[_TC];
|
|
318
|
+
}
|
|
319
|
+
if (input[_SI] != null) {
|
|
320
|
+
entries[_SI] = input[_SI];
|
|
321
|
+
}
|
|
322
|
+
if (input[_PC] != null) {
|
|
323
|
+
const memberEntries = se_ProvidedContextsListType(input[_PC]);
|
|
324
|
+
if (input[_PC]?.length === 0) {
|
|
325
|
+
entries.ProvidedContexts = [];
|
|
326
|
+
}
|
|
327
|
+
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
328
|
+
const loc = `ProvidedContexts.${key}`;
|
|
329
|
+
entries[loc] = value;
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
return entries;
|
|
333
|
+
};
|
|
334
|
+
const se_AssumeRoleWithWebIdentityRequest = (input, context) => {
|
|
335
|
+
const entries = {};
|
|
336
|
+
if (input[_RA] != null) {
|
|
337
|
+
entries[_RA] = input[_RA];
|
|
338
|
+
}
|
|
339
|
+
if (input[_RSN] != null) {
|
|
340
|
+
entries[_RSN] = input[_RSN];
|
|
341
|
+
}
|
|
342
|
+
if (input[_WIT] != null) {
|
|
343
|
+
entries[_WIT] = input[_WIT];
|
|
344
|
+
}
|
|
345
|
+
if (input[_PI] != null) {
|
|
346
|
+
entries[_PI] = input[_PI];
|
|
347
|
+
}
|
|
348
|
+
if (input[_PA] != null) {
|
|
349
|
+
const memberEntries = se_policyDescriptorListType(input[_PA]);
|
|
350
|
+
if (input[_PA]?.length === 0) {
|
|
351
|
+
entries.PolicyArns = [];
|
|
352
|
+
}
|
|
353
|
+
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
354
|
+
const loc = `PolicyArns.${key}`;
|
|
355
|
+
entries[loc] = value;
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
if (input[_P] != null) {
|
|
359
|
+
entries[_P] = input[_P];
|
|
360
|
+
}
|
|
361
|
+
if (input[_DS] != null) {
|
|
362
|
+
entries[_DS] = input[_DS];
|
|
363
|
+
}
|
|
364
|
+
return entries;
|
|
365
|
+
};
|
|
366
|
+
const se_policyDescriptorListType = (input, context) => {
|
|
367
|
+
const entries = {};
|
|
368
|
+
let counter = 1;
|
|
369
|
+
for (const entry of input) {
|
|
370
|
+
if (entry === null) {
|
|
371
|
+
continue;
|
|
372
|
+
}
|
|
373
|
+
const memberEntries = se_PolicyDescriptorType(entry);
|
|
374
|
+
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
375
|
+
entries[`member.${counter}.${key}`] = value;
|
|
376
|
+
});
|
|
377
|
+
counter++;
|
|
378
|
+
}
|
|
379
|
+
return entries;
|
|
380
|
+
};
|
|
381
|
+
const se_PolicyDescriptorType = (input, context) => {
|
|
382
|
+
const entries = {};
|
|
383
|
+
if (input[_a] != null) {
|
|
384
|
+
entries[_a] = input[_a];
|
|
385
|
+
}
|
|
386
|
+
return entries;
|
|
387
|
+
};
|
|
388
|
+
const se_ProvidedContext = (input, context) => {
|
|
389
|
+
const entries = {};
|
|
390
|
+
if (input[_PAr] != null) {
|
|
391
|
+
entries[_PAr] = input[_PAr];
|
|
392
|
+
}
|
|
393
|
+
if (input[_CA] != null) {
|
|
394
|
+
entries[_CA] = input[_CA];
|
|
395
|
+
}
|
|
396
|
+
return entries;
|
|
397
|
+
};
|
|
398
|
+
const se_ProvidedContextsListType = (input, context) => {
|
|
399
|
+
const entries = {};
|
|
400
|
+
let counter = 1;
|
|
401
|
+
for (const entry of input) {
|
|
402
|
+
if (entry === null) {
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
const memberEntries = se_ProvidedContext(entry);
|
|
406
|
+
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
407
|
+
entries[`member.${counter}.${key}`] = value;
|
|
408
|
+
});
|
|
409
|
+
counter++;
|
|
410
|
+
}
|
|
411
|
+
return entries;
|
|
412
|
+
};
|
|
413
|
+
const se_Tag = (input, context) => {
|
|
414
|
+
const entries = {};
|
|
415
|
+
if (input[_K] != null) {
|
|
416
|
+
entries[_K] = input[_K];
|
|
417
|
+
}
|
|
418
|
+
if (input[_Va] != null) {
|
|
419
|
+
entries[_Va] = input[_Va];
|
|
420
|
+
}
|
|
421
|
+
return entries;
|
|
422
|
+
};
|
|
423
|
+
const se_tagKeyListType = (input, context) => {
|
|
424
|
+
const entries = {};
|
|
425
|
+
let counter = 1;
|
|
426
|
+
for (const entry of input) {
|
|
427
|
+
if (entry === null) {
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
entries[`member.${counter}`] = entry;
|
|
431
|
+
counter++;
|
|
432
|
+
}
|
|
433
|
+
return entries;
|
|
434
|
+
};
|
|
435
|
+
const se_tagListType = (input, context) => {
|
|
436
|
+
const entries = {};
|
|
437
|
+
let counter = 1;
|
|
438
|
+
for (const entry of input) {
|
|
439
|
+
if (entry === null) {
|
|
440
|
+
continue;
|
|
441
|
+
}
|
|
442
|
+
const memberEntries = se_Tag(entry);
|
|
443
|
+
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
444
|
+
entries[`member.${counter}.${key}`] = value;
|
|
445
|
+
});
|
|
446
|
+
counter++;
|
|
447
|
+
}
|
|
448
|
+
return entries;
|
|
449
|
+
};
|
|
450
|
+
const de_AssumedRoleUser = (output, context) => {
|
|
451
|
+
const contents = {};
|
|
452
|
+
if (output[_ARI] != null) {
|
|
453
|
+
contents[_ARI] = smithyClient.expectString(output[_ARI]);
|
|
454
|
+
}
|
|
455
|
+
if (output[_Ar] != null) {
|
|
456
|
+
contents[_Ar] = smithyClient.expectString(output[_Ar]);
|
|
457
|
+
}
|
|
458
|
+
return contents;
|
|
459
|
+
};
|
|
460
|
+
const de_AssumeRoleResponse = (output, context) => {
|
|
461
|
+
const contents = {};
|
|
462
|
+
if (output[_C] != null) {
|
|
463
|
+
contents[_C] = de_Credentials(output[_C]);
|
|
464
|
+
}
|
|
465
|
+
if (output[_ARU] != null) {
|
|
466
|
+
contents[_ARU] = de_AssumedRoleUser(output[_ARU]);
|
|
467
|
+
}
|
|
468
|
+
if (output[_PPS] != null) {
|
|
469
|
+
contents[_PPS] = smithyClient.strictParseInt32(output[_PPS]);
|
|
470
|
+
}
|
|
471
|
+
if (output[_SI] != null) {
|
|
472
|
+
contents[_SI] = smithyClient.expectString(output[_SI]);
|
|
473
|
+
}
|
|
474
|
+
return contents;
|
|
475
|
+
};
|
|
476
|
+
const de_AssumeRoleWithWebIdentityResponse = (output, context) => {
|
|
477
|
+
const contents = {};
|
|
478
|
+
if (output[_C] != null) {
|
|
479
|
+
contents[_C] = de_Credentials(output[_C]);
|
|
480
|
+
}
|
|
481
|
+
if (output[_SFWIT] != null) {
|
|
482
|
+
contents[_SFWIT] = smithyClient.expectString(output[_SFWIT]);
|
|
483
|
+
}
|
|
484
|
+
if (output[_ARU] != null) {
|
|
485
|
+
contents[_ARU] = de_AssumedRoleUser(output[_ARU]);
|
|
486
|
+
}
|
|
487
|
+
if (output[_PPS] != null) {
|
|
488
|
+
contents[_PPS] = smithyClient.strictParseInt32(output[_PPS]);
|
|
489
|
+
}
|
|
490
|
+
if (output[_Pr] != null) {
|
|
491
|
+
contents[_Pr] = smithyClient.expectString(output[_Pr]);
|
|
492
|
+
}
|
|
493
|
+
if (output[_Au] != null) {
|
|
494
|
+
contents[_Au] = smithyClient.expectString(output[_Au]);
|
|
495
|
+
}
|
|
496
|
+
if (output[_SI] != null) {
|
|
497
|
+
contents[_SI] = smithyClient.expectString(output[_SI]);
|
|
498
|
+
}
|
|
499
|
+
return contents;
|
|
500
|
+
};
|
|
501
|
+
const de_Credentials = (output, context) => {
|
|
502
|
+
const contents = {};
|
|
503
|
+
if (output[_AKI] != null) {
|
|
504
|
+
contents[_AKI] = smithyClient.expectString(output[_AKI]);
|
|
505
|
+
}
|
|
506
|
+
if (output[_SAK] != null) {
|
|
507
|
+
contents[_SAK] = smithyClient.expectString(output[_SAK]);
|
|
508
|
+
}
|
|
509
|
+
if (output[_ST] != null) {
|
|
510
|
+
contents[_ST] = smithyClient.expectString(output[_ST]);
|
|
511
|
+
}
|
|
512
|
+
if (output[_E] != null) {
|
|
513
|
+
contents[_E] = smithyClient.expectNonNull(smithyClient.parseRfc3339DateTimeWithOffset(output[_E]));
|
|
514
|
+
}
|
|
515
|
+
return contents;
|
|
516
|
+
};
|
|
517
|
+
const de_ExpiredTokenException = (output, context) => {
|
|
518
|
+
const contents = {};
|
|
519
|
+
if (output[_m] != null) {
|
|
520
|
+
contents[_m] = smithyClient.expectString(output[_m]);
|
|
521
|
+
}
|
|
522
|
+
return contents;
|
|
523
|
+
};
|
|
524
|
+
const de_IDPCommunicationErrorException = (output, context) => {
|
|
525
|
+
const contents = {};
|
|
526
|
+
if (output[_m] != null) {
|
|
527
|
+
contents[_m] = smithyClient.expectString(output[_m]);
|
|
528
|
+
}
|
|
529
|
+
return contents;
|
|
530
|
+
};
|
|
531
|
+
const de_IDPRejectedClaimException = (output, context) => {
|
|
532
|
+
const contents = {};
|
|
533
|
+
if (output[_m] != null) {
|
|
534
|
+
contents[_m] = smithyClient.expectString(output[_m]);
|
|
535
|
+
}
|
|
536
|
+
return contents;
|
|
537
|
+
};
|
|
538
|
+
const de_InvalidIdentityTokenException = (output, context) => {
|
|
539
|
+
const contents = {};
|
|
540
|
+
if (output[_m] != null) {
|
|
541
|
+
contents[_m] = smithyClient.expectString(output[_m]);
|
|
542
|
+
}
|
|
543
|
+
return contents;
|
|
544
|
+
};
|
|
545
|
+
const de_MalformedPolicyDocumentException = (output, context) => {
|
|
546
|
+
const contents = {};
|
|
547
|
+
if (output[_m] != null) {
|
|
548
|
+
contents[_m] = smithyClient.expectString(output[_m]);
|
|
549
|
+
}
|
|
550
|
+
return contents;
|
|
551
|
+
};
|
|
552
|
+
const de_PackedPolicyTooLargeException = (output, context) => {
|
|
553
|
+
const contents = {};
|
|
554
|
+
if (output[_m] != null) {
|
|
555
|
+
contents[_m] = smithyClient.expectString(output[_m]);
|
|
556
|
+
}
|
|
557
|
+
return contents;
|
|
558
|
+
};
|
|
559
|
+
const de_RegionDisabledException = (output, context) => {
|
|
560
|
+
const contents = {};
|
|
561
|
+
if (output[_m] != null) {
|
|
562
|
+
contents[_m] = smithyClient.expectString(output[_m]);
|
|
563
|
+
}
|
|
564
|
+
return contents;
|
|
565
|
+
};
|
|
566
|
+
const deserializeMetadata = (output) => ({
|
|
567
|
+
httpStatusCode: output.statusCode,
|
|
568
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
569
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
570
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
571
|
+
});
|
|
572
|
+
const throwDefaultError = smithyClient.withBaseException(STSServiceException);
|
|
573
|
+
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
574
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
575
|
+
const contents = {
|
|
576
|
+
protocol,
|
|
577
|
+
hostname,
|
|
578
|
+
port,
|
|
579
|
+
method: "POST",
|
|
580
|
+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
581
|
+
headers,
|
|
582
|
+
};
|
|
583
|
+
if (body !== undefined) {
|
|
584
|
+
contents.body = body;
|
|
585
|
+
}
|
|
586
|
+
return new protocolHttp.HttpRequest(contents);
|
|
587
|
+
};
|
|
588
|
+
const SHARED_HEADERS = {
|
|
589
|
+
"content-type": "application/x-www-form-urlencoded",
|
|
590
|
+
};
|
|
591
|
+
const _ = "2011-06-15";
|
|
592
|
+
const _A = "Action";
|
|
593
|
+
const _AKI = "AccessKeyId";
|
|
594
|
+
const _AR = "AssumeRole";
|
|
595
|
+
const _ARI = "AssumedRoleId";
|
|
596
|
+
const _ARU = "AssumedRoleUser";
|
|
597
|
+
const _ARWWI = "AssumeRoleWithWebIdentity";
|
|
598
|
+
const _Ar = "Arn";
|
|
599
|
+
const _Au = "Audience";
|
|
600
|
+
const _C = "Credentials";
|
|
601
|
+
const _CA = "ContextAssertion";
|
|
602
|
+
const _DS = "DurationSeconds";
|
|
603
|
+
const _E = "Expiration";
|
|
604
|
+
const _EI = "ExternalId";
|
|
605
|
+
const _K = "Key";
|
|
606
|
+
const _P = "Policy";
|
|
607
|
+
const _PA = "PolicyArns";
|
|
608
|
+
const _PAr = "ProviderArn";
|
|
609
|
+
const _PC = "ProvidedContexts";
|
|
610
|
+
const _PI = "ProviderId";
|
|
611
|
+
const _PPS = "PackedPolicySize";
|
|
612
|
+
const _Pr = "Provider";
|
|
613
|
+
const _RA = "RoleArn";
|
|
614
|
+
const _RSN = "RoleSessionName";
|
|
615
|
+
const _SAK = "SecretAccessKey";
|
|
616
|
+
const _SFWIT = "SubjectFromWebIdentityToken";
|
|
617
|
+
const _SI = "SourceIdentity";
|
|
618
|
+
const _SN = "SerialNumber";
|
|
619
|
+
const _ST = "SessionToken";
|
|
620
|
+
const _T = "Tags";
|
|
621
|
+
const _TC = "TokenCode";
|
|
622
|
+
const _TTK = "TransitiveTagKeys";
|
|
623
|
+
const _V = "Version";
|
|
624
|
+
const _Va = "Value";
|
|
625
|
+
const _WIT = "WebIdentityToken";
|
|
626
|
+
const _a = "arn";
|
|
627
|
+
const _m = "message";
|
|
628
|
+
const buildFormUrlencodedString = (formEntries) => Object.entries(formEntries)
|
|
629
|
+
.map(([key, value]) => smithyClient.extendedEncodeURIComponent(key) + "=" + smithyClient.extendedEncodeURIComponent(value))
|
|
630
|
+
.join("&");
|
|
631
|
+
const loadQueryErrorCode = (output, data) => {
|
|
632
|
+
if (data.Error?.Code !== undefined) {
|
|
633
|
+
return data.Error.Code;
|
|
634
|
+
}
|
|
635
|
+
if (output.statusCode == 404) {
|
|
636
|
+
return "NotFound";
|
|
637
|
+
}
|
|
770
638
|
};
|
|
771
639
|
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
(0,
|
|
640
|
+
class AssumeRoleCommand extends smithyClient.Command
|
|
641
|
+
.classBuilder()
|
|
642
|
+
.ep(EndpointParameters.commonParams)
|
|
643
|
+
.m(function (Command, cs, config, o) {
|
|
644
|
+
return [
|
|
645
|
+
middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
|
|
646
|
+
middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
647
|
+
];
|
|
648
|
+
})
|
|
649
|
+
.s("AWSSecurityTokenServiceV20110615", "AssumeRole", {})
|
|
650
|
+
.n("STSClient", "AssumeRoleCommand")
|
|
651
|
+
.f(void 0, AssumeRoleResponseFilterSensitiveLog)
|
|
652
|
+
.ser(se_AssumeRoleCommand)
|
|
653
|
+
.de(de_AssumeRoleCommand)
|
|
654
|
+
.build() {
|
|
655
|
+
}
|
|
784
656
|
|
|
785
|
-
|
|
786
|
-
|
|
657
|
+
class AssumeRoleWithWebIdentityCommand extends smithyClient.Command
|
|
658
|
+
.classBuilder()
|
|
659
|
+
.ep(EndpointParameters.commonParams)
|
|
660
|
+
.m(function (Command, cs, config, o) {
|
|
661
|
+
return [
|
|
662
|
+
middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
|
|
663
|
+
middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
664
|
+
];
|
|
665
|
+
})
|
|
666
|
+
.s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {})
|
|
667
|
+
.n("STSClient", "AssumeRoleWithWebIdentityCommand")
|
|
668
|
+
.f(AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog)
|
|
669
|
+
.ser(se_AssumeRoleWithWebIdentityCommand)
|
|
670
|
+
.de(de_AssumeRoleWithWebIdentityCommand)
|
|
671
|
+
.build() {
|
|
672
|
+
}
|
|
787
673
|
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
return arnComponents[4];
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
return void 0;
|
|
799
|
-
}, "getAccountIdFromAssumedRoleUser");
|
|
800
|
-
var resolveRegion = /* @__PURE__ */ __name(async (_region, _parentRegion, credentialProviderLogger) => {
|
|
801
|
-
const region = typeof _region === "function" ? await _region() : _region;
|
|
802
|
-
const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion;
|
|
803
|
-
credentialProviderLogger?.debug?.(
|
|
804
|
-
"@aws-sdk/client-sts::resolveRegion",
|
|
805
|
-
"accepting first of:",
|
|
806
|
-
`${region} (provider)`,
|
|
807
|
-
`${parentRegion} (parent client)`,
|
|
808
|
-
`${ASSUME_ROLE_DEFAULT_REGION} (STS default)`
|
|
809
|
-
);
|
|
810
|
-
return region ?? parentRegion ?? ASSUME_ROLE_DEFAULT_REGION;
|
|
811
|
-
}, "resolveRegion");
|
|
812
|
-
var getDefaultRoleAssumer = /* @__PURE__ */ __name((stsOptions, STSClient3) => {
|
|
813
|
-
let stsClient;
|
|
814
|
-
let closureSourceCreds;
|
|
815
|
-
return async (sourceCreds, params) => {
|
|
816
|
-
closureSourceCreds = sourceCreds;
|
|
817
|
-
if (!stsClient) {
|
|
818
|
-
const {
|
|
819
|
-
logger = stsOptions?.parentClientConfig?.logger,
|
|
820
|
-
region,
|
|
821
|
-
requestHandler = stsOptions?.parentClientConfig?.requestHandler,
|
|
822
|
-
credentialProviderLogger
|
|
823
|
-
} = stsOptions;
|
|
824
|
-
const resolvedRegion = await resolveRegion(
|
|
825
|
-
region,
|
|
826
|
-
stsOptions?.parentClientConfig?.region,
|
|
827
|
-
credentialProviderLogger
|
|
828
|
-
);
|
|
829
|
-
const isCompatibleRequestHandler = !isH2(requestHandler);
|
|
830
|
-
stsClient = new STSClient3({
|
|
831
|
-
profile: stsOptions?.parentClientConfig?.profile,
|
|
832
|
-
// A hack to make sts client uses the credential in current closure.
|
|
833
|
-
credentialDefaultProvider: /* @__PURE__ */ __name(() => async () => closureSourceCreds, "credentialDefaultProvider"),
|
|
834
|
-
region: resolvedRegion,
|
|
835
|
-
requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
|
|
836
|
-
logger
|
|
837
|
-
});
|
|
838
|
-
}
|
|
839
|
-
const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleCommand(params));
|
|
840
|
-
if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) {
|
|
841
|
-
throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);
|
|
842
|
-
}
|
|
843
|
-
const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser2);
|
|
844
|
-
const credentials = {
|
|
845
|
-
accessKeyId: Credentials2.AccessKeyId,
|
|
846
|
-
secretAccessKey: Credentials2.SecretAccessKey,
|
|
847
|
-
sessionToken: Credentials2.SessionToken,
|
|
848
|
-
expiration: Credentials2.Expiration,
|
|
849
|
-
// TODO(credentialScope): access normally when shape is updated.
|
|
850
|
-
...Credentials2.CredentialScope && { credentialScope: Credentials2.CredentialScope },
|
|
851
|
-
...accountId && { accountId }
|
|
852
|
-
};
|
|
853
|
-
(0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i");
|
|
854
|
-
return credentials;
|
|
855
|
-
};
|
|
856
|
-
}, "getDefaultRoleAssumer");
|
|
857
|
-
var getDefaultRoleAssumerWithWebIdentity = /* @__PURE__ */ __name((stsOptions, STSClient3) => {
|
|
858
|
-
let stsClient;
|
|
859
|
-
return async (params) => {
|
|
860
|
-
if (!stsClient) {
|
|
861
|
-
const {
|
|
862
|
-
logger = stsOptions?.parentClientConfig?.logger,
|
|
863
|
-
region,
|
|
864
|
-
requestHandler = stsOptions?.parentClientConfig?.requestHandler,
|
|
865
|
-
credentialProviderLogger
|
|
866
|
-
} = stsOptions;
|
|
867
|
-
const resolvedRegion = await resolveRegion(
|
|
868
|
-
region,
|
|
869
|
-
stsOptions?.parentClientConfig?.region,
|
|
870
|
-
credentialProviderLogger
|
|
871
|
-
);
|
|
872
|
-
const isCompatibleRequestHandler = !isH2(requestHandler);
|
|
873
|
-
stsClient = new STSClient3({
|
|
874
|
-
profile: stsOptions?.parentClientConfig?.profile,
|
|
875
|
-
region: resolvedRegion,
|
|
876
|
-
requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
|
|
877
|
-
logger
|
|
878
|
-
});
|
|
879
|
-
}
|
|
880
|
-
const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
|
|
881
|
-
if (!Credentials2 || !Credentials2.AccessKeyId || !Credentials2.SecretAccessKey) {
|
|
882
|
-
throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);
|
|
883
|
-
}
|
|
884
|
-
const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser2);
|
|
885
|
-
const credentials = {
|
|
886
|
-
accessKeyId: Credentials2.AccessKeyId,
|
|
887
|
-
secretAccessKey: Credentials2.SecretAccessKey,
|
|
888
|
-
sessionToken: Credentials2.SessionToken,
|
|
889
|
-
expiration: Credentials2.Expiration,
|
|
890
|
-
// TODO(credentialScope): access normally when shape is updated.
|
|
891
|
-
...Credentials2.CredentialScope && { credentialScope: Credentials2.CredentialScope },
|
|
892
|
-
...accountId && { accountId }
|
|
893
|
-
};
|
|
894
|
-
if (accountId) {
|
|
895
|
-
(0, import_client.setCredentialFeature)(credentials, "RESOLVED_ACCOUNT_ID", "T");
|
|
896
|
-
}
|
|
897
|
-
(0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k");
|
|
898
|
-
return credentials;
|
|
899
|
-
};
|
|
900
|
-
}, "getDefaultRoleAssumerWithWebIdentity");
|
|
901
|
-
var isH2 = /* @__PURE__ */ __name((requestHandler) => {
|
|
902
|
-
return requestHandler?.metadata?.handlerProtocol === "h2";
|
|
903
|
-
}, "isH2");
|
|
674
|
+
const commands = {
|
|
675
|
+
AssumeRoleCommand,
|
|
676
|
+
AssumeRoleWithWebIdentityCommand,
|
|
677
|
+
};
|
|
678
|
+
class STS extends STSClient.STSClient {
|
|
679
|
+
}
|
|
680
|
+
smithyClient.createAggregatedClient(commands, STS);
|
|
904
681
|
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
static {
|
|
912
|
-
__name(this, "CustomizableSTSClient");
|
|
913
|
-
}
|
|
914
|
-
constructor(config) {
|
|
915
|
-
super(config);
|
|
916
|
-
for (const customization of customizations) {
|
|
917
|
-
this.middlewareStack.use(customization);
|
|
682
|
+
const ASSUME_ROLE_DEFAULT_REGION = "us-east-1";
|
|
683
|
+
const getAccountIdFromAssumedRoleUser = (assumedRoleUser) => {
|
|
684
|
+
if (typeof assumedRoleUser?.Arn === "string") {
|
|
685
|
+
const arnComponents = assumedRoleUser.Arn.split(":");
|
|
686
|
+
if (arnComponents.length > 4 && arnComponents[4] !== "") {
|
|
687
|
+
return arnComponents[4];
|
|
918
688
|
}
|
|
919
|
-
|
|
689
|
+
}
|
|
690
|
+
return undefined;
|
|
691
|
+
};
|
|
692
|
+
const resolveRegion = async (_region, _parentRegion, credentialProviderLogger) => {
|
|
693
|
+
const region = typeof _region === "function" ? await _region() : _region;
|
|
694
|
+
const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion;
|
|
695
|
+
credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (provider)`, `${parentRegion} (parent client)`, `${ASSUME_ROLE_DEFAULT_REGION} (STS default)`);
|
|
696
|
+
return region ?? parentRegion ?? ASSUME_ROLE_DEFAULT_REGION;
|
|
697
|
+
};
|
|
698
|
+
const getDefaultRoleAssumer$1 = (stsOptions, STSClient) => {
|
|
699
|
+
let stsClient;
|
|
700
|
+
let closureSourceCreds;
|
|
701
|
+
return async (sourceCreds, params) => {
|
|
702
|
+
closureSourceCreds = sourceCreds;
|
|
703
|
+
if (!stsClient) {
|
|
704
|
+
const { logger = stsOptions?.parentClientConfig?.logger, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, } = stsOptions;
|
|
705
|
+
const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger);
|
|
706
|
+
const isCompatibleRequestHandler = !isH2(requestHandler);
|
|
707
|
+
stsClient = new STSClient({
|
|
708
|
+
profile: stsOptions?.parentClientConfig?.profile,
|
|
709
|
+
credentialDefaultProvider: () => async () => closureSourceCreds,
|
|
710
|
+
region: resolvedRegion,
|
|
711
|
+
requestHandler: isCompatibleRequestHandler ? requestHandler : undefined,
|
|
712
|
+
logger: logger,
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleCommand(params));
|
|
716
|
+
if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
|
|
717
|
+
throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`);
|
|
718
|
+
}
|
|
719
|
+
const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);
|
|
720
|
+
const credentials = {
|
|
721
|
+
accessKeyId: Credentials.AccessKeyId,
|
|
722
|
+
secretAccessKey: Credentials.SecretAccessKey,
|
|
723
|
+
sessionToken: Credentials.SessionToken,
|
|
724
|
+
expiration: Credentials.Expiration,
|
|
725
|
+
...(Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }),
|
|
726
|
+
...(accountId && { accountId }),
|
|
727
|
+
};
|
|
728
|
+
client.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i");
|
|
729
|
+
return credentials;
|
|
730
|
+
};
|
|
731
|
+
};
|
|
732
|
+
const getDefaultRoleAssumerWithWebIdentity$1 = (stsOptions, STSClient) => {
|
|
733
|
+
let stsClient;
|
|
734
|
+
return async (params) => {
|
|
735
|
+
if (!stsClient) {
|
|
736
|
+
const { logger = stsOptions?.parentClientConfig?.logger, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, } = stsOptions;
|
|
737
|
+
const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger);
|
|
738
|
+
const isCompatibleRequestHandler = !isH2(requestHandler);
|
|
739
|
+
stsClient = new STSClient({
|
|
740
|
+
profile: stsOptions?.parentClientConfig?.profile,
|
|
741
|
+
region: resolvedRegion,
|
|
742
|
+
requestHandler: isCompatibleRequestHandler ? requestHandler : undefined,
|
|
743
|
+
logger: logger,
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
|
|
747
|
+
if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
|
|
748
|
+
throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`);
|
|
749
|
+
}
|
|
750
|
+
const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser);
|
|
751
|
+
const credentials = {
|
|
752
|
+
accessKeyId: Credentials.AccessKeyId,
|
|
753
|
+
secretAccessKey: Credentials.SecretAccessKey,
|
|
754
|
+
sessionToken: Credentials.SessionToken,
|
|
755
|
+
expiration: Credentials.Expiration,
|
|
756
|
+
...(Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }),
|
|
757
|
+
...(accountId && { accountId }),
|
|
758
|
+
};
|
|
759
|
+
if (accountId) {
|
|
760
|
+
client.setCredentialFeature(credentials, "RESOLVED_ACCOUNT_ID", "T");
|
|
761
|
+
}
|
|
762
|
+
client.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k");
|
|
763
|
+
return credentials;
|
|
920
764
|
};
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
765
|
+
};
|
|
766
|
+
const isH2 = (requestHandler) => {
|
|
767
|
+
return requestHandler?.metadata?.handlerProtocol === "h2";
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
const getCustomizableStsClientCtor = (baseCtor, customizations) => {
|
|
771
|
+
if (!customizations)
|
|
772
|
+
return baseCtor;
|
|
773
|
+
else
|
|
774
|
+
return class CustomizableSTSClient extends baseCtor {
|
|
775
|
+
constructor(config) {
|
|
776
|
+
super(config);
|
|
777
|
+
for (const customization of customizations) {
|
|
778
|
+
this.middlewareStack.use(customization);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
};
|
|
783
|
+
const getDefaultRoleAssumer = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumer$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins));
|
|
784
|
+
const getDefaultRoleAssumerWithWebIdentity = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity$1(stsOptions, getCustomizableStsClientCtor(STSClient.STSClient, stsPlugins));
|
|
785
|
+
const decorateDefaultCredentialProvider = (provider) => (input) => provider({
|
|
786
|
+
roleAssumer: getDefaultRoleAssumer(input),
|
|
787
|
+
roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input),
|
|
788
|
+
...input,
|
|
789
|
+
});
|
|
790
|
+
|
|
791
|
+
Object.defineProperty(exports, "$Command", {
|
|
792
|
+
enumerable: true,
|
|
793
|
+
get: function () { return smithyClient.Command; }
|
|
794
|
+
});
|
|
795
|
+
exports.AssumeRoleCommand = AssumeRoleCommand;
|
|
796
|
+
exports.AssumeRoleResponseFilterSensitiveLog = AssumeRoleResponseFilterSensitiveLog;
|
|
797
|
+
exports.AssumeRoleWithWebIdentityCommand = AssumeRoleWithWebIdentityCommand;
|
|
798
|
+
exports.AssumeRoleWithWebIdentityRequestFilterSensitiveLog = AssumeRoleWithWebIdentityRequestFilterSensitiveLog;
|
|
799
|
+
exports.AssumeRoleWithWebIdentityResponseFilterSensitiveLog = AssumeRoleWithWebIdentityResponseFilterSensitiveLog;
|
|
800
|
+
exports.CredentialsFilterSensitiveLog = CredentialsFilterSensitiveLog;
|
|
801
|
+
exports.ExpiredTokenException = ExpiredTokenException;
|
|
802
|
+
exports.IDPCommunicationErrorException = IDPCommunicationErrorException;
|
|
803
|
+
exports.IDPRejectedClaimException = IDPRejectedClaimException;
|
|
804
|
+
exports.InvalidIdentityTokenException = InvalidIdentityTokenException;
|
|
805
|
+
exports.MalformedPolicyDocumentException = MalformedPolicyDocumentException;
|
|
806
|
+
exports.PackedPolicyTooLargeException = PackedPolicyTooLargeException;
|
|
807
|
+
exports.RegionDisabledException = RegionDisabledException;
|
|
808
|
+
exports.STS = STS;
|
|
809
|
+
exports.STSServiceException = STSServiceException;
|
|
810
|
+
exports.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider;
|
|
811
|
+
exports.getDefaultRoleAssumer = getDefaultRoleAssumer;
|
|
812
|
+
exports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity;
|
|
813
|
+
Object.keys(STSClient).forEach(function (k) {
|
|
814
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
815
|
+
enumerable: true,
|
|
816
|
+
get: function () { return STSClient[k]; }
|
|
817
|
+
});
|
|
951
818
|
});
|