diff --git a/go.mod b/go.mod index 4ac5fc017..e195ee4c2 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.3.1-0.20201116094437-fe336fd5ba28 + github.com/nspcc-dev/neofs-api-go v1.20.0 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 904341e5f..f16fceee0 100644 --- a/go.sum +++ b/go.sum @@ -276,8 +276,8 @@ github.com/nspcc-dev/neo-go v0.73.1-pre.0.20200303142215-f5a1b928ce09/go.mod h1: github.com/nspcc-dev/neo-go v0.91.0/go.mod h1:G6HdOWvzQ6tlvFdvFSN/PgCzLPN/X/X4d5hTjFRUDcc= github.com/nspcc-dev/neo-go v0.91.1-pre.0.20201030072836-71216865717b h1:gk5bZgpWOehaDVKI5vBDkcjXTpRkKqcvIb1h/vHnBH4= github.com/nspcc-dev/neo-go v0.91.1-pre.0.20201030072836-71216865717b/go.mod h1:9s7LNp2lMgf0caH2t0sam4+WT2SIauXozwP0AdBqnEo= -github.com/nspcc-dev/neofs-api-go v1.3.1-0.20201116094437-fe336fd5ba28 h1:FPS4eJx50eFnyfhiHCVmaOdv3q60duAuUZMVosILXX4= -github.com/nspcc-dev/neofs-api-go v1.3.1-0.20201116094437-fe336fd5ba28/go.mod h1:G7dqincfdjBrAbL5nxVp82emF05fSVEqe59ICsoRDI8= +github.com/nspcc-dev/neofs-api-go v1.20.0 h1:su+2Q3KxqHGAfuHBbSOOuJdbQpbvDFcenv6LXjZz2Ik= +github.com/nspcc-dev/neofs-api-go v1.20.0/go.mod h1:G7dqincfdjBrAbL5nxVp82emF05fSVEqe59ICsoRDI8= github.com/nspcc-dev/neofs-crypto v0.2.0/go.mod h1:F/96fUzPM3wR+UGsPi3faVNmFlA9KAEAUQR7dMxZmNA= github.com/nspcc-dev/neofs-crypto v0.2.3/go.mod h1:8w16GEJbH6791ktVqHN9YRNH3s9BEEKYxGhlFnp0cDw= github.com/nspcc-dev/neofs-crypto v0.3.0 h1:zlr3pgoxuzrmGCxc5W8dGVfA9Rro8diFvVnBg0L4ifM= diff --git a/pkg/core/container/fmt.go b/pkg/core/container/fmt.go index 1fbcdbce6..754049331 100644 --- a/pkg/core/container/fmt.go +++ b/pkg/core/container/fmt.go @@ -23,8 +23,8 @@ func CheckFormat(c *container.Container) error { return errors.Wrap(err, "incorrect version") } - if len(c.OwnerID().ToV2().GetValue()) != owner.NEO3WalletSize { - return errors.Wrap(owner.ErrBadID, "incorrect owner identifier") + if ln := len(c.OwnerID().ToV2().GetValue()); ln != owner.NEO3WalletSize { + return errors.Errorf("incorrect owner identifier: expected length %d != %d", owner.NEO3WalletSize, ln) } if _, err := uuid.FromBytes(c.Nonce()); err != nil { diff --git a/pkg/services/object/acl/eacl/validator.go b/pkg/services/object/acl/eacl/validator.go index 9cb3c6d78..f0179b74f 100644 --- a/pkg/services/object/acl/eacl/validator.go +++ b/pkg/services/object/acl/eacl/validator.go @@ -107,7 +107,7 @@ func tableAction(unit *ValidationUnit, table *eacl.Table) eacl.Action { // - positive value if no matching header is found for at least one filter; // - zero if at least one suitable header is found for all filters; // - negative value if the headers of at least one filter cannot be obtained. -func matchFilters(hdrSrc TypedHeaderSource, filters []eacl.Filter) int { +func matchFilters(hdrSrc TypedHeaderSource, filters []*eacl.Filter) int { matched := 0 for _, filter := range filters { @@ -151,7 +151,7 @@ func matchFilters(hdrSrc TypedHeaderSource, filters []eacl.Filter) int { // returns true if one of ExtendedACLTarget has // suitable target OR suitable public key. -func targetMatches(unit *ValidationUnit, record eacl.Record) bool { +func targetMatches(unit *ValidationUnit, record *eacl.Record) bool { for _, target := range record.Targets() { // check public key match for _, key := range target.Keys() { @@ -170,12 +170,12 @@ func targetMatches(unit *ValidationUnit, record eacl.Record) bool { } // Maps match type to corresponding function. -var mMatchFns = map[eacl.Match]func(Header, eacl.Filter) bool{ - eacl.MatchStringEqual: func(header Header, filter eacl.Filter) bool { +var mMatchFns = map[eacl.Match]func(Header, *eacl.Filter) bool{ + eacl.MatchStringEqual: func(header Header, filter *eacl.Filter) bool { return header.Value() == filter.Value() }, - eacl.MatchStringNotEqual: func(header Header, filter eacl.Filter) bool { + eacl.MatchStringNotEqual: func(header Header, filter *eacl.Filter) bool { return header.Value() != filter.Value() }, }