tree: Use delete verb instead put for Remove #1443
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
6 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1443
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "aarifullin/frostfs-node:fix/tree_remove_ape"
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?
Close #1406
We came to a point that resolving the issue #1406 by fixing policy-engine is not a good idea:
AWS specifies the behavior for negated operators and operators with
...IfExists...
in very complicating manner. That may lead to the backward-combability problem and also we may get unexpected behavior.So, here is the workaround. Let me remind: although we no longer check tree operations by eACL tables, we still use ACL "flavor" providing ACL operations instead of tree service verbs (for a while).
I believe, using
acl.OpObjectDelete
must be safe and the check forRemove
won't hit inappropriate policy (see #1406)[#1406] tree: Use delete verb instead put for Removeto tree: Use delete verb instead put for Remove@ -229,3 +229,3 @@
}
err := s.verifyClient(ctx, req, cid, b.GetBearerToken(), acl.OpObjectPut)
err := s.verifyClient(ctx, req, cid, b.GetBearerToken(), acl.OpObjectDelete)
An alternative: pass
OpObjectPut
as well butverifyClient
must specify the context of invocation to set "object type" property to APE-resource that seems unnecessaryI suppose it's ok to use just
acl.OpObjectDelete
here (in tree service). But for the same check in object service it seems we need add object type property. Otherwise, ifput tombstone
request goes to node that is not in container we will get the same problem (because check fails). Or do I miss something?The object service correctly sets resource properties and checks are performed correctly. We've got no problems so far
The tree service should have set the property on its own - like the object service does. But that's unnecessary if we use Delete op instead Put
@alexvanin @dkirillov could you approve this? We might've broken something.
LGTM, but can we add some tests?
Could you clarify then, what particularly you'd like to check with such tests? As we don't mock tree service, handlers won't be checked anyway. The checker itself is already tested and it works well (the same checker is used for object service and it's been already checked there)
UPD: I've add a couple of unit-tests to check that put and delete rules are not intersected and status is returned correctly
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings