-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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] S3 high level checksums #8933
Conversation
a479b9c
to
0201a02
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.
Looks like a solid start.
My main feedback here is that --checksum-algorithm
should be supported for copies (ie s3s3
). I can definitely see strong use cases for wanting to copy the object checksums between different S3 paths (or even generating different checksums). In order to support this, we're going to need to port this PR for the vended s3transfer
package. Let's make this port a separate PR to reduce noise in this one.
We should also prefer f-strings for string formatting in all new code. ie f"var: {my_var}"
instead of "var: %s" % myvar
.
90dfb1f
to
fcc9b99
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.
Playing around with it some more, I'm not sure --checksum-mode ENABLED
provides anything useful without the debug
flag:
aws s3 cp s3://hssyoo-brawn-test/README.rst ./ --checksum-mode ENABLED
download: s3://hssyoo-brawn-test/README.rst to ./README.rst
Compare this to the low-level get-object
:
aws s3api get-object --bucket hssyoo-brawn-test --key README.rst --checksum-mode ENABLED ./README.rst
{
...
"ChecksumCRC32C": "ac1Isw==",
...
}
With the current changes, the --checksum-mode
parameter in high-level S3 commands:
- Doesn't do client-side validation of the object
- Doesn't output the checksum the user could use to validate the object
We should decide what behavior we want to support.
EDIT: Sorry, validation is automatically supported with botocore
. Ignore.
fcc9b99
to
82286ca
Compare
d7088bd
to
8eb168d
Compare
1e5cc1c
to
320e75e
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.
Looks good! 🏆
Issue #, if available:
Low-level
aws s3api
commands support checksums other than MD5 for verifying end-to-end data integrity. This pull request ports over similar functionality to high-levelaws s3
commands.Description of changes:
--checksum-algorithm
flag for file uploads usingaws s3 cp
,aws s3 sync
, andaws s3 mv
.--checksum-mode
flag for file downloads usingaws s3 cp
,aws s3 sync
, andaws s3 mv
.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.