forked from TrueCloudLab/frostfs-node
[#1601] util: Correctly parse 'root' name for container resources
* Convert `root/*` to `//`; * Add unit-test case for parses to check parsing correctness. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
05fd999162
commit
c3c034ecca
2 changed files with 10 additions and 1 deletions
|
@ -43,6 +43,15 @@ func TestParseAPERule(t *testing.T) {
|
|||
Resources: policyengine.Resources{Names: []string{nativeschema.ResourceFormatRootObjects}},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Valid rule for all containers in explicit root namespace",
|
||||
rule: "allow Container.Put root/*",
|
||||
expectRule: policyengine.Rule{
|
||||
Status: policyengine.Allow,
|
||||
Actions: policyengine.Actions{Names: []string{nativeschema.MethodPutContainer}},
|
||||
Resources: policyengine.Resources{Names: []string{nativeschema.ResourceFormatRootContainers}},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Valid rule for all objects in root namespace and container",
|
||||
rule: "allow Object.Put /cid/*",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue