Skip to content
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

[v2] Turn on checksum validation for CRT S3 client #8298

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

kyleknap
Copy link
Contributor

@kyleknap kyleknap commented Nov 3, 2023

For uploads, the CRT S3 client will add CRC32 trailing checksums. For downloads, the CRT S3 client will validate checksums associated to the object when possible. This is also inline with the proposed changes in this s3transfer PR: boto/s3transfer#277. The plan is backport this to s3transfer once merged.

@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (90ecbeb) 93.19% compared to head (4245e18) 93.18%.

Additional details and impacted files
@@              Coverage Diff              @@
##           v2-s3-crt    #8298      +/-   ##
=============================================
- Coverage      93.19%   93.18%   -0.01%     
=============================================
  Files            364      364              
  Lines          38506    38519      +13     
  Branches        6169     6171       +2     
=============================================
+ Hits           35884    35893       +9     
- Misses          1950     1954       +4     
  Partials         672      672              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

For uploads, the CRT S3 client will add CRC32 trailing checksums.
For downloads, the CRT S3 client will validate checksums
associated to the object when possible.
@@ -206,6 +206,7 @@ def upload(self, fileobj, bucket, key, extra_args=None, subscribers=None):
extra_args = {}
if subscribers is None:
subscribers = {}
self._validate_checksum_algorithm_supported(extra_args)
Copy link

Choose a reason for hiding this comment

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

somewhat offtopic: Noticing that CRTTransferManager doesn't validate input as extensively as the classic TransferManager:

self._validate_all_known_args(extra_args, self.ALLOWED_UPLOAD_ARGS)
self._validate_if_bucket_supported(bucket)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I think we should follow up on validating extra args in another PR.

This is was made to keep parity with the pure Python transfer
manager which accepts lowercase algorithm values.
@kyleknap kyleknap merged commit c91b691 into aws:v2-s3-crt Nov 13, 2023
24 checks passed
@kyleknap kyleknap deleted the v2-crt-checksums branch November 13, 2023 22:45
kyleknap added a commit that referenced this pull request Nov 13, 2023
[v2] Turn on checksum validation for CRT S3 client
kyleknap added a commit to kyleknap/aws-cli that referenced this pull request Nov 22, 2023
[v2] Turn on checksum validation for CRT S3 client
kyleknap added a commit that referenced this pull request Nov 22, 2023
[v2] Turn on checksum validation for CRT S3 client
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.

4 participants