[#63] iam: Support tag keys #63

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

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 added 1 commit 2024-04-04 11:19:22 +00:00
Tests and linters / Tests (1.20) (pull_request) Failing after 23s Details
Tests and linters / Tests (1.21) (pull_request) Successful in 3m21s Details
DCO action / DCO (pull_request) Failing after 3m36s Details
Tests and linters / Staticcheck (pull_request) Successful in 3m56s Details
Tests and linters / Tests with -race (pull_request) Successful in 4m16s Details
Tests and linters / Lint (pull_request) Successful in 5m59s Details
8baf3b7dc3
[#XX] iam: Support tag keys
Support:
* aws:PrincipalTag
* aws:ResourceTag
* aws:Request

Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
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-"

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?
Poster
Collaborator

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):

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?
Poster
Collaborator

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, ""))
Collaborator

Should be ConvertToS3Chain?

Should be `ConvertToS3Chain`?
Poster
Collaborator

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 issue 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.
There is no content yet.