Skip to content

Apply AWS request features from a shared base client - #1003

Open
lukasdchang wants to merge 8 commits into
developfrom
consolidate-client-plugins
Open

lukasdchang wants to merge 8 commits into
developfrom
consolidate-client-plugins

Conversation

@lukasdchang

@lukasdchang lukasdchang commented Dec 1, 2026 •

Copy link
Copy Markdown

Issue #, if available:

Description

Every AWS client needs the same request setup, including adding AWS user-agent fields. Previously, codegen copied the same setup into every generated client. This PR moves the setup into shared parent classes. HttpClient/AsyncHttpClient in smithy-http install smithy_request_plugin. AwsClient/AsyncAwsClient in smithy-aws-core extend those classes and install the AWS plugin. When an AWS client is defined, its parent adds AwsRequestInterceptor. AwsRequestInterceptor is one consolidated interceptor for every AWS-wide feature, like user agent and soon recursion detection. user_agent_plugin was renamed to smithy_request_plugin to separate AWS features from Smithy features and avoid creating one plugin for every feature. This PR follows the review on #1001.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@lukasdchang
lukasdchang requested a review from a team as a code owner December 1, 2026 18:50
"Send the AWS user agent with every request."
def aws_request_plugin(config: AsyncJSONRPC10Config) -> None:
"Add the interceptors every AWS client applies to requests."
config.interceptors.append(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to have one combined interceptor for this plugin and for it to be emplaced in the base client, not in each generated client

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 5e8d80b

…nt-plugins

# Conflicts:
#	codegen-output-py/aws-json-1-0-client/.smithy-python-manifest.json
#	codegen-output-py/aws-json-1-1-client/.smithy-python-manifest.json
#	codegen-output-py/aws-query-client/.smithy-python-manifest.json
#	codegen-output-py/ec2-query-client/.smithy-python-manifest.json
#	codegen-output-py/rest-json-1-client/.smithy-python-manifest.json
#	codegen-output-py/rest-xml-client/.smithy-python-manifest.json
#	codegen-output/aws-json-1-0/src/awsjson10/aio/config.py
#	codegen-output/aws-json-1-0/src/awsjson10/config.py
#	codegen-output/aws-json-1-1/src/awsjson11/aio/config.py
#	codegen-output/aws-json-1-1/src/awsjson11/config.py
#	codegen-output/aws-query/src/awsquery/aio/config.py
#	codegen-output/aws-query/src/awsquery/config.py
#	codegen-output/ec2-query/src/ec2query/aio/config.py
#	codegen-output/ec2-query/src/ec2query/config.py
#	codegen-output/rest-json-1/src/restjson/aio/config.py
#	codegen-output/rest-json-1/src/restjson/config.py
#	codegen-output/rest-xml/src/restxml/aio/config.py
#	codegen-output/rest-xml/src/restxml/config.py
#	scripts/verifications/import-cost.json
@lukasdchang lukasdchang changed the title Rename user agent plugins to Smithy and AWS request plugins Apply AWS request features from a shared base client Dec 1, 2026
@lukasdchang
lukasdchang requested a review from kuhe December 1, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants