walletcli

command module
v0.0.0-...-9a4d363 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

README

WalletCLI testing tool

WalletCLI is a testing tool for checking the OIDC4VP flow. Referring to the sequence diagram for OIDC for SIOP presentation it simulates the Wallet behaviour starting from the step "Scan QR code and loads wallet" (#15) until checking the post authorization response status (#31).

Prerequisites

During the processing of OIDC4VP flow Wallet has to be enriched with the signed credentials to be able to resolve a Presentation Definition query. Please refer to the interface "VCProvider" that developer may use to provide a different credentials source. For now there is only one implementation called "vcs" that by default interacts with the Local VCS API, that can be launched using BDD docker-compose.yml file.

Therefore, to be able to use vcs VCProvider with default VCS local config, developer should launch VCS environment in advance.

CLI arguments

The next CLI arguments are supported:

-qrCodePath - path to the file with QR code. Only *.gif, *.jpg and *.png formats supported.

-oidc4vpAuthorizationRequest - OIDC4VP authorization request string. (e.g. openid-vc://?request_uri=http://example.com/request-object/637b99d5a2a6e0b3fc7d7192).

-vcProvider - VC provider implementation. (Default: vcs).

-vcIssuerURL - Issuer URL (Default: https://localhost:4455/issuer/profiles/i_myprofile_ud_es256_jwt/credentials/issue).

-vcFormat - format of the VC. Supported formats are jwt_vc and ldp_vc. (Default: jwt_vc).

Note:

`qrCodePath` or `oidc4vpAuthorizationRequest` must be supplied.

Usage

# build 
go build -o walletcli ./cli.go 

#run
./walletcli -qrCodePath=testdata/example/qrcode.png

Output example

$ ./walletcli -qrCodePath=qrcode.png
 Start OIDC4VP flow
 AuthorizationRequest: openid-vc://?request_uri=http://vc-rest-echo.trustbloc.local:8075/request-object/637ba60ca2a6e0b3fc7d71a2
 Creating wallet
 Issuing credentials
 Saving credentials to wallet
 4 credentials were saved to wallet
 Fetching request object
 Resolving request object
 Querying VC from wallet
 Creating authorized response
 Sending authorized response
 Credentials shared with verifier

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL