Thanks to visit codestin.com
Credit goes to github.com

Skip to content

implement S3 native RequestPayment, GetObject Part, Preconditions #8885

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

Merged
merged 4 commits into from
Aug 15, 2023

Conversation

bentsku
Copy link
Contributor

@bentsku bentsku commented Aug 10, 2023

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 and CopyObject.

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.

@bentsku bentsku added aws:s3 Amazon Simple Storage Service semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases labels Aug 10, 2023
@bentsku bentsku self-assigned this Aug 10, 2023
@bentsku bentsku force-pushed the s3-native-fix-and-bucket-payment branch 2 times, most recently from 656990a to ef22ad6 Compare August 10, 2023 13:03
@coveralls
Copy link

coveralls commented Aug 10, 2023

Coverage Status

coverage: 81.004% (-0.2%) from 81.159% when pulling 619d669 on s3-native-fix-and-bucket-payment into 3477ed6 on master.

@bentsku bentsku marked this pull request as ready for review August 10, 2023 21:23
@bentsku bentsku force-pushed the s3-native-object-lock branch from 1265be6 to 66f9f51 Compare August 10, 2023 22:22
@bentsku bentsku force-pushed the s3-native-fix-and-bucket-payment branch 2 times, most recently from c63ede2 to 28989a6 Compare August 10, 2023 22:25
@bentsku bentsku force-pushed the s3-native-object-lock branch 2 times, most recently from d97e8f8 to caecae3 Compare August 13, 2023 00:50
@bentsku bentsku force-pushed the s3-native-fix-and-bucket-payment branch from 28989a6 to d17f3be Compare August 13, 2023 00:51
@thrau thrau removed the request for review from dominikschubert August 14, 2023 19:12
Copy link
Member

@thrau thrau left a comment

Choose a reason for hiding this comment

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

LGTM! nice changes all over, and 👌 tests as always

@bentsku bentsku force-pushed the s3-native-object-lock branch from caecae3 to 9628b50 Compare August 15, 2023 17:26
Base automatically changed from s3-native-object-lock to master August 15, 2023 18:55
@bentsku bentsku force-pushed the s3-native-fix-and-bucket-payment branch from d17f3be to 619d669 Compare August 15, 2023 18:56
@github-actions
Copy link

LocalStack Community integration with Pro

       2 files         2 suites   1h 31m 1s ⏱️
2 076 tests 1 657 ✔️ 419 💤 0
2 077 runs  1 657 ✔️ 420 💤 0

Results for commit 619d669.

@bentsku bentsku merged commit 9c710ee into master Aug 15, 2023
@bentsku bentsku deleted the s3-native-fix-and-bucket-payment branch August 15, 2023 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:s3 Amazon Simple Storage Service semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants