@@ -7,20 +7,18 @@ import {
77} from "@aws-sdk/middleware-host-header" ;
88import { getLoggerPlugin } from "@aws-sdk/middleware-logger" ;
99import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection" ;
10- import {
11- AwsAuthInputConfig ,
12- AwsAuthResolvedConfig ,
13- getAwsAuthPlugin ,
14- resolveAwsAuthConfig ,
15- } from "@aws-sdk/middleware-signing" ;
1610import {
1711 getUserAgentPlugin ,
1812 resolveUserAgentConfig ,
1913 UserAgentInputConfig ,
2014 UserAgentResolvedConfig ,
2115} from "@aws-sdk/middleware-user-agent" ;
22- import { Credentials as __Credentials } from "@aws-sdk/types" ;
2316import { RegionInputConfig , RegionResolvedConfig , resolveRegionConfig } from "@smithy/config-resolver" ;
17+ import {
18+ DefaultIdentityProviderConfig ,
19+ getHttpAuthSchemeEndpointRuleSetPlugin ,
20+ getHttpSigningPlugin ,
21+ } from "@smithy/core" ;
2422import { getContentLengthPlugin } from "@smithy/middleware-content-length" ;
2523import { EndpointInputConfig , EndpointResolvedConfig , resolveEndpointConfig } from "@smithy/middleware-endpoint" ;
2624import { getRetryPlugin , resolveRetryConfig , RetryInputConfig , RetryResolvedConfig } from "@smithy/middleware-retry" ;
@@ -32,6 +30,7 @@ import {
3230 SmithyResolvedConfiguration as __SmithyResolvedConfiguration ,
3331} from "@smithy/smithy-client" ;
3432import {
33+ AwsCredentialIdentityProvider ,
3534 BodyLengthCalculator as __BodyLengthCalculator ,
3635 CheckOptionalClientConfig as __CheckOptionalClientConfig ,
3736 ChecksumConstructor as __ChecksumConstructor ,
@@ -48,6 +47,12 @@ import {
4847 UserAgent as __UserAgent ,
4948} from "@smithy/types" ;
5049
50+ import {
51+ defaultEC2HttpAuthSchemeParametersProvider ,
52+ HttpAuthSchemeInputConfig ,
53+ HttpAuthSchemeResolvedConfig ,
54+ resolveHttpAuthSchemeConfig ,
55+ } from "./auth/httpAuthSchemeProvider" ;
5156import {
5257 AcceptAddressTransferCommandInput ,
5358 AcceptAddressTransferCommandOutput ,
@@ -3465,21 +3470,22 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
34653470 useFipsEndpoint ?: boolean | __Provider < boolean > ;
34663471
34673472 /**
3468- * The AWS region to which this client will send requests
3473+ * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
3474+ * @internal
34693475 */
3470- region ?: string | __Provider < string > ;
3476+ defaultUserAgentProvider ?: Provider < __UserAgent > ;
34713477
34723478 /**
3473- * Default credentials provider; Not available in browser runtime.
3474- * @internal
3479+ * The AWS region to which this client will send requests
34753480 */
3476- credentialDefaultProvider ?: ( input : any ) => __Provider < __Credentials > ;
3481+ region ?: string | __Provider < string > ;
34773482
34783483 /**
3479- * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
3484+ * Default credentials provider; Not available in browser runtime.
3485+ * @deprecated
34803486 * @internal
34813487 */
3482- defaultUserAgentProvider ?: Provider < __UserAgent > ;
3488+ credentialDefaultProvider ?: ( input : any ) => AwsCredentialIdentityProvider ;
34833489
34843490 /**
34853491 * Value for how many times a request will be made at most in case of retry.
@@ -3518,8 +3524,8 @@ export type EC2ClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOpt
35183524 EndpointInputConfig < EndpointParameters > &
35193525 RetryInputConfig &
35203526 HostHeaderInputConfig &
3521- AwsAuthInputConfig &
35223527 UserAgentInputConfig &
3528+ HttpAuthSchemeInputConfig &
35233529 ClientInputEndpointParameters ;
35243530/**
35253531 * @public
@@ -3538,8 +3544,8 @@ export type EC2ClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHa
35383544 EndpointResolvedConfig < EndpointParameters > &
35393545 RetryResolvedConfig &
35403546 HostHeaderResolvedConfig &
3541- AwsAuthResolvedConfig &
35423547 UserAgentResolvedConfig &
3548+ HttpAuthSchemeResolvedConfig &
35433549 ClientResolvedEndpointParameters ;
35443550/**
35453551 * @public
@@ -3588,15 +3594,26 @@ export class EC2Client extends __Client<
35883594 */
35893595 readonly config : EC2ClientResolvedConfig ;
35903596
3597+ private getDefaultHttpAuthSchemeParametersProvider ( ) {
3598+ return defaultEC2HttpAuthSchemeParametersProvider ;
3599+ }
3600+
3601+ private getIdentityProviderConfigProvider ( ) {
3602+ return async ( config : EC2ClientResolvedConfig ) =>
3603+ new DefaultIdentityProviderConfig ( {
3604+ "aws.auth#sigv4" : config . credentials ,
3605+ } ) ;
3606+ }
3607+
35913608 constructor ( ...[ configuration ] : __CheckOptionalClientConfig < EC2ClientConfig > ) {
35923609 const _config_0 = __getRuntimeConfig ( configuration || { } ) ;
35933610 const _config_1 = resolveClientEndpointParameters ( _config_0 ) ;
35943611 const _config_2 = resolveRegionConfig ( _config_1 ) ;
35953612 const _config_3 = resolveEndpointConfig ( _config_2 ) ;
35963613 const _config_4 = resolveRetryConfig ( _config_3 ) ;
35973614 const _config_5 = resolveHostHeaderConfig ( _config_4 ) ;
3598- const _config_6 = resolveAwsAuthConfig ( _config_5 ) ;
3599- const _config_7 = resolveUserAgentConfig ( _config_6 ) ;
3615+ const _config_6 = resolveUserAgentConfig ( _config_5 ) ;
3616+ const _config_7 = resolveHttpAuthSchemeConfig ( _config_6 ) ;
36003617 const _config_8 = resolveRuntimeExtensions ( _config_7 , configuration ?. extensions || [ ] ) ;
36013618 super ( _config_8 ) ;
36023619 this . config = _config_8 ;
@@ -3605,8 +3622,14 @@ export class EC2Client extends __Client<
36053622 this . middlewareStack . use ( getHostHeaderPlugin ( this . config ) ) ;
36063623 this . middlewareStack . use ( getLoggerPlugin ( this . config ) ) ;
36073624 this . middlewareStack . use ( getRecursionDetectionPlugin ( this . config ) ) ;
3608- this . middlewareStack . use ( getAwsAuthPlugin ( this . config ) ) ;
36093625 this . middlewareStack . use ( getUserAgentPlugin ( this . config ) ) ;
3626+ this . middlewareStack . use (
3627+ getHttpAuthSchemeEndpointRuleSetPlugin ( this . config , {
3628+ httpAuthSchemeParametersProvider : this . getDefaultHttpAuthSchemeParametersProvider ( ) ,
3629+ identityProviderConfigProvider : this . getIdentityProviderConfigProvider ( ) ,
3630+ } )
3631+ ) ;
3632+ this . middlewareStack . use ( getHttpSigningPlugin ( this . config ) ) ;
36103633 }
36113634
36123635 /**
0 commit comments