Repository navigation
Apply AWS request features from a shared base client - #1003
Open
lukasdchang wants to merge 8 commits into
Open
lukasdchang wants to merge 8 commits into
lukasdchang wants to merge 8 commits into
Conversation
kuhe
reviewed
Dec 1, 2026
| "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( |
Contributor
There was a problem hiding this comment.
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
kuhe
requested changes
Dec 1, 2026
…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
…nt-plugins # Conflicts: # codegen-output-py/features-client/.smithy-python-manifest.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.