Skip to content

Commit

Permalink
feat: added wallet-cli VC status output (#1543)
Browse files Browse the repository at this point in the history
Signed-off-by: Mykhailo Sizov <[email protected]>
  • Loading branch information
mishasizov-SK authored Dec 1, 2023
1 parent b28d479 commit 3680bec
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions component/wallet-cli/cmd/oidc4vci_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,20 @@ func NewOIDC4VCICommand() *cobra.Command {
return fmt.Errorf("add credential to wallet: %w", err)
}

var cslURL, statusListIndex, statusListType string
if vcc := vc.Contents(); vcc.Status != nil && vcc.Status.CustomFields != nil {
cslURL = vcc.Status.CustomFields["statusListCredential"].(string)
statusListIndex = vcc.Status.CustomFields["statusListIndex"].(string)
statusListType = vcc.Status.Type
}

slog.Info("credential added to wallet",
"credential_id", vc.Contents().ID,
"credential_type", strings.Join(lo.Filter(vc.Contents().Types, func(item string, i int) bool { return !strings.EqualFold(item, "VerifiableCredential") }), ","),
"issuer_id", vc.Contents().Issuer.ID,
"csl_url", cslURL,
"status_list_index", statusListIndex,
"status_list_type", statusListType,
)

return nil
Expand Down

0 comments on commit 3680bec

Please sign in to comment.