[#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 <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-03-23 15:50:34 +03:00 committed by Alex Vanin
parent 9b2523a408
commit f2c1bc4bfb

View file

@ -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)