verifiablesoftware / vsw

Core project of VerifiableSoftware
Apache License 2.0
1 stars 0 forks source link

vsw exit should remember status #102

Closed wenjing closed 3 years ago

wenjing commented 3 years ago

After "vsw exit", we should remember the status and refuse to execute any more commands. v0.0.10 currently still attempts to perform new commands. It should check its wallet and agent status and tell user to perform "vsw setup" first.

root@bf2fc89a268a:/# vsw list -cd {'credential_definition_ids': ['7oyYcUVf2DfqqL4h338Rdj:3:CL:3733:default']} root@bf2fc89a268a:/# vsw exit Exited vsw root@bf2fc89a268a:/# root@bf2fc89a268a:/# vsw list -c 2021-05-26 17:56:28 vsw.commands.list ERROR /usr/local/lib/python3.6/dist-packages/vsw/commands/list.py Failed to execute list: HTTPConnectionPool(host='127.0.0.1', port=8021): Max retries exceeded with url: /connections (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f4bfa1de128>: Failed to establish a new connection: [Errno 111] Connection refused',))

felixchen1023 commented 3 years ago

fixed now, please verify

wenjing commented 3 years ago

You added checking to "vsw list", but other commands are still allowed. Please go through all of them, or add condition checking to the top level. After vsw exit, the only valid command is "vsw setup wallet" or "vsw setup newwallet" or "vsw help". root@dbc35131571b:/# root@dbc35131571b:/# vsw exit root@dbc35131571b:/# vsw list -c 2021-06-02 17:31:21 vsw.commands.list ERROR /usr/local/lib/python3.6/dist-packages/vsw/commands/list.py vsw is not running root@dbc35131571b:/# vsw exit root@dbc35131571b:/# vsw publish -c workspace/publish_attest.json -s testCertificate 2021-06-02 17:31:57 vsw.commands.attest INFO /usr/local/lib/python3.6/dist-packages/vsw/commands/attest.py executing publish, please waiting for response 2021-06-02 17:31:57 vsw.commands.publish ERROR /usr/local/lib/python3.6/dist-packages/vsw/commands/publish.py vsw is not running root@dbc35131571b:/# root@dbc35131571b:/# vsw usage: vsw [-h] [-v] {exit,help,list,publish,revoke,setup,verify} vsw: error: the following arguments are required: command, args root@dbc35131571b:/# vsw setup Incorrect sub command root@dbc35131571b:/#
root@dbc35131571b:/# root@dbc35131571b:/# root@dbc35131571b:/# root@dbc35131571b:/# vsw revoke vsw: error: either the credential exchange id, or credential registry id and credential revocation id are required. Usage: vsw revoke [options] -cei, --credential-exchange-id The Credential Exchange Id -reg, --credential-registry-id The Credential Registry ID -rev, --credential-revocation-id The Credential Revocation ID root@dbc35131571b:/# vsw revoke -reg NpVnd1VR2je1pmHA8uepfq:4:NpVnd1VR2je1pmHA8uepfq:3:CL:3949:default:CL_ACCUM:5ce87596-bf vsw: error: the credential registry id and credential revocation id are both required. Usage: vsw revoke [options] -cei, --credential-exchange-id The Credential Exchange Id -reg, --credential-registry-id The Credential Registry ID -rev, --credential-revocation-id The Credential Revocation ID root@dbc35131571b:/# vsw revoke -reg NpVnd1VR2je1pmHA8uepfq:4:NpVnd1VR2je1pmHA8uepfq:3:CL:3949:default:CL_ACCUM:5ce87596-bf30-469a-8f18-e51167a07a46 -cei 1 2021-06-02 17:35:44 vsw.commands.revoke INFO /usr/local/lib/python3.6/dist-packages/vsw/commands/revoke.py executing revoke, please waiting for response Traceback (most recent call last): File "/usr/local/bin/vsw", line 11, in sys.exit(main()) File "/usr/local/lib/python3.6/dist-packages/vsw/main.py", line 9, in main cli.dispatch(sys.argv[1:]) File "/usr/local/lib/python3.6/dist-packages/vsw/cli.py", line 36, in dispatch return main(args.args) File "/usr/local/lib/python3.6/dist-packages/vsw/commands/revoke.py", line 36, in main revoke(credential_exchange_id, credential_registry_id, credential_revocation_id, args.publish) File "/usr/local/lib/python3.6/dist-packages/vsw/commands/revoke.py", line 65, in revoke credential_registry_id = res["revoc_reg_id"] KeyError: 'revoc_reg_id' root@dbc35131571b:/#

felixchen1023 commented 3 years ago

fixed

wenjing commented 3 years ago

verified in 0.0.18