-
Notifications
You must be signed in to change notification settings - Fork 706
[reverted] Make it possible to disable integrity checks for multipart uploads #3148
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
4d2ab95
to
8932ea0
Compare
@stanhu LGTM, could you rebase it from latest release today so I can approve |
8932ea0
to
1c0245e
Compare
@wty-Bryant Done, thanks! |
codegen/integration test failed in forks, waiting for other CI pass and merge |
3f4a6e0
to
49a9057
Compare
As announced in aws#2960, AWS SDK for Go v2 service/s3 v1.73.0 shipped a change (aws#2808) that adopted the new default integrity protections. While it is possible to revert to the previous behavior by setting `AWS_REQUEST_CHECKSUM_CALCULATION=when_required`, this config setting did not apply to the S3 Manager multipart uploader, which always enabled CRC32 checksums by default. This commit checks the S3 options and only attaches the CRC32 checksums if `when_required` is not set. Relates to aws#3007 Signed-off-by: Stan Hu <[email protected]>
49a9057
to
1f72db5
Compare
@wty-Bryant Please discuss external contributor PRs with at least one other team member before merging them. |
@stanhu I've reverted this as the patch was not properly reviewed by multiple team members prior to merging. We are willing to accept a contribution for this-- but a minimum you would need to change this to expose the checksum calculation setting on the uploader's options structure rather than inferring it from the provided S3 client. You will also need to ensure that this does not break S3 Express buckets, which require CRC32 in all scenarios. |
… default checksums (aws#3148) As announced in aws#2960, AWS SDK for Go v2 service/s3 v1.73.0 shipped a change (aws#2808) that adopted new default integrity protections, automatically calculating CRC32 checksums for operations like PutObject and UploadPart. While it is possible to revert to the previous behavior by setting `AWS_REQUEST_CHECKSUM_CALCULATION=when_required`, this config setting did not apply to the S3 Manager multipart uploader, which always enabled CRC32 checksums by default regardless of the global setting. This commit adds a new `RequestChecksumCalculation` field to the Uploader struct that allows users to control checksum behavior: - `RequestChecksumCalculationWhenSupported` (default): Always calculates CRC32 checksums for multipart uploads - `RequestChecksumCalculationWhenRequired`: Only calculates checksums when explicitly set by the user, preserving backwards compatibility For example: ```go uploader := manager.NewUploader(client, func(u *manager.Uploader) { u.RequestChecksumCalculation = aws.RequestChecksumCalculationWhenRequired }) ``` S3 Express One Zone buckets always require CRC32 checksums regardless of this setting, as mandated by the S3 Express service requirements. The uploader automatically detects S3 Express buckets (names ending with `--x-s3`) and applies CRC32 checksums unconditionally. Fixes aws#3007
@lucix-aws @wty-Bryant Ok. Can you review #3151? |
As announced in #2960, AWS SDK for Go v2 service/s3 v1.73.0 shipped a change (#2808) that adopted the new default integrity protections.
While it is possible to revert to the previous behavior by setting
AWS_REQUEST_CHECKSUM_CALCULATION=when_required
, this config setting did not apply to the S3 Manager multipart uploader, which always enabled CRC32 checksums by default.This commit checks the S3 options and only attaches the CRC32 checksums if
when_required
is not set.Relates to #3007