git ssb

0+

Spruce git-ssb bridge / ssi



Commit 8fff89ad5e4d258e30667fee00ea0f33c031eaa2

Relax DIDMethod: DIDResolver requirement

Charles E. Lehner committed on 3/1/2022, 3:18:31 PM
Parent: cc61fbf69bc1b61e4422b47285a8be137859d44f

Files changed

src/did.rschanged
src/did.rsView
@@ -394,9 +394,9 @@
394394 /// Some DID Methods are registered in the [DID Specification
395395 /// Registries](https://www.w3.org/TR/did-spec-registries/#did-methods).
396396 #[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
397397 #[cfg_attr(not(target_arch = "wasm32"), async_trait)]
398-pub trait DIDMethod: DIDResolver {
398 +pub trait DIDMethod: Sync {
399399 /// Get the DID method's name.
400400 ///
401401 /// `method-name` in [DID Syntax](https://w3c.github.io/did-core/#did-syntax).
402402 fn name(&self) -> &'static str;
@@ -502,9 +502,9 @@
502502 let method = match self.get_method(did) {
503503 Ok(method) => method,
504504 Err(err) => return (ResolutionMetadata::from_error(err), None, None),
505505 };
506- method.resolve(did, input_metadata).await
506 + method.to_resolver().resolve(did, input_metadata).await
507507 }
508508
509509 /// Resolve a DID to a DID document representation, using the corresponding DID method in the
510510 /// [DIDMethods][] instance.
@@ -516,9 +516,12 @@
516516 let method = match self.get_method(did) {
517517 Ok(method) => method,
518518 Err(err) => return (ResolutionMetadata::from_error(err), Vec::new(), None),
519519 };
520- method.resolve_representation(did, input_metadata).await
520 + method
521 + .to_resolver()
522 + .resolve_representation(did, input_metadata)
523 + .await
521524 }
522525
523526 /// Dereference a DID URL, using the corresponding DID method in the
524527 /// [DIDMethods][] instance.
@@ -536,9 +539,12 @@
536539 ContentMetadata::default(),
537540 ))
538541 }
539542 };
540- method.dereference(did_url, input_metadata).await
543 + method
544 + .to_resolver()
545 + .dereference(did_url, input_metadata)
546 + .await
541547 }
542548 }
543549
544550 impl DIDURL {

Built with git-ssb-web