7
7
HttpAuthSchemeParameters ,
8
8
HttpAuthSchemeParametersProvider ,
9
9
HttpAuthSchemeProvider ,
10
+ Provider ,
10
11
} from "@smithy/types" ;
11
- import { getSmithyContext } from "@smithy/util-middleware" ;
12
+ import { getSmithyContext , normalizeProvider } from "@smithy/util-middleware" ;
12
13
13
14
/**
14
15
* @internal
@@ -68,6 +69,14 @@ export const defaultRpcV2ProtocolHttpAuthSchemeProvider: RpcV2ProtocolHttpAuthSc
68
69
* @internal
69
70
*/
70
71
export interface HttpAuthSchemeInputConfig {
72
+ /**
73
+ * A comma-separated list of case-sensitive auth scheme names.
74
+ * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.
75
+ * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.
76
+ * @public
77
+ */
78
+ authSchemePreference ?: string [ ] | Provider < string [ ] > ;
79
+
71
80
/**
72
81
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
73
82
* @internal
@@ -85,6 +94,14 @@ export interface HttpAuthSchemeInputConfig {
85
94
* @internal
86
95
*/
87
96
export interface HttpAuthSchemeResolvedConfig {
97
+ /**
98
+ * A comma-separated list of case-sensitive auth scheme names.
99
+ * An auth scheme name is a fully qualified auth scheme ID with the namespace prefix trimmed.
100
+ * For example, the auth scheme with ID aws.auth#sigv4 is named sigv4.
101
+ * @public
102
+ */
103
+ readonly authSchemePreference : Provider < string [ ] > ;
104
+
88
105
/**
89
106
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
90
107
* @internal
@@ -104,5 +121,7 @@ export interface HttpAuthSchemeResolvedConfig {
104
121
export const resolveHttpAuthSchemeConfig = < T > (
105
122
config : T & HttpAuthSchemeInputConfig
106
123
) : T & HttpAuthSchemeResolvedConfig => {
107
- return Object . assign ( config , { } ) as T & HttpAuthSchemeResolvedConfig ;
124
+ return Object . assign ( config , {
125
+ authSchemePreference : normalizeProvider ( config . authSchemePreference ?? [ ] ) ,
126
+ } ) as T & HttpAuthSchemeResolvedConfig ;
108
127
} ;
0 commit comments