Interactions between documentLoader and security context
See original GitHub issueWhen a signature suite is not registered here: https://w3id.org/security/v2
match proof must be modified like so:
async matchProof({
proof,
}: // document,
// purpose,
// documentLoader,
// expansionMap,
any) {
// console.log(proof, this.type);
return proof.type === this.type || proof.type === '/' + this.type;
}
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 changing SECURITY_CONTEXT_URL
…
however, all of them are more intrusive than changing matchProof
… and since any new suite is obviously not going to be registered in SECURITY_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
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:16 (13 by maintainers)
Top GitHub Comments
@antonimmo
https://github.com/transmute-industries/vc.js/blob/master/packages/ed25519-signature-2020/src/__fixtures__/contexts/credentials-latest.json#L12
https://github.com/transmute-industries/vc.js/blob/master/packages/ed25519-signature-2020/src/__fixtures__/credential.json#L6
https://github.com/transmute-industries/vc.js/blob/master/packages/ed25519-signature-2020/src/__fixtures__/documentLoader.ts#L17
https://github.com/transmute-industries/vc.js/blob/master/packages/ed25519-signature-2020/src/__tests__/vc-js-tester.ts#L11
https://github.com/transmute-industries/vc.js/blob/master/packages/ed25519-signature-2020/src/__fixtures__/credential.json#L38
However, you may also need to adjust
type
andmatchProof
in the suite you are developinghttps://github.com/transmute-industries/vc.js/blob/master/packages/ed25519-signature-2020/src/Ed25519Signature2020.ts#L27
https://github.com/transmute-industries/vc.js/blob/master/packages/ed25519-signature-2020/src/Ed25519Signature2020.ts#L105
It worked! I just missed the final two adjustments on
type
andmatchProof
.Thanks!