diff --git a/cmd/neofs-cli/modules/container.go b/cmd/neofs-cli/modules/container.go index b2cd0cba2..ca1a4c6f0 100644 --- a/cmd/neofs-cli/modules/container.go +++ b/cmd/neofs-cli/modules/container.go @@ -340,13 +340,21 @@ var getExtendedACLCmd = &cobra.Command{ return err } - eaclTable, err := cli.GetEACL(ctx, id, client.WithTTL(getTTL())) + res, err := cli.GetEACLWithSignature(ctx, id, client.WithTTL(getTTL())) if err != nil { return fmt.Errorf("rpc error: %w", err) } + eaclTable := res.EACL() + sig := res.Signature() + if containerPathTo == "" { + fmt.Println("eACL: ") prettyPrintEACL(eaclTable) + + fmt.Println("Signature:") + printJSONMarshaler(sig, "signature") + return nil } @@ -366,6 +374,9 @@ var getExtendedACLCmd = &cobra.Command{ fmt.Println("dumping data to file:", containerPathTo) + fmt.Println("Signature:") + printJSONMarshaler(sig, "signature") + return ioutil.WriteFile(containerPathTo, data, 0644) }, } @@ -694,9 +705,13 @@ func parseEACL(eaclPath string) (*eacl.Table, error) { } func prettyPrintEACL(table *eacl.Table) { - data, err := table.MarshalJSON() + printJSONMarshaler(table, "eACL") +} + +func printJSONMarshaler(j json.Marshaler, entity string) { + data, err := j.MarshalJSON() if err != nil { - printVerbose("Can't convert container to json: %w", err) + printVerbose("Can't convert %s to json: %w", entity, err) return } buf := new(bytes.Buffer) diff --git a/go.mod b/go.mod index 6eb9791cc..4dfde67d7 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/multiformats/go-multiaddr-net v0.1.2 // v0.1.1 => v0.1.2 github.com/multiformats/go-multihash v0.0.13 // indirect github.com/nspcc-dev/neo-go v0.91.1-pre.0.20201030072836-71216865717b - github.com/nspcc-dev/neofs-api-go v1.20.3-0.20201123111542-5ee500bb43c6 + github.com/nspcc-dev/neofs-api-go v1.20.3-0.20201124121642-8c99d9d54c5c github.com/nspcc-dev/neofs-crypto v0.3.0 github.com/nspcc-dev/tzhash v1.4.0 github.com/panjf2000/ants/v2 v2.3.0 diff --git a/go.sum b/go.sum index e31d1c98a..bda477d6f 100644 Binary files a/go.sum and b/go.sum differ