Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(clients): use default values according to defaultsMode config #3192

Merged
merged 1 commit into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions clients/client-accessanalyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
"@aws-sdk/util-base64-node": "3.46.0",
"@aws-sdk/util-body-length-browser": "3.46.0",
"@aws-sdk/util-body-length-node": "3.46.0",
"@aws-sdk/util-defaults-mode-browser": "3.0.0",
"@aws-sdk/util-defaults-mode-node": "3.0.0",
"@aws-sdk/util-user-agent-browser": "3.46.0",
"@aws-sdk/util-user-agent-node": "3.46.0",
"@aws-sdk/util-utf8-browser": "3.46.0",
Expand Down
6 changes: 6 additions & 0 deletions clients/client-accessanalyzer/src/AccessAnalyzerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http";
import {
Client as __Client,
DefaultsMode,
SmithyConfiguration as __SmithyConfiguration,
SmithyResolvedConfiguration as __SmithyResolvedConfiguration,
} from "@aws-sdk/smithy-client";
Expand Down Expand Up @@ -283,6 +284,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
* @internal
*/
defaultUserAgentProvider?: Provider<__UserAgent>;

/**
* The {@link DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
*/
defaultsMode?: DefaultsMode | Provider<DefaultsMode>;
}

type AccessAnalyzerClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
Expand Down
11 changes: 8 additions & 3 deletions clients/client-accessanalyzer/src/runtimeConfig.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import packageInfo from "../package.json"; // eslint-disable-line

