Browse Source

use PUT instead of DELETE action

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

2
weed/s3api/s3_action_resolver.go

@ -68,7 +68,7 @@ var bucketQueryActions = map[string]map[string]string{
"lifecycle": { "lifecycle": {
http.MethodGet: s3_constants.S3_ACTION_GET_BUCKET_LIFECYCLE, http.MethodGet: s3_constants.S3_ACTION_GET_BUCKET_LIFECYCLE,
http.MethodPut: s3_constants.S3_ACTION_PUT_BUCKET_LIFECYCLE, http.MethodPut: s3_constants.S3_ACTION_PUT_BUCKET_LIFECYCLE,
http.MethodDelete: s3_constants.S3_ACTION_DELETE_BUCKET_LIFECYCLE,
http.MethodDelete: s3_constants.S3_ACTION_PUT_BUCKET_LIFECYCLE, // DELETE uses same permission as PUT
}, },
"versioning": { "versioning": {
http.MethodGet: s3_constants.S3_ACTION_GET_BUCKET_VERSIONING, http.MethodGet: s3_constants.S3_ACTION_GET_BUCKET_VERSIONING,

6
weed/s3api/s3_constants/s3_action_strings.go

@ -60,9 +60,9 @@ const (
S3_ACTION_DELETE_BUCKET_CORS = "s3:DeleteBucketCors" S3_ACTION_DELETE_BUCKET_CORS = "s3:DeleteBucketCors"
// Bucket lifecycle operations // Bucket lifecycle operations
S3_ACTION_GET_BUCKET_LIFECYCLE = "s3:GetLifecycleConfiguration"
S3_ACTION_PUT_BUCKET_LIFECYCLE = "s3:PutLifecycleConfiguration"
S3_ACTION_DELETE_BUCKET_LIFECYCLE = "s3:PutLifecycleConfiguration"
// Note: Both PUT and DELETE lifecycle operations use s3:PutLifecycleConfiguration
S3_ACTION_GET_BUCKET_LIFECYCLE = "s3:GetLifecycleConfiguration"
S3_ACTION_PUT_BUCKET_LIFECYCLE = "s3:PutLifecycleConfiguration"
// Bucket versioning operations // Bucket versioning operations
S3_ACTION_GET_BUCKET_VERSIONING = "s3:GetBucketVersioning" S3_ACTION_GET_BUCKET_VERSIONING = "s3:GetBucketVersioning"

Loading…
Cancel
Save