pub struct DidPlcResolver<F: PlcAuditFetcher> { /* private fields */ }Expand description
Resolves a did:plc identifier to its validated DID document.
Generic over a PlcAuditFetcher so the parse/validate/verify path is
testable with an injected fixture (no live network); the native
implementation is HttpPlcFetcher. This is the federation-intake
artifact E2 (#1174, foreign handle resolution) and E3 (#1175, exchange
audience) build on.
Read-only forever: there is no write path. See the module docs.
Implementations§
Source§impl<F: PlcAuditFetcher> DidPlcResolver<F>
impl<F: PlcAuditFetcher> DidPlcResolver<F>
Sourcepub fn with_fetcher(fetcher: F, config: PlcResolverConfig) -> Self
pub fn with_fetcher(fetcher: F, config: PlcResolverConfig) -> Self
Construct a resolver over an injected document+audit fetcher. This is for
fixtures and alternate transports; native callers should use
DidPlcResolver::<HttpPlcFetcher>::new, which couples its cache TTL
to this resolver’s one configuration object.
Sourcepub fn config(&self) -> &PlcResolverConfig
pub fn config(&self) -> &PlcResolverConfig
The resolver’s directory configuration (base URL, TTL).
Sourcepub async fn resolve_document(&self, did: &str) -> Result<Value>
pub async fn resolve_document(&self, did: &str) -> Result<Value>
Resolve did to its DID document, validated.
Derives the pinned URL beneath the configured base URL, fetches it, and
enforces the subject binding (validate_plc_document). Every failure
— malformed DID, fetch error, malformed document, doc.id mismatch —
is Err (fail-closed).
Source§impl DidPlcResolver<HttpPlcFetcher>
impl DidPlcResolver<HttpPlcFetcher>
Sourcepub fn new(config: PlcResolverConfig) -> Result<Self>
pub fn new(config: PlcResolverConfig) -> Result<Self>
Construct the native HTTPS resolver from one configuration object.
The fetcher is created here rather than accepted from the caller, so the cache enforcing the TTL and the resolver advertising it cannot diverge.
Trait Implementations§
Source§impl<F: PlcAuditFetcher> DidDocResolve for DidPlcResolver<F>
A configured did:plc resolver can serve the existing federation admission
boundary. Its URL derivation, egress allowlist, cache, and doc.id binding
are all enforced before this gate inspects verification methods.
impl<F: PlcAuditFetcher> DidDocResolve for DidPlcResolver<F>
A configured did:plc resolver can serve the existing federation admission
boundary. Its URL derivation, egress allowlist, cache, and doc.id binding
are all enforced before this gate inspects verification methods.
Auto Trait Implementations§
impl<F> Freeze for DidPlcResolver<F>where
F: Freeze,
impl<F> RefUnwindSafe for DidPlcResolver<F>where
F: RefUnwindSafe,
impl<F> Send for DidPlcResolver<F>
impl<F> Sync for DidPlcResolver<F>
impl<F> Unpin for DidPlcResolver<F>where
F: Unpin,
impl<F> UnsafeUnpin for DidPlcResolver<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for DidPlcResolver<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more