diff --git a/go.mod b/go.mod index 415b746d7..5fcdbf384 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/multiformats/go-multiaddr-net v0.1.2 // v0.1.1 => v0.1.2 github.com/multiformats/go-multihash v0.0.13 // indirect github.com/nspcc-dev/neo-go v0.91.1-pre.0.20201030072836-71216865717b - github.com/nspcc-dev/neofs-api-go v1.20.3-0.20201126102634-2a94fdc5e709 + github.com/nspcc-dev/neofs-api-go v1.20.3-0.20201201071132-c01024b5531a github.com/nspcc-dev/neofs-crypto v0.3.0 github.com/nspcc-dev/tzhash v1.4.0 github.com/panjf2000/ants/v2 v2.3.0 diff --git a/go.sum b/go.sum index 97caf4843..b88742fd6 100644 Binary files a/go.sum and b/go.sum differ diff --git a/pkg/services/object/acl/eacl/v2/eacl_test.go b/pkg/services/object/acl/eacl/v2/eacl_test.go index 0c6f9ff3f..0a4721485 100644 --- a/pkg/services/object/acl/eacl/v2/eacl_test.go +++ b/pkg/services/object/acl/eacl/v2/eacl_test.go @@ -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) diff --git a/pkg/services/object/acl/eacl/validator.go b/pkg/services/object/acl/eacl/validator.go index 8939f06a8..212433204 100644 --- a/pkg/services/object/acl/eacl/validator.go +++ b/pkg/services/object/acl/eacl/validator.go @@ -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 } }