generated from TrueCloudLab/basic
[#17] iam: Add converter to native policy #17
No reviewers
TrueCloudLab/storage-core-developers
TrueCloudLab/storage-services-developers
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
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/policy-engine#17
Loading…
Reference in a new issue
No description provided.
Delete branch "dkirillov/policy-engine:feature/support-iam_to_native_converter"
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: Denis Kirillov d.kirillov@yadro.com
WIP: [#XX] iam: Add converter to native policyto WIP: [#17] iam: Add converter to native policyIs this PR duplicate of TrueCloudLab/frostfs-node#800 ?
Not really, here we want to have converter from IAM (not EACL) policy to native policy
Hm, but looks like this will be
frostfs-storage
- specific, so i think it is better to do infrostfs-node
repository.dfba3eb75b
to3191bab0fc
3191bab0fc
tocec3744f9f
cec3744f9f
toe2e53d8f1e
e2e53d8f1e
to6f140f0df8
6f140f0df8
to9226dc32b9
@ -0,0 +78,4 @@
},
Condition: append(ruleConditions, conditions...),
}
engineChain.Rules = append(engineChain.Rules, r)
Note: we have to form several rules because of currently conditions can be combined only in one level OR/AND but in iam we have more complex scheme.
Also we need separate conditions for user in different rules to achieve OR behavior. The same for resources.
Explanation:
Consider applying initial policy for resources:
bucket1/object1
bucket2/*
In case of
buket1/object1
resource we form native resourcenative:object//<bucket1-cid>/*
and additional condition:FilePath
must equalobject1
. So if we place both native resources (native:object//<bucket1-cid>/*
andnative:object//<bucket2-cid>/*
) into one rule we will match only requests that operates on object withFilePath: object1
even forbucket2
but we want to apply rule to any object inbucket2
cc @fyrchik
WIP: [#17] iam: Add converter to native policyto [#17] iam: Add converter to native policy@ -223,2 +223,4 @@
func (p Policy) validate() error {
if len(p.Statement) == 0 {
return errors.New("'Statement' missing")
typo: 'Statement' is missing
9226dc32b9
to3d8b63ac2a
@ -0,0 +30,4 @@
supportedS3ActionListBucket = "ListBucket"
)
//nolint:funlen
:-(
Whoops. It's not necessary anymore
3d8b63ac2a
toc9d4d15db6
@ -4,2 +4,3 @@
require github.com/stretchr/testify v1.8.1
require (
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20231114081800-3787477133f3
sdk-go
could depend on this repo, not the other way around.Should we avoid neo-go dependency as well? I think it is possible by making interfaces more abstract and return strings, instead of keys and container ids.
I would avoid if possible, though neo-go couldn't introduce circles, SDK easily can.
Ok, I'll fix this
c9d4d15db6
to5fa9d91903