generated from TrueCloudLab/basic
Add printing user info
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
parent
c40ad3627d
commit
9cb198d411
1 changed files with 13 additions and 0 deletions
|
@ -2,6 +2,7 @@ package chains
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
|
"encoding/hex"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
@ -85,6 +86,8 @@ func runListCmd(cmd *cobra.Command, _ []string) error {
|
||||||
return err
|
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))
|
res, err := commonclient.ReadIteratorItems(invoker.New(rpcCli, nil), 100, policyHash, "iteratorChainsByPrefix", big.NewInt(int64(policycontract.Namespace)), subj.Namespace, string(service))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -188,3 +191,13 @@ func parseService(service string) (apechain.Name, error) {
|
||||||
|
|
||||||
return "", errUnknownServiceType
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue