-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
implement PubObjectRetention and WORM #6969
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
Conversation
This reverts commit 6736434.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull Request Overview
This PR implements S3 Object Retention (GOVERNANCE and COMPLIANCE modes), Legal Hold, and legacy WORM support across the SeaweedFS S3 API, including new error codes, routes, handlers, core logic, and end-to-end tests.
- Added new S3 API error codes for object lock, retention, and legal hold.
- Registered and implemented HTTP routes and handlers for Put/Get Object Retention, Legal Hold, and bucket-level ObjectLockConfiguration.
- Added parsing, validation, and enforcement logic in core code, plus comprehensive unit and integration tests under
test/s3/retention
and updated CI to run them.
Reviewed Changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
weed/s3api/s3err/s3api_errors.go | Added ErrNoSuchObjectLockConfiguration and ErrNoSuchObjectLegalHold codes and mappings |
weed/s3api/s3api_server.go | Registered routes for retention, legal hold, and bucket-level lock configuration |
weed/s3api/s3api_object_retention.go | Core parsing, validation, and metadata manipulation for retention and legal hold |
weed/s3api/s3api_object_handlers_retention.go | Implemented HTTP handlers for Put/Get Object Retention & Legal Hold |
weed/s3api/s3api_object_handlers_delete.go | Enforced retention and bypass-governance checks in single and bulk deletes |
test/s3/retention | Added unit tests for parsing/validation and integration tests for WORM compatibility |
.github/workflows/s3-versioning-tests.yml | Extended CI workflow to include quick and comprehensive retention tests |
Code: "", | ||
Message: err.Error(), | ||
Key: object.ObjectName, | ||
Code: "", |
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.
When appending DeleteError for unexpected failures, the Code field is empty. Populate it with the appropriate S3 API error code (e.g., s3err.GetAPIError(s3err.ErrInternalError).Code or the access denied code) so clients receive a valid in the error response.
Suggested change
Code: "",
Code: s3err.GetAPIError(s3err.ErrInternalError).Code,
Copilot uses AI. Check for mistakes.
@@ -4,7 +4,7 @@ import ( | |||
"net/http" | |||
) | |||
|
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.
[nitpick] The skip-handlers file has been trimmed to only ACL stubs. Consider updating the file header comment or renaming it to clearly reflect that it now solely provides ACL handler stubs for better maintainability.
// This file contains stub implementations for ACL-related handlers in the S3 API. | |
// These handlers currently return HTTP 204 No Content responses. |
Copilot uses AI. Check for mistakes.
What problem are we solving?
need PubObjectRetention and WORM
How are we solving the problem?
implement
How is the PR tested?
Checks