@aws-sdk/client-signin 3.935.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.
Files changed (74) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +214 -0
  3. package/dist-cjs/auth/httpAuthSchemeProvider.js +56 -0
  4. package/dist-cjs/endpoint/endpointResolver.js +18 -0
  5. package/dist-cjs/endpoint/ruleset.js +7 -0
  6. package/dist-cjs/index.js +439 -0
  7. package/dist-cjs/runtimeConfig.browser.js +39 -0
  8. package/dist-cjs/runtimeConfig.js +56 -0
  9. package/dist-cjs/runtimeConfig.native.js +15 -0
  10. package/dist-cjs/runtimeConfig.shared.js +42 -0
  11. package/dist-es/Signin.js +9 -0
  12. package/dist-es/SigninClient.js +50 -0
  13. package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  14. package/dist-es/auth/httpAuthSchemeProvider.js +50 -0
  15. package/dist-es/commands/CreateOAuth2TokenCommand.js +16 -0
  16. package/dist-es/commands/index.js +1 -0
  17. package/dist-es/endpoint/EndpointParameters.js +13 -0
  18. package/dist-es/endpoint/endpointResolver.js +14 -0
  19. package/dist-es/endpoint/ruleset.js +4 -0
  20. package/dist-es/extensionConfiguration.js +1 -0
  21. package/dist-es/index.js +6 -0
  22. package/dist-es/models/SigninServiceException.js +8 -0
  23. package/dist-es/models/enums.js +8 -0
  24. package/dist-es/models/errors.js +57 -0
  25. package/dist-es/models/models_0.js +1 -0
  26. package/dist-es/runtimeConfig.browser.js +34 -0
  27. package/dist-es/runtimeConfig.js +51 -0
  28. package/dist-es/runtimeConfig.native.js +11 -0
  29. package/dist-es/runtimeConfig.shared.js +38 -0
  30. package/dist-es/runtimeExtensions.js +9 -0
  31. package/dist-es/schemas/schemas_0.js +221 -0
  32. package/dist-types/Signin.d.ts +18 -0
  33. package/dist-types/SigninClient.d.ts +198 -0
  34. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  35. package/dist-types/auth/httpAuthSchemeProvider.d.ts +75 -0
  36. package/dist-types/commands/CreateOAuth2TokenCommand.d.ts +157 -0
  37. package/dist-types/commands/index.d.ts +1 -0
  38. package/dist-types/endpoint/EndpointParameters.d.ts +38 -0
  39. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  40. package/dist-types/endpoint/ruleset.d.ts +2 -0
  41. package/dist-types/extensionConfiguration.d.ts +9 -0
  42. package/dist-types/index.d.ts +16 -0
  43. package/dist-types/models/SigninServiceException.d.ts +14 -0
  44. package/dist-types/models/enums.d.ts +34 -0
  45. package/dist-types/models/errors.d.ts +102 -0
  46. package/dist-types/models/models_0.d.ts +142 -0
  47. package/dist-types/runtimeConfig.browser.d.ts +59 -0
  48. package/dist-types/runtimeConfig.d.ts +59 -0
  49. package/dist-types/runtimeConfig.native.d.ts +58 -0
  50. package/dist-types/runtimeConfig.shared.d.ts +33 -0
  51. package/dist-types/runtimeExtensions.d.ts +17 -0
  52. package/dist-types/schemas/schemas_0.d.ts +14 -0
  53. package/dist-types/ts3.4/Signin.d.ts +22 -0
  54. package/dist-types/ts3.4/SigninClient.d.ts +127 -0
  55. package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
  56. package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +47 -0
  57. package/dist-types/ts3.4/commands/CreateOAuth2TokenCommand.d.ts +47 -0
  58. package/dist-types/ts3.4/commands/index.d.ts +1 -0
  59. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +51 -0
  60. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  61. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  62. package/dist-types/ts3.4/extensionConfiguration.d.ts +9 -0
  63. package/dist-types/ts3.4/index.d.ts +10 -0
  64. package/dist-types/ts3.4/models/SigninServiceException.d.ts +9 -0
  65. package/dist-types/ts3.4/models/enums.d.ts +10 -0
  66. package/dist-types/ts3.4/models/errors.d.ts +35 -0
  67. package/dist-types/ts3.4/models/models_0.d.ts +26 -0
  68. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +121 -0
  69. package/dist-types/ts3.4/runtimeConfig.d.ts +116 -0
  70. package/dist-types/ts3.4/runtimeConfig.native.d.ts +125 -0
  71. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +53 -0
  72. package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
  73. package/dist-types/ts3.4/schemas/schemas_0.d.ts +19 -0
  74. package/package.json +99 -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,50 @@
