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 Binary files a/go.sum and b/go.sum differ 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() }, }