mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-16 00:38:53 +01:00
s3: accept the governance bypass header case-insensitively (#12667)
* s3: accept the governance bypass header case-insensitively botocore and the AWS CLI send x-amz-bypass-governance-retention: True, so the exact "true" match ignored the bypass and governance-locked deletes and retention changes failed with AccessDenied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: test governance bypass with SDK-style header values Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c0509cf499
commit
c09009a74f
6 files changed
+65
-10
No files matched your search
@@ -520,6 +520,14 @@ func TestValidateObjectLockHeaders(t *testing.T) {
|
||||
assert.True(t, errors.Is(err, ErrGovernanceBypassVersioningRequired))
|
||||
})
|
||||
|
||||
t.Run("Title-case governance bypass header on non-versioned bucket", func(t *testing.T) {
|
||||
req := httptest.NewRequest("PUT", "/bucket/object", nil)
|
||||
req.Header.Set("x-amz-bypass-governance-retention", "True")
|
||||
|
||||
err := s3a.validateObjectLockHeaders(req, "bucket", "object", false)
|
||||
assert.True(t, errors.Is(err, ErrGovernanceBypassVersioningRequired))
|
||||
})
|
||||
|
||||
t.Run("Governance bypass header on versioned bucket should pass", func(t *testing.T) {
|
||||
req := httptest.NewRequest("PUT", "/bucket/object", nil)
|
||||
req.Header.Set("x-amz-bypass-governance-retention", "true")
|
||||
|
||||
Reference in new issue
Block a user