@aws-sdk/nested-clients 3.996.0 → 3.996.1
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/cognito-identity.d.ts +7 -0
- package/cognito-identity.js +5 -0
- package/dist-cjs/submodules/cognito-identity/auth/httpAuthSchemeProvider.js +60 -0
- package/dist-cjs/submodules/cognito-identity/endpoint/endpointResolver.js +18 -0
- package/dist-cjs/submodules/cognito-identity/endpoint/ruleset.js +146 -0
- package/dist-cjs/submodules/cognito-identity/index.js +174 -0
- package/dist-cjs/submodules/cognito-identity/models/CognitoIdentityServiceException.js +12 -0
- package/dist-cjs/submodules/cognito-identity/models/errors.js +121 -0
- package/dist-cjs/submodules/cognito-identity/runtimeConfig.browser.js +38 -0
- package/dist-cjs/submodules/cognito-identity/runtimeConfig.js +53 -0
- package/dist-cjs/submodules/cognito-identity/runtimeConfig.native.js +15 -0
- package/dist-cjs/submodules/cognito-identity/runtimeConfig.shared.js +50 -0
- package/dist-cjs/submodules/cognito-identity/schemas/schemas_0.js +110 -0
- package/dist-cjs/submodules/signin/endpoint/ruleset.js +128 -2
- package/dist-cjs/submodules/sso/auth/httpAuthSchemeProvider.js +56 -0
- package/dist-cjs/submodules/sso/endpoint/endpointResolver.js +18 -0
- package/dist-cjs/submodules/sso/endpoint/ruleset.js +106 -0
- package/dist-cjs/submodules/sso/index.js +160 -0
- package/dist-cjs/submodules/sso/models/SSOServiceException.js +12 -0
- package/dist-cjs/submodules/sso/models/errors.js +56 -0
- package/dist-cjs/submodules/sso/runtimeConfig.browser.js +38 -0
- package/dist-cjs/submodules/sso/runtimeConfig.js +53 -0
- package/dist-cjs/submodules/sso/runtimeConfig.native.js +15 -0
- package/dist-cjs/submodules/sso/runtimeConfig.shared.js +49 -0
- package/dist-cjs/submodules/sso/schemas/schemas_0.js +90 -0
- package/dist-cjs/submodules/sso-oidc/endpoint/ruleset.js +101 -2
- package/dist-cjs/submodules/sts/endpoint/ruleset.js +140 -2
- package/dist-es/submodules/cognito-identity/CognitoIdentity.js +11 -0
- package/dist-es/submodules/cognito-identity/CognitoIdentityClient.js +50 -0
- package/dist-es/submodules/cognito-identity/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/submodules/cognito-identity/auth/httpAuthSchemeProvider.js +54 -0
- package/dist-es/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.js +16 -0
- package/dist-es/submodules/cognito-identity/commands/GetIdCommand.js +16 -0
- package/dist-es/submodules/cognito-identity/commands/index.js +2 -0
- package/dist-es/submodules/cognito-identity/endpoint/EndpointParameters.js +13 -0
- package/dist-es/submodules/cognito-identity/endpoint/endpointResolver.js +14 -0
- package/dist-es/submodules/cognito-identity/endpoint/ruleset.js +143 -0
- package/dist-es/submodules/cognito-identity/extensionConfiguration.js +1 -0
- package/dist-es/submodules/cognito-identity/index.js +7 -0
- package/dist-es/submodules/cognito-identity/models/CognitoIdentityServiceException.js +8 -0
- package/dist-es/submodules/cognito-identity/models/errors.js +109 -0
- package/dist-es/submodules/cognito-identity/models/models_0.js +1 -0
- package/dist-es/submodules/cognito-identity/runtimeConfig.browser.js +33 -0
- package/dist-es/submodules/cognito-identity/runtimeConfig.js +48 -0
- package/dist-es/submodules/cognito-identity/runtimeConfig.native.js +11 -0
- package/dist-es/submodules/cognito-identity/runtimeConfig.shared.js +46 -0
- package/dist-es/submodules/cognito-identity/runtimeExtensions.js +9 -0
- package/dist-es/submodules/cognito-identity/schemas/schemas_0.js +107 -0
- package/dist-es/submodules/signin/Signin.js +1 -1
- package/dist-es/submodules/signin/endpoint/ruleset.js +128 -2
- package/dist-es/submodules/sso/SSO.js +9 -0
- package/dist-es/submodules/sso/SSOClient.js +50 -0
- package/dist-es/submodules/sso/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/submodules/sso/auth/httpAuthSchemeProvider.js +50 -0
- package/dist-es/submodules/sso/commands/GetRoleCredentialsCommand.js +16 -0
- package/dist-es/submodules/sso/commands/index.js +1 -0
- package/dist-es/submodules/sso/endpoint/EndpointParameters.js +13 -0
- package/dist-es/submodules/sso/endpoint/endpointResolver.js +14 -0
- package/dist-es/submodules/sso/endpoint/ruleset.js +103 -0
- package/dist-es/submodules/sso/extensionConfiguration.js +1 -0
- package/dist-es/submodules/sso/index.js +7 -0
- package/dist-es/submodules/sso/models/SSOServiceException.js +8 -0
- package/dist-es/submodules/sso/models/errors.js +49 -0
- package/dist-es/submodules/sso/models/models_0.js +1 -0
- package/dist-es/submodules/sso/runtimeConfig.browser.js +33 -0
- package/dist-es/submodules/sso/runtimeConfig.js +48 -0
- package/dist-es/submodules/sso/runtimeConfig.native.js +11 -0
- package/dist-es/submodules/sso/runtimeConfig.shared.js +45 -0
- package/dist-es/submodules/sso/runtimeExtensions.js +9 -0
- package/dist-es/submodules/sso/schemas/schemas_0.js +87 -0
- package/dist-es/submodules/sso-oidc/endpoint/ruleset.js +101 -2
- package/dist-es/submodules/sts/defaultStsRoleAssumers.js +1 -1
- package/dist-es/submodules/sts/endpoint/ruleset.js +140 -2
- package/dist-types/submodules/cognito-identity/CognitoIdentity.d.ts +38 -0
- package/dist-types/submodules/cognito-identity/CognitoIdentityClient.d.ts +198 -0
- package/dist-types/submodules/cognito-identity/auth/httpAuthExtensionConfiguration.d.ts +30 -0
- package/dist-types/submodules/cognito-identity/auth/httpAuthSchemeProvider.d.ts +75 -0
- package/dist-types/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.d.ts +120 -0
- package/dist-types/submodules/cognito-identity/commands/GetIdCommand.d.ts +107 -0
- package/dist-types/submodules/cognito-identity/commands/index.d.ts +2 -0
- package/dist-types/submodules/cognito-identity/endpoint/EndpointParameters.d.ts +50 -0
- package/dist-types/submodules/cognito-identity/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/submodules/cognito-identity/endpoint/ruleset.d.ts +2 -0
- package/dist-types/submodules/cognito-identity/extensionConfiguration.d.ts +9 -0
- package/dist-types/submodules/cognito-identity/index.d.ts +29 -0
- package/dist-types/submodules/cognito-identity/models/CognitoIdentityServiceException.d.ts +14 -0
- package/dist-types/submodules/cognito-identity/models/errors.d.ts +119 -0
- package/dist-types/submodules/cognito-identity/models/models_0.d.ts +136 -0
- package/dist-types/submodules/cognito-identity/runtimeConfig.browser.d.ts +62 -0
- package/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +62 -0
- package/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +61 -0
- package/dist-types/submodules/cognito-identity/runtimeConfig.shared.d.ts +38 -0
- package/dist-types/submodules/cognito-identity/runtimeExtensions.d.ts +17 -0
- package/dist-types/submodules/cognito-identity/schemas/schemas_0.d.ts +25 -0
- package/dist-types/submodules/signin/Signin.d.ts +1 -1
- package/dist-types/submodules/signin/auth/httpAuthExtensionConfiguration.d.ts +2 -1
- package/dist-types/submodules/signin/endpoint/ruleset.d.ts +1 -1
- package/dist-types/submodules/signin/models/errors.d.ts +1 -1
- package/dist-types/submodules/sso/SSO.d.ts +32 -0
- package/dist-types/submodules/sso/SSOClient.d.ts +198 -0
- package/dist-types/submodules/sso/auth/httpAuthExtensionConfiguration.d.ts +30 -0
- package/dist-types/submodules/sso/auth/httpAuthSchemeProvider.d.ts +75 -0
- package/dist-types/submodules/sso/commands/GetRoleCredentialsCommand.d.ts +97 -0
- package/dist-types/submodules/sso/commands/index.d.ts +1 -0
- package/dist-types/submodules/sso/endpoint/EndpointParameters.d.ts +50 -0
- package/dist-types/submodules/sso/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/submodules/sso/endpoint/ruleset.d.ts +2 -0
- package/dist-types/submodules/sso/extensionConfiguration.d.ts +9 -0
- package/dist-types/submodules/sso/index.d.ts +30 -0
- package/dist-types/submodules/sso/models/SSOServiceException.d.ts +14 -0
- package/dist-types/submodules/sso/models/errors.d.ts +53 -0
- package/dist-types/submodules/sso/models/models_0.d.ts +61 -0
- package/dist-types/submodules/sso/runtimeConfig.browser.d.ts +62 -0
- package/dist-types/submodules/sso/runtimeConfig.d.ts +62 -0
- package/dist-types/submodules/sso/runtimeConfig.native.d.ts +61 -0
- package/dist-types/submodules/sso/runtimeConfig.shared.d.ts +38 -0
- package/dist-types/submodules/sso/runtimeExtensions.d.ts +17 -0
- package/dist-types/submodules/sso/schemas/schemas_0.d.ts +17 -0
- package/dist-types/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.d.ts +2 -1
- package/dist-types/submodules/sso-oidc/endpoint/ruleset.d.ts +1 -1
- package/dist-types/submodules/sso-oidc/models/errors.d.ts +1 -1
- package/dist-types/submodules/sts/auth/httpAuthExtensionConfiguration.d.ts +2 -1
- package/dist-types/submodules/sts/defaultRoleAssumers.d.ts +3 -3
- package/dist-types/submodules/sts/defaultStsRoleAssumers.d.ts +3 -3
- package/dist-types/submodules/sts/endpoint/ruleset.d.ts +1 -1
- package/dist-types/ts3.4/submodules/cognito-identity/CognitoIdentity.d.ts +38 -0
- package/dist-types/ts3.4/submodules/cognito-identity/CognitoIdentityClient.d.ts +126 -0
- package/dist-types/ts3.4/submodules/cognito-identity/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/dist-types/ts3.4/submodules/cognito-identity/auth/httpAuthSchemeProvider.d.ts +47 -0
- package/dist-types/ts3.4/submodules/cognito-identity/commands/GetCredentialsForIdentityCommand.d.ts +51 -0
- package/dist-types/ts3.4/submodules/cognito-identity/commands/GetIdCommand.d.ts +41 -0
- package/dist-types/ts3.4/submodules/cognito-identity/commands/index.d.ts +2 -0
- package/dist-types/ts3.4/submodules/cognito-identity/endpoint/EndpointParameters.d.ts +51 -0
- package/dist-types/ts3.4/submodules/cognito-identity/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/submodules/cognito-identity/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/submodules/cognito-identity/extensionConfiguration.d.ts +9 -0
- package/dist-types/ts3.4/submodules/cognito-identity/index.d.ts +10 -0
- package/dist-types/ts3.4/submodules/cognito-identity/models/CognitoIdentityServiceException.d.ts +9 -0
- package/dist-types/ts3.4/submodules/cognito-identity/models/errors.d.ts +68 -0
- package/dist-types/ts3.4/submodules/cognito-identity/models/models_0.d.ts +23 -0
- package/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +122 -0
- package/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +117 -0
- package/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +126 -0
- package/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.shared.d.ts +60 -0
- package/dist-types/ts3.4/submodules/cognito-identity/runtimeExtensions.d.ts +13 -0
- package/dist-types/ts3.4/submodules/cognito-identity/schemas/schemas_0.d.ts +24 -0
- package/dist-types/ts3.4/submodules/signin/auth/httpAuthExtensionConfiguration.d.ts +1 -1
- package/dist-types/ts3.4/submodules/sso/SSO.d.ts +22 -0
- package/dist-types/ts3.4/submodules/sso/SSOClient.d.ts +117 -0
- package/dist-types/ts3.4/submodules/sso/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/dist-types/ts3.4/submodules/sso/auth/httpAuthSchemeProvider.d.ts +46 -0
- package/dist-types/ts3.4/submodules/sso/commands/GetRoleCredentialsCommand.d.ts +47 -0
- package/dist-types/ts3.4/submodules/sso/commands/index.d.ts +1 -0
- package/dist-types/ts3.4/submodules/sso/endpoint/EndpointParameters.d.ts +51 -0
- package/dist-types/ts3.4/submodules/sso/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/submodules/sso/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/submodules/sso/extensionConfiguration.d.ts +9 -0
- package/dist-types/ts3.4/submodules/sso/index.d.ts +10 -0
- package/dist-types/ts3.4/submodules/sso/models/SSOServiceException.d.ts +9 -0
- package/dist-types/ts3.4/submodules/sso/models/errors.d.ts +30 -0
- package/dist-types/ts3.4/submodules/sso/models/models_0.d.ts +14 -0
- package/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +120 -0
- package/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +115 -0
- package/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +124 -0
- package/dist-types/ts3.4/submodules/sso/runtimeConfig.shared.d.ts +58 -0
- package/dist-types/ts3.4/submodules/sso/runtimeExtensions.d.ts +11 -0
- package/dist-types/ts3.4/submodules/sso/schemas/schemas_0.d.ts +16 -0
- package/dist-types/ts3.4/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.d.ts +1 -1
- package/dist-types/ts3.4/submodules/sts/auth/httpAuthExtensionConfiguration.d.ts +1 -1
- package/package.json +54 -36
- package/sso.d.ts +7 -0
- package/sso.js +5 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
2
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
3
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
4
|
+
let _credentials = runtimeConfig.credentials;
|
|
5
|
+
return {
|
|
6
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
7
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
8
|
+
if (index === -1) {
|
|
9
|
+
_httpAuthSchemes.push(httpAuthScheme);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
httpAuthSchemes() {
|
|
16
|
+
return _httpAuthSchemes;
|
|
17
|
+
},
|
|
18
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
19
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
20
|
+
},
|
|
21
|
+
httpAuthSchemeProvider() {
|
|
22
|
+
return _httpAuthSchemeProvider;
|
|
23
|
+
},
|
|
24
|
+
setCredentials(credentials) {
|
|
25
|
+
_credentials = credentials;
|
|
26
|
+
},
|
|
27
|
+
credentials() {
|
|
28
|
+
return _credentials;
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export const resolveHttpAuthRuntimeConfig = (config) => {
|
|
33
|
+
return {
|
|
34
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
35
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
36
|
+
credentials: config.credentials(),
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { resolveAwsSdkSigV4Config } from "@aws-sdk/core";
|
|
2
|
+
import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";
|
|
3
|
+
export const defaultCognitoIdentityHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
4
|
+
return {
|
|
5
|
+
operation: getSmithyContext(context).operation,
|
|
6
|
+
region: (await normalizeProvider(config.region)()) ||
|
|
7
|
+
(() => {
|
|
8
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
9
|
+
})(),
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
13
|
+
return {
|
|
14
|
+
schemeId: "aws.auth#sigv4",
|
|
15
|
+
signingProperties: {
|
|
16
|
+
name: "cognito-identity",
|
|
17
|
+
region: authParameters.region,
|
|
18
|
+
},
|
|
19
|
+
propertiesExtractor: (config, context) => ({
|
|
20
|
+
signingProperties: {
|
|
21
|
+
config,
|
|
22
|
+
context,
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
|
|
28
|
+
return {
|
|
29
|
+
schemeId: "smithy.api#noAuth",
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export const defaultCognitoIdentityHttpAuthSchemeProvider = (authParameters) => {
|
|
33
|
+
const options = [];
|
|
34
|
+
switch (authParameters.operation) {
|
|
35
|
+
case "GetCredentialsForIdentity": {
|
|
36
|
+
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
case "GetId": {
|
|
40
|
+
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
default: {
|
|
44
|
+
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return options;
|
|
48
|
+
};
|
|
49
|
+
export const resolveHttpAuthSchemeConfig = (config) => {
|
|
50
|
+
const config_0 = resolveAwsSdkSigV4Config(config);
|
|
51
|
+
return Object.assign(config_0, {
|
|
52
|
+
authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
|
|
53
|
+
});
|
|
54
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
|
+
import { commonParams } from "../endpoint/EndpointParameters";
|
|
4
|
+
import { GetCredentialsForIdentity$ } from "../schemas/schemas_0";
|
|
5
|
+
export { $Command };
|
|
6
|
+
export class GetCredentialsForIdentityCommand extends $Command
|
|
7
|
+
.classBuilder()
|
|
8
|
+
.ep(commonParams)
|
|
9
|
+
.m(function (Command, cs, config, o) {
|
|
10
|
+
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
+
})
|
|
12
|
+
.s("AWSCognitoIdentityService", "GetCredentialsForIdentity", {})
|
|
13
|
+
.n("CognitoIdentityClient", "GetCredentialsForIdentityCommand")
|
|
14
|
+
.sc(GetCredentialsForIdentity$)
|
|
15
|
+
.build() {
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
3
|
+
import { commonParams } from "../endpoint/EndpointParameters";
|
|
4
|
+
import { GetId$ } from "../schemas/schemas_0";
|
|
5
|
+
export { $Command };
|
|
6
|
+
export class GetIdCommand extends $Command
|
|
7
|
+
.classBuilder()
|
|
8
|
+
.ep(commonParams)
|
|
9
|
+
.m(function (Command, cs, config, o) {
|
|
10
|
+
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
11
|
+
})
|
|
12
|
+
.s("AWSCognitoIdentityService", "GetId", {})
|
|
13
|
+
.n("CognitoIdentityClient", "GetIdCommand")
|
|
14
|
+
.sc(GetId$)
|
|
15
|
+
.build() {
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const resolveClientEndpointParameters = (options) => {
|
|
2
|
+
return Object.assign(options, {
|
|
3
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
4
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
5
|
+
defaultSigningName: "cognito-identity",
|
|
6
|
+
});
|
|
7
|
+
};
|
|
8
|
+
export const commonParams = {
|
|
9
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
10
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
11
|
+
Region: { type: "builtInParams", name: "region" },
|
|
12
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
13
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { awsEndpointFunctions } from "@aws-sdk/util-endpoints";
|
|
2
|
+
import { customEndpointFunctions, EndpointCache, resolveEndpoint } from "@smithy/util-endpoints";
|
|
3
|
+
import { ruleSet } from "./ruleset";
|
|
4
|
+
const cache = new EndpointCache({
|
|
5
|
+
size: 50,
|
|
6
|
+
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
|
|
7
|
+
});
|
|
8
|
+
export const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
9
|
+
return cache.get(endpointParams, () => resolveEndpoint(ruleSet, {
|
|
10
|
+
endpointParams: endpointParams,
|
|
11
|
+
logger: context.logger,
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
const w = "required", x = "fn", y = "argv", z = "ref";
|
|
2
|
+
const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "getAttr", i = "stringEquals", j = { [w]: false, type: "string" }, k = { [w]: true, default: false, type: "boolean" }, l = { [z]: "Endpoint" }, m = { [x]: c, [y]: [{ [z]: "UseFIPS" }, true] }, n = { [x]: c, [y]: [{ [z]: "UseDualStack" }, true] }, o = {}, p = { [z]: "Region" }, q = { [x]: h, [y]: [{ [z]: g }, "supportsFIPS"] }, r = { [z]: g }, s = { [x]: c, [y]: [true, { [x]: h, [y]: [r, "supportsDualStack"] }] }, t = [m], u = [n], v = [p];
|
|
3
|
+
const _data = {
|
|
4
|
+
version: "1.0",
|
|
5
|
+
parameters: { Region: j, UseDualStack: k, UseFIPS: k, Endpoint: j },
|
|
6
|
+
rules: [
|
|
7
|
+
{
|
|
8
|
+
conditions: [{ [x]: b, [y]: [l] }],
|
|
9
|
+
rules: [
|
|
10
|
+
{ conditions: t, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d },
|
|
11
|
+
{ conditions: u, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d },
|
|
12
|
+
{ endpoint: { url: l, properties: o, headers: o }, type: e },
|
|
13
|
+
],
|
|
14
|
+
type: f,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
conditions: [{ [x]: b, [y]: v }],
|
|
18
|
+
rules: [
|
|
19
|
+
{
|
|
20
|
+
conditions: [{ [x]: "aws.partition", [y]: v, assign: g }],
|
|
21
|
+
rules: [
|
|
22
|
+
{
|
|
23
|
+
conditions: [m, n],
|
|
24
|
+
rules: [
|
|
25
|
+
{
|
|
26
|
+
conditions: [{ [x]: c, [y]: [a, q] }, s],
|
|
27
|
+
rules: [
|
|
28
|
+
{
|
|
29
|
+
conditions: [{ [x]: i, [y]: [p, "us-east-1"] }],
|
|
30
|
+
endpoint: {
|
|
31
|
+
url: "https://cognito-identity-fips.us-east-1.amazonaws.com",
|
|
32
|
+
properties: o,
|
|
33
|
+
headers: o,
|
|
34
|
+
},
|
|
35
|
+
type: e,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
conditions: [{ [x]: i, [y]: [p, "us-east-2"] }],
|
|
39
|
+
endpoint: {
|
|
40
|
+
url: "https://cognito-identity-fips.us-east-2.amazonaws.com",
|
|
41
|
+
properties: o,
|
|
42
|
+
headers: o,
|
|
43
|
+
},
|
|
44
|
+
type: e,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
conditions: [{ [x]: i, [y]: [p, "us-west-1"] }],
|
|
48
|
+
endpoint: {
|
|
49
|
+
url: "https://cognito-identity-fips.us-west-1.amazonaws.com",
|
|
50
|
+
properties: o,
|
|
51
|
+
headers: o,
|
|
52
|
+
},
|
|
53
|
+
type: e,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
conditions: [{ [x]: i, [y]: [p, "us-west-2"] }],
|
|
57
|
+
endpoint: {
|
|
58
|
+
url: "https://cognito-identity-fips.us-west-2.amazonaws.com",
|
|
59
|
+
properties: o,
|
|
60
|
+
headers: o,
|
|
61
|
+
},
|
|
62
|
+
type: e,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
endpoint: {
|
|
66
|
+
url: "https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
|
|
67
|
+
properties: o,
|
|
68
|
+
headers: o,
|
|
69
|
+
},
|
|
70
|
+
type: e,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
type: f,
|
|
74
|
+
},
|
|
75
|
+
{ error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d },
|
|
76
|
+
],
|
|
77
|
+
type: f,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
conditions: t,
|
|
81
|
+
rules: [
|
|
82
|
+
{
|
|
83
|
+
conditions: [{ [x]: c, [y]: [q, a] }],
|
|
84
|
+
rules: [
|
|
85
|
+
{
|
|
86
|
+
endpoint: {
|
|
87
|
+
url: "https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}",
|
|
88
|
+
properties: o,
|
|
89
|
+
headers: o,
|
|
90
|
+
},
|
|
91
|
+
type: e,
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
type: f,
|
|
95
|
+
},
|
|
96
|
+
{ error: "FIPS is enabled but this partition does not support FIPS", type: d },
|
|
97
|
+
],
|
|
98
|
+
type: f,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
conditions: u,
|
|
102
|
+
rules: [
|
|
103
|
+
{
|
|
104
|
+
conditions: [s],
|
|
105
|
+
rules: [
|
|
106
|
+
{
|
|
107
|
+
conditions: [{ [x]: i, [y]: ["aws", { [x]: h, [y]: [r, "name"] }] }],
|
|
108
|
+
endpoint: { url: "https://cognito-identity.{Region}.amazonaws.com", properties: o, headers: o },
|
|
109
|
+
type: e,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
endpoint: {
|
|
113
|
+
url: "https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}",
|
|
114
|
+
properties: o,
|
|
115
|
+
headers: o,
|
|
116
|
+
},
|
|
117
|
+
type: e,
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
type: f,
|
|
121
|
+
},
|
|
122
|
+
{ error: "DualStack is enabled but this partition does not support DualStack", type: d },
|
|
123
|
+
],
|
|
124
|
+
type: f,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
endpoint: {
|
|
128
|
+
url: "https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",
|
|
129
|
+
properties: o,
|
|
130
|
+
headers: o,
|
|
131
|
+
},
|
|
132
|
+
type: e,
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
type: f,
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
type: f,
|
|
139
|
+
},
|
|
140
|
+
{ error: "Invalid Configuration: Missing Region", type: d },
|
|
141
|
+
],
|
|
142
|
+
};
|
|
143
|
+
export const ruleSet = _data;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./CognitoIdentityClient";
|
|
2
|
+
export * from "./CognitoIdentity";
|
|
3
|
+
export * from "./commands";
|
|
4
|
+
export * from "./schemas/schemas_0";
|
|
5
|
+
export * from "./models/errors";
|
|
6
|
+
export * from "./models/models_0";
|
|
7
|
+
export { CognitoIdentityServiceException } from "./models/CognitoIdentityServiceException";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ServiceException as __ServiceException, } from "@smithy/smithy-client";
|
|
2
|
+
export { __ServiceException };
|
|
3
|
+
export class CognitoIdentityServiceException extends __ServiceException {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
Object.setPrototypeOf(this, CognitoIdentityServiceException.prototype);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { CognitoIdentityServiceException as __BaseException } from "./CognitoIdentityServiceException";
|
|
2
|
+
export class ExternalServiceException extends __BaseException {
|
|
3
|
+
name = "ExternalServiceException";
|
|
4
|
+
$fault = "client";
|
|
5
|
+
constructor(opts) {
|
|
6
|
+
super({
|
|
7
|
+
name: "ExternalServiceException",
|
|
8
|
+
$fault: "client",
|
|
9
|
+
...opts,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, ExternalServiceException.prototype);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class InternalErrorException extends __BaseException {
|
|
15
|
+
name = "InternalErrorException";
|
|
16
|
+
$fault = "server";
|
|
17
|
+
constructor(opts) {
|
|
18
|
+
super({
|
|
19
|
+
name: "InternalErrorException",
|
|
20
|
+
$fault: "server",
|
|
21
|
+
...opts,
|
|
22
|
+
});
|
|
23
|
+
Object.setPrototypeOf(this, InternalErrorException.prototype);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export class InvalidIdentityPoolConfigurationException extends __BaseException {
|
|
27
|
+
name = "InvalidIdentityPoolConfigurationException";
|
|
28
|
+
$fault = "client";
|
|
29
|
+
constructor(opts) {
|
|
30
|
+
super({
|
|
31
|
+
name: "InvalidIdentityPoolConfigurationException",
|
|
32
|
+
$fault: "client",
|
|
33
|
+
...opts,
|
|
34
|
+
});
|
|
35
|
+
Object.setPrototypeOf(this, InvalidIdentityPoolConfigurationException.prototype);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export class InvalidParameterException extends __BaseException {
|
|
39
|
+
name = "InvalidParameterException";
|
|
40
|
+
$fault = "client";
|
|
41
|
+
constructor(opts) {
|
|
42
|
+
super({
|
|
43
|
+
name: "InvalidParameterException",
|
|
44
|
+
$fault: "client",
|
|
45
|
+
...opts,
|
|
46
|
+
});
|
|
47
|
+
Object.setPrototypeOf(this, InvalidParameterException.prototype);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export class NotAuthorizedException extends __BaseException {
|
|
51
|
+
name = "NotAuthorizedException";
|
|
52
|
+
$fault = "client";
|
|
53
|
+
constructor(opts) {
|
|
54
|
+
super({
|
|
55
|
+
name: "NotAuthorizedException",
|
|
56
|
+
$fault: "client",
|
|
57
|
+
...opts,
|
|
58
|
+
});
|
|
59
|
+
Object.setPrototypeOf(this, NotAuthorizedException.prototype);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export class ResourceConflictException extends __BaseException {
|
|
63
|
+
name = "ResourceConflictException";
|
|
64
|
+
$fault = "client";
|
|
65
|
+
constructor(opts) {
|
|
66
|
+
super({
|
|
67
|
+
name: "ResourceConflictException",
|
|
68
|
+
$fault: "client",
|
|
69
|
+
...opts,
|
|
70
|
+
});
|
|
71
|
+
Object.setPrototypeOf(this, ResourceConflictException.prototype);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export class ResourceNotFoundException extends __BaseException {
|
|
75
|
+
name = "ResourceNotFoundException";
|
|
76
|
+
$fault = "client";
|
|
77
|
+
constructor(opts) {
|
|
78
|
+
super({
|
|
79
|
+
name: "ResourceNotFoundException",
|
|
80
|
+
$fault: "client",
|
|
81
|
+
...opts,
|
|
82
|
+
});
|
|
83
|
+
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export class TooManyRequestsException extends __BaseException {
|
|
87
|
+
name = "TooManyRequestsException";
|
|
88
|
+
$fault = "client";
|
|
89
|
+
constructor(opts) {
|
|
90
|
+
super({
|
|
91
|
+
name: "TooManyRequestsException",
|
|
92
|
+
$fault: "client",
|
|
93
|
+
...opts,
|
|
94
|
+
});
|
|
95
|
+
Object.setPrototypeOf(this, TooManyRequestsException.prototype);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
export class LimitExceededException extends __BaseException {
|
|
99
|
+
name = "LimitExceededException";
|
|
100
|
+
$fault = "client";
|
|
101
|
+
constructor(opts) {
|
|
102
|
+
super({
|
|
103
|
+
name: "LimitExceededException",
|
|
104
|
+
$fault: "client",
|
|
105
|
+
...opts,
|
|
106
|
+
});
|
|
107
|
+
Object.setPrototypeOf(this, LimitExceededException.prototype);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import packageInfo from "../../../package.json";
|
|
2
|
+
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
3
|
+
import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser";
|
|
4
|
+
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
|
|
5
|
+
import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
|
|
6
|
+
import { invalidProvider } from "@smithy/invalid-dependency";
|
|
7
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
8
|
+
import { calculateBodyLength } from "@smithy/util-body-length-browser";
|
|
9
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
|
|
10
|
+
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
11
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
12
|
+
export const getRuntimeConfig = (config) => {
|
|
13
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
14
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
15
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
16
|
+
return {
|
|
17
|
+
...clientSharedValues,
|
|
18
|
+
...config,
|
|
19
|
+
runtime: "browser",
|
|
20
|
+
defaultsMode,
|
|
21
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
22
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
23
|
+
createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
24
|
+
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
25
|
+
region: config?.region ?? invalidProvider("Region is missing"),
|
|
26
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
27
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
28
|
+
sha256: config?.sha256 ?? Sha256,
|
|
29
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
30
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
31
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import packageInfo from "../../../package.json";
|
|
2
|
+
import { emitWarningIfUnsupportedVersion as awsCheckVersion, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS } from "@aws-sdk/core";
|
|
3
|
+
import { createDefaultUserAgentProvider, NODE_APP_ID_CONFIG_OPTIONS } from "@aws-sdk/util-user-agent-node";
|
|
4
|
+
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver";
|
|
5
|
+
import { Hash } from "@smithy/hash-node";
|
|
6
|
+
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
|
|
7
|
+
import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
|
|
8
|
+
import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
|
|
9
|
+
import { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
10
|
+
import { calculateBodyLength } from "@smithy/util-body-length-node";
|
|
11
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
|
|
12
|
+
import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
13
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
14
|
+
export const getRuntimeConfig = (config) => {
|
|
15
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
16
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
17
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
18
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
19
|
+
awsCheckVersion(process.version);
|
|
20
|
+
const loaderConfig = {
|
|
21
|
+
profile: config?.profile,
|
|
22
|
+
logger: clientSharedValues.logger,
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
...clientSharedValues,
|
|
26
|
+
...config,
|
|
27
|
+
runtime: "node",
|
|
28
|
+
defaultsMode,
|
|
29
|
+
authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
30
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
31
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
32
|
+
createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
33
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
34
|
+
region: config?.region ??
|
|
35
|
+
loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
36
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
37
|
+
retryMode: config?.retryMode ??
|
|
38
|
+
loadNodeConfig({
|
|
39
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
40
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
41
|
+
}, config),
|
|
42
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
43
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
44
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
45
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
46
|
+
userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
2
|
+
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
3
|
+
export 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
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AwsSdkSigV4Signer } from "@aws-sdk/core";
|
|
2
|
+
import { AwsJson1_1Protocol } from "@aws-sdk/core/protocols";
|
|
3
|
+
import { NoAuthSigner } from "@smithy/core";
|
|
4
|
+
import { NoOpLogger } from "@smithy/smithy-client";
|
|
5
|
+
import { parseUrl } from "@smithy/url-parser";
|
|
6
|
+
import { fromBase64, toBase64 } from "@smithy/util-base64";
|
|
7
|
+
import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
|
|
8
|
+
import { defaultCognitoIdentityHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider";
|
|
9
|
+
import { defaultEndpointResolver } from "./endpoint/endpointResolver";
|
|
10
|
+
import { errorTypeRegistries } from "./schemas/schemas_0";
|
|
11
|
+
export const getRuntimeConfig = (config) => {
|
|
12
|
+
return {
|
|
13
|
+
apiVersion: "2014-06-30",
|
|
14
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
15
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
16
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
17
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
18
|
+
extensions: config?.extensions ?? [],
|
|
19
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultCognitoIdentityHttpAuthSchemeProvider,
|
|
20
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
21
|
+
{
|
|
22
|
+
schemeId: "aws.auth#sigv4",
|
|
23
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
24
|
+
signer: new AwsSdkSigV4Signer(),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
schemeId: "smithy.api#noAuth",
|
|
28
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
29
|
+
signer: new NoAuthSigner(),
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
33
|
+
protocol: config?.protocol ?? AwsJson1_1Protocol,
|
|
34
|
+
protocolSettings: config?.protocolSettings ?? {
|
|
35
|
+
defaultNamespace: "com.amazonaws.cognitoidentity",
|
|
36
|
+
errorTypeRegistries,
|
|
37
|
+
xmlNamespace: "http://cognito-identity.amazonaws.com/doc/2014-06-30/",
|
|
38
|
+
version: "2014-06-30",
|
|
39
|
+
serviceTarget: "AWSCognitoIdentityService",
|
|
40
|
+
},
|
|
41
|
+
serviceId: config?.serviceId ?? "Cognito Identity",
|
|
42
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
43
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
44
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
|
|
2
|
+
import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
|
|
3
|
+
import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
|
|
4
|
+
import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration";
|
|
5
|
+
export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
6
|
+
const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
|
|
7
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
8
|
+
return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
|
|
9
|
+
};
|