@@ -12,20 +12,18 @@ import {
12
12
} from "@aws-sdk/middleware-host-header" ;
13
13
import { getLoggerPlugin } from "@aws-sdk/middleware-logger" ;
14
14
import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection" ;
15
- import {
16
- AwsAuthInputConfig ,
17
- AwsAuthResolvedConfig ,
18
- getAwsAuthPlugin ,
19
- resolveAwsAuthConfig ,
20
- } from "@aws-sdk/middleware-signing" ;
21
15
import {
22
16
getUserAgentPlugin ,
23
17
resolveUserAgentConfig ,
24
18
UserAgentInputConfig ,
25
19
UserAgentResolvedConfig ,
26
20
} from "@aws-sdk/middleware-user-agent" ;
27
- import { Credentials as __Credentials } from "@aws-sdk/types" ;
28
21
import { RegionInputConfig , RegionResolvedConfig , resolveRegionConfig } from "@smithy/config-resolver" ;
22
+ import {
23
+ DefaultIdentityProviderConfig ,
24
+ getHttpAuthSchemeEndpointRuleSetPlugin ,
25
+ getHttpSigningPlugin ,
26
+ } from "@smithy/core" ;
29
27
import { getContentLengthPlugin } from "@smithy/middleware-content-length" ;
30
28
import { EndpointInputConfig , EndpointResolvedConfig , resolveEndpointConfig } from "@smithy/middleware-endpoint" ;
31
29
import { getRetryPlugin , resolveRetryConfig , RetryInputConfig , RetryResolvedConfig } from "@smithy/middleware-retry" ;
@@ -37,6 +35,7 @@ import {
37
35
SmithyResolvedConfiguration as __SmithyResolvedConfiguration ,
38
36
} from "@smithy/smithy-client" ;
39
37
import {
38
+ AwsCredentialIdentityProvider ,
40
39
BodyLengthCalculator as __BodyLengthCalculator ,
41
40
CheckOptionalClientConfig as __CheckOptionalClientConfig ,
42
41
ChecksumConstructor as __ChecksumConstructor ,
@@ -53,6 +52,12 @@ import {
53
52
UserAgent as __UserAgent ,
54
53
} from "@smithy/types" ;
55
54
55
+ import {
56
+ defaultDynamoDBHttpAuthSchemeParametersProvider ,
57
+ HttpAuthSchemeInputConfig ,
58
+ HttpAuthSchemeResolvedConfig ,
59
+ resolveHttpAuthSchemeConfig ,
60
+ } from "./auth/httpAuthSchemeProvider" ;
56
61
import {
57
62
BatchExecuteStatementCommandInput ,
58
63
BatchExecuteStatementCommandOutput ,
@@ -375,28 +380,22 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
375
380
useFipsEndpoint ?: boolean | __Provider < boolean > ;
376
381
377
382
/**
378
- * The AWS region to which this client will send requests
379
- */
380
- region ?: string | __Provider < string > ;
381
-
382
- /**
383
- * Default credentials provider; Not available in browser runtime.
383
+ * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
384
384
* @internal
385
385
*/
386
- credentialDefaultProvider ?: ( input : any ) => __Provider < __Credentials > ;
386
+ defaultUserAgentProvider ?: Provider < __UserAgent > ;
387
387
388
388
/**
389
- * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
390
- * @internal
389
+ * The AWS region to which this client will send requests
391
390
*/
392
- defaultUserAgentProvider ?: Provider < __UserAgent > ;
391
+ region ?: string | __Provider < string > ;
393
392
394
393
/**
395
- * The provider which populates default for endpointDiscoveryEnabled configuration, if it's
396
- * not passed during client creation.
394
+ * Default credentials provider; Not available in browser runtime.
395
+ * @deprecated
397
396
* @internal
398
397
*/
399
- endpointDiscoveryEnabledProvider ?: __Provider < boolean | undefined > ;
398
+ credentialDefaultProvider ?: ( input : any ) => AwsCredentialIdentityProvider ;
400
399
401
400
/**
402
401
* Value for how many times a request will be made at most in case of retry.
@@ -424,6 +423,13 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
424
423
* The {@link @smithy/smithy-client#DefaultsMode } that will be used to determine how certain default configuration options are resolved in the SDK.
425
424
*/
426
425
defaultsMode ?: __DefaultsMode | __Provider < __DefaultsMode > ;
426
+
427
+ /**
428
+ * The provider which populates default for endpointDiscoveryEnabled configuration, if it's
429
+ * not passed during client creation.
430
+ * @internal
431
+ */
432
+ endpointDiscoveryEnabledProvider ?: __Provider < boolean | undefined > ;
427
433
}
428
434
429
435
/**
@@ -435,8 +441,8 @@ export type DynamoDBClientConfigType = Partial<__SmithyConfiguration<__HttpHandl
435
441
EndpointInputConfig < EndpointParameters > &
436
442
RetryInputConfig &
437
443
HostHeaderInputConfig &
438
- AwsAuthInputConfig &
439
444
UserAgentInputConfig &
445
+ HttpAuthSchemeInputConfig &
440
446
EndpointDiscoveryInputConfig &
441
447
ClientInputEndpointParameters ;
442
448
/**
@@ -456,8 +462,8 @@ export type DynamoDBClientResolvedConfigType = __SmithyResolvedConfiguration<__H
456
462
EndpointResolvedConfig < EndpointParameters > &
457
463
RetryResolvedConfig &
458
464
HostHeaderResolvedConfig &
459
- AwsAuthResolvedConfig &
460
465
UserAgentResolvedConfig &
466
+ HttpAuthSchemeResolvedConfig &
461
467
EndpointDiscoveryResolvedConfig &
462
468
ClientResolvedEndpointParameters ;
463
469
/**
@@ -498,15 +504,26 @@ export class DynamoDBClient extends __Client<
498
504
*/
499
505
readonly config : DynamoDBClientResolvedConfig ;
500
506
507
+ private getDefaultHttpAuthSchemeParametersProvider ( ) {
508
+ return defaultDynamoDBHttpAuthSchemeParametersProvider ;
509
+ }
510
+
511
+ private getIdentityProviderConfigProvider ( ) {
512
+ return async ( config : DynamoDBClientResolvedConfig ) =>
513
+ new DefaultIdentityProviderConfig ( {
514
+ "aws.auth#sigv4" : config . credentials ,
515
+ } ) ;
516
+ }
517
+
501
518
constructor ( ...[ configuration ] : __CheckOptionalClientConfig < DynamoDBClientConfig > ) {
502
519
const _config_0 = __getRuntimeConfig ( configuration || { } ) ;
503
520
const _config_1 = resolveClientEndpointParameters ( _config_0 ) ;
504
521
const _config_2 = resolveRegionConfig ( _config_1 ) ;
505
522
const _config_3 = resolveEndpointConfig ( _config_2 ) ;
506
523
const _config_4 = resolveRetryConfig ( _config_3 ) ;
507
524
const _config_5 = resolveHostHeaderConfig ( _config_4 ) ;
508
- const _config_6 = resolveAwsAuthConfig ( _config_5 ) ;
509
- const _config_7 = resolveUserAgentConfig ( _config_6 ) ;
525
+ const _config_6 = resolveUserAgentConfig ( _config_5 ) ;
526
+ const _config_7 = resolveHttpAuthSchemeConfig ( _config_6 ) ;
510
527
const _config_8 = resolveEndpointDiscoveryConfig ( _config_7 , {
511
528
endpointDiscoveryCommandCtor : DescribeEndpointsCommand ,
512
529
} ) ;
@@ -518,8 +535,14 @@ export class DynamoDBClient extends __Client<
518
535
this . middlewareStack . use ( getHostHeaderPlugin ( this . config ) ) ;
519
536
this . middlewareStack . use ( getLoggerPlugin ( this . config ) ) ;
520
537
this . middlewareStack . use ( getRecursionDetectionPlugin ( this . config ) ) ;
521
- this . middlewareStack . use ( getAwsAuthPlugin ( this . config ) ) ;
522
538
this . middlewareStack . use ( getUserAgentPlugin ( this . config ) ) ;
539
+ this . middlewareStack . use (
540
+ getHttpAuthSchemeEndpointRuleSetPlugin ( this . config , {
541
+ httpAuthSchemeParametersProvider : this . getDefaultHttpAuthSchemeParametersProvider ( ) ,
542
+ identityProviderConfigProvider : this . getIdentityProviderConfigProvider ( ) ,
543
+ } )
544
+ ) ;
545
+ this . middlewareStack . use ( getHttpSigningPlugin ( this . config ) ) ;
523
546
}
524
547
525
548
/**
0 commit comments