Skip to content

Commit 3f0d93f

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

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
TokenIdentity,
1212
TokenIdentityProvider,
1313
} from "@smithy/types";
14-
import { getSmithyContext } from "@smithy/util-middleware";
14+
import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";
1515

1616
import { CodeCatalystClientResolvedConfig } from "../CodeCatalystClient";
1717

@@ -89,6 +89,11 @@ export const defaultCodeCatalystHttpAuthSchemeProvider: CodeCatalystHttpAuthSche
8989
* @internal
9090
*/
9191
export interface HttpAuthSchemeInputConfig {
92+
/**
93+
* 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
94+
*/
95+
authSchemePreference?: string[] | Provider<string[]>;
96+
9297
/**
9398
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
9499
* @internal
@@ -111,6 +116,11 @@ export interface HttpAuthSchemeInputConfig {
111116
* @internal
112117
*/
113118
export interface HttpAuthSchemeResolvedConfig {
119+
/**
120+
* 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
121+
*/
122+
readonly authSchemePreference: Provider<string[]>;
123+
114124
/**
115125
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
116126
* @internal
@@ -137,6 +147,7 @@ export const resolveHttpAuthSchemeConfig = <T>(
137147
): T & HttpAuthSchemeResolvedConfig => {
138148
const token = memoizeIdentityProvider(config.token, isIdentityExpired, doesIdentityRequireRefresh);
139149
return Object.assign(config, {
150+
authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
140151
token,
141152
}) as T & HttpAuthSchemeResolvedConfig;
142153
};

0 commit comments

Comments
 (0)