Skip to content

Commit 56ce5e5

Browse files
kuheSteven Yuan
andauthored
chore(clients): enable identity-and-auth SRA by default (#6299)
* feat(experimentalIdentityAndAuth): enable identity and auth by default * feat(codegen): refactor builtin plugins * chore: maintain id&a exclusion list * chore: set legacyAuth list and awsauth plugin order * chore: codegen sync * chore(codegen): update smithy hash for id&auth SRA * chore: codegen sync for id&auth * chore: update smithy hash for parm ordering fix * chore: update yarn lock --------- Co-authored-by: Steven Yuan <[email protected]>
1 parent 042b7dd commit 56ce5e5

File tree

921 files changed

+12267
-11837
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

921 files changed

+12267
-11837
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ experimental features that can affect `aws-sdk-js-v3`. These features are enable
149149
Note that any contributions related to these features MUST be reviewed carefully for opt-in behavior via feature flags
150150
as to not break any existing customers. Here are the experimental features that are currently under development:
151151

152-
| Experimental Feature | Flag | Description |
153-
| -------------------- | ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
154-
| Identity & Auth | `experimentalIdentityAndAuth` | Standardize identity and auth integrations to match the Smithy specification (see [Authentication Traits](https://smithy.io/2.0/spec/authentication-traits.html)). Newer capabilities include support for multiple auth schemes, `@optionalAuth`, and standardized identity interfaces for authentication schemes both in code generation and TypeScript packages. In `smithy-typescript`, `@httpApiKeyAuth` will be updated to use the new standardized interfaces. In `aws-sdk-js-v3` (`smithy-typescript`'s largest customer), this will affect `@aws.auth#sigv4` and `@httpBearerAuth` implementations, but is planned to be completely backwards-compatible. |
152+
| Experimental Feature | Flag | Description |
153+
| -------------------- | ---- | ----------- |
154+
| N/A | N/A | N/A |
155155

156156
## Build caching
157157

clients/client-accessanalyzer/src/AccessAnalyzerClient.ts

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,11 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
352352
*/
353353
export type AccessAnalyzerClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
354354
ClientDefaults &
355-
RegionInputConfig &
356-
EndpointInputConfig<EndpointParameters> &
357-
HostHeaderInputConfig &
358355
UserAgentInputConfig &
359356
RetryInputConfig &
357+
RegionInputConfig &
358+
HostHeaderInputConfig &
359+
EndpointInputConfig<EndpointParameters> &
360360
HttpAuthSchemeInputConfig &
361361
ClientInputEndpointParameters;
362362
/**
@@ -372,11 +372,11 @@ export interface AccessAnalyzerClientConfig extends AccessAnalyzerClientConfigTy
372372
export type AccessAnalyzerClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
373373
Required<ClientDefaults> &
374374
RuntimeExtensionsConfig &
375-
RegionResolvedConfig &
376-
EndpointResolvedConfig<EndpointParameters> &
377-
HostHeaderResolvedConfig &
378375
UserAgentResolvedConfig &
379376
RetryResolvedConfig &
377+
RegionResolvedConfig &
378+
HostHeaderResolvedConfig &
379+
EndpointResolvedConfig<EndpointParameters> &
380380
HttpAuthSchemeResolvedConfig &
381381
ClientResolvedEndpointParameters;
382382
/**
@@ -427,25 +427,28 @@ export class AccessAnalyzerClient extends __Client<
427427
constructor(...[configuration]: __CheckOptionalClientConfig<AccessAnalyzerClientConfig>) {
428428
const _config_0 = __getRuntimeConfig(configuration || {});
429429
const _config_1 = resolveClientEndpointParameters(_config_0);
430-
const _config_2 = resolveRegionConfig(_config_1);
431-
const _config_3 = resolveEndpointConfig(_config_2);
432-
const _config_4 = resolveHostHeaderConfig(_config_3);
433-
const _config_5 = resolveUserAgentConfig(_config_4);
434-
const _config_6 = resolveRetryConfig(_config_5);
430+
const _config_2 = resolveUserAgentConfig(_config_1);
431+
const _config_3 = resolveRetryConfig(_config_2);
432+
const _config_4 = resolveRegionConfig(_config_3);
433+
const _config_5 = resolveHostHeaderConfig(_config_4);
434+
const _config_6 = resolveEndpointConfig(_config_5);
435435
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
436436
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
437437
super(_config_8);
438438
this.config = _config_8;
439-
this.middlewareStack.use(getHostHeaderPlugin(this.config));
440-
this.middlewareStack.use(getLoggerPlugin(this.config));
441-
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
442439
this.middlewareStack.use(getUserAgentPlugin(this.config));
443440
this.middlewareStack.use(getRetryPlugin(this.config));
444441
this.middlewareStack.use(getContentLengthPlugin(this.config));
442+
this.middlewareStack.use(getHostHeaderPlugin(this.config));
443+
this.middlewareStack.use(getLoggerPlugin(this.config));
444+
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
445445
this.middlewareStack.use(
446446
getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
447-
httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
448-
identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
447+
httpAuthSchemeParametersProvider: defaultAccessAnalyzerHttpAuthSchemeParametersProvider,
448+
identityProviderConfigProvider: async (config: AccessAnalyzerClientResolvedConfig) =>
449+
new DefaultIdentityProviderConfig({
450+
"aws.auth#sigv4": config.credentials,
451+
}),
449452
})
450453
);
451454
this.middlewareStack.use(getHttpSigningPlugin(this.config));
@@ -459,13 +462,4 @@ export class AccessAnalyzerClient extends __Client<
459462
destroy(): void {
460463
super.destroy();
461464
}
462-
private getDefaultHttpAuthSchemeParametersProvider() {
463-
return defaultAccessAnalyzerHttpAuthSchemeParametersProvider;
464-
}
465-
private getIdentityProviderConfigProvider() {
466-
return async (config: AccessAnalyzerClientResolvedConfig) =>
467-
new DefaultIdentityProviderConfig({
468-
"aws.auth#sigv4": config.credentials,
469-
});
470-
}
471465
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ export const defaultAccessAnalyzerHttpAuthSchemeProvider: AccessAnalyzerHttpAuth
9696
*/
9797
export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig {
9898
/**
99-
* experimentalIdentityAndAuth: Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
99+
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
100100
* @internal
101101
*/
102102
httpAuthSchemes?: HttpAuthScheme[];
103103

104104
/**
105-
* experimentalIdentityAndAuth: Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
105+
* Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
106106
* @internal
107107
*/
108108
httpAuthSchemeProvider?: AccessAnalyzerHttpAuthSchemeProvider;
@@ -113,13 +113,13 @@ export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig {
113113
*/
114114
export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig {
115115
/**
116-
* experimentalIdentityAndAuth: Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
116+
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
117117
* @internal
118118
*/
119119
readonly httpAuthSchemes: HttpAuthScheme[];
120120

121121
/**
122-
* experimentalIdentityAndAuth: Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
122+
* Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
123123
* @internal
124124
*/
125125
readonly httpAuthSchemeProvider: AccessAnalyzerHttpAuthSchemeProvider;

clients/client-account/src/AccountClient.ts

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,11 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
268268
*/
269269
export type AccountClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
270270
ClientDefaults &
271-
RegionInputConfig &
272-
EndpointInputConfig<EndpointParameters> &
273-
HostHeaderInputConfig &
274271
UserAgentInputConfig &
275272
RetryInputConfig &
273+
RegionInputConfig &
274+
HostHeaderInputConfig &
275+
EndpointInputConfig<EndpointParameters> &
276276
HttpAuthSchemeInputConfig &
277277
ClientInputEndpointParameters;
278278
/**
@@ -288,11 +288,11 @@ export interface AccountClientConfig extends AccountClientConfigType {}
288288
export type AccountClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
289289
Required<ClientDefaults> &
290290
RuntimeExtensionsConfig &
291-
RegionResolvedConfig &
292-
EndpointResolvedConfig<EndpointParameters> &
293-
HostHeaderResolvedConfig &
294291
UserAgentResolvedConfig &
295292
RetryResolvedConfig &
293+
RegionResolvedConfig &
294+
HostHeaderResolvedConfig &
295+
EndpointResolvedConfig<EndpointParameters> &
296296
HttpAuthSchemeResolvedConfig &
297297
ClientResolvedEndpointParameters;
298298
/**
@@ -320,25 +320,28 @@ export class AccountClient extends __Client<
320320
constructor(...[configuration]: __CheckOptionalClientConfig<AccountClientConfig>) {
321321
const _config_0 = __getRuntimeConfig(configuration || {});
322322
const _config_1 = resolveClientEndpointParameters(_config_0);
323-
const _config_2 = resolveRegionConfig(_config_1);
324-
const _config_3 = resolveEndpointConfig(_config_2);
325-
const _config_4 = resolveHostHeaderConfig(_config_3);
326-
const _config_5 = resolveUserAgentConfig(_config_4);
327-
const _config_6 = resolveRetryConfig(_config_5);
323+
const _config_2 = resolveUserAgentConfig(_config_1);
324+
const _config_3 = resolveRetryConfig(_config_2);
325+
const _config_4 = resolveRegionConfig(_config_3);
326+
const _config_5 = resolveHostHeaderConfig(_config_4);
327+
const _config_6 = resolveEndpointConfig(_config_5);
328328
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
329329
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
330330
super(_config_8);
331331
this.config = _config_8;
332-
this.middlewareStack.use(getHostHeaderPlugin(this.config));
333-
this.middlewareStack.use(getLoggerPlugin(this.config));
334-
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
335332
this.middlewareStack.use(getUserAgentPlugin(this.config));
336333
this.middlewareStack.use(getRetryPlugin(this.config));
337334
this.middlewareStack.use(getContentLengthPlugin(this.config));
335+
this.middlewareStack.use(getHostHeaderPlugin(this.config));
336+
this.middlewareStack.use(getLoggerPlugin(this.config));
337+
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
338338
this.middlewareStack.use(
339339
getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
340-
httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
341-
identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
340+
httpAuthSchemeParametersProvider: defaultAccountHttpAuthSchemeParametersProvider,
341+
identityProviderConfigProvider: async (config: AccountClientResolvedConfig) =>
342+
new DefaultIdentityProviderConfig({
343+
"aws.auth#sigv4": config.credentials,
344+
}),
342345
})
343346
);
344347
this.middlewareStack.use(getHttpSigningPlugin(this.config));
@@ -352,13 +355,4 @@ export class AccountClient extends __Client<
352355
destroy(): void {
353356
super.destroy();
354357
}
355-
private getDefaultHttpAuthSchemeParametersProvider() {
356-
return defaultAccountHttpAuthSchemeParametersProvider;
357-
}
358-
private getIdentityProviderConfigProvider() {
359-
return async (config: AccountClientResolvedConfig) =>
360-
new DefaultIdentityProviderConfig({
361-
"aws.auth#sigv4": config.credentials,
362-
});
363-
}
364358
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ export const defaultAccountHttpAuthSchemeProvider: AccountHttpAuthSchemeProvider
9595
*/
9696
export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig {
9797
/**
98-
* experimentalIdentityAndAuth: Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
98+
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
9999
* @internal
100100
*/
101101
httpAuthSchemes?: HttpAuthScheme[];
102102

103103
/**
104-
* experimentalIdentityAndAuth: Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
104+
* Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
105105
* @internal
106106
*/
107107
httpAuthSchemeProvider?: AccountHttpAuthSchemeProvider;
@@ -112,13 +112,13 @@ export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig {
112112
*/
113113
export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig {
114114
/**
115-
* experimentalIdentityAndAuth: Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
115+
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
116116
* @internal
117117
*/
118118
readonly httpAuthSchemes: HttpAuthScheme[];
119119

120120
/**
121-
* experimentalIdentityAndAuth: Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
121+
* Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
122122
* @internal
123123
*/
124124
readonly httpAuthSchemeProvider: AccountHttpAuthSchemeProvider;

clients/client-acm-pca/src/ACMPCAClient.ts

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,11 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
319319
*/
320320
export type ACMPCAClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
321321
ClientDefaults &
322-
RegionInputConfig &
323-
EndpointInputConfig<EndpointParameters> &
324-
HostHeaderInputConfig &
325322
UserAgentInputConfig &
326323
RetryInputConfig &
324+
RegionInputConfig &
325+
HostHeaderInputConfig &
326+
EndpointInputConfig<EndpointParameters> &
327327
HttpAuthSchemeInputConfig &
328328
ClientInputEndpointParameters;
329329
/**
@@ -339,11 +339,11 @@ export interface ACMPCAClientConfig extends ACMPCAClientConfigType {}
339339
export type ACMPCAClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
340340
Required<ClientDefaults> &
341341
RuntimeExtensionsConfig &
342-
RegionResolvedConfig &
343-
EndpointResolvedConfig<EndpointParameters> &
344-
HostHeaderResolvedConfig &
345342
UserAgentResolvedConfig &
346343
RetryResolvedConfig &
344+
RegionResolvedConfig &
345+
HostHeaderResolvedConfig &
346+
EndpointResolvedConfig<EndpointParameters> &
347347
HttpAuthSchemeResolvedConfig &
348348
ClientResolvedEndpointParameters;
349349
/**
@@ -386,25 +386,28 @@ export class ACMPCAClient extends __Client<
386386
constructor(...[configuration]: __CheckOptionalClientConfig<ACMPCAClientConfig>) {
387387
const _config_0 = __getRuntimeConfig(configuration || {});
388388
const _config_1 = resolveClientEndpointParameters(_config_0);
389-
const _config_2 = resolveRegionConfig(_config_1);
390-
const _config_3 = resolveEndpointConfig(_config_2);
391-
const _config_4 = resolveHostHeaderConfig(_config_3);
392-
const _config_5 = resolveUserAgentConfig(_config_4);
393-
const _config_6 = resolveRetryConfig(_config_5);
389+
const _config_2 = resolveUserAgentConfig(_config_1);
390+
const _config_3 = resolveRetryConfig(_config_2);
391+
const _config_4 = resolveRegionConfig(_config_3);
392+
const _config_5 = resolveHostHeaderConfig(_config_4);
393+
const _config_6 = resolveEndpointConfig(_config_5);
394394
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
395395
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
396396
super(_config_8);
397397
this.config = _config_8;
398-
this.middlewareStack.use(getHostHeaderPlugin(this.config));
399-
this.middlewareStack.use(getLoggerPlugin(this.config));
400-
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
401398
this.middlewareStack.use(getUserAgentPlugin(this.config));
402399
this.middlewareStack.use(getRetryPlugin(this.config));
403400
this.middlewareStack.use(getContentLengthPlugin(this.config));
401+
this.middlewareStack.use(getHostHeaderPlugin(this.config));
402+
this.middlewareStack.use(getLoggerPlugin(this.config));
403+
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
404404
this.middlewareStack.use(
405405
getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
406-
httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
407-
identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
406+
httpAuthSchemeParametersProvider: defaultACMPCAHttpAuthSchemeParametersProvider,
407+
identityProviderConfigProvider: async (config: ACMPCAClientResolvedConfig) =>
408+
new DefaultIdentityProviderConfig({
409+
"aws.auth#sigv4": config.credentials,
410+
}),
408411
})
409412
);
410413
this.middlewareStack.use(getHttpSigningPlugin(this.config));
@@ -418,13 +421,4 @@ export class ACMPCAClient extends __Client<
418421
destroy(): void {
419422
super.destroy();
420423
}
421-
private getDefaultHttpAuthSchemeParametersProvider() {
422-
return defaultACMPCAHttpAuthSchemeParametersProvider;
423-
}
424-
private getIdentityProviderConfigProvider() {
425-
return async (config: ACMPCAClientResolvedConfig) =>
426-
new DefaultIdentityProviderConfig({
427-
"aws.auth#sigv4": config.credentials,
428-
});
429-
}
430424
}

clients/client-acm-pca/src/auth/httpAuthSchemeProvider.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ export const defaultACMPCAHttpAuthSchemeProvider: ACMPCAHttpAuthSchemeProvider =
9595
*/
9696
export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig {
9797
/**
98-
* experimentalIdentityAndAuth: Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
98+
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
9999
* @internal
100100
*/
101101
httpAuthSchemes?: HttpAuthScheme[];
102102

103103
/**
104-
* experimentalIdentityAndAuth: Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
104+
* Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
105105
* @internal
106106
*/
107107
httpAuthSchemeProvider?: ACMPCAHttpAuthSchemeProvider;
@@ -112,13 +112,13 @@ export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig {
112112
*/
113113
export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig {
114114
/**
115-
* experimentalIdentityAndAuth: Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
115+
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
116116
* @internal
117117
*/
118118
readonly httpAuthSchemes: HttpAuthScheme[];
119119

120120
/**
121-
* experimentalIdentityAndAuth: Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
121+
* Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
122122
* @internal
123123
*/
124124
readonly httpAuthSchemeProvider: ACMPCAHttpAuthSchemeProvider;

0 commit comments

Comments
 (0)