@aws-sdk/client-sts 3.1074.0 → 3.1076.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/index.js +944 -16
- package/dist-types/runtimeConfig.browser.d.ts +1 -1
- package/dist-types/runtimeConfig.d.ts +1 -1
- package/dist-types/runtimeConfig.native.d.ts +1 -1
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +7 -1
- package/dist-types/ts3.4/runtimeConfig.d.ts +7 -1
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +7 -1
- package/package.json +10 -10
- package/dist-cjs/auth/httpAuthSchemeProvider.js +0 -138
- package/dist-cjs/endpoint/bdd.js +0 -85
- package/dist-cjs/endpoint/endpointResolver.js +0 -14
- package/dist-cjs/models/STSServiceException.js +0 -8
- package/dist-cjs/models/errors.js +0 -146
- package/dist-cjs/runtimeConfig.browser.js +0 -32
- package/dist-cjs/runtimeConfig.js +0 -64
- package/dist-cjs/runtimeConfig.native.js +0 -12
- package/dist-cjs/runtimeConfig.shared.js +0 -52
- package/dist-cjs/schemas/schemas_0.js +0 -425
|
@@ -14,7 +14,7 @@ export declare const getRuntimeConfig: (config: STSClientConfig) => {
|
|
|
14
14
|
requestHandler: import("@smithy/core/protocols").HttpHandler<any> | RequestHandler;
|
|
15
15
|
retryMode: string | import("@smithy/types").Provider<string>;
|
|
16
16
|
sha256: import("@smithy/types").HashConstructor;
|
|
17
|
-
streamCollector: import("
|
|
17
|
+
streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
|
|
18
18
|
useDualstackEndpoint: (boolean | import("@smithy/types").Provider<boolean>) & (boolean | import("@smithy/types").Provider<boolean | undefined>);
|
|
19
19
|
useFipsEndpoint: (boolean | import("@smithy/types").Provider<boolean>) & (boolean | import("@smithy/types").Provider<boolean | undefined>);
|
|
20
20
|
cacheMiddleware?: boolean | undefined;
|
|
@@ -28,7 +28,7 @@ export declare const getRuntimeConfig: (config: STSClientConfig) => {
|
|
|
28
28
|
retryMode: string | import("@smithy/types").Provider<string>;
|
|
29
29
|
sha256: import("@smithy/types").HashConstructor;
|
|
30
30
|
sigv4aSigningRegionSet: string[] | import("@smithy/types").Provider<string[] | undefined>;
|
|
31
|
-
streamCollector: import("
|
|
31
|
+
streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
|
|
32
32
|
useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
|
|
33
33
|
useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
|
|
34
34
|
userAgentAppId: string | import("@smithy/types").Provider<string | undefined>;
|
|
@@ -15,7 +15,7 @@ export declare const getRuntimeConfig: (config: STSClientConfig) => {
|
|
|
15
15
|
apiVersion: string;
|
|
16
16
|
urlParser: import("@smithy/types").UrlParser;
|
|
17
17
|
bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
|
|
18
|
-
streamCollector: import("
|
|
18
|
+
streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
|
|
19
19
|
base64Decoder: import("@smithy/types").Decoder;
|
|
20
20
|
base64Encoder: (_input: Uint8Array | string) => string;
|
|
21
21
|
utf8Decoder: import("@smithy/types").Decoder;
|
|
@@ -21,7 +21,13 @@ export declare const getRuntimeConfig: (config: STSClientConfig) => {
|
|
|
21
21
|
| RequestHandler;
|
|
22
22
|
retryMode: string | import("@smithy/types").Provider<string>;
|
|
23
23
|
sha256: import("@smithy/types").HashConstructor;
|
|
24
|
-
streamCollector:
|
|
24
|
+
streamCollector: (
|
|
25
|
+
stream:
|
|
26
|
+
| import("stream").Readable
|
|
27
|
+
| import("stream/web").ReadableStream
|
|
28
|
+
| ReadableStream
|
|
29
|
+
| Blob
|
|
30
|
+
) => Promise<Uint8Array>;
|
|
25
31
|
useDualstackEndpoint: (boolean | import("@smithy/types").Provider<boolean>) &
|
|
26
32
|
(boolean | import("@smithy/types").Provider<boolean | undefined>);
|
|
27
33
|
useFipsEndpoint: (boolean | import("@smithy/types").Provider<boolean>) &
|
|
@@ -54,7 +54,13 @@ export declare const getRuntimeConfig: (config: STSClientConfig) => {
|
|
|
54
54
|
sigv4aSigningRegionSet:
|
|
55
55
|
| string[]
|
|
56
56
|
| import("@smithy/types").Provider<string[] | undefined>;
|
|
57
|
-
streamCollector:
|
|
57
|
+
streamCollector: (
|
|
58
|
+
stream:
|
|
59
|
+
| import("stream").Readable
|
|
60
|
+
| import("stream/web").ReadableStream
|
|
61
|
+
| ReadableStream
|
|
62
|
+
| Blob
|
|
63
|
+
) => Promise<Uint8Array>;
|
|
58
64
|
useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
|
|
59
65
|
useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
|
|
60
66
|
userAgentAppId: string | import("@smithy/types").Provider<string | undefined>;
|
|
@@ -20,7 +20,13 @@ export declare const getRuntimeConfig: (config: STSClientConfig) => {
|
|
|
20
20
|
apiVersion: string;
|
|
21
21
|
urlParser: import("@smithy/types").UrlParser;
|
|
22
22
|
bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
|
|
23
|
-
streamCollector:
|
|
23
|
+
streamCollector: (
|
|
24
|
+
stream:
|
|
25
|
+
| import("stream").Readable
|
|
26
|
+
| import("stream/web").ReadableStream
|
|
27
|
+
| ReadableStream
|
|
28
|
+
| Blob
|
|
29
|
+
) => Promise<Uint8Array>;
|
|
24
30
|
base64Decoder: import("@smithy/types").Decoder;
|
|
25
31
|
base64Encoder: (_input: Uint8Array | string) => string;
|
|
26
32
|
utf8Decoder: import("@smithy/types").Decoder;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-sts",
|
|
3
3
|
"description": "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.1076.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
7
7
|
"build:cjs": "node ../../scripts/compilation/inline",
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
29
29
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
30
|
-
"@aws-sdk/core": "^3.974.
|
|
31
|
-
"@aws-sdk/credential-provider-node": "^3.972.
|
|
32
|
-
"@aws-sdk/signature-v4-multi-region": "^3.996.
|
|
33
|
-
"@aws-sdk/types": "^3.973.
|
|
34
|
-
"@smithy/core": "^3.
|
|
35
|
-
"@smithy/fetch-http-handler": "^5.
|
|
36
|
-
"@smithy/node-http-handler": "^4.
|
|
37
|
-
"@smithy/types": "^4.
|
|
30
|
+
"@aws-sdk/core": "^3.974.24",
|
|
31
|
+
"@aws-sdk/credential-provider-node": "^3.972.59",
|
|
32
|
+
"@aws-sdk/signature-v4-multi-region": "^3.996.36",
|
|
33
|
+
"@aws-sdk/types": "^3.973.14",
|
|
34
|
+
"@smithy/core": "^3.27.0",
|
|
35
|
+
"@smithy/fetch-http-handler": "^5.6.0",
|
|
36
|
+
"@smithy/node-http-handler": "^4.9.0",
|
|
37
|
+
"@smithy/types": "^4.15.0",
|
|
38
38
|
"tslib": "^2.6.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@smithy/snapshot-testing": "^2.
|
|
41
|
+
"@smithy/snapshot-testing": "^2.2.3",
|
|
42
42
|
"@tsconfig/node20": "20.1.8",
|
|
43
43
|
"@types/node": "^20.14.8",
|
|
44
44
|
"concurrently": "7.0.0",
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
const { resolveAwsSdkSigV4AConfig, resolveAwsSdkSigV4Config } = require("@aws-sdk/core/httpAuthSchemes");
|
|
2
|
-
const { SignatureV4MultiRegion } = require("@aws-sdk/signature-v4-multi-region");
|
|
3
|
-
const { getSmithyContext, normalizeProvider } = require("@smithy/core/client");
|
|
4
|
-
const { resolveParams } = require("@smithy/core/endpoints");
|
|
5
|
-
const { defaultEndpointResolver } = require("../endpoint/endpointResolver");
|
|
6
|
-
const createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
|
|
7
|
-
if (!input) {
|
|
8
|
-
throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");
|
|
9
|
-
}
|
|
10
|
-
const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
|
|
11
|
-
const instructionsFn = getSmithyContext(context)?.commandInstance?.constructor
|
|
12
|
-
?.getEndpointParameterInstructions;
|
|
13
|
-
if (!instructionsFn) {
|
|
14
|
-
throw new Error(`getEndpointParameterInstructions() is not defined on '${context.commandName}'`);
|
|
15
|
-
}
|
|
16
|
-
const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config);
|
|
17
|
-
return Object.assign(defaultParameters, endpointParameters);
|
|
18
|
-
};
|
|
19
|
-
const _defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
20
|
-
return {
|
|
21
|
-
operation: getSmithyContext(context).operation,
|
|
22
|
-
region: await normalizeProvider(config.region)() || (() => {
|
|
23
|
-
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
24
|
-
})(),
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
exports.defaultSTSHttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultSTSHttpAuthSchemeParametersProvider);
|
|
28
|
-
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
29
|
-
return {
|
|
30
|
-
schemeId: "aws.auth#sigv4",
|
|
31
|
-
signingProperties: {
|
|
32
|
-
name: "sts",
|
|
33
|
-
region: authParameters.region,
|
|
34
|
-
},
|
|
35
|
-
propertiesExtractor: (config, context) => ({
|
|
36
|
-
signingProperties: {
|
|
37
|
-
config,
|
|
38
|
-
context,
|
|
39
|
-
},
|
|
40
|
-
}),
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function createAwsAuthSigv4aHttpAuthOption(authParameters) {
|
|
44
|
-
return {
|
|
45
|
-
schemeId: "aws.auth#sigv4a",
|
|
46
|
-
signingProperties: {
|
|
47
|
-
name: "sts",
|
|
48
|
-
region: authParameters.region,
|
|
49
|
-
},
|
|
50
|
-
propertiesExtractor: (config, context) => ({
|
|
51
|
-
signingProperties: {
|
|
52
|
-
config,
|
|
53
|
-
context,
|
|
54
|
-
},
|
|
55
|
-
}),
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
|
|
59
|
-
return {
|
|
60
|
-
schemeId: "smithy.api#noAuth",
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
const createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
|
|
64
|
-
const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
|
|
65
|
-
const endpoint = defaultEndpointResolver(authParameters);
|
|
66
|
-
const authSchemes = endpoint.properties?.authSchemes;
|
|
67
|
-
if (!authSchemes) {
|
|
68
|
-
return defaultHttpAuthSchemeResolver(authParameters);
|
|
69
|
-
}
|
|
70
|
-
const options = [];
|
|
71
|
-
for (const scheme of authSchemes) {
|
|
72
|
-
const { name: resolvedName, properties = {}, ...rest } = scheme;
|
|
73
|
-
const name = resolvedName.toLowerCase();
|
|
74
|
-
if (resolvedName !== name) {
|
|
75
|
-
console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`);
|
|
76
|
-
}
|
|
77
|
-
let schemeId;
|
|
78
|
-
if (name === "sigv4a") {
|
|
79
|
-
schemeId = "aws.auth#sigv4a";
|
|
80
|
-
const sigv4Present = authSchemes.find((s) => {
|
|
81
|
-
const name = s.name.toLowerCase();
|
|
82
|
-
return name !== "sigv4a" && name.startsWith("sigv4");
|
|
83
|
-
});
|
|
84
|
-
if (SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) {
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
else if (name.startsWith("sigv4")) {
|
|
89
|
-
schemeId = "aws.auth#sigv4";
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`);
|
|
93
|
-
}
|
|
94
|
-
const createOption = createHttpAuthOptionFunctions[schemeId];
|
|
95
|
-
if (!createOption) {
|
|
96
|
-
throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`);
|
|
97
|
-
}
|
|
98
|
-
const option = createOption(authParameters);
|
|
99
|
-
option.schemeId = schemeId;
|
|
100
|
-
option.signingProperties = { ...(option.signingProperties || {}), ...rest, ...properties };
|
|
101
|
-
options.push(option);
|
|
102
|
-
}
|
|
103
|
-
return options;
|
|
104
|
-
};
|
|
105
|
-
return endpointRuleSetHttpAuthSchemeProvider;
|
|
106
|
-
};
|
|
107
|
-
const _defaultSTSHttpAuthSchemeProvider = (authParameters) => {
|
|
108
|
-
const options = [];
|
|
109
|
-
switch (authParameters.operation) {
|
|
110
|
-
case "AssumeRoleWithSAML": {
|
|
111
|
-
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
112
|
-
options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
case "AssumeRoleWithWebIdentity": {
|
|
116
|
-
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
117
|
-
options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
default: {
|
|
121
|
-
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
122
|
-
options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return options;
|
|
126
|
-
};
|
|
127
|
-
exports.defaultSTSHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultSTSHttpAuthSchemeProvider, {
|
|
128
|
-
"aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
|
|
129
|
-
"aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
|
|
130
|
-
"smithy.api#noAuth": createSmithyApiNoAuthHttpAuthOption,
|
|
131
|
-
});
|
|
132
|
-
exports.resolveHttpAuthSchemeConfig = (config) => {
|
|
133
|
-
const config_0 = resolveAwsSdkSigV4Config(config);
|
|
134
|
-
const config_1 = resolveAwsSdkSigV4AConfig(config_0);
|
|
135
|
-
return Object.assign(config_1, {
|
|
136
|
-
authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
|
|
137
|
-
});
|
|
138
|
-
};
|
package/dist-cjs/endpoint/bdd.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
const { BinaryDecisionDiagram } = require("@smithy/core/endpoints");
|
|
2
|
-
const q = "ref";
|
|
3
|
-
const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "booleanEquals", f = "stringEquals", g = "getAttr", h = "us-east-1", i = "sigv4", j = "sts", k = "https://sts.{Region}.{PartitionResult#dnsSuffix}", l = { [q]: "Endpoint" }, m = { [q]: "Region" }, n = { [q]: d }, o = {}, p = [m];
|
|
4
|
-
const _data = {
|
|
5
|
-
conditions: [
|
|
6
|
-
[c, [l]],
|
|
7
|
-
[c, p],
|
|
8
|
-
["aws.partition", p, d],
|
|
9
|
-
[e, [{ [q]: "UseFIPS" }, b]],
|
|
10
|
-
[e, [{ [q]: "UseDualStack" }, b]],
|
|
11
|
-
[f, [m, "aws-global"]],
|
|
12
|
-
[e, [{ [q]: "UseGlobalEndpoint" }, b]],
|
|
13
|
-
[f, [m, "eu-central-1"]],
|
|
14
|
-
[e, [{ fn: g, argv: [n, "supportsDualStack"] }, b]],
|
|
15
|
-
[e, [{ fn: g, argv: [n, "supportsFIPS"] }, b]],
|
|
16
|
-
[f, [m, "ap-south-1"]],
|
|
17
|
-
[f, [m, "eu-north-1"]],
|
|
18
|
-
[f, [m, "eu-west-1"]],
|
|
19
|
-
[f, [m, "eu-west-2"]],
|
|
20
|
-
[f, [m, "eu-west-3"]],
|
|
21
|
-
[f, [m, "sa-east-1"]],
|
|
22
|
-
[f, [m, h]],
|
|
23
|
-
[f, [m, "us-east-2"]],
|
|
24
|
-
[f, [m, "us-west-2"]],
|
|
25
|
-
[f, [m, "us-west-1"]],
|
|
26
|
-
[f, [m, "ca-central-1"]],
|
|
27
|
-
[f, [m, "ap-southeast-1"]],
|
|
28
|
-
[f, [m, "ap-northeast-1"]],
|
|
29
|
-
[f, [m, "ap-southeast-2"]],
|
|
30
|
-
[f, [{ fn: g, argv: [n, "name"] }, "aws-us-gov"]]
|
|
31
|
-
],
|
|
32
|
-
results: [
|
|
33
|
-
[a],
|
|
34
|
-
["https://sts.amazonaws.com", { authSchemes: [{ name: i, signingName: j, signingRegion: h }] }],
|
|
35
|
-
[k, { authSchemes: [{ name: i, signingName: j, signingRegion: "{Region}" }] }],
|
|
36
|
-
[a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
|
|
37
|
-
[a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
|
|
38
|
-
[l, o],
|
|
39
|
-
["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", o],
|
|
40
|
-
[a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
|
|
41
|
-
["https://sts.{Region}.amazonaws.com", o],
|
|
42
|
-
["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", o],
|
|
43
|
-
[a, "FIPS is enabled but this partition does not support FIPS"],
|
|
44
|
-
["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", o],
|
|
45
|
-
[a, "DualStack is enabled but this partition does not support DualStack"],
|
|
46
|
-
[k, o],
|
|
47
|
-
[a, "Invalid Configuration: Missing Region"]
|
|
48
|
-
]
|
|
49
|
-
};
|
|
50
|
-
const root = 2;
|
|
51
|
-
const r = 100_000_000;
|
|
52
|
-
const nodes = new Int32Array([
|
|
53
|
-
-1, 1, -1,
|
|
54
|
-
0, 30, 3,
|
|
55
|
-
1, 4, r + 14,
|
|
56
|
-
2, 5, r + 14,
|
|
57
|
-
3, 25, 6,
|
|
58
|
-
4, 24, 7,
|
|
59
|
-
5, r + 1, 8,
|
|
60
|
-
6, 9, r + 13,
|
|
61
|
-
7, r + 1, 10,
|
|
62
|
-
10, r + 1, 11,
|
|
63
|
-
11, r + 1, 12,
|
|
64
|
-
12, r + 1, 13,
|
|
65
|
-
13, r + 1, 14,
|
|
66
|
-
14, r + 1, 15,
|
|
67
|
-
15, r + 1, 16,
|
|
68
|
-
16, r + 1, 17,
|
|
69
|
-
17, r + 1, 18,
|
|
70
|
-
18, r + 1, 19,
|
|
71
|
-
19, r + 1, 20,
|
|
72
|
-
20, r + 1, 21,
|
|
73
|
-
21, r + 1, 22,
|
|
74
|
-
22, r + 1, 23,
|
|
75
|
-
23, r + 1, r + 2,
|
|
76
|
-
8, r + 11, r + 12,
|
|
77
|
-
4, 28, 26,
|
|
78
|
-
9, 27, r + 10,
|
|
79
|
-
24, r + 8, r + 9,
|
|
80
|
-
8, 29, r + 7,
|
|
81
|
-
9, r + 6, r + 7,
|
|
82
|
-
3, r + 3, 31,
|
|
83
|
-
4, r + 4, r + 5,
|
|
84
|
-
]);
|
|
85
|
-
exports.bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const { awsEndpointFunctions } = require("@aws-sdk/core/client");
|
|
2
|
-
const { customEndpointFunctions, decideEndpoint, EndpointCache } = require("@smithy/core/endpoints");
|
|
3
|
-
const { bdd } = require("./bdd");
|
|
4
|
-
const cache = new EndpointCache({
|
|
5
|
-
size: 50,
|
|
6
|
-
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"],
|
|
7
|
-
});
|
|
8
|
-
exports.defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
9
|
-
return cache.get(endpointParams, () => decideEndpoint(bdd, {
|
|
10
|
-
endpointParams: endpointParams,
|
|
11
|
-
logger: context.logger,
|
|
12
|
-
}));
|
|
13
|
-
};
|
|
14
|
-
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const { ServiceException: __ServiceException } = require("@smithy/core/client");
|
|
2
|
-
exports.__ServiceException = __ServiceException;
|
|
3
|
-
exports.STSServiceException = class STSServiceException extends __ServiceException {
|
|
4
|
-
constructor(options) {
|
|
5
|
-
super(options);
|
|
6
|
-
Object.setPrototypeOf(this, STSServiceException.prototype);
|
|
7
|
-
}
|
|
8
|
-
};
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
const { STSServiceException: __BaseException } = require("./STSServiceException");
|
|
2
|
-
exports.ExpiredTokenException = class ExpiredTokenException extends __BaseException {
|
|
3
|
-
name = "ExpiredTokenException";
|
|
4
|
-
$fault = "client";
|
|
5
|
-
constructor(opts) {
|
|
6
|
-
super({
|
|
7
|
-
name: "ExpiredTokenException",
|
|
8
|
-
$fault: "client",
|
|
9
|
-
...opts,
|
|
10
|
-
});
|
|
11
|
-
Object.setPrototypeOf(this, ExpiredTokenException.prototype);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
exports.MalformedPolicyDocumentException = class MalformedPolicyDocumentException extends __BaseException {
|
|
15
|
-
name = "MalformedPolicyDocumentException";
|
|
16
|
-
$fault = "client";
|
|
17
|
-
constructor(opts) {
|
|
18
|
-
super({
|
|
19
|
-
name: "MalformedPolicyDocumentException",
|
|
20
|
-
$fault: "client",
|
|
21
|
-
...opts,
|
|
22
|
-
});
|
|
23
|
-
Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
exports.PackedPolicyTooLargeException = class PackedPolicyTooLargeException extends __BaseException {
|
|
27
|
-
name = "PackedPolicyTooLargeException";
|
|
28
|
-
$fault = "client";
|
|
29
|
-
constructor(opts) {
|
|
30
|
-
super({
|
|
31
|
-
name: "PackedPolicyTooLargeException",
|
|
32
|
-
$fault: "client",
|
|
33
|
-
...opts,
|
|
34
|
-
});
|
|
35
|
-
Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
exports.RegionDisabledException = class RegionDisabledException extends __BaseException {
|
|
39
|
-
name = "RegionDisabledException";
|
|
40
|
-
$fault = "client";
|
|
41
|
-
constructor(opts) {
|
|
42
|
-
super({
|
|
43
|
-
name: "RegionDisabledException",
|
|
44
|
-
$fault: "client",
|
|
45
|
-
...opts,
|
|
46
|
-
});
|
|
47
|
-
Object.setPrototypeOf(this, RegionDisabledException.prototype);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
exports.IDPRejectedClaimException = class IDPRejectedClaimException extends __BaseException {
|
|
51
|
-
name = "IDPRejectedClaimException";
|
|
52
|
-
$fault = "client";
|
|
53
|
-
constructor(opts) {
|
|
54
|
-
super({
|
|
55
|
-
name: "IDPRejectedClaimException",
|
|
56
|
-
$fault: "client",
|
|
57
|
-
...opts,
|
|
58
|
-
});
|
|
59
|
-
Object.setPrototypeOf(this, IDPRejectedClaimException.prototype);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
exports.InvalidIdentityTokenException = class InvalidIdentityTokenException extends __BaseException {
|
|
63
|
-
name = "InvalidIdentityTokenException";
|
|
64
|
-
$fault = "client";
|
|
65
|
-
constructor(opts) {
|
|
66
|
-
super({
|
|
67
|
-
name: "InvalidIdentityTokenException",
|
|
68
|
-
$fault: "client",
|
|
69
|
-
...opts,
|
|
70
|
-
});
|
|
71
|
-
Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
exports.IDPCommunicationErrorException = class IDPCommunicationErrorException extends __BaseException {
|
|
75
|
-
name = "IDPCommunicationErrorException";
|
|
76
|
-
$fault = "client";
|
|
77
|
-
$retryable = {};
|
|
78
|
-
constructor(opts) {
|
|
79
|
-
super({
|
|
80
|
-
name: "IDPCommunicationErrorException",
|
|
81
|
-
$fault: "client",
|
|
82
|
-
...opts,
|
|
83
|
-
});
|
|
84
|
-
Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype);
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
exports.InvalidAuthorizationMessageException = class InvalidAuthorizationMessageException extends __BaseException {
|
|
88
|
-
name = "InvalidAuthorizationMessageException";
|
|
89
|
-
$fault = "client";
|
|
90
|
-
constructor(opts) {
|
|
91
|
-
super({
|
|
92
|
-
name: "InvalidAuthorizationMessageException",
|
|
93
|
-
$fault: "client",
|
|
94
|
-
...opts,
|
|
95
|
-
});
|
|
96
|
-
Object.setPrototypeOf(this, InvalidAuthorizationMessageException.prototype);
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
exports.ExpiredTradeInTokenException = class ExpiredTradeInTokenException extends __BaseException {
|
|
100
|
-
name = "ExpiredTradeInTokenException";
|
|
101
|
-
$fault = "client";
|
|
102
|
-
constructor(opts) {
|
|
103
|
-
super({
|
|
104
|
-
name: "ExpiredTradeInTokenException",
|
|
105
|
-
$fault: "client",
|
|
106
|
-
...opts,
|
|
107
|
-
});
|
|
108
|
-
Object.setPrototypeOf(this, ExpiredTradeInTokenException.prototype);
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
exports.JWTPayloadSizeExceededException = class JWTPayloadSizeExceededException extends __BaseException {
|
|
112
|
-
name = "JWTPayloadSizeExceededException";
|
|
113
|
-
$fault = "client";
|
|
114
|
-
constructor(opts) {
|
|
115
|
-
super({
|
|
116
|
-
name: "JWTPayloadSizeExceededException",
|
|
117
|
-
$fault: "client",
|
|
118
|
-
...opts,
|
|
119
|
-
});
|
|
120
|
-
Object.setPrototypeOf(this, JWTPayloadSizeExceededException.prototype);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
exports.OutboundWebIdentityFederationDisabledException = class OutboundWebIdentityFederationDisabledException extends __BaseException {
|
|
124
|
-
name = "OutboundWebIdentityFederationDisabledException";
|
|
125
|
-
$fault = "client";
|
|
126
|
-
constructor(opts) {
|
|
127
|
-
super({
|
|
128
|
-
name: "OutboundWebIdentityFederationDisabledException",
|
|
129
|
-
$fault: "client",
|
|
130
|
-
...opts,
|
|
131
|
-
});
|
|
132
|
-
Object.setPrototypeOf(this, OutboundWebIdentityFederationDisabledException.prototype);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
exports.SessionDurationEscalationException = class SessionDurationEscalationException extends __BaseException {
|
|
136
|
-
name = "SessionDurationEscalationException";
|
|
137
|
-
$fault = "client";
|
|
138
|
-
constructor(opts) {
|
|
139
|
-
super({
|
|
140
|
-
name: "SessionDurationEscalationException",
|
|
141
|
-
$fault: "client",
|
|
142
|
-
...opts,
|
|
143
|
-
});
|
|
144
|
-
Object.setPrototypeOf(this, SessionDurationEscalationException.prototype);
|
|
145
|
-
}
|
|
146
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const packageInfo = require("../package.json");
|
|
2
|
-
const { Sha256 } = require("@aws-crypto/sha256-browser");
|
|
3
|
-
const { createDefaultUserAgentProvider } = require("@aws-sdk/core/client");
|
|
4
|
-
const { invalidProvider, loadConfigsForDefaultMode } = require("@smithy/core/client");
|
|
5
|
-
const { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT, resolveDefaultsModeConfig } = require("@smithy/core/config");
|
|
6
|
-
const { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } = require("@smithy/core/retry");
|
|
7
|
-
const { calculateBodyLength } = require("@smithy/core/serde");
|
|
8
|
-
const { FetchHttpHandler: RequestHandler, streamCollector } = require("@smithy/fetch-http-handler");
|
|
9
|
-
const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
|
|
10
|
-
const getRuntimeConfig = (config) => {
|
|
11
|
-
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
12
|
-
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
13
|
-
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
14
|
-
return {
|
|
15
|
-
...clientSharedValues,
|
|
16
|
-
...config,
|
|
17
|
-
runtime: "browser",
|
|
18
|
-
defaultsMode,
|
|
19
|
-
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
20
|
-
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
21
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
22
|
-
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
23
|
-
region: config?.region ?? invalidProvider("Region is missing"),
|
|
24
|
-
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
25
|
-
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
26
|
-
sha256: config?.sha256 ?? Sha256,
|
|
27
|
-
streamCollector: config?.streamCollector ?? streamCollector,
|
|
28
|
-
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
29
|
-
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const packageInfo = require("../package.json");
|
|
2
|
-
const { createDefaultUserAgentProvider, emitWarningIfUnsupportedVersion: awsCheckVersion, NODE_APP_ID_CONFIG_OPTIONS } = require("@aws-sdk/core/client");
|
|
3
|
-
const { AwsSdkSigV4ASigner, AwsSdkSigV4Signer, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, NODE_SIGV4A_CONFIG_OPTIONS } = require("@aws-sdk/core/httpAuthSchemes");
|
|
4
|
-
const { defaultProvider: credentialDefaultProvider } = require("@aws-sdk/credential-provider-node");
|
|
5
|
-
const { NoAuthSigner } = require("@smithy/core");
|
|
6
|
-
const { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } = require("@smithy/core/client");
|
|
7
|
-
const { loadConfig: loadNodeConfig, NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, resolveDefaultsModeConfig } = require("@smithy/core/config");
|
|
8
|
-
const { DEFAULT_RETRY_MODE, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } = require("@smithy/core/retry");
|
|
9
|
-
const { calculateBodyLength, Hash } = require("@smithy/core/serde");
|
|
10
|
-
const { NodeHttpHandler: RequestHandler, streamCollector } = require("@smithy/node-http-handler");
|
|
11
|
-
const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
|
|
12
|
-
const getRuntimeConfig = (config) => {
|
|
13
|
-
emitWarningIfUnsupportedVersion(process.version);
|
|
14
|
-
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
15
|
-
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
16
|
-
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
17
|
-
awsCheckVersion(process.version);
|
|
18
|
-
const loaderConfig = {
|
|
19
|
-
profile: config?.profile,
|
|
20
|
-
logger: clientSharedValues.logger,
|
|
21
|
-
};
|
|
22
|
-
return {
|
|
23
|
-
...clientSharedValues,
|
|
24
|
-
...config,
|
|
25
|
-
runtime: "node",
|
|
26
|
-
defaultsMode,
|
|
27
|
-
authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
28
|
-
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
29
|
-
credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
|
|
30
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
31
|
-
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
32
|
-
{
|
|
33
|
-
schemeId: "aws.auth#sigv4",
|
|
34
|
-
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") || (async (idProps) => await credentialDefaultProvider(idProps?.__config || {})()),
|
|
35
|
-
signer: new AwsSdkSigV4Signer(),
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
schemeId: "aws.auth#sigv4a",
|
|
39
|
-
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
|
|
40
|
-
signer: new AwsSdkSigV4ASigner(),
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
schemeId: "smithy.api#noAuth",
|
|
44
|
-
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
45
|
-
signer: new NoAuthSigner(),
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
49
|
-
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
50
|
-
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
51
|
-
retryMode: config?.retryMode ??
|
|
52
|
-
loadNodeConfig({
|
|
53
|
-
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
54
|
-
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
55
|
-
}, config),
|
|
56
|
-
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
57
|
-
sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig),
|
|
58
|
-
streamCollector: config?.streamCollector ?? streamCollector,
|
|
59
|
-
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
60
|
-
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
61
|
-
userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const { Sha256 } = require("@aws-crypto/sha256-js");
|
|
2
|
-
const { getRuntimeConfig: getBrowserRuntimeConfig } = require("./runtimeConfig.browser");
|
|
3
|
-
const getRuntimeConfig = (config) => {
|
|
4
|
-
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
5
|
-
return {
|
|
6
|
-
...browserDefaults,
|
|
7
|
-
...config,
|
|
8
|
-
runtime: "react-native",
|
|
9
|
-
sha256: config?.sha256 ?? Sha256,
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
exports.getRuntimeConfig = getRuntimeConfig;
|