From 1caf15463e9a0803f3f612b9f47ee9b985f404a3 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 17 Nov 2020 11:51:49 +0300 Subject: [PATCH] [#174] Update to neofs-api-go v1.20.0 Signed-off-by: Leonard Lyubich --- go.mod | 2 +- go.sum | Bin 59747 -> 59689 bytes pkg/core/container/fmt.go | 4 ++-- pkg/services/object/acl/eacl/validator.go | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 4ac5fc01..e195ee4c 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 904341e5fba0c8ce19380a4443cbf482558dab5e..f16fceee03ae2355247f63e37d4bb69eafe87e37 100644 GIT binary patch delta 75 zcmaESiFxHE<_+vw#zqEu1_~L5R>h^-MuEoO6@?z|j%lSHPD#Q3{-s_iNr44PWiD>X dsd;5)J`q__RYsoKlOJTNvw-w%o}YE34gltM8rlE= delta 137 zcmZ2^iTUv*<_+vw0mgcUx(0ei21W*khK6PamL?{~=DKOA#>Qr8DW*w@MivSghE{F? z!6vC*6{ZHMZh4hy8JQl=VY!L^DP_imW(Fyxj-{bdzG3;ro<0!~CX)+u#V3Ey6i_5+ K@aEL4BXs~azbWMa diff --git a/pkg/core/container/fmt.go b/pkg/core/container/fmt.go index 1fbcdbce..75404933 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 9cb3c6d7..f0179b74 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() }, }