diff --git a/modules/chains/list_user.go b/modules/chains/list_user.go index 64afe55..ba0f58a 100644 --- a/modules/chains/list_user.go +++ b/modules/chains/list_user.go @@ -2,6 +2,7 @@ package chains import ( "encoding/base64" + "encoding/hex" "errors" "fmt" "math/big" @@ -85,6 +86,8 @@ func runListCmd(cmd *cobra.Command, _ []string) error { return err } + printSubject(cmd, subj) + res, err := commonclient.ReadIteratorItems(invoker.New(rpcCli, nil), 100, policyHash, "iteratorChainsByPrefix", big.NewInt(int64(policycontract.Namespace)), subj.Namespace, string(service)) if err != nil { return err @@ -188,3 +191,13 @@ func parseService(service string) (apechain.Name, error) { return "", errUnknownServiceType } + +func printSubject(cmd *cobra.Command, subj *ffsidclient.SubjectExtended) { + cmd.Println("ns:", subj.Namespace) + cmd.Println("name:", subj.Name) + cmd.Println("key:", hex.EncodeToString(subj.PrimaryKey.Bytes())) + cmd.Println("claims:") + for k, v := range subj.KV { + cmd.Println(k, v) + } +}