-
Notifications
You must be signed in to change notification settings - Fork 16
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
Update to go-did v0.11 #2634
Update to go-did v0.11 #2634
Conversation
95f4b7f
to
a6b5ec3
Compare
c57ec44
to
9c2775a
Compare
Could you elaborate on this? In go-leia in examples/jsonld I can change the template (remove the array from children) and it will work exactly the same. Is it only an API problem then? |
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.
I've added a commit to fix a VC validator issue
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.
It seems this only happens for the JSON stores, we can just change them to JSONLD stores and the problem is solved.
- change all JSON collection types to JSONLD collection types
- change to the correct index and search queries
- rename the index, then the index will be rebuild from the kv kackup
Lots of tests have to be updated though.
The need for this change started with simplifying the PEX submission validation. In order to do it without a lot of code, we could change the go-did library so it always marshals to arrays instead of objects when n=1. But this had some more consequences which are now being fixed by this PR. So in short: simplification lead to lib change lead to monkey patch... Maybe it's better to implement the PEX stuff using the complex approach? |
On the other hand, if upcoming VC versions don't compact arrays in JSON-LD, we need it sooner or later? |
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.
over complete review, but requesting changes mainly on last comment
Changes:
VerifiableCredential.IssuanceDate
is now a required*time.Time
. I had to add them where it wasn't present, and change it to a pointer where it was present.Earlier, it included these changes, which we decided to revert since it leads to too many changes in the Nuts node:
go-leia
credential store assume JSON-LD arrays are compacted. Changing this, although still valid JSON-LD and semantically the same credential, would break expected behavior of API users. So I introduced aCompactingVerifiableCredential
andCompactingVerifiablePresentation
which essentially do the same asgo-did
earlier did for JSON-LD types; compacting arrays on JSON marshalling. This is the majority of the change. This can be removed when the VCR v2 API andgo-leia
credential store is replaced with something else.SignedDocument.UnmarshalProofValue
assumed there was only 1 proof which is never the case any more, since it's now always marshalled into an array (even if it has just one value). I extended the function to not burden the caller with checking the number of proofs, since I don't expect there multiple proofs at any time (although still supported).verifiableCredential[0]
).