ape: fill request properties with user claim tags #1096

Merged
fyrchik merged 3 commits from aarifullin/frostfs-node:feat/ape_user_claim_tag into master 2024-04-16 15:54:24 +00:00
Collaborator
  • tree: Make verifyClient fill ape request with user claim tags
  • object: Make ape middleware fill request with user claim tags
  • container: Make ape middleware fill request with user claim tags
  • go.mod: Update policy-engine package version
* `tree`: Make `verifyClient` fill ape request with user claim tags * `object`: Make ape middleware fill request with user claim tags * `container`: Make ape middleware fill request with user claim tags * `go.mod`: Update policy-engine package version
aarifullin added 4 commits 2024-04-16 08:14:49 +00:00
cfd4108826 [#XX] go.mod: Update policy-engine package version
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
cf9d0390d9 [#XX] container: Make ape middleware fill request with user claim tags
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
8dadfe2232 [#XX] object: Make ape middleware fill request with user claim tags
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
DCO action / DCO (pull_request) Failing after 2m38s Details
Vulncheck / Vulncheck (pull_request) Successful in 3m2s Details
Build / Build Components (1.21) (pull_request) Successful in 3m32s Details
Build / Build Components (1.22) (pull_request) Successful in 3m32s Details
Tests and linters / gopls check (pull_request) Successful in 5m16s Details
Tests and linters / Staticcheck (pull_request) Successful in 5m21s Details
Tests and linters / Lint (pull_request) Successful in 6m2s Details
Tests and linters / Tests (1.21) (pull_request) Successful in 10m18s Details
Tests and linters / Tests (1.22) (pull_request) Successful in 10m33s Details
Tests and linters / Tests with -race (pull_request) Successful in 15m58s Details
fcc4ba057f
[#XX] tree: Make `verifyClient` fill ape request with user claim tags
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
aarifullin force-pushed feat/ape_user_claim_tag from fcc4ba057f to a4604e1141 2024-04-16 08:16:04 +00:00 Compare
aarifullin requested review from dkirillov 2024-04-16 08:16:39 +00:00
aarifullin requested review from storage-core-committers 2024-04-16 08:16:41 +00:00
aarifullin requested review from storage-core-developers 2024-04-16 08:28:09 +00:00
dkirillov reviewed 2024-04-16 08:50:05 +00:00
@ -600,0 +626,4 @@
}
return reqProps, nil
}
const tagSuffix = "tag-"

Let's make this function more general. I mean don't use just tags (but all claims). We should write something like

for k, v := range subj.KV {
    key := fmt.Sprintf(commonschema.PropertyKeyFormatFrostFSIDUserClaim, k)
    reqProps[key] = v
}
Let's make this function more general. I mean don't use just tags (but all claims). We should write something like ``` for k, v := range subj.KV { key := fmt.Sprintf(commonschema.PropertyKeyFormatFrostFSIDUserClaim, k) reqProps[key] = v } ```
Poster
Collaborator

Alright

Alright
Poster
Collaborator

I've fixed. Thanks for the commment

I've fixed. Thanks for the commment

It seems there will be a conflict with #1095 -- could you review it, so I can merge and you can rebase this PR?

It seems there will be a conflict with https://git.frostfs.info/TrueCloudLab/frostfs-node/pulls/1095 -- could you review it, so I can merge and you can rebase this PR?
aarifullin force-pushed feat/ape_user_claim_tag from a4604e1141 to 8a35c4de3d 2024-04-16 09:21:09 +00:00 Compare
fyrchik reviewed 2024-04-16 09:23:54 +00:00
@ -600,0 +621,4 @@
}
subj, err := ac.frostFSIDClient.GetSubject(pk.GetScriptHash())
if err != nil {
if !strings.Contains(err.Error(), errSubjectNotFound.Error()) {

You define errSubjectNotFound as an error, but only use it inside strings.Contains
Why not declare a string so that we can avoid the conversion?

You define `errSubjectNotFound` as an error, but only use it inside `strings.Contains` Why not declare a string so that we can avoid the conversion?
Poster
Collaborator

Fixed: subjectNotFoundErrorMessage has been introduced

Fixed: `subjectNotFoundErrorMessage` has been introduced
Poster
Collaborator

PR has been rebased, the conflicts - resolved

PR has been rebased, the conflicts - resolved
aarifullin force-pushed feat/ape_user_claim_tag from 8a35c4de3d to bb0dbfb3a4 2024-04-16 09:27:24 +00:00 Compare
aarifullin force-pushed feat/ape_user_claim_tag from bb0dbfb3a4 to 1387dd1f72 2024-04-16 09:37:24 +00:00 Compare
Poster
Collaborator

It seems there will be a conflict with #1095 -- could you review it, so I can merge and you can rebase this PR?

Sure. I'll rebase and resolve conflicts as soon as you merge your PR

> It seems there will be a conflict with https://git.frostfs.info/TrueCloudLab/frostfs-node/pulls/1095 -- could you review it, so I can merge and you can rebase this PR? Sure. I'll rebase and resolve conflicts as soon as you merge your PR
aarifullin force-pushed feat/ape_user_claim_tag from 1387dd1f72 to 10ee865e98 2024-04-16 12:13:03 +00:00 Compare
dstepanov-yadro approved these changes 2024-04-16 14:30:28 +00:00
fyrchik approved these changes 2024-04-16 15:54:17 +00:00
fyrchik merged commit 10ee865e98 into master 2024-04-16 15:54:24 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1096
There is no content yet.