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
New modules:
trustchain-ion/did_methods
DIDMethodsResult
.DIDMethod
s and implements theDIDResolver
trait to expose theresolve
method with a prior match on the method of the DID being resolved (eg. "ion" or "key" methods).DIDMethodsResult
is a wrapper forssi::did::DIDMethods
, re-implementing the fullDIDMethods
api in addition to aresolve_as_result
method, which is a Trustchain extension of theresolve
method (wrapping the returned tuple in aResult<T,ResolverError>
)Extent of
DIDMethodResult
usage:trustchain-ion/tests/resolver.rs
.IONResolver
s are used extensively in tests and library code, created withget_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 theIONVerifier
).Changes with widespread effects:
get_ion_resolver(endpoint: &str)
refactored toget_ion_resolver(endpoint: &Endpoint)
, using theEndpoint
type from thetrustchain-ion