From f2c1bc4bfb13f247c291baca95dc8a41b6b86e06 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 23 Mar 2022 15:50:34 +0300 Subject: [PATCH] [#1261] neofs-cli: Allow to create eACL with empty container ID Empty CID can be used in bearer token eACL. See https://github.com/nspcc-dev/neofs-api/issues/207 . Signed-off-by: Evgenii Stratonikov --- cmd/neofs-cli/modules/acl/extended/create.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/neofs-cli/modules/acl/extended/create.go b/cmd/neofs-cli/modules/acl/extended/create.go index b5033c6a8..da11fcc80 100644 --- a/cmd/neofs-cli/modules/acl/extended/create.go +++ b/cmd/neofs-cli/modules/acl/extended/create.go @@ -66,10 +66,13 @@ func createEACL(cmd *cobra.Command, _ []string) { outArg, _ := cmd.Flags().GetString("out") cidArg, _ := cmd.Flags().GetString("cid") - containerID := cid.New() - if err := containerID.Parse(cidArg); err != nil { - cmd.PrintErrf("invalid container ID: %v\n", err) - os.Exit(1) + var containerID *cid.ID + if cidArg != "" { + containerID = cid.New() + if err := containerID.Parse(cidArg); err != nil { + cmd.PrintErrf("invalid container ID: %v\n", err) + os.Exit(1) + } } rulesFile, err := getRulesFromFile(fileArg)