Skip to content

Conversation

chrislusf
Copy link
Collaborator

What problem are we solving?

need PubObjectRetention and WORM

How are we solving the problem?

implement

How is the PR tested?

Checks

  • I have added unit tests if possible.
  • I will add related wiki document changes and link to this PR after merging.

@chrislusf chrislusf requested a review from Copilot July 12, 2025 09:15
Copilot

This comment was marked as outdated.

@chrislusf chrislusf requested a review from Copilot July 12, 2025 16:43
Copilot

This comment was marked as outdated.

@chrislusf chrislusf requested a review from Copilot July 12, 2025 17:48
Copilot

This comment was marked as outdated.

@chrislusf chrislusf requested a review from Copilot July 12, 2025 18:58
Copilot

This comment was marked as outdated.

@chrislusf chrislusf requested a review from Copilot July 12, 2025 19:14
Copilot

This comment was marked as outdated.

@chrislusf chrislusf requested a review from Copilot July 12, 2025 19:39
Copilot

This comment was marked as outdated.

@chrislusf chrislusf requested a review from Copilot July 12, 2025 19:54
Copilot

This comment was marked as outdated.

@chrislusf chrislusf requested a review from Copilot July 12, 2025 20:33
Copilot

This comment was marked as outdated.

@chrislusf chrislusf requested a review from Copilot July 12, 2025 21:00
Copilot

This comment was marked as outdated.

@chrislusf chrislusf requested a review from Copilot July 12, 2025 21:10
Copilot

This comment was marked as outdated.

chrislusf and others added 4 commits July 12, 2025 14:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@chrislusf chrislusf requested a review from Copilot July 12, 2025 21:36
Copilot

This comment was marked as outdated.

@chrislusf chrislusf requested a review from Copilot July 13, 2025 02:48
Copilot

This comment was marked as outdated.

@chrislusf chrislusf requested a review from Copilot July 13, 2025 02:53
Copilot

This comment was marked as outdated.

@chrislusf chrislusf requested a review from Copilot July 13, 2025 03:31
Copilot

This comment was marked as outdated.

@chrislusf chrislusf requested a review from Copilot July 13, 2025 04:51
Copy link
Contributor

@Copilot Copilot AI left a 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: "",
Copy link
Preview

Copilot AI Jul 13, 2025

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"
)

Copy link
Preview

Copilot AI Jul 13, 2025

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.

Suggested change
// 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.

@chrislusf chrislusf merged commit 1549ee2 into master Jul 13, 2025
14 checks passed
@chrislusf chrislusf deleted the implement-PubObjectRetention-and-WORM branch July 13, 2025 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant