[#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:
parent
9b2523a408
commit
f2c1bc4bfb
1 changed files with 7 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue