[#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,11 +66,14 @@ func createEACL(cmd *cobra.Command, _ []string) {
|
||||||
outArg, _ := cmd.Flags().GetString("out")
|
outArg, _ := cmd.Flags().GetString("out")
|
||||||
cidArg, _ := cmd.Flags().GetString("cid")
|
cidArg, _ := cmd.Flags().GetString("cid")
|
||||||
|
|
||||||
containerID := cid.New()
|
var containerID *cid.ID
|
||||||
|
if cidArg != "" {
|
||||||
|
containerID = cid.New()
|
||||||
if err := containerID.Parse(cidArg); err != nil {
|
if err := containerID.Parse(cidArg); err != nil {
|
||||||
cmd.PrintErrf("invalid container ID: %v\n", err)
|
cmd.PrintErrf("invalid container ID: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rulesFile, err := getRulesFromFile(fileArg)
|
rulesFile, err := getRulesFromFile(fileArg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue