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

Skip to content

implement S3 native object lock #8884

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 3 commits into from
Aug 15, 2023
Merged

implement S3 native object lock #8884

merged 3 commits into from
Aug 15, 2023

Conversation

bentsku
Copy link
Contributor

@bentsku bentsku commented Aug 10, 2023

Motivation

Implement the ObjectLock functionality in the new native S3 provider. This was partially implemented in our provider in order to fix Moto.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-overview.html
https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html
https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html

Changes

This PR adds the necessary API operations as well as a good amount of snapshot tests.

  • GetObjectLockConfiguration
  • PutObjectLockConfiguration
  • GetObjectLegalHold
  • PutObjectLegalHold
  • GetObjectRetention
  • PutObjectRetention

@bentsku bentsku self-assigned this Aug 10, 2023
@bentsku bentsku added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label Aug 10, 2023
@coveralls
Copy link

coveralls commented Aug 10, 2023

Coverage Status

coverage: 81.151% (-0.2%) from 81.344% when pulling 9628b50 on s3-native-object-lock into e0a3816 on master.

@bentsku bentsku marked this pull request as ready for review August 10, 2023 21:22
@bentsku bentsku force-pushed the s3-native-website branch from ad12ee0 to 649dd3d Compare August 10, 2023 22:21
@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-website branch from 649dd3d to bf92734 Compare August 10, 2023 22:26
@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-website branch from bf92734 to c034bae Compare August 13, 2023 00:50
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! Thanks for linking the docs, that was very helpful :-)

self.is_current = True

@staticmethod
def is_locked(*_, **__) -> bool:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def is_locked(*_, **__) -> bool:
def is_locked(*args, **kwargs) -> bool:

i know the IDE complains, but this is more readable :-)

if you "just can't" the warnings, you can also:

    def is_locked(*_args, **_kwargs) -> bool:

@bentsku bentsku force-pushed the s3-native-website branch 3 times, most recently from a787d67 to 182905f Compare August 15, 2023 00:04
@bentsku bentsku removed the request for review from dominikschubert August 15, 2023 00:05
Base automatically changed from s3-native-website to master August 15, 2023 17:24
@bentsku bentsku force-pushed the s3-native-object-lock branch from caecae3 to 9628b50 Compare August 15, 2023 17:26
@github-actions
Copy link

LocalStack Community integration with Pro

       2 files         2 suites   1h 21m 5s ⏱️
2 073 tests 1 657 ✔️ 416 💤 0
2 074 runs  1 657 ✔️ 417 💤 0

Results for commit 9628b50.

@bentsku bentsku merged commit 3477ed6 into master Aug 15, 2023
@bentsku bentsku deleted the s3-native-object-lock branch August 15, 2023 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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