Fix error for APE check #1524
No reviewers
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
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1524
Loading…
Reference in a new issue
No description provided.
Delete branch "aarifullin/frostfs-node:fix/ape/error"
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?
Common APE checking logic was moved into a common package but
CheckAPE
has been returning the error wrapped intoapistatus
. That leads to this effect:So:
apistatus
incommon
packagecba53ccdfc
tod831ffc695
@ -112,3 +106,1 @@
errAccessDenied := &apistatus.ObjectAccessDenied{}
errAccessDenied.WriteReason(err.Error())
return errAccessDenied
return fmt.Errorf("access to operation %s is denied by access policy engine: %s", prm.Request.Operation(), status.String())
This file has not been touched by the recent refactoring.
Why change it instead of fixing what has changed there?
It seems in PR #1362 I unnecessarily moved
apeErr
to common package because I was thinking rather abouttree
service thanobject
service. It's better if the common package just returns error without statuses and each service wraps into status on its ownLet's have a look at the ape middleware of object service. Any failure is turned to
object access denied
bytoStatusErr
invocationSo, I suppose the middleware wraps an error on its own and I don't need to check statuses within