Skip to content
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 resolution of "key" DID method #121

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

edchapman88
Copy link
Collaborator

New modules:

  • trustchain-ion/did_methods
    • New struct DIDMethodsResult.
      • In short, this struct can be used in place of a resolver to handle the resolution of multiple DID methods.
      • Contains a map of DIDMethods and implements the DIDResolver trait to expose the resolve method with a prior match on the method of the DID being resolved (eg. "ion" or "key" methods).
      • DIDMethodsResult is a wrapper for ssi::did::DIDMethods, re-implementing the full DIDMethods api in addition to a resolve_as_result method, which is a Trustchain extension of the resolve method (wrapping the returned tuple in a Result<T,ResolverError>)

Extent of DIDMethodResult usage:

  • Currently only used in resolution integration tests found in trustchain-ion/tests/resolver.rs.
  • IONResolvers are used extensively in tests and library code, created with get_ion_resolver, and none of these have been replaced with the more flexible DID Methods resolver (in many cases it doesn't make sense to support resolution of non-"ion" DIDs, eg. when resolving during ion verification inside the IONVerifier).

Changes with widespread effects:

  • get_ion_resolver(endpoint: &str) refactored to get_ion_resolver(endpoint: &Endpoint), using the Endpoint type from the trustchain-ion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant