w3c / vc-test-suite

Verifiable Credentials WG Test Suite
https://w3c.github.io/vc-test-suite/
BSD 3-Clause "New" or "Revised" License
69 stars 39 forks source link

Allow VP without verifiableCredential or proof #113

Closed clehner closed 3 years ago

clehner commented 3 years ago

This addresses #112 to allow a VerifiablePresentation without the verifiableCredential property, for the use case of proving control over a DID as in vp-request-spec. I also removed the requirement for the proof property, as that property is similarly mentioned in the VC Data Model with "If present," implying optionality (https://w3c.github.io/vc-data-model/#presentations-0) - except for ZKPs where it is required (https://w3c.github.io/vc-data-model/#zero-knowledge-proofs).

I renamed the positive test case for a VP containing verifiableCredential and proof to say "MAY" instead of "MUST". "MAY" isn't used elsewhere in the tests, but I thought it would be useful to express that the credential may have this property (which the implementation must support). Since this test case is the same but only renamed, I considered updating the implementation reports JSON with the renaming, so that their info would still appear in the generated implementation report HTML file. But I left them as-is so they remain true to what the implementors submitted. This particular row in the generated implementation report then disappears until implementation reports are updated.

The negative case for missing verifiableCredential is changed to a positive case ("MAY omit verifiableCredential"). This means previous implementations passing this test will now fail it, and vice versa. But it will be useful to know which ones support this for the use cases in question.

A possible use case for omitting the proof property is in https://github.com/w3c-ccg/vc-http-api/issues/88, but I did not add any positive test case for omitting the proof property.

To replace the negative test case for missing proof property, I added a negative test case for a proof with missing type property, as that is a required property: https://w3c.github.io/vc-data-model/#proofs-signatures

Fixes #112

msporny commented 3 years ago

Merge conflicts.

I'd also like a few people to run these tests against their implementations to make sure they agree with the changes.

clehner commented 3 years ago

Rebased to fix merge conflicts. I'm also open to other ways to make this work.

msporny commented 3 years ago

Rebased to fix merge conflicts. I'm also open to other ways to make this work.

Conflicts are back :(

clehner commented 3 years ago

Rebased again. The conflicts were in implementations/index.html; fixed using node implementations/generate.js

msporny commented 3 years ago

@brentzundel -- can you please check the changes in this PR... it modifies the ZKP tests in a way that I think is correct, but want to double check with you to make sure I'm not missing something.