[#510] treesvc: Rename `tableFromBearer` to `useBearer`
ci/woodpecker/pr/pre-commit Pipeline failed Details
Build / Build Components (1.19) (pull_request) Successful in 3m56s Details
Build / Build Components (1.20) (pull_request) Successful in 3m40s Details
Tests and linters / Tests (1.20) (pull_request) Successful in 4m40s Details
Tests and linters / Tests with -race (pull_request) Successful in 4m57s Details
Tests and linters / Staticcheck (pull_request) Successful in 3m59s Details
Tests and linters / Tests (1.19) (pull_request) Successful in 14m5s Details
Tests and linters / Lint (pull_request) Successful in 14m52s Details

With impersonation, the old name is no longer descriptive.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
pull/510/head
Evgenii Stratonikov 2023-07-12 10:26:18 +03:00
parent aa935a4c40
commit 32d92b8038
1 changed files with 4 additions and 4 deletions

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()
}
}