-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: updates v3-unstable context to follow best practices #70
Conversation
Ok @dlongley thanks for all the advice through the various issues necessary to put this together. We got this working with the Bbs Signature Suite in a way that doesn't conflict with the V1 context. This should address #51 as well. EDIT: still need to update to fully define each term rather than using the compact IRIs when defining terms. Will update that. |
Whilst alphabetising the terms may be useful, it is making this review quite difficult, do you mind reverting and applying the changes to this context in a way that makes it easier to review? |
Overall, +1 for this PR, thank you for putting it together @kdenhartog. Here are my high-level concerns, none of which should block this from being merged (but we may want to take a week or two to try to address them):
That's it upon a cursory examination of the PR... would appreciate responses to the above before we merge. Thank you again for all the hard work! |
"JsonWebKey2020": { | ||
"@id": "https://w3id.org/security#JsonWebKey2020" | ||
"@version": 1.1, | ||
"id": "@id", |
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.
Should also have "@protected": true
at the top level of this context.
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.
Fixed as well now.
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 usage of @protected
ended up breaking many different tests in the BBS suite. I haven't been able to dig in and figure out what is the cause of this yet. The error I'm getting is that I'm redefining protected terms though.
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.
suggest opening an issue, and working to address it with better tests separately... the context you are editing is already marked as unstable.
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.
@kdenhartog -- it sounds like adding @protected
may have successfully surfaced errors that weren't getting detected previously in the BBS suite. The cause of those errors should be determined, we shouldn't turn off protection just to avoid them.
I don't have time to do a full review of the changes here right now, but they are heading in the right direction. Thanks! |
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.
@kdenhartog can you adddress manu's concerns or open issues to track addressing them, and fix the merge conflict.
I am in favor of merging this asap, and taking smaller PRs which are easier to review for specific issues after.
Been working on them today to address them all. Just keep getting sidetracked with other conversations as well. Looking to get this merged ASAP as well. |
a39e8c0
to
90446b8
Compare
So far, we've validated this using BbsBlsSignatures2020 suite. As far as I can tell this remains backwards compatible and doesn't redefine terms in a breaking way (I've effectively just copied v1 and v2). In the case of BbsBlsSignature2020 suite the compact operation being performed by jsonld-signatures is doing so in a way that the type ends up being
Yup agreed tests for all the types would be good. Just don't have the bandwidth to handle that at this point.
Happy to do this before stabilizing, but want to make sure we agree to which terms are being dropped rather than me picking and choosing. I'm not aware of how all of the v1/v2 terms are being used all the time. Can we do this in a separate issue and I'll go through and clean them up after?
Should all be cleaned up now. Thanks.
Should be fixed now as well. Thanks.
All fixed up now as well. |
90446b8
to
a82be1a
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.
This PR is getting large and has already spawned a number of smaller issues, I would like to merge it and address the issues raised seperatly.
We have some unit tests that use this context in our Java library jsonld-common-java. This has a locally cached version of security-v3-unstable.jsonld here. I just tried to simply replace the current version with the version proposed in this PR, and the unit test did NOT pass. The error that is thrown is "An attempt was made to redefine a protected term". This may very well be a bug in our library or the underlying titanium-json-ld rather than the context file. I'd be happy to dig deeper to find out, just wanted to quickly report this. |
@peacekeeper thanks for testing this! I am still in favor to taking these changes, but perhaps we can add some CI checks to this repo next? wonder if we could get some cross language JSON-LD tests going so we an know how changes like this impact , go, python, js and java via CI. |
I've not had time to figure out the problem with this yet, but have narrowed the problem down to using the |
we should add something like what I'm working on here : w3c-ccg/traceability-vocab#28 to this repo eventually. |
Figured out the issue and playing around with a few ways to fix it at the moment. What I've discovered is that the new terms (except the one's defined in the VC context) are encountering issues where the terms are being redefined within the V3 context itself. For example, when using the to now being defined like so:
So the problem is that the way that we originally defined terms like |
This v3-unstable context update makes two major changes. - redefines all of the v2 and v1 context terms in a json-ld 1.1 compliant way rather than inporting through the context. - Makes the v3 context compliant with the VC v1 context so that there's not a protected term conflict.
a82be1a
to
ea39e99
Compare
I've removed the Additionally, I've opened issue #75 so we can decide the best way to update the context before stablizing. This way we can merge this PR and keep the fixes easier to review. |
"cipherData": "https://w3id.org/security#cipherData", | ||
"cipherKey": "https://w3id.org/security#cipherKey", | ||
"created": {"@id": "http://purl.org/dc/terms/created", "@type": "http://www.w3.org/2001/XMLSchema#dateTime"}, | ||
"creator": "http://purl.org/dc/terms/createdcreator", |
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.
"creator": "http://purl.org/dc/terms/createdcreator", | |
"creator": {"@id": "http://purl.org/dc/terms/creator", "@type": "@id"}, |
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.
Thanks will fix this.
Thanks @kdenhartog, I can confirm that this works for me now, and I agree with your analysis (I came to the same conclusion). I wonder, was this working for others, i.e. having |
One additional change I am noticing in my unit tests is that now |
We should have |
They were working fine because the v1/v2 context weren't protecting the terms there, so the scoped context terms that were redefining them overrode the terms discovered in v1/v2 security vocab. Now that all terms are being brought into a single context without reference it's causing issues once the
Yeah see here for the discussion about those considerations: #73
I've diagnosed them in the comments above. I agree that the terms should not be allowed to be redefined and am working on a PR to reintroduce the usage of |
Fine with me, this is definitely good work! But let's try to not leave it in a broken state for long, even if it's marked as unstable.. |
Ok, sounds good. |
Yup, agreed. I've got a few proposals on how to handle this and we can consider the options and discuss in issue #75 |
Merging after multiple Oks. Further work on this will continue as follow up PRs to add the |
This v3-unstable context update makes two major changes.