-
Notifications
You must be signed in to change notification settings - Fork 51
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
Interactions between documentLoader and security context #80
Comments
I opened this issue here, but its really about inheritance assumptions of jsonld-signatures and their assumed interfaces by this library: https://github.com/digitalbazaar/jsonld-signatures/blob/master/lib/suites/LinkedDataProof.js#L50 |
I have confirmed this issue by reimplementing the necessary parts, and observing that my new implementation that requires a custom documentLoader (and will not use a "default") hits I recommend verifying this issue by testing |
When issuing a vc, and passing a custom document loader (that only supports local contexts), you should be forced to have local copies of the following:
|
@dlongley mentioned in a drive-by IRC comment that "you get a |
This issue is a little hard to parse. Could we get a simple runnable example that demonstrates the problem whereby changing If a type value is being expressed as But I think we need a runnable example to easily explore this further. |
https://github.com/w3c-ccg/lds-jws2020#usage ^ has examples. As i noted here: #80 (comment), we don't see the security context v2 getting loaded by the document loader... so a custom document loader cannot be used to "preview" what the suite would look like with all terms in that context. |
@OR13, Ok, we'll look into this further as soon as we can. I do see right away that the "JsonWebKey2020" term isn't defined in any context that is used in the first example. If we cooked up a context that would work with the example, determined that setting the |
@dlongley yes, i think so.. but it won't resolve the issue of wanting to simulate an updated security context with those terms... which is what I was hoping to be able to show here, because my goal was to get this suite to the same state as
The way the documentLoader in this repo is handling security context-v2 seems to be preventing me from accomplishing 1 without implementing 2... which seems like a bug to me. when a custom document loader is provided, it should be possible to see the security-v2 context resolved... my testing indicated that the way overloading was happening, custom document loaders cannot override the security context. https://github.com/digitalbazaar/jsonld-signatures/blob/master/lib/documentLoader.js#L19
This logic implies that it's not possible to simulate changes to the security context with the libraries as is. |
This is still on my radar, just been too busy to get to it. In the meantime, I have some other comments in another issue that you may find useful for your understanding around jsonld-signatures that I thought I'd link to: digitalbazaar/jsonld.js#402 |
@OR13 -- sorry, forgot to tag you in the above comment. |
no worries, I'm hoping that I can take another stab at debugging it now that I have a better understanding of the internals.... I believe the BBS+ signature suite is having similar issues. essentially the problem is "How to use new signature suites with the vc data model". |
I expect we will have the same issue with |
That's exactly what brought me here. I'm signing VCs with secp384k1, for which I'm using a custom schema (basically a copy-paste of https://www.w3.org/2018/credentials/v1 and adding EcdsaSecp384r1Signature2020 with ID "https://w3id.org/security#EcdsaSecp384r1Signature2020"), but still get Any clue on how to extend the schema? |
However, you may also need to adjust |
Thanks, @OR13! I'll take a look into it. I've already implemented custom LDKeyPair and LinkedDataSignature, so I hope I'm almost there. |
It worked! I just missed the final two adjustments on Thanks! |
When a signature suite is not registered here: https://w3id.org/security/v2
match proof must be modified like so:
This modification needs to happen in classes which are normally internal, and thus, this behavior prevents the use of vc-js with custom signature suites, unless the implementer does not extend DB classes (forces implementer to not use inheritance)... this seems undesirable for digital bazaar, but I'm not really sure...
There are various other approaches possible, like experimenting with adding contexts, overriding contexts,
compactProof
, or changingSECURITY_CONTEXT_URL
...however, all of them are more intrusive than changing
matchProof
... and since any new suite is obviously not going to be registered inSECURITY_CONTEXT_URL
yet... it seems logical to make the change suggested...For example, this one change, allows for a new suite: https://github.com/w3c-ccg/lds-jws2020/pull/19/files#diff-e886e78ec0726474ae672dcfa71f28c7R16
and an old suite: https://github.com/w3c-ccg/lds-jws2020/pull/19/files#diff-ed30fefd45db38ae8b8b0e692510803fR16
to both pass tests... but it required the new suite to make the change noted on this ticket... no additional changes were required, see the document loader:
https://github.com/w3c-ccg/lds-jws2020/pull/19/files#diff-e25e8ce8b4ce985e43c848580e547d55R13
The text was updated successfully, but these errors were encountered: