WIP: Morph: Add unit tests #2

Closed
dstepanov-yadro wants to merge 233 commits from TrueCloudLab/frostfs-node:master into object-3608-morph-unit-tests
Showing only changes of commit 8a9fc2c372 - Show all commits

View file

@ -84,7 +84,7 @@ func (s *Service) verifyClient(req message, cid cidSDK.ID, rawBearer []byte, op
return nil
}
var tableFromBearer bool
var useBearer bool
if len(rawBearer) != 0 {
if !basicACL.AllowedBearerRules(op) {
s.log.Debug(logs.TreeBearerPresentedButNotAllowedByACL,
@ -92,13 +92,13 @@ func (s *Service) verifyClient(req message, cid cidSDK.ID, rawBearer []byte, op
zap.String("op", op.String()),
)
} else {
tableFromBearer = true
useBearer = true
}
}
var tb eacl.Table
signer := req.GetSignature().GetKey()
if tableFromBearer && !bt.Impersonate() {
if useBearer && !bt.Impersonate() {
if !bearer.ResolveIssuer(*bt).Equals(cnr.Value.Owner()) {
return eACLErr(eaclOp, errBearerWrongOwner)
}
@ -110,7 +110,7 @@ func (s *Service) verifyClient(req message, cid cidSDK.ID, rawBearer []byte, op
}
tb = *tbCore.Value
if tableFromBearer && bt.Impersonate() {
if useBearer && bt.Impersonate() {
signer = bt.SigningKeyBytes()
}
}