-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Ensure compatibility with latest botocore
S3 client customizations
#8495
Conversation
Werkzeug request will not have data populated, but raw stream will have it
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8495 +/- ##
==========================================
- Coverage 92.63% 92.63% -0.01%
==========================================
Files 1225 1224 -1
Lines 105921 105922 +1
==========================================
- Hits 98123 98120 -3
- Misses 7798 7802 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
botocore
S3 Client Customizationsbotocore
S3 client customizations
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.
Awesome, thank you for tackling this @bpandola!
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.
Where Content-MD5 was required before, it is not any more, but only on S3 proper. Third party S3-like services will still require it. I'm not sure the third party S3-like services support trailing checksums either, and certainly won't support the new CRC64 mode.
Do we need a way for whatever is running moto to specify the "flavor" of S3 it is emulating now?
Caused by: boto/boto3#4392 |
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 diff here looks more complicated than it truly is. I just reordered the if
statements so that the chunked
encoding takes precedence over the Content-Length
header. The code within these conditionals was not changed at all.
This change was necessary because some of the intercepted S3 requests from boto3/botocore now default to a chunked encoding (that also include a Content-Length
header).
It's not clear to me if anything changed server-side at AWS. The changes in question all seem to affect the client requests generated by boto3/botocore. As such, this PR just updates If you run into a specific issue with |
I've released |
The latest version of
botocore
adds some customizations to the S3 client that break some of our S3 tests:This PR removes assertions around the default checksum behavior (as it now varies across
botocore
versions). It also manually supplies theContentMD5
parameter for API calls that require it, asbotocore
no longer automatically computes it.This PR also contains minor
request.body
processing tweaks for S3 as well as duringproxy
orrecording
mode, due to the newaws-chunked
encoding and theAwsChunkedWrapper
object that now wraps some S3 request bodies sent from boto3/botocore.Note
This PR fixes the
moto
build breakages that occurred as a result of the new "default integrity protections" introduced in the AWS SDK for Python v1.36.0. It also maintains existing compatibility with earlier SDK versions. There may be additional issues encountered by users ofmoto
as a result of these AWS changes, which will have to be addressed in subsequent PRs as they arise.Ref: boto/boto3#4392
Ref: boto/botocore@590103b