-
Notifications
You must be signed in to change notification settings - Fork 63
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
Support custom context sets #388
Comments
In many places a DID resolver trait object is passed around, also adjacent to the proof options. One possible approach may be to change that to use a more generalized resolver/loader trait object in the high-level functions, that DIDResolver could blanket-implement. Like how the JS implementation use a document loader: https://github.com/decentralized-identity/jsonld-document-loader Passing around a set of contexts, rather than using a loader object, would avoid having to deal with security questions about loading remote context files - but would probably mean adding another parameter like you said -- unless the loader object just uses a set of passed-in URLs mapped to files/objects as its "backing" along with the existing DID resolver(s), and loading additional remote things does not need to be enabled. |
Related issue in didkit: spruceid/didkit#151 |
I'm making an attempt at this, and it's proving a bit tricky, because adding a "context loader" parameter requires touching many function definitions and call sites. Unfortunately, based on how the Current work, which is a bit unpolished, and I wouldn't consider to be the ideal implementation of this feature (could use some work to refine how |
I think one way to deal with the mutability of the |
I'd like to get back to work on this one. Any feedback about the approach? I.e. passing around a ContextLoader object around the many various function calls (this is how the https://github.com/LedgerDomain/ssi/tree/context-loader branch currently implements it) vs putting together something that combines DIDResolver and ContextLoader? |
@vdods I think it's a good approach. I was hoping the use of lazy_static per context file could be kept for the parsing. With the changes all the context files get JSON-parsed at runtime. But maybe this is a pre-mature optimization. This would mostly be relevant for DIDKit CLI or other programs that exit after one operation more or less. |
Ok, updated (new) PR is #432 |
This issue is addressed, closing |
I'm working within a consortium of organizations which have defined a couple of industry-specific W3C VC contexts.
ssi::jsonld::StaticLoader
provides a list of general-use contexts, and I've got a branch ofssi
in which I've added my own. I'm wondering if thessi
crate might provide a way to specify the set of contexts, in case of the need to add additional application-specific contexts. Looking at the current implementation, there's no clear simple way to plumb in a&dyn json_ld::loader::Loader
, as the current use ofStaticLoader
funnels through about a dozen functions that aren't simply related (they don't share an obviously common set of parameters to generalize).My initial thought was it might make sense to add to
ssi::vc::LinkedDataProofOptions
, but that's for generating proofs, not verifying them. So a customLoader
would be a parameter "parallel" toLinkedDataProofOptions
for vc/vp-generating functions, but the customLoader
would need to be plumbed into signing functions separately. I'm hesitant to just do this myself because it feels like spaghetti code, and maybe there's a plan for adding that in a more sensible way later.The text was updated successfully, but these errors were encountered: