@aws-sdk/client-sso-oidc 3.1075.0 → 3.1076.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ export declare const getRuntimeConfig: (config: SSOOIDCClientConfig) => {
14
14
  requestHandler: import("@smithy/core/protocols").HttpHandler<any> | RequestHandler;
15
15
  retryMode: string | import("@smithy/types").Provider<string>;
16
16
  sha256: import("@smithy/types").HashConstructor;
17
- streamCollector: import("@smithy/types").StreamCollector;
17
+ streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
18
18
  useDualstackEndpoint: (boolean | import("@smithy/types").Provider<boolean>) & (boolean | import("@smithy/types").Provider<boolean | undefined>);
19
19
  useFipsEndpoint: (boolean | import("@smithy/types").Provider<boolean>) & (boolean | import("@smithy/types").Provider<boolean | undefined>);
20
20
  cacheMiddleware?: boolean | undefined;
@@ -15,7 +15,7 @@ export declare const getRuntimeConfig: (config: SSOOIDCClientConfig) => {
15
15
  requestHandler: RequestHandler | import("@smithy/core/protocols").HttpHandler<any>;
16
16
  retryMode: string | import("@smithy/types").Provider<string>;
17
17
  sha256: import("@smithy/types").HashConstructor;
18
- streamCollector: import("@smithy/types").StreamCollector;
18
+ streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
19
19
  useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
20
20
  useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
21
21
  userAgentAppId: string | import("@smithy/types").Provider<string | undefined>;
@@ -15,7 +15,7 @@ export declare const getRuntimeConfig: (config: SSOOIDCClientConfig) => {
15
15
  apiVersion: string;
16
16
  urlParser: import("@smithy/types").UrlParser;
17
17
  bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
18
- streamCollector: import("@smithy/types").StreamCollector;
18
+ streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
19
19
  base64Decoder: import("@smithy/types").Decoder;
20
20
  base64Encoder: (_input: Uint8Array | string) => string;
21
21
  utf8Decoder: import("@smithy/types").Decoder;
@@ -21,7 +21,13 @@ export declare const getRuntimeConfig: (config: SSOOIDCClientConfig) => {
21
21
  | RequestHandler;
22
22
  retryMode: string | import("@smithy/types").Provider<string>;
23
23
  sha256: import("@smithy/types").HashConstructor;
24
- streamCollector: import("@smithy/types").StreamCollector;
24
+ streamCollector: (
25
+ stream:
26
+ | import("stream").Readable
27
+ | import("stream/web").ReadableStream
28
+ | ReadableStream
29
+ | Blob
30
+ ) => Promise<Uint8Array>;
25
31
  useDualstackEndpoint: (boolean | import("@smithy/types").Provider<boolean>) &
26
32
  (boolean | import("@smithy/types").Provider<boolean | undefined>);
27
33
  useFipsEndpoint: (boolean | import("@smithy/types").Provider<boolean>) &
@@ -22,7 +22,13 @@ export declare const getRuntimeConfig: (config: SSOOIDCClientConfig) => {
22
22
  | import("@smithy/core/protocols").HttpHandler<any>;
23
23
  retryMode: string | import("@smithy/types").Provider<string>;
24
24
  sha256: import("@smithy/types").HashConstructor;
25
- streamCollector: import("@smithy/types").StreamCollector;
25
+ streamCollector: (
26
+ stream:
27
+ | import("stream").Readable
28
+ | import("stream/web").ReadableStream
29
+ | ReadableStream
30
+ | Blob
31
+ ) => Promise<Uint8Array>;
26
32
  useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
27
33
  useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
28
34
  userAgentAppId: string | import("@smithy/types").Provider<string | undefined>;
@@ -20,7 +20,13 @@ export declare const getRuntimeConfig: (config: SSOOIDCClientConfig) => {
20
20
  apiVersion: string;
21
21
  urlParser: import("@smithy/types").UrlParser;
22
22
  bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
23
- streamCollector: import("@smithy/types").StreamCollector;
23
+ streamCollector: (
24
+ stream:
25
+ | import("stream").Readable
26
+ | import("stream/web").ReadableStream
27
+ | ReadableStream
28
+ | Blob
29
+ ) => Promise<Uint8Array>;
24
30
  base64Decoder: import("@smithy/types").Decoder;
25
31
  base64Encoder: (_input: Uint8Array | string) => string;
26
32
  utf8Decoder: import("@smithy/types").Decoder;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sso-oidc",
3
3
  "description": "AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native",
4
- "version": "3.1075.0",
4
+ "version": "3.1076.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
7
7
  "build:cjs": "node ../../scripts/compilation/inline",
@@ -25,17 +25,17 @@
25
25
  "dependencies": {
26
26
  "@aws-crypto/sha256-browser": "5.2.0",
27
27
  "@aws-crypto/sha256-js": "5.2.0",
28
- "@aws-sdk/core": "^3.974.23",
29
- "@aws-sdk/credential-provider-node": "^3.972.58",
30
- "@aws-sdk/types": "^3.973.13",
31
- "@smithy/core": "^3.24.6",
32
- "@smithy/fetch-http-handler": "^5.4.6",
33
- "@smithy/node-http-handler": "^4.7.6",
34
- "@smithy/types": "^4.14.3",
28
+ "@aws-sdk/core": "^3.974.24",
29
+ "@aws-sdk/credential-provider-node": "^3.972.59",
30
+ "@aws-sdk/types": "^3.973.14",
31
+ "@smithy/core": "^3.27.0",
32
+ "@smithy/fetch-http-handler": "^5.6.0",
33
+ "@smithy/node-http-handler": "^4.9.0",
34
+ "@smithy/types": "^4.15.0",
35
35
  "tslib": "^2.6.2"
36
36
  },
37
37
  "devDependencies": {
38
- "@smithy/snapshot-testing": "^2.1.7",
38
+ "@smithy/snapshot-testing": "^2.2.3",
39
39
  "@tsconfig/node20": "20.1.8",
40
40
  "@types/node": "^20.14.8",
41
41
  "concurrently": "7.0.0",
@@ -1,63 +0,0 @@
1
- const { resolveAwsSdkSigV4Config } = require("@aws-sdk/core/httpAuthSchemes");
2
- const { getSmithyContext, normalizeProvider } = require("@smithy/core/client");
3
- exports.defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context, input) => {
4
- return {
5
- operation: getSmithyContext(context).operation,
6
- region: await normalizeProvider(config.region)() || (() => {
7
- throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
8
- })(),
9
- };
10
- };
11
- function createAwsAuthSigv4HttpAuthOption(authParameters) {
12
- return {
13
- schemeId: "aws.auth#sigv4",
14
- signingProperties: {
15
- name: "sso-oauth",
16
- region: authParameters.region,
17
- },
18
- propertiesExtractor: (config, context) => ({
19
- signingProperties: {
20
- config,
21
- context,
22
- },
23
- }),
24
- };
25
- }
26
- function createSmithyApiNoAuthHttpAuthOption(authParameters) {
27
- return {
28
- schemeId: "smithy.api#noAuth",
29
- };
30
- }
31
- exports.defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => {
32
- const options = [];
33
- switch (authParameters.operation) {
34
- case "CreateToken":
35
- {
36
- options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
37
- break;
38
- }
39
- ;
40
- case "RegisterClient":
41
- {
42
- options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
43
- break;
44
- }
45
- ;
46
- case "StartDeviceAuthorization":
47
- {
48
- options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
49
- break;
50
- }
51
- ;
52
- default: {
53
- options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
54
- }
55
- }
56
- return options;
57
- };
58
- exports.resolveHttpAuthSchemeConfig = (config) => {
59
- const config_0 = resolveAwsSdkSigV4Config(config);
60
- return Object.assign(config_0, {
61
- authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
62
- });
63
- };
@@ -1,49 +0,0 @@
1
- const { BinaryDecisionDiagram } = require("@smithy/core/endpoints");
2
- const k = "ref";
3
- const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "booleanEquals", f = "getAttr", g = { [k]: "Endpoint" }, h = { [k]: d }, i = {}, j = [{ [k]: "Region" }];
4
- const _data = {
5
- conditions: [
6
- [c, [g]],
7
- [c, j],
8
- ["aws.partition", j, d],
9
- [e, [{ [k]: "UseFIPS" }, b]],
10
- [e, [{ [k]: "UseDualStack" }, b]],
11
- [e, [{ fn: f, argv: [h, "supportsDualStack"] }, b]],
12
- [e, [{ fn: f, argv: [h, "supportsFIPS"] }, b]],
13
- ["stringEquals", [{ fn: f, argv: [h, "name"] }, "aws-us-gov"]]
14
- ],
15
- results: [
16
- [a],
17
- [a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
18
- [a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
19
- [g, i],
20
- ["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", i],
21
- [a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
22
- ["https://oidc.{Region}.amazonaws.com", i],
23
- ["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", i],
24
- [a, "FIPS is enabled but this partition does not support FIPS"],
25
- ["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", i],
26
- [a, "DualStack is enabled but this partition does not support DualStack"],
27
- ["https://oidc.{Region}.{PartitionResult#dnsSuffix}", i],
28
- [a, "Invalid Configuration: Missing Region"]
29
- ]
30
- };
31
- const root = 2;
32
- const r = 100_000_000;
33
- const nodes = new Int32Array([
34
- -1, 1, -1,
35
- 0, 13, 3,
36
- 1, 4, r + 12,
37
- 2, 5, r + 12,
38
- 3, 8, 6,
39
- 4, 7, r + 11,
40
- 5, r + 9, r + 10,
41
- 4, 11, 9,
42
- 6, 10, r + 8,
43
- 7, r + 6, r + 7,
44
- 5, 12, r + 5,
45
- 6, r + 4, r + 5,
46
- 3, r + 1, 14,
47
- 4, r + 2, r + 3,
48
- ]);
49
- exports.bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
@@ -1,14 +0,0 @@
1
- const { awsEndpointFunctions } = require("@aws-sdk/core/client");
2
- const { customEndpointFunctions, decideEndpoint, EndpointCache } = require("@smithy/core/endpoints");
3
- const { bdd } = require("./bdd");
4
- const cache = new EndpointCache({
5
- size: 50,
6
- params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
7
- });
8
- exports.defaultEndpointResolver = (endpointParams, context = {}) => {
9
- return cache.get(endpointParams, () => decideEndpoint(bdd, {
10
- endpointParams: endpointParams,
11
- logger: context.logger,
12
- }));
13
- };
14
- customEndpointFunctions.aws = awsEndpointFunctions;
@@ -1,8 +0,0 @@
1
- const { ServiceException: __ServiceException } = require("@smithy/core/client");
2
- exports.__ServiceException = __ServiceException;
3
- exports.SSOOIDCServiceException = class SSOOIDCServiceException extends __ServiceException {
4
- constructor(options) {
5
- super(options);
6
- Object.setPrototypeOf(this, SSOOIDCServiceException.prototype);
7
- }
8
- };
@@ -1,233 +0,0 @@
1
- const { SSOOIDCServiceException: __BaseException } = require("./SSOOIDCServiceException");
2
- exports.AccessDeniedException = class AccessDeniedException extends __BaseException {
3
- name = "AccessDeniedException";
4
- $fault = "client";
5
- error;
6
- reason;
7
- error_description;
8
- constructor(opts) {
9
- super({
10
- name: "AccessDeniedException",
11
- $fault: "client",
12
- ...opts,
13
- });
14
- Object.setPrototypeOf(this, AccessDeniedException.prototype);
15
- this.error = opts.error;
16
- this.reason = opts.reason;
17
- this.error_description = opts.error_description;
18
- }
19
- };
20
- exports.AuthorizationPendingException = class AuthorizationPendingException extends __BaseException {
21
- name = "AuthorizationPendingException";
22
- $fault = "client";
23
- error;
24
- error_description;
25
- constructor(opts) {
26
- super({
27
- name: "AuthorizationPendingException",
28
- $fault: "client",
29
- ...opts,
30
- });
31
- Object.setPrototypeOf(this, AuthorizationPendingException.prototype);
32
- this.error = opts.error;
33
- this.error_description = opts.error_description;
34
- }
35
- };
36
- exports.ExpiredTokenException = class ExpiredTokenException extends __BaseException {
37
- name = "ExpiredTokenException";
38
- $fault = "client";
39
- error;
40
- error_description;
41
- constructor(opts) {
42
- super({
43
- name: "ExpiredTokenException",
44
- $fault: "client",
45
- ...opts,
46
- });
47
- Object.setPrototypeOf(this, ExpiredTokenException.prototype);
48
- this.error = opts.error;
49
- this.error_description = opts.error_description;
50
- }
51
- };
52
- exports.InternalServerException = class InternalServerException extends __BaseException {
53
- name = "InternalServerException";
54
- $fault = "server";
55
- error;
56
- error_description;
57
- constructor(opts) {
58
- super({
59
- name: "InternalServerException",
60
- $fault: "server",
61
- ...opts,
62
- });
63
- Object.setPrototypeOf(this, InternalServerException.prototype);
64
- this.error = opts.error;
65
- this.error_description = opts.error_description;
66
- }
67
- };
68
- exports.InvalidClientException = class InvalidClientException extends __BaseException {
69
- name = "InvalidClientException";
70
- $fault = "client";
71
- error;
72
- error_description;
73
- constructor(opts) {
74
- super({
75
- name: "InvalidClientException",
76
- $fault: "client",
77
- ...opts,
78
- });
79
- Object.setPrototypeOf(this, InvalidClientException.prototype);
80
- this.error = opts.error;
81
- this.error_description = opts.error_description;
82
- }
83
- };
84
- exports.InvalidGrantException = class InvalidGrantException extends __BaseException {
85
- name = "InvalidGrantException";
86
- $fault = "client";
87
- error;
88
- error_description;
89
- constructor(opts) {
90
- super({
91
- name: "InvalidGrantException",
92
- $fault: "client",
93
- ...opts,
94
- });
95
- Object.setPrototypeOf(this, InvalidGrantException.prototype);
96
- this.error = opts.error;
97
- this.error_description = opts.error_description;
98
- }
99
- };
100
- exports.InvalidRequestException = class InvalidRequestException extends __BaseException {
101
- name = "InvalidRequestException";
102
- $fault = "client";
103
- error;
104
- reason;
105
- error_description;
106
- constructor(opts) {
107
- super({
108
- name: "InvalidRequestException",
109
- $fault: "client",
110
- ...opts,
111
- });
112
- Object.setPrototypeOf(this, InvalidRequestException.prototype);
113
- this.error = opts.error;
114
- this.reason = opts.reason;
115
- this.error_description = opts.error_description;
116
- }
117
- };
118
- exports.InvalidScopeException = class InvalidScopeException extends __BaseException {
119
- name = "InvalidScopeException";
120
- $fault = "client";
121
- error;
122
- error_description;
123
- constructor(opts) {
124
- super({
125
- name: "InvalidScopeException",
126
- $fault: "client",
127
- ...opts,
128
- });
129
- Object.setPrototypeOf(this, InvalidScopeException.prototype);
130
- this.error = opts.error;
131
- this.error_description = opts.error_description;
132
- }
133
- };
134
- exports.SlowDownException = class SlowDownException extends __BaseException {
135
- name = "SlowDownException";
136
- $fault = "client";
137
- error;
138
- error_description;
139
- constructor(opts) {
140
- super({
141
- name: "SlowDownException",
142
- $fault: "client",
143
- ...opts,
144
- });
145
- Object.setPrototypeOf(this, SlowDownException.prototype);
146
- this.error = opts.error;
147
- this.error_description = opts.error_description;
148
- }
149
- };
150
- exports.UnauthorizedClientException = class UnauthorizedClientException extends __BaseException {
151
- name = "UnauthorizedClientException";
152
- $fault = "client";
153
- error;
154
- error_description;
155
- constructor(opts) {
156
- super({
157
- name: "UnauthorizedClientException",
158
- $fault: "client",
159
- ...opts,
160
- });
161
- Object.setPrototypeOf(this, UnauthorizedClientException.prototype);
162
- this.error = opts.error;
163
- this.error_description = opts.error_description;
164
- }
165
- };
166
- exports.UnsupportedGrantTypeException = class UnsupportedGrantTypeException extends __BaseException {
167
- name = "UnsupportedGrantTypeException";
168
- $fault = "client";
169
- error;
170
- error_description;
171
- constructor(opts) {
172
- super({
173
- name: "UnsupportedGrantTypeException",
174
- $fault: "client",
175
- ...opts,
176
- });
177
- Object.setPrototypeOf(this, UnsupportedGrantTypeException.prototype);
178
- this.error = opts.error;
179
- this.error_description = opts.error_description;
180
- }
181
- };
182
- exports.InvalidRequestRegionException = class InvalidRequestRegionException extends __BaseException {
183
- name = "InvalidRequestRegionException";
184
- $fault = "client";
185
- error;
186
- error_description;
187
- endpoint;
188
- region;
189
- constructor(opts) {
190
- super({
191
- name: "InvalidRequestRegionException",
192
- $fault: "client",
193
- ...opts,
194
- });
195
- Object.setPrototypeOf(this, InvalidRequestRegionException.prototype);
196
- this.error = opts.error;
197
- this.error_description = opts.error_description;
198
- this.endpoint = opts.endpoint;
199
- this.region = opts.region;
200
- }
201
- };
202
- exports.InvalidClientMetadataException = class InvalidClientMetadataException extends __BaseException {
203
- name = "InvalidClientMetadataException";
204
- $fault = "client";
205
- error;
206
- error_description;
207
- constructor(opts) {
208
- super({
209
- name: "InvalidClientMetadataException",
210
- $fault: "client",
211
- ...opts,
212
- });
213
- Object.setPrototypeOf(this, InvalidClientMetadataException.prototype);
214
- this.error = opts.error;
215
- this.error_description = opts.error_description;
216
- }
217
- };
218
- exports.InvalidRedirectUriException = class InvalidRedirectUriException extends __BaseException {
219
- name = "InvalidRedirectUriException";
220
- $fault = "client";
221
- error;
222
- error_description;
223
- constructor(opts) {
224
- super({
225
- name: "InvalidRedirectUriException",
226
- $fault: "client",
227
- ...opts,
228
- });
229
- Object.setPrototypeOf(this, InvalidRedirectUriException.prototype);
230
- this.error = opts.error;
231
- this.error_description = opts.error_description;
232
- }
233
- };
@@ -1,32 +0,0 @@
1
- const packageInfo = require("../package.json");
2
- const { Sha256 } = require("@aws-crypto/sha256-browser");
3
- const { createDefaultUserAgentProvider } = require("@aws-sdk/core/client");
4
- const { invalidProvider, loadConfigsForDefaultMode } = require("@smithy/core/client");
5
- const { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT, resolveDefaultsModeConfig } = require("@smithy/core/config");
6
- const { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } = require("@smithy/core/retry");
7
- const { calculateBodyLength } = require("@smithy/core/serde");
8
- const { FetchHttpHandler: RequestHandler, streamCollector } = require("@smithy/fetch-http-handler");
9
- const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
10
- const getRuntimeConfig = (config) => {
11
- const defaultsMode = resolveDefaultsModeConfig(config);
12
- const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
13
- const clientSharedValues = getSharedRuntimeConfig(config);
14
- return {
15
- ...clientSharedValues,
16
- ...config,
17
- runtime: "browser",
18
- defaultsMode,
19
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
20
- credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
21
- defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
22
- maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
23
- region: config?.region ?? invalidProvider("Region is missing"),
24
- requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
25
- retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
26
- sha256: config?.sha256 ?? Sha256,
27
- streamCollector: config?.streamCollector ?? streamCollector,
28
- useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
29
- useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
30
- };
31
- };
32
- exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,45 +0,0 @@
1
- const packageInfo = require("../package.json");
2
- const { createDefaultUserAgentProvider, emitWarningIfUnsupportedVersion: awsCheckVersion, NODE_APP_ID_CONFIG_OPTIONS } = require("@aws-sdk/core/client");
3
- const { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS } = require("@aws-sdk/core/httpAuthSchemes");
4
- const { defaultProvider: credentialDefaultProvider } = require("@aws-sdk/credential-provider-node");
5
- const { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } = require("@smithy/core/client");
6
- const { loadConfig: loadNodeConfig, NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, resolveDefaultsModeConfig } = require("@smithy/core/config");
7
- const { DEFAULT_RETRY_MODE, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } = require("@smithy/core/retry");
8
- const { calculateBodyLength, Hash } = require("@smithy/core/serde");
9
- const { NodeHttpHandler: RequestHandler, streamCollector } = require("@smithy/node-http-handler");
10
- const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
11
- const getRuntimeConfig = (config) => {
12
- emitWarningIfUnsupportedVersion(process.version);
13
- const defaultsMode = resolveDefaultsModeConfig(config);
14
- const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
15
- const clientSharedValues = getSharedRuntimeConfig(config);
16
- awsCheckVersion(process.version);
17
- const loaderConfig = {
18
- profile: config?.profile,
19
- logger: clientSharedValues.logger,
20
- };
21
- return {
22
- ...clientSharedValues,
23
- ...config,
24
- runtime: "node",
25
- defaultsMode,
26
- authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
27
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
28
- credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
29
- defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
30
- maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
31
- region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
32
- requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
33
- retryMode: config?.retryMode ??
34
- loadNodeConfig({
35
- ...NODE_RETRY_MODE_CONFIG_OPTIONS,
36
- default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
37
- }, config),
38
- sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
39
- streamCollector: config?.streamCollector ?? streamCollector,
40
- useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
41
- useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
42
- userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
43
- };
44
- };
45
- exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,12 +0,0 @@
1
- const { Sha256 } = require("@aws-crypto/sha256-js");
2
- const { getRuntimeConfig: getBrowserRuntimeConfig } = require("./runtimeConfig.browser");
3
- const getRuntimeConfig = (config) => {
4
- const browserDefaults = getBrowserRuntimeConfig(config);
5
- return {
6
- ...browserDefaults,
7
- ...config,
8
- runtime: "react-native",
9
- sha256: config?.sha256 ?? Sha256,
10
- };
11
- };
12
- exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,44 +0,0 @@
1
- const { AwsSdkSigV4Signer } = require("@aws-sdk/core/httpAuthSchemes");
2
- const { AwsRestJsonProtocol } = require("@aws-sdk/core/protocols");
3
- const { NoAuthSigner } = require("@smithy/core");
4
- const { NoOpLogger } = require("@smithy/core/client");
5
- const { parseUrl } = require("@smithy/core/protocols");
6
- const { fromBase64, fromUtf8, toBase64, toUtf8 } = require("@smithy/core/serde");
7
- const { defaultSSOOIDCHttpAuthSchemeProvider } = require("./auth/httpAuthSchemeProvider");
8
- const { defaultEndpointResolver } = require("./endpoint/endpointResolver");
9
- const { errorTypeRegistries } = require("./schemas/schemas_0");
10
- exports.getRuntimeConfig = (config) => {
11
- return {
12
- apiVersion: "2019-06-10",
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 ?? defaultSSOOIDCHttpAuthSchemeProvider,
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 ?? AwsRestJsonProtocol,
33
- protocolSettings: config?.protocolSettings ?? {
34
- defaultNamespace: "com.amazonaws.ssooidc",
35
- errorTypeRegistries,
36
- version: "2019-06-10",
37
- serviceTarget: "AWSSSOOIDCService",
38
- },
39
- serviceId: config?.serviceId ?? "SSO OIDC",
40
- urlParser: config?.urlParser ?? parseUrl,
41
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
42
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
43
- };
44
- };