[#365] Include iam user tags in query #365
No reviewers
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-s3-gw#365
Loading…
Reference in a new issue
No description provided.
Delete branch "pogpp/frostfs-s3-gw:feature/add_user_tags_in_query"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Pavel Pogodaev p.pogodaev@yadro.com
80b4809ca5
to1b562df3fc
[#291] Include iam user tags in queryto [#365] Include iam user tags in query@ -385,0 +384,4 @@
reqInfo := GetReqInfo(ctx)
queries := reqInfo.URL.Query()
for _, v := range reqInfo.GetTags() {
We must use user claims from
frostfsid
. Tags fromreqInfo
contain nothing.You should extend method
FrostFSIDInformer.GetUserGroupIDs
that it returns not only groups but also all claims.Also add tests please
1b562df3fc
tof0943fa580
f0943fa580
to2b15ead7b5
@ -250,6 +250,14 @@ func TestDefaultBehaviorPolicyChecker(t *testing.T) {
createBucketErr(chiRouter, ns, bktName, apiErrors.ErrAccessDenied)
}
func TestDefaultPolicyCheckerWithUserTags(t *testing.T) {
Could you clarify what this test does?
It would be nice to have tests that check if user can have access with certain claims
@ -127,1 +127,3 @@
return res, nil
tags := make(map[string]string)
for k, v := range subjExt.KV {
if strings.HasPrefix(k, "tag-") {
Let's rename this function to
GetUserGroupIDsAndClaims
and return not only tags but all KV claimse2e6794605
toe33ca77ec8
@ -253,0 +255,4 @@
ns, bktName := "", "bucket"
router.middlewareSettings.denyByDefault = true
allowOperations(router, ns, []string{"s3:CreateBucket"}, nil)
createBucket(router, ns, bktName)
The logic should be the following:
true
AccessDenied
must be got)FrostFSIDMock
so it return appropriate tag for userPlease, rebase
e33ca77ec8
to608fc3d09b
@ -125,3 +126,3 @@
func (h *handlerMock) HeadObjectHandler(http.ResponseWriter, *http.Request) {
//TODO implement me
// TODO implement me
Do we really need such changes?
It's GoLand autoformating - gimme just a moment
Please, beatify commit. Now we have two commits with the same message. Squash them into one commit or separate more logically and mention such separation in commit messages
608fc3d09b
toe6bdcb4228
Rebase, please
e6bdcb4228
toe48b46d0ab
@ -129,0 +130,4 @@
func (f *FrostFSID) GetUserGroupIDsAndClaims(userHash util.Uint160) ([]string, map[string]string, error) {
subjExt, err := f.frostfsid.GetSubjectExtended(userHash)
if err != nil {
if strings.Contains(err.Error(), "not found") {
What is the purpose of this
if
?@ -127,2 +127,4 @@
return userKey, nil
}
func (f *FrostFSID) GetUserGroupIDsAndClaims(userHash util.Uint160) ([]string, map[string]string, error) {
It seems we must update
GetUserGroupIDs
(now it isn't used I suppose)Consequences of bad rebase conflict resolving
e48b46d0ab
to5e1f3a8189
@ -63,3 +63,3 @@
if strings.Contains(err.Error(), "not found") {
f.log.Debug(logs.UserGroupsListIsEmpty, zap.Error(err))
return nil, nil
return nil, nil, err
We must not return error
5e1f3a8189
tob902c9d999
b902c9d999
tof206b87a93
f206b87a93
to3c436d8de9