import { Sha256 } from "@aws-crypto/sha256-browser";
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver";
import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
import { FetchHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
import { invalidProvider } from "@aws-sdk/invalid-dependency";
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry";
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser";
Expand All @@ -12,16 +12,21 @@ import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
import { AccessAnalyzerClientConfig } from "./AccessAnalyzerClient";
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser";

/**
* @internal
*/
export const getRuntimeConfig = (config: AccessAnalyzerClientConfig) => {
const defaultsMode = resolveDefaultsModeConfig(config);
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
const clientSharedValues = getSharedRuntimeConfig(config);
return {
...clientSharedValues,
...config,
runtime: "browser",
defaultsMode,
base64Decoder: config?.base64Decoder ?? fromBase64,
base64Encoder: config?.base64Encoder ?? toBase64,
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
Expand All @@ -32,8 +37,8 @@ export const getRuntimeConfig = (config: AccessAnalyzerClientConfig) => {
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
region: config?.region ?? invalidProvider("Region is missing"),
requestHandler: config?.requestHandler ?? new FetchHttpHandler(),
retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)),
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
sha256: config?.sha256 ?? Sha256,
streamCollector: config?.streamCollector ?? streamCollector,
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
Expand Down
22 changes: 18 additions & 4 deletions clients/client-accessanalyzer/src/runtimeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,34 @@ import {
} from "@aws-sdk/config-resolver";
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
import { Hash } from "@aws-sdk/hash-node";
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry";
import {
DEFAULT_RETRY_MODE,
NODE_MAX_ATTEMPT_CONFIG_OPTIONS,
NODE_RETRY_MODE_CONFIG_OPTIONS,
} from "@aws-sdk/middleware-retry";
import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider";
import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler";
import { NodeHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/node-http-handler";
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node";
import { calculateBodyLength } from "@aws-sdk/util-body-length-node";
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node";
import { AccessAnalyzerClientConfig } from "./AccessAnalyzerClient";
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node";

/**
* @internal
*/
export const getRuntimeConfig = (config: AccessAnalyzerClientConfig) => {
const defaultsMode = resolveDefaultsModeConfig(config);
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
const clientSharedValues = getSharedRuntimeConfig(config);
return {
...clientSharedValues,
...config,
runtime: "node",
defaultsMode,
base64Decoder: config?.base64Decoder ?? fromBase64,
base64Encoder: config?.base64Encoder ?? toBase64,
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
Expand All @@ -39,8 +48,13 @@ export const getRuntimeConfig = (config: AccessAnalyzerClientConfig) => {
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
requestHandler: config?.requestHandler ?? new NodeHttpHandler(),
retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS),
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
retryMode:
config?.retryMode ??
loadNodeConfig({
...NODE_RETRY_MODE_CONFIG_OPTIONS,
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
}),
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
streamCollector: config?.streamCollector ?? streamCollector,
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
Expand Down
2 changes: 2 additions & 0 deletions clients/client-account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
"@aws-sdk/util-base64-node": "3.46.0",
"@aws-sdk/util-body-length-browser": "3.46.0",
"@aws-sdk/util-body-length-node": "3.46.0",
"@aws-sdk/util-defaults-mode-browser": "3.0.0",
"@aws-sdk/util-defaults-mode-node": "3.0.0",
"@aws-sdk/util-user-agent-browser": "3.46.0",
"@aws-sdk/util-user-agent-node": "3.46.0",
"@aws-sdk/util-utf8-browser": "3.46.0",
Expand Down
6 changes: 6 additions & 0 deletions clients/client-account/src/AccountClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http";
import {
Client as __Client,
DefaultsMode,
SmithyConfiguration as __SmithyConfiguration,
SmithyResolvedConfiguration as __SmithyResolvedConfiguration,
} from "@aws-sdk/smithy-client";
Expand Down Expand Up @@ -193,6 +194,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
* @internal
*/
defaultUserAgentProvider?: Provider<__UserAgent>;

/**
* The {@link DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
*/
defaultsMode?: DefaultsMode | Provider<DefaultsMode>;
}

type AccountClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
Expand Down
11 changes: 8 additions & 3 deletions clients/client-account/src/runtimeConfig.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import packageInfo from "../package.json"; // eslint-disable-line

import { Sha256 } from "@aws-crypto/sha256-browser";
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver";
import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
import { FetchHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
import { invalidProvider } from "@aws-sdk/invalid-dependency";
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry";
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser";
Expand All @@ -12,16 +12,21 @@ import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
import { AccountClientConfig } from "./AccountClient";
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser";

/**
* @internal
*/
export const getRuntimeConfig = (config: AccountClientConfig) => {
const defaultsMode = resolveDefaultsModeConfig(config);
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
const clientSharedValues = getSharedRuntimeConfig(config);
return {
...clientSharedValues,
...config,
runtime: "browser",
defaultsMode,
base64Decoder: config?.base64Decoder ?? fromBase64,
base64Encoder: config?.base64Encoder ?? toBase64,
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
Expand All @@ -32,8 +37,8 @@ export const getRuntimeConfig = (config: AccountClientConfig) => {
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
region: config?.region ?? invalidProvider("Region is missing"),
requestHandler: config?.requestHandler ?? new FetchHttpHandler(),
retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)),
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
sha256: config?.sha256 ?? Sha256,
streamCollector: config?.streamCollector ?? streamCollector,
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
Expand Down
22 changes: 18 additions & 4 deletions clients/client-account/src/runtimeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,34 @@ import {
} from "@aws-sdk/config-resolver";
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
import { Hash } from "@aws-sdk/hash-node";
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry";
import {
DEFAULT_RETRY_MODE,
NODE_MAX_ATTEMPT_CONFIG_OPTIONS,
NODE_RETRY_MODE_CONFIG_OPTIONS,
} from "@aws-sdk/middleware-retry";
import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider";
import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler";
import { NodeHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/node-http-handler";
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node";
import { calculateBodyLength } from "@aws-sdk/util-body-length-node";
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node";
import { AccountClientConfig } from "./AccountClient";
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node";

/**
* @internal
*/
export const getRuntimeConfig = (config: AccountClientConfig) => {
const defaultsMode = resolveDefaultsModeConfig(config);
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
const clientSharedValues = getSharedRuntimeConfig(config);
return {
...clientSharedValues,
...config,
runtime: "node",
defaultsMode,
base64Decoder: config?.base64Decoder ?? fromBase64,
base64Encoder: config?.base64Encoder ?? toBase64,
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
Expand All @@ -39,8 +48,13 @@ export const getRuntimeConfig = (config: AccountClientConfig) => {
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
requestHandler: config?.requestHandler ?? new NodeHttpHandler(),
retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS),
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
retryMode:
config?.retryMode ??
loadNodeConfig({
...NODE_RETRY_MODE_CONFIG_OPTIONS,
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
}),
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
streamCollector: config?.streamCollector ?? streamCollector,
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
Expand Down
2 changes: 2 additions & 0 deletions clients/client-acm-pca/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
"@aws-sdk/util-base64-node": "3.46.0",
"@aws-sdk/util-body-length-browser": "3.46.0",
"@aws-sdk/util-body-length-node": "3.46.0",
"@aws-sdk/util-defaults-mode-browser": "3.0.0",
"@aws-sdk/util-defaults-mode-node": "3.0.0",
"@aws-sdk/util-user-agent-browser": "3.46.0",
"@aws-sdk/util-user-agent-node": "3.46.0",
"@aws-sdk/util-utf8-browser": "3.46.0",
Expand Down
6 changes: 6 additions & 0 deletions clients/client-acm-pca/src/ACMPCAClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http";
import {
Client as __Client,
DefaultsMode,
SmithyConfiguration as __SmithyConfiguration,
SmithyResolvedConfiguration as __SmithyResolvedConfiguration,
} from "@aws-sdk/smithy-client";
Expand Down Expand Up @@ -283,6 +284,11 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
* @internal
*/
defaultUserAgentProvider?: Provider<__UserAgent>;

/**
* The {@link DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
*/
defaultsMode?: DefaultsMode | Provider<DefaultsMode>;
}

type ACMPCAClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
Expand Down
11 changes: 8 additions & 3 deletions clients/client-acm-pca/src/runtimeConfig.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import packageInfo from "../package.json"; // eslint-disable-line

import { Sha256 } from "@aws-crypto/sha256-browser";
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver";
import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
import { FetchHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
import { invalidProvider } from "@aws-sdk/invalid-dependency";
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry";
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser";
Expand All @@ -12,16 +12,21 @@ import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
import { ACMPCAClientConfig } from "./ACMPCAClient";
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser";

/**
* @internal
*/
export const getRuntimeConfig = (config: ACMPCAClientConfig) => {
const defaultsMode = resolveDefaultsModeConfig(config);
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
const clientSharedValues = getSharedRuntimeConfig(config);
return {
...clientSharedValues,
...config,
runtime: "browser",
defaultsMode,
base64Decoder: config?.base64Decoder ?? fromBase64,
base64Encoder: config?.base64Encoder ?? toBase64,
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
Expand All @@ -32,8 +37,8 @@ export const getRuntimeConfig = (config: ACMPCAClientConfig) => {
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
region: config?.region ?? invalidProvider("Region is missing"),
requestHandler: config?.requestHandler ?? new FetchHttpHandler(),
retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)),
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
sha256: config?.sha256 ?? Sha256,
streamCollector: config?.streamCollector ?? streamCollector,
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
Expand Down
22 changes: 18 additions & 4 deletions clients/client-acm-pca/src/runtimeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,34 @@ import {
} from "@aws-sdk/config-resolver";
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
import { Hash } from "@aws-sdk/hash-node";
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry";
import {
DEFAULT_RETRY_MODE,
NODE_MAX_ATTEMPT_CONFIG_OPTIONS,
NODE_RETRY_MODE_CONFIG_OPTIONS,
} from "@aws-sdk/middleware-retry";
import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider";
import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler";
import { NodeHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/node-http-handler";
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node";
import { calculateBodyLength } from "@aws-sdk/util-body-length-node";
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node";
import { ACMPCAClientConfig } from "./ACMPCAClient";
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node";

/**
* @internal
*/
export const getRuntimeConfig = (config: ACMPCAClientConfig) => {
const defaultsMode = resolveDefaultsModeConfig(config);
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
const clientSharedValues = getSharedRuntimeConfig(config);
return {
...clientSharedValues,
...config,
runtime: "node",
defaultsMode,
base64Decoder: config?.base64Decoder ?? fromBase64,
base64Encoder: config?.base64Encoder ?? toBase64,
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
Expand All @@ -39,8 +48,13 @@ export const getRuntimeConfig = (config: ACMPCAClientConfig) => {
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
requestHandler: config?.requestHandler ?? new NodeHttpHandler(),
retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS),
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
retryMode:
config?.retryMode ??
loadNodeConfig({
...NODE_RETRY_MODE_CONFIG_OPTIONS,
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
}),
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
streamCollector: config?.streamCollector ?? streamCollector,
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
Expand Down
Loading