generated from TrueCloudLab/basic
Support group conditions #33
Labels
No labels
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/policy-engine#33
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
In IAM service it's required to be able set rules that match request if its owner belongs to specific group in frostfsid (note that subject/user can belong to several groups).
We have several options as I can see:
CondStringContains
or more group specific name). And add the following case here:so we can form rule condition:
and some request property
groupIDs: 1,2,3
.CondContains
), change Request so that return several values. Then we can use the following case:so we can form rule condition:
and some request property
groupIDs: [1,2,3]
.CondStringLike
condition but support more complex wildcard using in glob. Then we can have rule condition:and form request property as
groupIDs: 1,2,3
.Probably we can have some other options
Let's resolve it before the end of the year.
First option is cheap and straightforward,
but requires to define property delimiter to split single string to multiple values, which may be tricky. I think comma is okay if we support character escaping (now or later).Edit 1: First option is more about finding sub-string in a value string which is also fair solution.
Second option gives us more unintuitive cases, e.g. operation is
CondStringEquals
andlen(val)==2
for some reason. Should we compare both values inval
or only the first? I think such condition is worse than having hardcoded delimiter in a string./cc @fyrchik @dstepanov-yadro @aarifullin
I like the first and the last options.
The first looks like the cheapest option (and can be reused for other things)
Regarging the last one: don't we need to eventually implement it anyway because that's is what aws support (and thus what IAM converter needs)?
Don't like the second one: returning
any
or multiple values seems an overkill.Regarding the first and last option: as @alexvanin noticed using
strings.Contains
or regexp*1*
will matchgroupIDs: 11,12
that seems incorrect.So probably we should transform the first option:
CondSlicesContains
The exact implementation is up to debate, we could even use
\x00
as a separator -- this way strings with,
are supported too.And for regexp it is possible to use
(^|,)...($|,)
Let's go for
\x00
separator andCondSliceContains
condition, unless there are strong opinions against it.