[#357] Add check of request and resource tags #357

Merged
alexvanin merged 1 commits from mbiryukova/frostfs-s3-gw:feature/tags_to_policy_check into master 2024-04-17 07:07:00 +00:00
Collaborator

Signed-off-by: Marina Biryukova m.biryukova@yadro.com

Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova self-assigned this 2024-04-10 07:47:42 +00:00
mbiryukova added 1 commit 2024-04-10 07:47:44 +00:00
/ DCO (pull_request) Failing after 2m6s Details
/ Builds (1.20) (pull_request) Successful in 2m16s Details
/ Builds (1.21) (pull_request) Successful in 2m2s Details
/ Vulncheck (pull_request) Failing after 3m29s Details
/ Lint (pull_request) Successful in 4m19s Details
/ Tests (1.20) (pull_request) Failing after 12s Details
/ Tests (1.21) (pull_request) Successful in 2m58s Details
84e123a0fb
[#xxx] Add check of request and resource tags
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova force-pushed feature/tags_to_policy_check from 84e123a0fb to 1c84cf5ae2 2024-04-10 07:48:14 +00:00 Compare
mbiryukova changed title from [#xxx] Add check of request and resource tags to [#357] Add check of request and resource tags 2024-04-10 07:48:41 +00:00
mbiryukova requested review from storage-services-committers 2024-04-10 08:01:19 +00:00
mbiryukova requested review from storage-services-developers 2024-04-10 08:01:19 +00:00
mbiryukova force-pushed feature/tags_to_policy_check from 1c84cf5ae2 to 0fe50f000d 2024-04-10 08:31:41 +00:00 Compare
mbiryukova force-pushed feature/tags_to_policy_check from 0fe50f000d to 780c329cab 2024-04-10 09:27:35 +00:00 Compare
mbiryukova force-pushed feature/tags_to_policy_check from 780c329cab to 0c47fd4228 2024-04-10 13:25:28 +00:00 Compare
dkirillov reviewed 2024-04-11 06:57:14 +00:00
dkirillov left a comment
Collaborator

Looks good

Looks good
@ -30,0 +40,4 @@
CompleteMultipartUploadOperation,
UploadPartOperation,
UploadPartCopyOperation,
ListPartsOperation,
Collaborator

Can aws restrict uploadPart/listingParts by resource attribute (that was added during create multipart upload)?

Can aws restrict uploadPart/listingParts by resource attribute (that was added during create multipart upload)?
Poster
Collaborator

It seems not

It seems not
dkirillov marked this conversation as resolved
@ -39,0 +59,4 @@
}
type ResourceTagging interface {
GetBucketInfo(ctx context.Context, name string) (*data.BucketInfo, error)
Collaborator

This duplicates PolicyConfig.BucketResolver.

This duplicates `PolicyConfig.BucketResolver`.
dkirillov marked this conversation as resolved
@ -54,6 +84,7 @@ func PolicyCheck(cfg PolicyConfig) Func {
ctx := r.Context()
if err := policyCheck(r, cfg); err != nil {
reqLogOrDefault(ctx, cfg.Log).Error(logs.PolicyValidationFailed, zap.Error(err))
err = frostfsErrors.UnwrapErr(err)
Collaborator

Why do we need this?

Why do we need this?
Poster
Collaborator

Without this we will return InternalError if requesting tags of non-existent bucket or object, instead of NoSuchBucket or NoSuchKey

Without this we will return `InternalError` if requesting tags of non-existent bucket or object, instead of `NoSuchBucket` or `NoSuchKey`
Collaborator

Can we add test for such case then? For now If I remove this line tests still pass

Can we add test for such case then? For now If I remove this line tests still pass
dkirillov marked this conversation as resolved
@ -68,3 +99,3 @@
func policyCheck(r *http.Request, cfg PolicyConfig) error {
reqType, bktName, objName := getBucketObject(r, cfg.Domains)
req, err := getPolicyRequest(r, cfg.FrostfsID, reqType, bktName, objName, cfg.Log)
req, err := getPolicyRequest(r, cfg.FrostfsID, cfg.Decoder, cfg.Tagging, reqType, bktName, objName, cfg.Log)
Collaborator

It seems we can pass whole cfg param

It seems we can pass whole `cfg` param
dkirillov marked this conversation as resolved
mbiryukova force-pushed feature/tags_to_policy_check from 0c47fd4228 to 3b76446d72 2024-04-11 11:06:29 +00:00 Compare
dkirillov approved these changes 2024-04-12 06:29:34 +00:00
ironbee approved these changes 2024-04-16 14:07:16 +00:00
alexvanin approved these changes 2024-04-17 07:06:53 +00:00
alexvanin merged commit 3ff027587c into master 2024-04-17 07:07:00 +00:00
alexvanin deleted branch feature/tags_to_policy_check 2024-04-17 07:07:01 +00:00
alexvanin added this to the v0.30.0 milestone 2024-05-27 11:14:12 +00:00
Sign in to join this conversation.
There is no content yet.