@@ -7,20 +7,18 @@ import {
7
7
} from "@aws-sdk/middleware-host-header" ;
8
8
import { getLoggerPlugin } from "@aws-sdk/middleware-logger" ;
9
9
import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection" ;
10
- import {
11
- AwsAuthInputConfig ,
12
- AwsAuthResolvedConfig ,
13
- getAwsAuthPlugin ,
14
- resolveAwsAuthConfig ,
15
- } from "@aws-sdk/middleware-signing" ;
16
10
import {
17
11
getUserAgentPlugin ,
18
12
resolveUserAgentConfig ,
19
13
UserAgentInputConfig ,
20
14
UserAgentResolvedConfig ,
21
15
} from "@aws-sdk/middleware-user-agent" ;
22
- import { Credentials as __Credentials } from "@aws-sdk/types" ;
23
16
import { RegionInputConfig , RegionResolvedConfig , resolveRegionConfig } from "@smithy/config-resolver" ;
17
+ import {
18
+ DefaultIdentityProviderConfig ,
19
+ getHttpAuthSchemeEndpointRuleSetPlugin ,
20
+ getHttpSigningPlugin ,
21
+ } from "@smithy/core" ;
24
22
import { getContentLengthPlugin } from "@smithy/middleware-content-length" ;
25
23
import { EndpointInputConfig , EndpointResolvedConfig , resolveEndpointConfig } from "@smithy/middleware-endpoint" ;
26
24
import { getRetryPlugin , resolveRetryConfig , RetryInputConfig , RetryResolvedConfig } from "@smithy/middleware-retry" ;
@@ -32,6 +30,7 @@ import {
32
30
SmithyResolvedConfiguration as __SmithyResolvedConfiguration ,
33
31
} from "@smithy/smithy-client" ;
34
32
import {
33
+ AwsCredentialIdentityProvider ,
35
34
BodyLengthCalculator as __BodyLengthCalculator ,
36
35
CheckOptionalClientConfig as __CheckOptionalClientConfig ,
37
36
ChecksumConstructor as __ChecksumConstructor ,
@@ -48,6 +47,12 @@ import {
48
47
UserAgent as __UserAgent ,
49
48
} from "@smithy/types" ;
50
49
50
+ import {
51
+ defaultCloudFrontKeyValueStoreHttpAuthSchemeParametersProvider ,
52
+ HttpAuthSchemeInputConfig ,
53
+ HttpAuthSchemeResolvedConfig ,
54
+ resolveHttpAuthSchemeConfig ,
55
+ } from "./auth/httpAuthSchemeProvider" ;
51
56
import { DeleteKeyCommandInput , DeleteKeyCommandOutput } from "./commands/DeleteKeyCommand" ;
52
57
import {
53
58
DescribeKeyValueStoreCommandInput ,
@@ -182,16 +187,17 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
182
187
region ?: string | __Provider < string > ;
183
188
184
189
/**
185
- * Default credentials provider; Not available in browser runtime.
190
+ * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
186
191
* @internal
187
192
*/
188
- credentialDefaultProvider ?: ( input : any ) => __Provider < __Credentials > ;
193
+ defaultUserAgentProvider ?: Provider < __UserAgent > ;
189
194
190
195
/**
191
- * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
196
+ * Default credentials provider; Not available in browser runtime.
197
+ * @deprecated
192
198
* @internal
193
199
*/
194
- defaultUserAgentProvider ?: Provider < __UserAgent > ;
200
+ credentialDefaultProvider ?: ( input : any ) => AwsCredentialIdentityProvider ;
195
201
196
202
/**
197
203
* Value for how many times a request will be made at most in case of retry.
@@ -226,12 +232,12 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
226
232
*/
227
233
export type CloudFrontKeyValueStoreClientConfigType = Partial < __SmithyConfiguration < __HttpHandlerOptions > > &
228
234
ClientDefaults &
229
- RegionInputConfig &
230
- EndpointInputConfig < EndpointParameters > &
235
+ UserAgentInputConfig &
231
236
RetryInputConfig &
237
+ RegionInputConfig &
232
238
HostHeaderInputConfig &
233
- AwsAuthInputConfig &
234
- UserAgentInputConfig &
239
+ EndpointInputConfig < EndpointParameters > &
240
+ HttpAuthSchemeInputConfig &
235
241
ClientInputEndpointParameters ;
236
242
/**
237
243
* @public
@@ -246,12 +252,12 @@ export interface CloudFrontKeyValueStoreClientConfig extends CloudFrontKeyValueS
246
252
export type CloudFrontKeyValueStoreClientResolvedConfigType = __SmithyResolvedConfiguration < __HttpHandlerOptions > &
247
253
Required < ClientDefaults > &
248
254
RuntimeExtensionsConfig &
249
- RegionResolvedConfig &
250
- EndpointResolvedConfig < EndpointParameters > &
255
+ UserAgentResolvedConfig &
251
256
RetryResolvedConfig &
257
+ RegionResolvedConfig &
252
258
HostHeaderResolvedConfig &
253
- AwsAuthResolvedConfig &
254
- UserAgentResolvedConfig &
259
+ EndpointResolvedConfig < EndpointParameters > &
260
+ HttpAuthSchemeResolvedConfig &
255
261
ClientResolvedEndpointParameters ;
256
262
/**
257
263
* @public
@@ -278,22 +284,28 @@ export class CloudFrontKeyValueStoreClient extends __Client<
278
284
constructor ( ...[ configuration ] : __CheckOptionalClientConfig < CloudFrontKeyValueStoreClientConfig > ) {
279
285
const _config_0 = __getRuntimeConfig ( configuration || { } ) ;
280
286
const _config_1 = resolveClientEndpointParameters ( _config_0 ) ;
281
- const _config_2 = resolveRegionConfig ( _config_1 ) ;
282
- const _config_3 = resolveEndpointConfig ( _config_2 ) ;
283
- const _config_4 = resolveRetryConfig ( _config_3 ) ;
287
+ const _config_2 = resolveUserAgentConfig ( _config_1 ) ;
288
+ const _config_3 = resolveRetryConfig ( _config_2 ) ;
289
+ const _config_4 = resolveRegionConfig ( _config_3 ) ;
284
290
const _config_5 = resolveHostHeaderConfig ( _config_4 ) ;
285
- const _config_6 = resolveAwsAuthConfig ( _config_5 ) ;
286
- const _config_7 = resolveUserAgentConfig ( _config_6 ) ;
291
+ const _config_6 = resolveEndpointConfig ( _config_5 ) ;
292
+ const _config_7 = resolveHttpAuthSchemeConfig ( _config_6 ) ;
287
293
const _config_8 = resolveRuntimeExtensions ( _config_7 , configuration ?. extensions || [ ] ) ;
288
294
super ( _config_8 ) ;
289
295
this . config = _config_8 ;
296
+ this . middlewareStack . use ( getUserAgentPlugin ( this . config ) ) ;
290
297
this . middlewareStack . use ( getRetryPlugin ( this . config ) ) ;
291
298
this . middlewareStack . use ( getContentLengthPlugin ( this . config ) ) ;
292
299
this . middlewareStack . use ( getHostHeaderPlugin ( this . config ) ) ;
293
300
this . middlewareStack . use ( getLoggerPlugin ( this . config ) ) ;
294
301
this . middlewareStack . use ( getRecursionDetectionPlugin ( this . config ) ) ;
295
- this . middlewareStack . use ( getAwsAuthPlugin ( this . config ) ) ;
296
- this . middlewareStack . use ( getUserAgentPlugin ( this . config ) ) ;
302
+ this . middlewareStack . use (
303
+ getHttpAuthSchemeEndpointRuleSetPlugin ( this . config , {
304
+ httpAuthSchemeParametersProvider : this . getDefaultHttpAuthSchemeParametersProvider ( ) ,
305
+ identityProviderConfigProvider : this . getIdentityProviderConfigProvider ( ) ,
306
+ } )
307
+ ) ;
308
+ this . middlewareStack . use ( getHttpSigningPlugin ( this . config ) ) ;
297
309
}
298
310
299
311
/**
@@ -304,4 +316,14 @@ export class CloudFrontKeyValueStoreClient extends __Client<
304
316
destroy ( ) : void {
305
317
super . destroy ( ) ;
306
318
}
319
+ private getDefaultHttpAuthSchemeParametersProvider ( ) {
320
+ return defaultCloudFrontKeyValueStoreHttpAuthSchemeParametersProvider ;
321
+ }
322
+ private getIdentityProviderConfigProvider ( ) {
323
+ return async ( config : CloudFrontKeyValueStoreClientResolvedConfig ) =>
324
+ new DefaultIdentityProviderConfig ( {
325
+ "aws.auth#sigv4" : config . credentials ,
326
+ "aws.auth#sigv4a" : config . credentials ,
327
+ } ) ;
328
+ }
307
329
}
0 commit comments