1
+ import { resolveAwsSdkSigV4Config, } from "@aws-sdk/core";
2
+ import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";
3
+ export const defaultSigninHttpAuthSchemeParametersProvider = 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: "signin",
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 defaultSigninHttpAuthSchemeProvider = (authParameters) => {
33
+ const options = [];
34
+ switch (authParameters.operation) {
35
+ case "CreateOAuth2Token": {
36
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
37
+ break;
38
+ }
39
+ default: {
40
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
41
+ }
42
+ }
43
+ return options;
44
+ };
45
+ export const resolveHttpAuthSchemeConfig = (config) => {
46
+ const config_0 = resolveAwsSdkSigV4Config(config);
47
+ return Object.assign(config_0, {
48
+ authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
49
+ });
50
+ };
@@ -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 { CreateOAuth2Token } from "../schemas/schemas_0";
5
+ export { $Command };
6
+ export class CreateOAuth2TokenCommand extends $Command
7
+ .classBuilder()
8
+ .ep(commonParams)
9
+ .m(function (Command, cs, config, o) {
10
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
11
+ })
12
+ .s("Signin", "CreateOAuth2Token", {})
13
+ .n("SigninClient", "CreateOAuth2TokenCommand")
14
+ .sc(CreateOAuth2Token)
15
+ .build() {
16
+ }
@@ -0,0 +1 @@
1
+ export * from "./CreateOAuth2TokenCommand";
@@ -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: "signin",
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,4 @@
1
+ const u = "required", v = "fn", w = "argv", x = "ref";
2
+ 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" }];
3
+ 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 }] };
4
+ export const ruleSet = _data;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export * from "./SigninClient";
2
+ export * from "./Signin";
3
+ export * from "./commands";
4
+ export * from "./models/enums";
5
+ export * from "./models/errors";
6
+ export { SigninServiceException } from "./models/SigninServiceException";
@@ -0,0 +1,8 @@
1
+ import { ServiceException as __ServiceException, } from "@smithy/smithy-client";
2
+ export { __ServiceException };
3
+ export class SigninServiceException extends __ServiceException {
4
+ constructor(options) {
5
+ super(options);
6
+ Object.setPrototypeOf(this, SigninServiceException.prototype);
7
+ }
8
+ }
@@ -0,0 +1,8 @@
1
+ export const OAuth2ErrorCode = {
2
+ AUTHCODE_EXPIRED: "AUTHCODE_EXPIRED",
3
+ INSUFFICIENT_PERMISSIONS: "INSUFFICIENT_PERMISSIONS",
4
+ INVALID_REQUEST: "INVALID_REQUEST",
5
+ SERVER_ERROR: "server_error",
6
+ TOKEN_EXPIRED: "TOKEN_EXPIRED",
7
+ USER_CREDENTIALS_CHANGED: "USER_CREDENTIALS_CHANGED",
8
+ };
@@ -0,0 +1,57 @@
1
+ import { SigninServiceException as __BaseException } from "./SigninServiceException";
2
+ export class AccessDeniedException extends __BaseException {
3
+ name = "AccessDeniedException";
4
+ $fault = "client";
5
+ error;
6
+ constructor(opts) {
7
+ super({
8
+ name: "AccessDeniedException",
9
+ $fault: "client",
10
+ ...opts,
11
+ });
12
+ Object.setPrototypeOf(this, AccessDeniedException.prototype);
13
+ this.error = opts.error;
14
+ }
15
+ }
16
+ export class InternalServerException extends __BaseException {
17
+ name = "InternalServerException";
18
+ $fault = "server";
19
+ error;
20
+ constructor(opts) {
21
+ super({
22
+ name: "InternalServerException",
23
+ $fault: "server",
24
+ ...opts,
25
+ });
26
+ Object.setPrototypeOf(this, InternalServerException.prototype);
27
+ this.error = opts.error;
28
+ }
29
+ }
30
+ export class TooManyRequestsError extends __BaseException {
31
+ name = "TooManyRequestsError";
32
+ $fault = "client";
33
+ error;
34
+ constructor(opts) {
35
+ super({
36
+ name: "TooManyRequestsError",
37
+ $fault: "client",
38
+ ...opts,
39
+ });
40
+ Object.setPrototypeOf(this, TooManyRequestsError.prototype);
41
+ this.error = opts.error;
42
+ }
43
+ }
44
+ export class ValidationException extends __BaseException {
45
+ name = "ValidationException";
46
+ $fault = "client";
47
+ error;
48
+ constructor(opts) {
49
+ super({
50
+ name: "ValidationException",
51
+ $fault: "client",
52
+ ...opts,
53
+ });
54
+ Object.setPrototypeOf(this, ValidationException.prototype);
55
+ this.error = opts.error;
56
+ }
57
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,34 @@
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 { calculateBodyLength } from "@smithy/util-body-length-browser";
8
+ import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
9
+ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
10
+ import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
11
+ import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
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
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
23
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
24
+ createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
25
+ maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
26
+ region: config?.region ?? invalidProvider("Region is missing"),
27
+ requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
28
+ retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
29
+ sha256: config?.sha256 ?? Sha256,
30
+ streamCollector: config?.streamCollector ?? streamCollector,
31
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
32
+ useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
33
+ };
34
+ };
@@ -0,0 +1,51 @@
1
+ import packageInfo from "../package.json";
2
+ import { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
3
+ import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
4
+ import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node";
5
+ 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";
6
+ import { Hash } from "@smithy/hash-node";
7
+ import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
8
+ import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
9
+ import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
10
+ import { calculateBodyLength } from "@smithy/util-body-length-node";
11
+ import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
12
+ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
13
+ import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
14
+ import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
15
+ import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client";
16
+ export const getRuntimeConfig = (config) => {
17
+ emitWarningIfUnsupportedVersion(process.version);
18
+ const defaultsMode = resolveDefaultsModeConfig(config);
19
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
20
+ const clientSharedValues = getSharedRuntimeConfig(config);
21
+ awsCheckVersion(process.version);
22
+ const loaderConfig = {
23
+ profile: config?.profile,
24
+ logger: clientSharedValues.logger,
25
+ };
26
+ return {
27
+ ...clientSharedValues,
28
+ ...config,
29
+ runtime: "node",
30
+ defaultsMode,
31
+ authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
32
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
33
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
34
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
35
+ createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
36
+ maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
37
+ region: config?.region ??
38
+ loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
39
+ requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
40
+ retryMode: config?.retryMode ??
41
+ loadNodeConfig({
42
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
43
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
44
+ }, config),
45
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
46
+ streamCollector: config?.streamCollector ?? streamCollector,
47
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
48
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
49
+ userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
50
+ };
51
+ };
@@ -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,38 @@
1
+ import { AwsSdkSigV4Signer } from "@aws-sdk/core";
2
+ import { AwsRestJsonProtocol } 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 { defaultSigninHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider";
9
+ import { defaultEndpointResolver } from "./endpoint/endpointResolver";
10
+ export const getRuntimeConfig = (config) => {
11
+ return {
12
+ apiVersion: "2023-01-01",
13
+ base64Decoder: config?.base64Decoder ?? fromBase64,
14
+ base64Encoder: config?.base64Encoder ?? toBase64,
15
+ disableHostPrefix: config?.disableHostPrefix ?? false,
16
+ endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
17
+ extensions: config?.extensions ?? [],
18
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSigninHttpAuthSchemeProvider,
19
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
20
+ {
21
+ schemeId: "aws.auth#sigv4",
22
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
23
+ signer: new AwsSdkSigV4Signer(),
24
+ },
25
+ {
26
+ schemeId: "smithy.api#noAuth",
27
+ identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
28
+ signer: new NoAuthSigner(),
29
+ },
30
+ ],
31
+ logger: config?.logger ?? new NoOpLogger(),
32
+ protocol: config?.protocol ?? new AwsRestJsonProtocol({ defaultNamespace: "com.amazonaws.signin" }),
33
+ serviceId: config?.serviceId ?? "Signin",
34
+ urlParser: config?.urlParser ?? parseUrl,
35
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
36
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
37
+ };
38
+ };
@@ -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
+ };
@@ -0,0 +1,221 @@
1
+ const _ADE = "AccessDeniedException";
2
+ const _AT = "AccessToken";
3
+ const _COAT = "CreateOAuth2Token";
4
+ const _COATR = "CreateOAuth2TokenRequest";
5
+ const _COATRB = "CreateOAuth2TokenRequestBody";
6
+ const _COATRBr = "CreateOAuth2TokenResponseBody";
7
+ const _COATRr = "CreateOAuth2TokenResponse";
8
+ const _ISE = "InternalServerException";
9
+ const _RT = "RefreshToken";
10
+ const _TMRE = "TooManyRequestsError";
11
+ const _VE = "ValidationException";
12
+ const _aKI = "accessKeyId";
13
+ const _aT = "accessToken";
14
+ const _c = "client";
15
+ const _cI = "clientId";
16
+ const _cV = "codeVerifier";
17
+ const _co = "code";
18
+ const _e = "error";
19
+ const _eI = "expiresIn";
20
+ const _gT = "grantType";
21
+ const _h = "http";
22
+ const _hE = "httpError";
23
+ const _iT = "idToken";
24
+ const _jN = "jsonName";
25
+ const _m = "message";
26
+ const _rT = "refreshToken";
27
+ const _rU = "redirectUri";
28
+ const _s = "server";
29
+ const _sAK = "secretAccessKey";
30
+ const _sT = "sessionToken";
31
+ const _sm = "smithy.ts.sdk.synthetic.com.amazonaws.signin";
32
+ const _tI = "tokenInput";
33
+ const _tO = "tokenOutput";
34
+ const _tT = "tokenType";
35
+ const n0 = "com.amazonaws.signin";
36
+ import { TypeRegistry } from "@smithy/core/schema";
37
+ import { AccessDeniedException as __AccessDeniedException, InternalServerException as __InternalServerException, TooManyRequestsError as __TooManyRequestsError, ValidationException as __ValidationException, } from "../models/errors";
38
+ import { SigninServiceException as __SigninServiceException } from "../models/SigninServiceException";
39
+ export var RefreshToken = [0, n0, _RT, 8, 0];
40
+ export var AccessDeniedException = [
41
+ -3,
42
+ n0,
43
+ _ADE,
44
+ {
45
+ [_e]: _c,
46
+ },
47
+ [_e, _m],
48
+ [0, 0],
49
+ ];
50
+ TypeRegistry.for(n0).registerError(AccessDeniedException, __AccessDeniedException);
51
+ export var AccessToken = [
52
+ 3,
53
+ n0,
54
+ _AT,
55
+ 8,
56
+ [_aKI, _sAK, _sT],
57
+ [
58
+ [
59
+ 0,
60
+ {
61
+ [_jN]: _aKI,
62
+ },
63
+ ],
64
+ [
65
+ 0,
66
+ {
67
+ [_jN]: _sAK,
68
+ },
69
+ ],
70
+ [
71
+ 0,
72
+ {
73
+ [_jN]: _sT,
74
+ },
75
+ ],
76
+ ],
77
+ ];
78
+ export var CreateOAuth2TokenRequest = [
79
+ 3,
80
+ n0,
81
+ _COATR,
82
+ 0,
83
+ [_tI],
84
+ [[() => CreateOAuth2TokenRequestBody, 16]],
85
+ ];
86
+ export var CreateOAuth2TokenRequestBody = [
87
+ 3,
88
+ n0,
89
+ _COATRB,
90
+ 0,
91
+ [_cI, _gT, _co, _rU, _cV, _rT],
92
+ [
93
+ [
94
+ 0,
95
+ {
96
+ [_jN]: _cI,
97
+ },
98
+ ],
99
+ [
100
+ 0,
101
+ {
102
+ [_jN]: _gT,
103
+ },
104
+ ],
105
+ 0,
106
+ [
107
+ 0,
108
+ {
109
+ [_jN]: _rU,
110
+ },
111
+ ],
112
+ [
113
+ 0,
114
+ {
115
+ [_jN]: _cV,
116
+ },
117
+ ],
118
+ [
119
+ () => RefreshToken,
120
+ {
121
+ [_jN]: _rT,
122
+ },
123
+ ],
124
+ ],
125
+ ];
126
+ export var CreateOAuth2TokenResponse = [
127
+ 3,
128
+ n0,
129
+ _COATRr,
130
+ 0,
131
+ [_tO],
132
+ [[() => CreateOAuth2TokenResponseBody, 16]],
133
+ ];
134
+ export var CreateOAuth2TokenResponseBody = [
135
+ 3,
136
+ n0,
137
+ _COATRBr,
138
+ 0,
139
+ [_aT, _tT, _eI, _rT, _iT],
140
+ [
141
+ [
142
+ () => AccessToken,
143
+ {
144
+ [_jN]: _aT,
145
+ },
146
+ ],
147
+ [
148
+ 0,
149
+ {
150
+ [_jN]: _tT,
151
+ },
152
+ ],
153
+ [
154
+ 1,
155
+ {
156
+ [_jN]: _eI,
157
+ },
158
+ ],
159
+ [
160
+ () => RefreshToken,
161
+ {
162
+ [_jN]: _rT,
163
+ },
164
+ ],
165
+ [
166
+ 0,
167
+ {
168
+ [_jN]: _iT,
169
+ },
170
+ ],
171
+ ],
172
+ ];
173
+ export var InternalServerException = [
174
+ -3,
175
+ n0,
176
+ _ISE,
177
+ {
178
+ [_e]: _s,
179
+ [_hE]: 500,
180
+ },
181
+ [_e, _m],
182
+ [0, 0],
183
+ ];
184
+ TypeRegistry.for(n0).registerError(InternalServerException, __InternalServerException);
185
+ export var TooManyRequestsError = [
186
+ -3,
187
+ n0,
188
+ _TMRE,
189
+ {
190
+ [_e]: _c,
191
+ [_hE]: 429,
192
+ },
193
+ [_e, _m],
194
+ [0, 0],
195
+ ];
196
+ TypeRegistry.for(n0).registerError(TooManyRequestsError, __TooManyRequestsError);
197
+ export var ValidationException = [
198
+ -3,
199
+ n0,
200
+ _VE,
201
+ {
202
+ [_e]: _c,
203
+ [_hE]: 400,
204
+ },
205
+ [_e, _m],
206
+ [0, 0],
207
+ ];
208
+ TypeRegistry.for(n0).registerError(ValidationException, __ValidationException);
209
+ export var __Unit = "unit";
210
+ export var SigninServiceException = [-3, _sm, "SigninServiceException", 0, [], []];
211
+ TypeRegistry.for(_sm).registerError(SigninServiceException, __SigninServiceException);
212
+ export var CreateOAuth2Token = [
213
+ 9,
214
+ n0,
215
+ _COAT,
216
+ {
217
+ [_h]: ["POST", "/v1/token", 200],
218
+ },
219
+ () => CreateOAuth2TokenRequest,
220
+ () => CreateOAuth2TokenResponse,
221
+ ];
@@ -0,0 +1,18 @@
1
+ import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
2
+ import { CreateOAuth2TokenCommandInput, CreateOAuth2TokenCommandOutput } from "./commands/CreateOAuth2TokenCommand";
3
+ import { SigninClient } from "./SigninClient";
4
+ export interface Signin {
5
+ /**
6
+ * @see {@link CreateOAuth2TokenCommand}
7
+ */
8
+ createOAuth2Token(args: CreateOAuth2TokenCommandInput, options?: __HttpHandlerOptions): Promise<CreateOAuth2TokenCommandOutput>;
9
+ createOAuth2Token(args: CreateOAuth2TokenCommandInput, cb: (err: any, data?: CreateOAuth2TokenCommandOutput) => void): void;
10
+ createOAuth2Token(args: CreateOAuth2TokenCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateOAuth2TokenCommandOutput) => void): void;
11
+ }
12
+ /**
13
+ * AWS Sign-In manages authentication for AWS services. This service provides
14
+ * secure authentication flows for accessing AWS resources from the console and developer tools.
15
+ * @public
16
+ */
17
+ export declare class Signin extends SigninClient implements Signin {
18
+ }