verifiablesoftware / vsw

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

verify predicate conditions not working #114

Closed wenjing closed 3 years ago

wenjing commented 3 years ago

I use test1.json: vsw verify -c test1.json works.

Then, added: "requested_predicates": { "1_ranking_GE_uuid": { "name": "ranking", "p_type": ">=", "p_value": 3 } }

It failed with error:

root@4d7cb3cff4ff:/# workspace/test13 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/verify.py", line 36, in main execute(parsed_args.proof_request, parsed_args.revoke_date) File "/usr/local/lib/python3.6/dist-packages/vsw/commands/verify.py", line 82, in execute requested_predicates, revoke_date) File "/usr/local/lib/python3.6/dist-packages/vsw/commands/verify.py", line 211, in send_request p["restrictions"] = [{"cred_def_id": attest.get_credential_definition_id()}] File "/usr/local/lib/python3.6/dist-packages/vsw/commands/attest.py", line 71, in get_credential_definition_id raise ValueError('vsw: error: Not found attest credential definition id!') ValueError: vsw: error: Not found attest credential definition id! root@4d7cb3cff4ff:/# root@4d7cb3cff4ff:/#

wenjing commented 3 years ago

{ "requested_attributes": [ { "schema_id": "UyDtaEFuTySAV9VZDykHkh:2:softwareCertificate:0.3", "issuer_did": "A9cEertJWkV6zKDTwcuEho", "attr::softwarename::value": "vsw", "attr::softwareversion::value": "0.0.11", "attr::softwaredid::value": "P9VxHNTAmn8LHnbXP95i4q" }, { "schema_id": "UyDtaEFuTySAV9VZDykHkh:2:testCertificate:0.1", "attr::testerdid::value": "8ombbMgjNRDXYf2ZhfvdzM", "attr::softwaredid::value": "P9VxHNTAmn8LHnbXP95i4q", "attr::testspecurl::value": "https://github.com/verifiablesoftware/vsw-repo/tree/master/tests", "attr::testresult::value": "Pass" } ], "requested_predicates": { "1_ranking_GE_uuid": { "name": "ranking", "p_type": ">=", "p_value": 3 } } }

felixchen1023 commented 3 years ago

Fixed

wenjing commented 3 years ago

Also, to be consistent, the predicate should look something like:

"requested_predicates": { [ { "schema_id": "UyDtaEFuTySAV9VZDykHkh:2:testCertificate:0.1", "issuer_did": "8ombbMgjNRDXYf2ZhfvdzM", "name": "ranking", "p_type": ">=", "p_value": 3 } ] }

Similarly, "attr::softwarename::value" should just be "softwarename", or better, "softwareName"? This file is not well formatted.

wenjing commented 3 years ago

verified in 0.0.20