-
Notifications
You must be signed in to change notification settings - Fork 688
Fix flex checksum validation cfg #2981
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
Conversation
merge main into branch
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.
Please include sample code that tests this and demonstrates the desired outcome in the PR description.
to double check, if an object is uploaded with CRC64, enabling response validation should still succeed and we have a test for it, right? |
{ | ||
"id": "df93fff8-f662-441f-a12d-ac87614a5064", | ||
"type": "bugfix", | ||
"description": "Add a setter to output checksum middleware cfg to enable request validation mode by default", |
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.
Is this setter something that customers can interact with? If not, I'd just leave it as "Enable request validation mode by default"
Seconded. In fact, we need integration tests for everything here. Please demonstrate all of the following in integration tests:
|
We may have tests already that cover some of those cases, just point to them it so |
ChecksumCRC64NVME: aws.String("uxBNEklueLQ="), | ||
}, | ||
expectPayload: []byte("Hello, precomputed checksum!"), | ||
expectComputedChecksums: &s3.ComputedInputChecksumsMetadata{ |
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.
nit: this is a bit of a misnomer since we don't really calculate anything, but ¯_(ツ)_/¯
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.
I just got that checksum from previous old manual test :(
Hello @wty-Bryant, this worked perfectly for me for single part gets, but i still get the warnings for multipart gets. With a debugger i can see that the CRC32 header is returned for small files but not for large/multipart files, triggering the warning. I am just using a library that calls |
@wty-Bryant This change is causing my application to constantly throw the following warning -
Is there any way to disable this validation to prevent the warning from being thrown? |
@anishsana you probably need to set the env var AWS_RESPONSE_CHECKSUM_VALIDATION="WHEN_REQUIRED" in the meantime |
Operations supporting output checksum validation (e.g.
s3.GetObject
) would only return checksum if user enable that in request. This PR fixes flex checksum's validation cfg to enable validation by defaultIt has been tested that getting a s3 object uploaded with checksum will validate checksum from response by default, so there should be no warning like
WARN Response has no supported checksum. Not validating response payload.
. Sample test code is shown below: