Browse Source

no need for action copy object

pull/7479/head
chrislu 3 weeks ago
parent
commit
83deff5126
  1. 6
      weed/s3api/s3_action_resolver.go
  2. 2
      weed/s3api/s3_constants/s3_action_strings.go

6
weed/s3api/s3_action_resolver.go

@ -217,10 +217,8 @@ func resolveObjectLevelAction(method string, baseAction string, r *http.Request)
case http.MethodPut: case http.MethodPut:
if baseAction == s3_constants.ACTION_WRITE { if baseAction == s3_constants.ACTION_WRITE {
// Check for copy operation
if r.Header.Get("X-Amz-Copy-Source") != "" {
return s3_constants.S3_ACTION_COPY_OBJECT
}
// Note: CopyObject operations also use s3:PutObject permission (same as MinIO/AWS)
// Copy requires s3:PutObject on destination and s3:GetObject on source
return s3_constants.S3_ACTION_PUT_OBJECT return s3_constants.S3_ACTION_PUT_OBJECT
} }

2
weed/s3api/s3_constants/s3_action_strings.go

@ -6,7 +6,6 @@ const (
// Object operations // Object operations
S3_ACTION_GET_OBJECT = "s3:GetObject" S3_ACTION_GET_OBJECT = "s3:GetObject"
S3_ACTION_PUT_OBJECT = "s3:PutObject" S3_ACTION_PUT_OBJECT = "s3:PutObject"
S3_ACTION_COPY_OBJECT = "s3:CopyObject"
S3_ACTION_DELETE_OBJECT = "s3:DeleteObject" S3_ACTION_DELETE_OBJECT = "s3:DeleteObject"
S3_ACTION_DELETE_OBJECT_VERSION = "s3:DeleteObjectVersion" S3_ACTION_DELETE_OBJECT_VERSION = "s3:DeleteObjectVersion"
S3_ACTION_GET_OBJECT_VERSION = "s3:GetObjectVersion" S3_ACTION_GET_OBJECT_VERSION = "s3:GetObjectVersion"
@ -83,4 +82,3 @@ const (
// Wildcard for all S3 actions // Wildcard for all S3 actions
S3_ACTION_ALL = "s3:*" S3_ACTION_ALL = "s3:*"
) )
Loading…
Cancel
Save