Add example of APE rules to cli commands help #1575
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
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/frostfs-node#1575
Loading…
Add table
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?
Is your feature request related to a problem? Please describe.
It would be very nice to see syntax for
--rules
flag in help forfrostfs-adm morph ape add-rule-chain
frostfs-cli ape-manager add
Currently there is only comment in code
// ParseAPERule parses access-policy-engine statement from the following form:
// <status>[:status_detail] <action>... [<condition>...] <resource>...
//
// Examples:
// deny Object.Put *
// deny:QuotaLimitReached Object.Put *
// allow Object.Put *
// allow Object.Get ResourceCondition:Department=HR RequestCondition:Actor=ownerA *
// allow Object.Get any ResourceCondition:Department=HR RequestCondition:Actor=ownerA *
// allow Object.Get all ResourceCondition:Department=HR RequestCondition:Actor=ownerA *
// allow Object.* *
// allow Container.* *
//
//nolint:godot
func ParseAPERule(r *apechain.Rule, rule string) error {
Describe the solution you'd like
Add examples to help
Describe alternatives you've considered
No
Additional context
No
The help message for the
--rule
flag in the CLI was recently made more descriptive (#1519). This change is only for the CLI, not forfrostfs-adm
. The need of having it infrostfs-adm
should be considered. Does the existing help message lack anything you might need?etc
For example: Can I use
Container.List
(or action for ListContainer has different name in cli?) in container operations or this is possible only for namespace?Can I provide rule with
StringLike
condition?Probably we support only
=
and!=
for the sake of simplicity. But we should mention this and advise to use json format for complex rules.But probably we could support wildcard in condition with
=
/!=
and consider it as*Like
conditionFinally I'd like to see a couple of exact examples of rules e.g.
I think we should link to a spec then. This help is useful, but not need to be exhaustive. For us
Container.List
is just a string (correct me if I am wrong), and the "real" list of methods depends on the API version.What spec do you mean? If you mean
api-go
orpolicy-engine
it seems I will seePutObject
or similar const there. But cli accept this in different format.Probably we should fix
frostfs-cli
then so it accepts exactly string from spec (PutObect
,ListContainers
etc.) rather thanObject.Put