implement S3 native RequestPayment, GetObject Part, Preconditions #8885
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
This PR implements a small mocked API, BucketPaymentRequest, which is only mocked currently.
It was also an opportunity to add functionality to the "core" operations that were not done. Also, rounds of CI runs showed small issues in the current logic that were hard to spot earlier.
Changes
This PR implements
BucketRequestPayment
API, which are only mocked and do not have actual effect on the global behaviour of S3 (like moto today).It also implements preconditions checks for
HeadObject
,GetObject
andCopyObject
.It also implements a pretty unknown feature of S3, which allows you to query the individual parts after you created an object using a MultipartUpload. It uses the behaviour of a
Range
request, even returning the same kind of headers. It is done under the hood by keep the necessary range data when completing a multipart, and using it to construct a range request when a part is being requested. It seems it is done the same way in AWS, we did not have any tests but I had a hunch it was working that way.Small change on the storage engine as well, the ETag is now a property, allowing to be calculated later on if it wasn't done.