-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change verifiable_credential
to type Vec<CRED>
in Presentation
#1231
Conversation
verifiable_credential
to type Vec<CRED>
in Presentation
daa0cd8
to
2b02872
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks again 🙏.
I'll approve this with additional comments to mean that I leave it to your judgement whether to implement them or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks for putting in the effort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Wasm examples CI workflow ran for 2:50h but didn't finish until then so I cancelled it. Had this before at some point but a rerun did the trick back then. I haven't restarted in case you want to fix the comment, otherwise just rerun the workflow.
@PhilippGackstatter @abdulmth thank you both for reviewing! I made the last suggested change to the unit test. Hopefully the CI workflow won't have any issues :) |
@nanderstabel Our convention is to let the PR creator hit the merge button, so feel free to go ahead whenever you want. Thanks again 🚀! |
Great, thanks again! |
Description of change
This change ensures that
verifiable_credential
inPresentation
will serialize into a[T]
instead of aT
, which was previously the case whenverifiable_credential
would only hold one single credential.This previous serialization is in line with how
credentialSubject
can be serialized: https://www.w3.org/TR/vc-data-model/#credential-subject, however this is not explicitly stated forverifiableCredential
: https://www.w3.org/TR/vc-data-model/#presentations-0.The following examples that are used in the specification seem to imply that 'single credentials' should be serialized as
[<credential>]
:The W3C VC Data Model 2.0 specification fortunately is more specific in this regard: https://www.w3.org/TR/vc-data-model-2.0/#presentations-0:
Therefore the introduction of the change in this PR.
Important detail:
Both W3C VC Data Model versions state that:
MAY be present
and**If** present...
, which imply thatverifiableCredential
is an optional property. I fail to think of any use case where one would have a presentation without any credentials included but this optional status ofverifiableCredential
is included in this PR as well.Links to any relevant issues
n/a
Type of change
Add an
x
to the boxes that are relevant to your changes.How the change has been tested
test_presentation_deserialization
which tests deserializing from an example verifiable presentation (with some minor adjustments): https://www.w3.org/TR/vc-data-model/#example-a-simple-example-of-a-verifiable-presentationtest_presentation_deserialization_without_credentials
which tests deserializing a verifiable presentation as well, but one without anyverifiableCredential
.test_presentation_builder_valid_without_credentials
which tests building a Presentation without any credentials set.Change checklist
Add an
x
to the boxes that are relevant to your changes.