[#221] eacl: Get rid of deprecated methods usage

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-12-01 10:35:01 +03:00 committed by Leonard Lyubich
parent 4c0ca23b34
commit d94a0eb25e
4 changed files with 7 additions and 8 deletions

View file

@ -124,12 +124,12 @@ func TestHeadRequest(t *testing.T) {
senderKey := test.DecodeKey(-1).PublicKey
r := new(eacl.Record)
r := eacl.NewRecord()
r.SetOperation(eacl.OperationHead)
r.SetAction(eacl.ActionDeny)
r.AddFilter(eacl.HeaderFromObject, eacl.MatchStringEqual, attrKey, attrVal)
r.AddFilter(eacl.HeaderFromRequest, eacl.MatchStringEqual, xKey, xVal)
r.AddTarget(eacl.RoleUnknown, senderKey)
eacl.AddFormedTarget(r, eacl.RoleUnknown, senderKey)
table.AddRecord(r)

View file

@ -5,7 +5,6 @@ import (
"errors"
"github.com/nspcc-dev/neofs-api-go/pkg/acl/eacl"
crypto "github.com/nspcc-dev/neofs-crypto"
"github.com/nspcc-dev/neofs-node/pkg/core/container"
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
"go.uber.org/zap"
@ -160,8 +159,8 @@ func matchFilters(hdrSrc TypedHeaderSource, filters []*eacl.Filter) int {
func targetMatches(unit *ValidationUnit, record *eacl.Record) bool {
for _, target := range record.Targets() {
// check public key match
for _, key := range target.Keys() {
if bytes.Equal(crypto.MarshalPublicKey(&key), unit.key) {
for _, key := range target.BinaryKeys() {
if bytes.Equal(key, unit.key) {
return true
}
}