From d3b998d6720cf76e7608ba070289fe16dcee163d Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Wed, 25 May 2022 11:26:45 +0300 Subject: [PATCH] [#250] eacl: Do not require CID in eACL table Container ID of extended ACL table can be omitted in bearer token according to API. Signed-off-by: Pavel Karpy --- eacl/table.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/eacl/table.go b/eacl/table.go index 962925c..fda5fd9 100644 --- a/eacl/table.go +++ b/eacl/table.go @@ -2,7 +2,6 @@ package eacl import ( "crypto/sha256" - "errors" "fmt" v2acl "github.com/nspcc-dev/neofs-api-go/v2/acl" @@ -183,8 +182,6 @@ func (t *Table) Marshal() ([]byte, error) { return t.ToV2().StableMarshal(nil), nil } -var errCIDNotSet = errors.New("container ID is not set") - // Unmarshal unmarshals protobuf binary representation of Table. func (t *Table) Unmarshal(data []byte) error { fV2 := new(v2acl.Table) @@ -255,7 +252,7 @@ func checkFormat(v2 *v2acl.Table) error { cidV2 := v2.GetContainerID() if cidV2 == nil { - return errCIDNotSet + return nil } err := cID.ReadFromV2(*cidV2)