Skip to content

Commit 803eadc

Browse files
committed
chore(client-codecatalyst): add config authSchemePreference
1 parent 66fdd56 commit 803eadc

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

clients/client-codecatalyst/src/auth/httpAuthSchemeProvider.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ import {
88
HttpAuthSchemeParameters,
99
HttpAuthSchemeParametersProvider,
1010
HttpAuthSchemeProvider,
11+
Provider,
1112
TokenIdentity,
1213
TokenIdentityProvider,
1314
} from "@smithy/types";
14-
import { getSmithyContext } from "@smithy/util-middleware";
15+
import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";
1516

1617
import { CodeCatalystClientResolvedConfig } from "../CodeCatalystClient";
1718

@@ -89,6 +90,11 @@ export const defaultCodeCatalystHttpAuthSchemeProvider: CodeCatalystHttpAuthSche
8990
* @internal
9091
*/
9192
export interface HttpAuthSchemeInputConfig {
93+
/**
94+
* A comma-separated list of case-sensitive auth scheme names. An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. @public
95+
*/
96+
authSchemePreference?: string[] | Provider<string[]>;
97+
9298
/**
9399
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
94100
* @internal
@@ -111,6 +117,11 @@ export interface HttpAuthSchemeInputConfig {
111117
* @internal
112118
*/
113119
export interface HttpAuthSchemeResolvedConfig {
120+
/**
121+
* A comma-separated list of case-sensitive auth scheme names. An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed. For example, the auth scheme with ID aws.auth#sigv4 is named sigv4. @public
122+
*/
123+
readonly authSchemePreference: Provider<string[]>;
124+
114125
/**
115126
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
116127
* @internal
@@ -137,6 +148,7 @@ export const resolveHttpAuthSchemeConfig = <T>(
137148
): T & HttpAuthSchemeResolvedConfig => {
138149
const token = memoizeIdentityProvider(config.token, isIdentityExpired, doesIdentityRequireRefresh);
139150
return Object.assign(config, {
151+
authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
140152
token,
141153
}) as T & HttpAuthSchemeResolvedConfig;
142154
};

0 commit comments

Comments
 (0)