@aws-sdk/nested-clients 3.934.0 → 3.936.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/submodules/signin/auth/httpAuthSchemeProvider.js +56 -0
- package/dist-cjs/submodules/signin/endpoint/endpointResolver.js +18 -0
- package/dist-cjs/submodules/signin/endpoint/ruleset.js +7 -0
- package/dist-cjs/submodules/signin/index.js +439 -0
- package/dist-cjs/submodules/signin/runtimeConfig.browser.js +39 -0
- package/dist-cjs/submodules/signin/runtimeConfig.js +54 -0
- package/dist-cjs/submodules/signin/runtimeConfig.native.js +15 -0
- package/dist-cjs/submodules/signin/runtimeConfig.shared.js +42 -0
- package/dist-cjs/submodules/sso-oidc/index.js +10 -9
- package/dist-es/submodules/signin/Signin.js +9 -0
- package/dist-es/submodules/signin/SigninClient.js +50 -0
- package/dist-es/submodules/signin/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/submodules/signin/auth/httpAuthSchemeProvider.js +50 -0
- package/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js +16 -0
- package/dist-es/submodules/signin/commands/index.js +1 -0
- package/dist-es/submodules/signin/endpoint/EndpointParameters.js +13 -0
- package/dist-es/submodules/signin/endpoint/endpointResolver.js +14 -0
- package/dist-es/submodules/signin/endpoint/ruleset.js +4 -0
- package/dist-es/submodules/signin/extensionConfiguration.js +1 -0
- package/dist-es/submodules/signin/index.js +6 -0
- package/dist-es/submodules/signin/models/SigninServiceException.js +8 -0
- package/dist-es/submodules/signin/models/enums.js +8 -0
- package/dist-es/submodules/signin/models/errors.js +57 -0
- package/dist-es/submodules/signin/models/models_0.js +1 -0
- package/dist-es/submodules/signin/runtimeConfig.browser.js +34 -0
- package/dist-es/submodules/signin/runtimeConfig.js +49 -0
- package/dist-es/submodules/signin/runtimeConfig.native.js +11 -0
- package/dist-es/submodules/signin/runtimeConfig.shared.js +38 -0
- package/dist-es/submodules/signin/runtimeExtensions.js +9 -0
- package/dist-es/submodules/signin/schemas/schemas_0.js +221 -0
- package/dist-es/submodules/sso-oidc/index.js +2 -1
- package/dist-es/submodules/sso-oidc/models/enums.js +9 -0
- package/dist-es/submodules/sso-oidc/models/errors.js +181 -0
- package/dist-es/submodules/sso-oidc/models/models_0.js +1 -190
- package/dist-es/submodules/sso-oidc/schemas/schemas_0.js +1 -1
- package/dist-es/submodules/sts/index.js +1 -1
- package/dist-es/submodules/sts/models/errors.js +85 -0
- package/dist-es/submodules/sts/models/models_0.js +1 -85
- package/dist-es/submodules/sts/schemas/schemas_0.js +1 -1
- package/dist-types/submodules/signin/Signin.d.ts +18 -0
- package/dist-types/submodules/signin/SigninClient.d.ts +198 -0
- package/dist-types/submodules/signin/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/submodules/signin/auth/httpAuthSchemeProvider.d.ts +75 -0
- package/dist-types/submodules/signin/commands/CreateOAuth2TokenCommand.d.ts +157 -0
- package/dist-types/submodules/signin/commands/index.d.ts +1 -0
- package/dist-types/submodules/signin/endpoint/EndpointParameters.d.ts +38 -0
- package/dist-types/submodules/signin/endpoint/endpointResolver.d.ts +5 -0
- package/dist-types/submodules/signin/endpoint/ruleset.d.ts +2 -0
- package/dist-types/submodules/signin/extensionConfiguration.d.ts +9 -0
- package/dist-types/submodules/signin/index.d.ts +16 -0
- package/dist-types/submodules/signin/models/SigninServiceException.d.ts +14 -0
- package/dist-types/submodules/signin/models/enums.d.ts +34 -0
- package/dist-types/submodules/signin/models/errors.d.ts +102 -0
- package/dist-types/submodules/signin/models/models_0.d.ts +142 -0
- package/dist-types/submodules/signin/runtimeConfig.browser.d.ts +59 -0
- package/dist-types/submodules/signin/runtimeConfig.d.ts +59 -0
- package/dist-types/submodules/signin/runtimeConfig.native.d.ts +58 -0
- package/dist-types/submodules/signin/runtimeConfig.shared.d.ts +33 -0
- package/dist-types/submodules/signin/runtimeExtensions.d.ts +17 -0
- package/dist-types/submodules/signin/schemas/schemas_0.d.ts +14 -0
- package/dist-types/submodules/sso-oidc/index.d.ts +3 -1
- package/dist-types/submodules/sso-oidc/models/enums.d.ts +25 -0
- package/dist-types/submodules/sso-oidc/models/errors.d.ts +279 -0
- package/dist-types/submodules/sso-oidc/models/models_0.d.ts +0 -303
- package/dist-types/submodules/sts/index.d.ts +2 -1
- package/dist-types/submodules/sts/models/errors.d.ts +108 -0
- package/dist-types/submodules/sts/models/models_0.d.ts +0 -108
- package/dist-types/ts3.4/submodules/signin/Signin.d.ts +22 -0
- package/dist-types/ts3.4/submodules/signin/SigninClient.d.ts +127 -0
- package/dist-types/ts3.4/submodules/signin/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/dist-types/ts3.4/submodules/signin/auth/httpAuthSchemeProvider.d.ts +47 -0
- package/dist-types/ts3.4/submodules/signin/commands/CreateOAuth2TokenCommand.d.ts +47 -0
- package/dist-types/ts3.4/submodules/signin/commands/index.d.ts +1 -0
- package/dist-types/ts3.4/submodules/signin/endpoint/EndpointParameters.d.ts +51 -0
- package/dist-types/ts3.4/submodules/signin/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/submodules/signin/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/submodules/signin/extensionConfiguration.d.ts +9 -0
- package/dist-types/ts3.4/submodules/signin/index.d.ts +10 -0
- package/dist-types/ts3.4/submodules/signin/models/SigninServiceException.d.ts +9 -0
- package/dist-types/ts3.4/submodules/signin/models/enums.d.ts +10 -0
- package/dist-types/ts3.4/submodules/signin/models/errors.d.ts +35 -0
- package/dist-types/ts3.4/submodules/signin/models/models_0.d.ts +26 -0
- package/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +121 -0
- package/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +114 -0
- package/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +125 -0
- package/dist-types/ts3.4/submodules/signin/runtimeConfig.shared.d.ts +53 -0
- package/dist-types/ts3.4/submodules/signin/runtimeExtensions.d.ts +11 -0
- package/dist-types/ts3.4/submodules/signin/schemas/schemas_0.d.ts +19 -0
- package/dist-types/ts3.4/submodules/sso-oidc/index.d.ts +3 -1
- package/dist-types/ts3.4/submodules/sso-oidc/models/enums.d.ts +13 -0
- package/dist-types/ts3.4/submodules/sso-oidc/models/errors.d.ts +105 -0
- package/dist-types/ts3.4/submodules/sso-oidc/models/models_0.d.ts +0 -114
- package/dist-types/ts3.4/submodules/sts/index.d.ts +2 -1
- package/dist-types/ts3.4/submodules/sts/models/errors.d.ts +54 -0
- package/dist-types/ts3.4/submodules/sts/models/models_0.d.ts +0 -54
- package/package.json +29 -18
- package/signin.d.ts +7 -0
- package/signin.js +5 -0
- package/dist-es/submodules/sso-oidc/models/index.js +0 -1
- package/dist-es/submodules/sts/models/index.js +0 -1
- package/dist-types/submodules/sso-oidc/models/index.d.ts +0 -1
- package/dist-types/submodules/sts/models/index.d.ts +0 -1
- package/dist-types/ts3.4/submodules/sso-oidc/models/index.d.ts +0 -1
- package/dist-types/ts3.4/submodules/sts/models/index.d.ts +0 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveHttpAuthSchemeConfig = exports.defaultSigninHttpAuthSchemeProvider = exports.defaultSigninHttpAuthSchemeParametersProvider = void 0;
|
|
4
|
+
const core_1 = require("@aws-sdk/core");
|
|
5
|
+
const util_middleware_1 = require("@smithy/util-middleware");
|
|
6
|
+
const defaultSigninHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
7
|
+
return {
|
|
8
|
+
operation: (0, util_middleware_1.getSmithyContext)(context).operation,
|
|
9
|
+
region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
|
|
10
|
+
(() => {
|
|
11
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
12
|
+
})(),
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.defaultSigninHttpAuthSchemeParametersProvider = defaultSigninHttpAuthSchemeParametersProvider;
|
|
16
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
17
|
+
return {
|
|
18
|
+
schemeId: "aws.auth#sigv4",
|
|
19
|
+
signingProperties: {
|
|
20
|
+
name: "signin",
|
|
21
|
+
region: authParameters.region,
|
|
22
|
+
},
|
|
23
|
+
propertiesExtractor: (config, context) => ({
|
|
24
|
+
signingProperties: {
|
|
25
|
+
config,
|
|
26
|
+
context,
|
|
27
|
+
},
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function createSmithyApiNoAuthHttpAuthOption(authParameters) {
|
|
32
|
+
return {
|
|
33
|
+
schemeId: "smithy.api#noAuth",
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const defaultSigninHttpAuthSchemeProvider = (authParameters) => {
|
|
37
|
+
const options = [];
|
|
38
|
+
switch (authParameters.operation) {
|
|
39
|
+
case "CreateOAuth2Token": {
|
|
40
|
+
options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
default: {
|
|
44
|
+
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return options;
|
|
48
|
+
};
|
|
49
|
+
exports.defaultSigninHttpAuthSchemeProvider = defaultSigninHttpAuthSchemeProvider;
|
|
50
|
+
const resolveHttpAuthSchemeConfig = (config) => {
|
|
51
|
+
const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
|
|
52
|
+
return Object.assign(config_0, {
|
|
53
|
+
authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []),
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultEndpointResolver = void 0;
|
|
4
|
+
const util_endpoints_1 = require("@aws-sdk/util-endpoints");
|
|
5
|
+
const util_endpoints_2 = require("@smithy/util-endpoints");
|
|
6
|
+
const ruleset_1 = require("./ruleset");
|
|
7
|
+
const cache = new util_endpoints_2.EndpointCache({
|
|
8
|
+
size: 50,
|
|
9
|
+
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
|
|
10
|
+
});
|
|
11
|
+
const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
12
|
+
return cache.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
|
|
13
|
+
endpointParams: endpointParams,
|
|
14
|
+
logger: context.logger,
|
|
15
|
+
}));
|
|
16
|
+
};
|
|
17
|
+
exports.defaultEndpointResolver = defaultEndpointResolver;
|
|
18
|
+
util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ruleSet = void 0;
|
|
4
|
+
const u = "required", v = "fn", w = "argv", x = "ref";
|
|
5
|
+
const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = "stringEquals", i = { [u]: true, "default": false, "type": "boolean" }, j = { [u]: false, "type": "string" }, k = { [x]: "Endpoint" }, l = { [v]: c, [w]: [{ [x]: "UseFIPS" }, true] }, m = { [v]: c, [w]: [{ [x]: "UseDualStack" }, true] }, n = {}, o = { [v]: "getAttr", [w]: [{ [x]: g }, "name"] }, p = { [v]: c, [w]: [{ [x]: "UseFIPS" }, false] }, q = { [v]: c, [w]: [{ [x]: "UseDualStack" }, false] }, r = { [v]: "getAttr", [w]: [{ [x]: g }, "supportsFIPS"] }, s = { [v]: c, [w]: [true, { [v]: "getAttr", [w]: [{ [x]: g }, "supportsDualStack"] }] }, t = [{ [x]: "Region" }];
|
|
6
|
+
const _data = { version: "1.0", parameters: { UseDualStack: i, UseFIPS: i, Endpoint: j, Region: j }, rules: [{ conditions: [{ [v]: b, [w]: [k] }], rules: [{ conditions: [l], error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { rules: [{ conditions: [m], error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: n, headers: n }, type: e }], type: f }], type: f }, { rules: [{ conditions: [{ [v]: b, [w]: t }], rules: [{ conditions: [{ [v]: "aws.partition", [w]: t, assign: g }], rules: [{ conditions: [{ [v]: h, [w]: [o, "aws"] }, p, q], endpoint: { url: "https://{Region}.signin.aws.amazon.com", properties: n, headers: n }, type: e }, { conditions: [{ [v]: h, [w]: [o, "aws-cn"] }, p, q], endpoint: { url: "https://{Region}.signin.amazonaws.cn", properties: n, headers: n }, type: e }, { conditions: [{ [v]: h, [w]: [o, "aws-us-gov"] }, p, q], endpoint: { url: "https://{Region}.signin.amazonaws-us-gov.com", properties: n, headers: n }, type: e }, { conditions: [l, m], rules: [{ conditions: [{ [v]: c, [w]: [a, r] }, s], rules: [{ endpoint: { url: "https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: [l, q], rules: [{ conditions: [{ [v]: c, [w]: [r, a] }], rules: [{ endpoint: { url: "https://signin-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: [p, m], rules: [{ conditions: [s], rules: [{ endpoint: { url: "https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { url: "https://signin.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }], type: f }] };
|
|
7
|
+
exports.ruleSet = _data;
|
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var middlewareHostHeader = require('@aws-sdk/middleware-host-header');
|
|
4
|
+
var middlewareLogger = require('@aws-sdk/middleware-logger');
|
|
5
|
+
var middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');
|
|
6
|
+
var middlewareUserAgent = require('@aws-sdk/middleware-user-agent');
|
|
7
|
+
var configResolver = require('@smithy/config-resolver');
|
|
8
|
+
var core = require('@smithy/core');
|
|
9
|
+
var schema = require('@smithy/core/schema');
|
|
10
|
+
var middlewareContentLength = require('@smithy/middleware-content-length');
|
|
11
|
+
var middlewareEndpoint = require('@smithy/middleware-endpoint');
|
|
12
|
+
var middlewareRetry = require('@smithy/middleware-retry');
|
|
13
|
+
var smithyClient = require('@smithy/smithy-client');
|
|
14
|
+
var httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');
|
|
15
|
+
var runtimeConfig = require('./runtimeConfig');
|
|
16
|
+
var regionConfigResolver = require('@aws-sdk/region-config-resolver');
|
|
17
|
+
var protocolHttp = require('@smithy/protocol-http');
|
|
18
|
+
|
|
19
|
+
const resolveClientEndpointParameters = (options) => {
|
|
20
|
+
return Object.assign(options, {
|
|
21
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
22
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
23
|
+
defaultSigningName: "signin",
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
const commonParams = {
|
|
27
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
28
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
29
|
+
Region: { type: "builtInParams", name: "region" },
|
|
30
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
34
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
35
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
36
|
+
let _credentials = runtimeConfig.credentials;
|
|
37
|
+
return {
|
|
38
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
39
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
40
|
+
if (index === -1) {
|
|
41
|
+
_httpAuthSchemes.push(httpAuthScheme);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
httpAuthSchemes() {
|
|
48
|
+
return _httpAuthSchemes;
|
|
49
|
+
},
|
|
50
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
51
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
52
|
+
},
|
|
53
|
+
httpAuthSchemeProvider() {
|
|
54
|
+
return _httpAuthSchemeProvider;
|
|
55
|
+
},
|
|
56
|
+
setCredentials(credentials) {
|
|
57
|
+
_credentials = credentials;
|
|
58
|
+
},
|
|
59
|
+
credentials() {
|
|
60
|
+
return _credentials;
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
const resolveHttpAuthRuntimeConfig = (config) => {
|
|
65
|
+
return {
|
|
66
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
67
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
68
|
+
credentials: config.credentials(),
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
73
|
+
const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
|
|
74
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
75
|
+
return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
class SigninClient extends smithyClient.Client {
|
|
79
|
+
config;
|
|
80
|
+
constructor(...[configuration]) {
|
|
81
|
+
const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});
|
|
82
|
+
super(_config_0);
|
|
83
|
+
this.initConfig = _config_0;
|
|
84
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
85
|
+
const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);
|
|
86
|
+
const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);
|
|
87
|
+
const _config_4 = configResolver.resolveRegionConfig(_config_3);
|
|
88
|
+
const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);
|
|
89
|
+
const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);
|
|
90
|
+
const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);
|
|
91
|
+
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
92
|
+
this.config = _config_8;
|
|
93
|
+
this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));
|
|
94
|
+
this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));
|
|
95
|
+
this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));
|
|
96
|
+
this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));
|
|
97
|
+
this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));
|
|
98
|
+
this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));
|
|
99
|
+
this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));
|
|
100
|
+
this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
101
|
+
httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSigninHttpAuthSchemeParametersProvider,
|
|
102
|
+
identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
|
|
103
|
+
"aws.auth#sigv4": config.credentials,
|
|
104
|
+
}),
|
|
105
|
+
}));
|
|
106
|
+
this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
|
|
107
|
+
}
|
|
108
|
+
destroy() {
|
|
109
|
+
super.destroy();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
let SigninServiceException$1 = class SigninServiceException extends smithyClient.ServiceException {
|
|
114
|
+
constructor(options) {
|
|
115
|
+
super(options);
|
|
116
|
+
Object.setPrototypeOf(this, SigninServiceException.prototype);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
let AccessDeniedException$1 = class AccessDeniedException extends SigninServiceException$1 {
|
|
121
|
+
name = "AccessDeniedException";
|
|
122
|
+
$fault = "client";
|
|
123
|
+
error;
|
|
124
|
+
constructor(opts) {
|
|
125
|
+
super({
|
|
126
|
+
name: "AccessDeniedException",
|
|
127
|
+
$fault: "client",
|
|
128
|
+
...opts,
|
|
129
|
+
});
|
|
130
|
+
Object.setPrototypeOf(this, AccessDeniedException.prototype);
|
|
131
|
+
this.error = opts.error;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
let InternalServerException$1 = class InternalServerException extends SigninServiceException$1 {
|
|
135
|
+
name = "InternalServerException";
|
|
136
|
+
$fault = "server";
|
|
137
|
+
error;
|
|
138
|
+
constructor(opts) {
|
|
139
|
+
super({
|
|
140
|
+
name: "InternalServerException",
|
|
141
|
+
$fault: "server",
|
|
142
|
+
...opts,
|
|
143
|
+
});
|
|
144
|
+
Object.setPrototypeOf(this, InternalServerException.prototype);
|
|
145
|
+
this.error = opts.error;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
let TooManyRequestsError$1 = class TooManyRequestsError extends SigninServiceException$1 {
|
|
149
|
+
name = "TooManyRequestsError";
|
|
150
|
+
$fault = "client";
|
|
151
|
+
error;
|
|
152
|
+
constructor(opts) {
|
|
153
|
+
super({
|
|
154
|
+
name: "TooManyRequestsError",
|
|
155
|
+
$fault: "client",
|
|
156
|
+
...opts,
|
|
157
|
+
});
|
|
158
|
+
Object.setPrototypeOf(this, TooManyRequestsError.prototype);
|
|
159
|
+
this.error = opts.error;
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
let ValidationException$1 = class ValidationException extends SigninServiceException$1 {
|
|
163
|
+
name = "ValidationException";
|
|
164
|
+
$fault = "client";
|
|
165
|
+
error;
|
|
166
|
+
constructor(opts) {
|
|
167
|
+
super({
|
|
168
|
+
name: "ValidationException",
|
|
169
|
+
$fault: "client",
|
|
170
|
+
...opts,
|
|
171
|
+
});
|
|
172
|
+
Object.setPrototypeOf(this, ValidationException.prototype);
|
|
173
|
+
this.error = opts.error;
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
const _ADE = "AccessDeniedException";
|
|
178
|
+
const _AT = "AccessToken";
|
|
179
|
+
const _COAT = "CreateOAuth2Token";
|
|
180
|
+
const _COATR = "CreateOAuth2TokenRequest";
|
|
181
|
+
const _COATRB = "CreateOAuth2TokenRequestBody";
|
|
182
|
+
const _COATRBr = "CreateOAuth2TokenResponseBody";
|
|
183
|
+
const _COATRr = "CreateOAuth2TokenResponse";
|
|
184
|
+
const _ISE = "InternalServerException";
|
|
185
|
+
const _RT = "RefreshToken";
|
|
186
|
+
const _TMRE = "TooManyRequestsError";
|
|
187
|
+
const _VE = "ValidationException";
|
|
188
|
+
const _aKI = "accessKeyId";
|
|
189
|
+
const _aT = "accessToken";
|
|
190
|
+
const _c = "client";
|
|
191
|
+
const _cI = "clientId";
|
|
192
|
+
const _cV = "codeVerifier";
|
|
193
|
+
const _co = "code";
|
|
194
|
+
const _e = "error";
|
|
195
|
+
const _eI = "expiresIn";
|
|
196
|
+
const _gT = "grantType";
|
|
197
|
+
const _h = "http";
|
|
198
|
+
const _hE = "httpError";
|
|
199
|
+
const _iT = "idToken";
|
|
200
|
+
const _jN = "jsonName";
|
|
201
|
+
const _m = "message";
|
|
202
|
+
const _rT = "refreshToken";
|
|
203
|
+
const _rU = "redirectUri";
|
|
204
|
+
const _s = "server";
|
|
205
|
+
const _sAK = "secretAccessKey";
|
|
206
|
+
const _sT = "sessionToken";
|
|
207
|
+
const _sm = "smithy.ts.sdk.synthetic.com.amazonaws.signin";
|
|
208
|
+
const _tI = "tokenInput";
|
|
209
|
+
const _tO = "tokenOutput";
|
|
210
|
+
const _tT = "tokenType";
|
|
211
|
+
const n0 = "com.amazonaws.signin";
|
|
212
|
+
var RefreshToken = [0, n0, _RT, 8, 0];
|
|
213
|
+
var AccessDeniedException = [
|
|
214
|
+
-3,
|
|
215
|
+
n0,
|
|
216
|
+
_ADE,
|
|
217
|
+
{
|
|
218
|
+
[_e]: _c,
|
|
219
|
+
},
|
|
220
|
+
[_e, _m],
|
|
221
|
+
[0, 0],
|
|
222
|
+
];
|
|
223
|
+
schema.TypeRegistry.for(n0).registerError(AccessDeniedException, AccessDeniedException$1);
|
|
224
|
+
var AccessToken = [
|
|
225
|
+
3,
|
|
226
|
+
n0,
|
|
227
|
+
_AT,
|
|
228
|
+
8,
|
|
229
|
+
[_aKI, _sAK, _sT],
|
|
230
|
+
[
|
|
231
|
+
[
|
|
232
|
+
0,
|
|
233
|
+
{
|
|
234
|
+
[_jN]: _aKI,
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
[
|
|
238
|
+
0,
|
|
239
|
+
{
|
|
240
|
+
[_jN]: _sAK,
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
[
|
|
244
|
+
0,
|
|
245
|
+
{
|
|
246
|
+
[_jN]: _sT,
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
],
|
|
250
|
+
];
|
|
251
|
+
var CreateOAuth2TokenRequest = [
|
|
252
|
+
3,
|
|
253
|
+
n0,
|
|
254
|
+
_COATR,
|
|
255
|
+
0,
|
|
256
|
+
[_tI],
|
|
257
|
+
[[() => CreateOAuth2TokenRequestBody, 16]],
|
|
258
|
+
];
|
|
259
|
+
var CreateOAuth2TokenRequestBody = [
|
|
260
|
+
3,
|
|
261
|
+
n0,
|
|
262
|
+
_COATRB,
|
|
263
|
+
0,
|
|
264
|
+
[_cI, _gT, _co, _rU, _cV, _rT],
|
|
265
|
+
[
|
|
266
|
+
[
|
|
267
|
+
0,
|
|
268
|
+
{
|
|
269
|
+
[_jN]: _cI,
|
|
270
|
+
},
|
|
271
|
+
],
|
|
272
|
+
[
|
|
273
|
+
0,
|
|
274
|
+
{
|
|
275
|
+
[_jN]: _gT,
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
0,
|
|
279
|
+
[
|
|
280
|
+
0,
|
|
281
|
+
{
|
|
282
|
+
[_jN]: _rU,
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
[
|
|
286
|
+
0,
|
|
287
|
+
{
|
|
288
|
+
[_jN]: _cV,
|
|
289
|
+
},
|
|
290
|
+
],
|
|
291
|
+
[
|
|
292
|
+
() => RefreshToken,
|
|
293
|
+
{
|
|
294
|
+
[_jN]: _rT,
|
|
295
|
+
},
|
|
296
|
+
],
|
|
297
|
+
],
|
|
298
|
+
];
|
|
299
|
+
var CreateOAuth2TokenResponse = [
|
|
300
|
+
3,
|
|
301
|
+
n0,
|
|
302
|
+
_COATRr,
|
|
303
|
+
0,
|
|
304
|
+
[_tO],
|
|
305
|
+
[[() => CreateOAuth2TokenResponseBody, 16]],
|
|
306
|
+
];
|
|
307
|
+
var CreateOAuth2TokenResponseBody = [
|
|
308
|
+
3,
|
|
309
|
+
n0,
|
|
310
|
+
_COATRBr,
|
|
311
|
+
0,
|
|
312
|
+
[_aT, _tT, _eI, _rT, _iT],
|
|
313
|
+
[
|
|
314
|
+
[
|
|
315
|
+
() => AccessToken,
|
|
316
|
+
{
|
|
317
|
+
[_jN]: _aT,
|
|
318
|
+
},
|
|
319
|
+
],
|
|
320
|
+
[
|
|
321
|
+
0,
|
|
322
|
+
{
|
|
323
|
+
[_jN]: _tT,
|
|
324
|
+
},
|
|
325
|
+
],
|
|
326
|
+
[
|
|
327
|
+
1,
|
|
328
|
+
{
|
|
329
|
+
[_jN]: _eI,
|
|
330
|
+
},
|
|
331
|
+
],
|
|
332
|
+
[
|
|
333
|
+
() => RefreshToken,
|
|
334
|
+
{
|
|
335
|
+
[_jN]: _rT,
|
|
336
|
+
},
|
|
337
|
+
],
|
|
338
|
+
[
|
|
339
|
+
0,
|
|
340
|
+
{
|
|
341
|
+
[_jN]: _iT,
|
|
342
|
+
},
|
|
343
|
+
],
|
|
344
|
+
],
|
|
345
|
+
];
|
|
346
|
+
var InternalServerException = [
|
|
347
|
+
-3,
|
|
348
|
+
n0,
|
|
349
|
+
_ISE,
|
|
350
|
+
{
|
|
351
|
+
[_e]: _s,
|
|
352
|
+
[_hE]: 500,
|
|
353
|
+
},
|
|
354
|
+
[_e, _m],
|
|
355
|
+
[0, 0],
|
|
356
|
+
];
|
|
357
|
+
schema.TypeRegistry.for(n0).registerError(InternalServerException, InternalServerException$1);
|
|
358
|
+
var TooManyRequestsError = [
|
|
359
|
+
-3,
|
|
360
|
+
n0,
|
|
361
|
+
_TMRE,
|
|
362
|
+
{
|
|
363
|
+
[_e]: _c,
|
|
364
|
+
[_hE]: 429,
|
|
365
|
+
},
|
|
366
|
+
[_e, _m],
|
|
367
|
+
[0, 0],
|
|
368
|
+
];
|
|
369
|
+
schema.TypeRegistry.for(n0).registerError(TooManyRequestsError, TooManyRequestsError$1);
|
|
370
|
+
var ValidationException = [
|
|
371
|
+
-3,
|
|
372
|
+
n0,
|
|
373
|
+
_VE,
|
|
374
|
+
{
|
|
375
|
+
[_e]: _c,
|
|
376
|
+
[_hE]: 400,
|
|
377
|
+
},
|
|
378
|
+
[_e, _m],
|
|
379
|
+
[0, 0],
|
|
380
|
+
];
|
|
381
|
+
schema.TypeRegistry.for(n0).registerError(ValidationException, ValidationException$1);
|
|
382
|
+
var SigninServiceException = [-3, _sm, "SigninServiceException", 0, [], []];
|
|
383
|
+
schema.TypeRegistry.for(_sm).registerError(SigninServiceException, SigninServiceException$1);
|
|
384
|
+
var CreateOAuth2Token = [
|
|
385
|
+
9,
|
|
386
|
+
n0,
|
|
387
|
+
_COAT,
|
|
388
|
+
{
|
|
389
|
+
[_h]: ["POST", "/v1/token", 200],
|
|
390
|
+
},
|
|
391
|
+
() => CreateOAuth2TokenRequest,
|
|
392
|
+
() => CreateOAuth2TokenResponse,
|
|
393
|
+
];
|
|
394
|
+
|
|
395
|
+
class CreateOAuth2TokenCommand extends smithyClient.Command
|
|
396
|
+
.classBuilder()
|
|
397
|
+
.ep(commonParams)
|
|
398
|
+
.m(function (Command, cs, config, o) {
|
|
399
|
+
return [middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
|
|
400
|
+
})
|
|
401
|
+
.s("Signin", "CreateOAuth2Token", {})
|
|
402
|
+
.n("SigninClient", "CreateOAuth2TokenCommand")
|
|
403
|
+
.sc(CreateOAuth2Token)
|
|
404
|
+
.build() {
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const commands = {
|
|
408
|
+
CreateOAuth2TokenCommand,
|
|
409
|
+
};
|
|
410
|
+
class Signin extends SigninClient {
|
|
411
|
+
}
|
|
412
|
+
smithyClient.createAggregatedClient(commands, Signin);
|
|
413
|
+
|
|
414
|
+
const OAuth2ErrorCode = {
|
|
415
|
+
AUTHCODE_EXPIRED: "AUTHCODE_EXPIRED",
|
|
416
|
+
INSUFFICIENT_PERMISSIONS: "INSUFFICIENT_PERMISSIONS",
|
|
417
|
+
INVALID_REQUEST: "INVALID_REQUEST",
|
|
418
|
+
SERVER_ERROR: "server_error",
|
|
419
|
+
TOKEN_EXPIRED: "TOKEN_EXPIRED",
|
|
420
|
+
USER_CREDENTIALS_CHANGED: "USER_CREDENTIALS_CHANGED",
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
Object.defineProperty(exports, "$Command", {
|
|
424
|
+
enumerable: true,
|
|
425
|
+
get: function () { return smithyClient.Command; }
|
|
426
|
+
});
|
|
427
|
+
Object.defineProperty(exports, "__Client", {
|
|
428
|
+
enumerable: true,
|
|
429
|
+
get: function () { return smithyClient.Client; }
|
|
430
|
+
});
|
|
431
|
+
exports.AccessDeniedException = AccessDeniedException$1;
|
|
432
|
+
exports.CreateOAuth2TokenCommand = CreateOAuth2TokenCommand;
|
|
433
|
+
exports.InternalServerException = InternalServerException$1;
|
|
434
|
+
exports.OAuth2ErrorCode = OAuth2ErrorCode;
|
|
435
|
+
exports.Signin = Signin;
|
|
436
|
+
exports.SigninClient = SigninClient;
|
|
437
|
+
exports.SigninServiceException = SigninServiceException$1;
|
|
438
|
+
exports.TooManyRequestsError = TooManyRequestsError$1;
|
|
439
|
+
exports.ValidationException = ValidationException$1;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const package_json_1 = tslib_1.__importDefault(require("../../../package.json"));
|
|
6
|
+
const sha256_browser_1 = require("@aws-crypto/sha256-browser");
|
|
7
|
+
const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser");
|
|
8
|
+
const config_resolver_1 = require("@smithy/config-resolver");
|
|
9
|
+
const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
|
|
10
|
+
const invalid_dependency_1 = require("@smithy/invalid-dependency");
|
|
11
|
+
const util_body_length_browser_1 = require("@smithy/util-body-length-browser");
|
|
12
|
+
const util_retry_1 = require("@smithy/util-retry");
|
|
13
|
+
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
14
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
15
|
+
const util_defaults_mode_browser_1 = require("@smithy/util-defaults-mode-browser");
|
|
16
|
+
const getRuntimeConfig = (config) => {
|
|
17
|
+
const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config);
|
|
18
|
+
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
|
19
|
+
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
|
|
20
|
+
return {
|
|
21
|
+
...clientSharedValues,
|
|
22
|
+
...config,
|
|
23
|
+
runtime: "browser",
|
|
24
|
+
defaultsMode,
|
|
25
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength,
|
|
26
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
27
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
28
|
+
(0, util_user_agent_browser_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
|
|
29
|
+
maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS,
|
|
30
|
+
region: config?.region ?? (0, invalid_dependency_1.invalidProvider)("Region is missing"),
|
|
31
|
+
requestHandler: fetch_http_handler_1.FetchHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
32
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE),
|
|
33
|
+
sha256: config?.sha256 ?? sha256_browser_1.Sha256,
|
|
34
|
+
streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector,
|
|
35
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
36
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_FIPS_ENDPOINT)),
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const package_json_1 = tslib_1.__importDefault(require("../../../package.json"));
|
|
6
|
+
const core_1 = require("@aws-sdk/core");
|
|
7
|
+
const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
|
|
8
|
+
const config_resolver_1 = require("@smithy/config-resolver");
|
|
9
|
+
const hash_node_1 = require("@smithy/hash-node");
|
|
10
|
+
const middleware_retry_1 = require("@smithy/middleware-retry");
|
|
11
|
+
const node_config_provider_1 = require("@smithy/node-config-provider");
|
|
12
|
+
const node_http_handler_1 = require("@smithy/node-http-handler");
|
|
13
|
+
const util_body_length_node_1 = require("@smithy/util-body-length-node");
|
|
14
|
+
const util_retry_1 = require("@smithy/util-retry");
|
|
15
|
+
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
16
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
17
|
+
const util_defaults_mode_node_1 = require("@smithy/util-defaults-mode-node");
|
|
18
|
+
const smithy_client_2 = require("@smithy/smithy-client");
|
|
19
|
+
const getRuntimeConfig = (config) => {
|
|
20
|
+
(0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
|
|
21
|
+
const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
|
|
22
|
+
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
|
23
|
+
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
|
|
24
|
+
(0, core_1.emitWarningIfUnsupportedVersion)(process.version);
|
|
25
|
+
const loaderConfig = {
|
|
26
|
+
profile: config?.profile,
|
|
27
|
+
logger: clientSharedValues.logger,
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
...clientSharedValues,
|
|
31
|
+
...config,
|
|
32
|
+
runtime: "node",
|
|
33
|
+
defaultsMode,
|
|
34
|
+
authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
35
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
|
|
36
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
37
|
+
(0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
|
|
38
|
+
maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
39
|
+
region: config?.region ??
|
|
40
|
+
(0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
41
|
+
requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
42
|
+
retryMode: config?.retryMode ??
|
|
43
|
+
(0, node_config_provider_1.loadConfig)({
|
|
44
|
+
...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
45
|
+
default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE,
|
|
46
|
+
}, config),
|
|
47
|
+
sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
|
|
48
|
+
streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
|
|
49
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
50
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
51
|
+
userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const sha256_js_1 = require("@aws-crypto/sha256-js");
|
|
5
|
+
const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
|
|
6
|
+
const getRuntimeConfig = (config) => {
|
|
7
|
+
const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config);
|
|
8
|
+
return {
|
|
9
|
+
...browserDefaults,
|
|
10
|
+
...config,
|
|
11
|
+
runtime: "react-native",
|
|
12
|
+
sha256: config?.sha256 ?? sha256_js_1.Sha256,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const core_1 = require("@aws-sdk/core");
|
|
5
|
+
const protocols_1 = require("@aws-sdk/core/protocols");
|
|
6
|
+
const core_2 = require("@smithy/core");
|
|
7
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
8
|
+
const url_parser_1 = require("@smithy/url-parser");
|
|
9
|
+
const util_base64_1 = require("@smithy/util-base64");
|
|
10
|
+
const util_utf8_1 = require("@smithy/util-utf8");
|
|
11
|
+
const httpAuthSchemeProvider_1 = require("./auth/httpAuthSchemeProvider");
|
|
12
|
+
const endpointResolver_1 = require("./endpoint/endpointResolver");
|
|
13
|
+
const getRuntimeConfig = (config) => {
|
|
14
|
+
return {
|
|
15
|
+
apiVersion: "2023-01-01",
|
|
16
|
+
base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
|
|
17
|
+
base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
|
|
18
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
19
|
+
endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
|
|
20
|
+
extensions: config?.extensions ?? [],
|
|
21
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSigninHttpAuthSchemeProvider,
|
|
22
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
23
|
+
{
|
|
24
|
+
schemeId: "aws.auth#sigv4",
|
|
25
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
26
|
+
signer: new core_1.AwsSdkSigV4Signer(),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
schemeId: "smithy.api#noAuth",
|
|
30
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
|
|
31
|
+
signer: new core_2.NoAuthSigner(),
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
|
|
35
|
+
protocol: config?.protocol ?? new protocols_1.AwsRestJsonProtocol({ defaultNamespace: "com.amazonaws.signin" }),
|
|
36
|
+
serviceId: config?.serviceId ?? "Signin",
|
|
37
|
+
urlParser: config?.urlParser ?? url_parser_1.parseUrl,
|
|
38
|
+
utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
|
|
39
|
+
utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|