From 943b30d9f424716a9f78c5995ab626d260b1e016 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Wed, 26 Jun 2024 16:26:10 +0300 Subject: [PATCH] [#411] Don't check object tags on deletion By specification https://docs.aws.amazon.com/AmazonS3/latest/userguide/tagging-and-policies.html we shouldn't check object tags on PUT and DELETE Signed-off-by: Denis Kirillov --- api/middleware/policy.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/middleware/policy.go b/api/middleware/policy.go index 2501c7a7..e03e36c1 100644 --- a/api/middleware/policy.go +++ b/api/middleware/policy.go @@ -32,7 +32,9 @@ const ( amzTagging = "x-amz-tagging" ) -// At the beginning of these operations resources haven't yet been created. +// In these operations we don't check resource tags because +// * they haven't been created yet +// * resource tags shouldn't be checked by AWS spec. var withoutResourceOps = []string{ CreateBucketOperation, CreateMultipartUploadOperation, @@ -43,6 +45,8 @@ var withoutResourceOps = []string{ ListPartsOperation, PutObjectOperation, CopyObjectOperation, + DeleteObjectOperation, + DeleteMultipleObjectsOperation, } type PolicySettings interface {