[#63] iam: Support tag keys #63

Merged
fyrchik merged 1 commit from dkirillov/policy-engine:feature/iam-tags into master 2024-04-05 11:22:59 +00:00
Member

Support:

  • aws:PrincipalTag
  • aws:ResourceTag
  • aws:Request

Signed-off-by: Denis Kirillov d.kirillov@yadro.com

Support: * aws:PrincipalTag * aws:ResourceTag * aws:Request Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
dkirillov self-assigned this 2024-04-04 11:19:18 +00:00
dkirillov changed title from [#XX] iam: Support tag keys to [#63] iam: Support tag keys 2024-04-04 11:19:30 +00:00
dkirillov force-pushed feature/iam-tags from 8baf3b7dc3 to eb296dd757 2024-04-04 11:20:04 +00:00 Compare
dkirillov requested review from storage-core-committers 2024-04-04 11:20:45 +00:00
dkirillov requested review from storage-core-developers 2024-04-04 11:20:52 +00:00
dkirillov requested review from storage-services-committers 2024-04-04 11:20:58 +00:00
fyrchik approved these changes 2024-04-04 11:27:24 +00:00
iam/converter.go Outdated
@ -66,0 +66,4 @@
const (
condKeyAWSPrincipalARN = "aws:PrincipalArn"
condKeyAWSPrincipalTagPrefix = "aws:PrincipalTag/"
userClaimTagPrefix = "tag-"
Owner

To be clear, is this tag- something present in AWS/S3 spec or our addition?

To be clear, is this `tag-` something present in AWS/S3 spec or our addition?
Author
Member

Our addition, to distinguish tags in user claims.

Our addition, to distinguish tags in user claims.
fyrchik marked this conversation as resolved
iam/converter.go Outdated
@ -188,1 +193,4 @@
func transformKey(key string) string {
switch {
case strings.HasPrefix(key, condKeyAWSPrincipalTagPrefix):
Owner

What about using https://pkg.go.dev/strings#CutPrefix? (it combines HasPrefix and TrimPrefix)
Or do we expect this switch to grow?

What about using https://pkg.go.dev/strings#CutPrefix? (it combines `HasPrefix` and `TrimPrefix`) Or do we expect this switch to grow?
Author
Member

In the future I expect this switch to grow, but for now I'll change to using CutPrefix

In the future I expect this switch to grow, but for now I'll change to using `CutPrefix`
fyrchik marked this conversation as resolved
dkirillov force-pushed feature/iam-tags from eb296dd757 to 1cf6417ed2 2024-04-04 11:57:03 +00:00 Compare
mbiryukova reviewed 2024-04-04 15:40:30 +00:00
@ -1503,0 +1547,4 @@
err := json.Unmarshal([]byte(policy), &p)
require.NoError(t, err)
s3Chain, err := ConvertToNativeChain(p, newMockUserResolver(nil, nil, ""))
Member

Should be ConvertToS3Chain?

Should be `ConvertToS3Chain`?
Author
Member

Oh, sure

Oh, sure
mbiryukova marked this conversation as resolved
dkirillov force-pushed feature/iam-tags from 1cf6417ed2 to 67e4595a91 2024-04-05 06:36:15 +00:00 Compare
mbiryukova approved these changes 2024-04-05 07:00:42 +00:00
aarifullin approved these changes 2024-04-05 09:09:54 +00:00
acid-ant approved these changes 2024-04-05 09:46:08 +00:00
fyrchik merged commit 67e4595a91 into master 2024-04-05 11:22:59 +00:00
fyrchik referenced this pull request from a commit 2024-04-05 11:23:01 +00:00
dkirillov deleted branch feature/iam-tags 2024-04-08 06:20:48 +00:00
Sign in to join this conversation.
No description provided.