-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flexible Checksums Updates #3845
Conversation
cf331e4
to
3175d0c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on this, leaving comments accumulated so far. Will circle back.
aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt
Outdated
Show resolved
Hide resolved
@@ -39,20 +47,49 @@ internal fun RuntimeConfig.awsInlineableHttpRequestChecksum() = | |||
CargoDependency.smithyHttp(this), | |||
CargoDependency.smithyRuntimeApiClient(this), | |||
CargoDependency.smithyTypes(this), | |||
AwsCargoDependency.awsSigv4(this), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need awsSigv4 crate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The http_request_checksum.rs
inlineable uses the sigv4 crate. In previous contexts where it was used that crate was pulled in as a dependency by other decorators. When I started writing the codegen tests for this with a generic model that crate was not being pulled in. Since it is necessary for the inlineable to work I added it as a dependency here.
aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/HttpRequestChecksumDecorator.kt
Outdated
Show resolved
Hide resolved
be5e2d4
to
6182401
Compare
A new generated diff is ready to view.
A new doc preview is ready to view. |
2879b9e
to
bf37449
Compare
A new generated diff is ready to view.
A new doc preview is ready to view. |
bf37449
to
8df2e4c
Compare
A new generated diff is ready to view.
A new doc preview is ready to view. |
8df2e4c
to
d0aedfe
Compare
Update codegen to point to new checksum config
To traverse the model via a knowledge index
Update PutBucketLifecycleConfiguration test it now checks the Crc32 checksum header instead of Md5
d0aedfe
to
1f25cb4
Compare
A new generated diff is ready to view.
A new doc preview is ready to view. |
I'm thinking whether we can somehow avoid adding new interceptors, since we'd want all related logic to be bundled in one place. What if we augment existing interceptors in
In the
To wire things up, where we instantiate this struct in codegen, give this code to the closure for The same argument goes for I haven't verified if this idea compiles or works. But the net benefit is that we don't have to render new interceptor structs per operation. FYI, I'm ok with merging what we have and iterate on this to avoid churn (new interceptors are private so we can change later we want to). |
A new generated diff is ready to view.
A new doc preview is ready to view. |
Good suggestion @ysaito1001, implemented in d682c8d and 6c9c3da |
A new generated diff is ready to view.
A new doc preview is ready to view. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. One non-blocking question.
##[allow(clippy::wildcard_in_or_patterns)] | ||
match response_checksum_validation { | ||
#{ResponseChecksumValidation}::WhenRequired => {} | ||
#{ResponseChecksumValidation}::WhenSupported | _ => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why | _
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The {Response | Request}ChecksumValidation
enums are marked non-exhaustive
as a safety measure so have to handle that case somehow. Since these should always be set before this point that case shouldn't actually be encountered, but if it is we treat it the same as the default (WhenSupported
).
76f8a55
into
feature/flexible-checksums
Motivation and Context
Updates to flexible checksum functionality to align with the upcoming spec updates.
Note: this PR is to a feature branch since some of the changes here would be breaking before service deployments to align with the updated spec.
Description
SdkConfig
fieldsresponse_checksum_validation
andrequest_checksum_calculation
that indicate the user's preferred checksum behaviorCrc32
as the default checksum algorithmSdkConfig
settings and default checksumTesting
Added new suite of tests as modeled in the SEP in
HttpChecksumTest.kt
There are a few CI tests failing an all of those are currently expected:
aws-smithy-checksums
asnon-exhaustive
. That crate is not yet 1.0 so this change should be fine (and is necessary since we will likely support different checksum types in the future).upload_part
contains the defaultcrc32
checksum butcreate_multipart_upload
does not specify a checksum. S3 will fix this behavior before we deploy.check-aws-sdk-smoketest-unit-tests: This fails on an S3 protocol test withmissing required header: 'content-md5'
. This should be fixed by bumping to the newest smithy version (in a separate PR) since MD5 is now deprecated.Checklist
.changelog
directory, specifying "client," "server," or both in theapplies_to
key..changelog
directory, specifying "aws-sdk-rust" in theapplies_to
key.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.