FastATP

PLCResolver

A class in fastatp.did.plc (source).

PLCResolver(
    *,
    directory: str = PLC_DIRECTORY,
    verify: bool = True,
    timeout: float = 10.0,
    cache_size: int = 1024,
    cache_ttl: float = 300.0,
    client: httpx.AsyncClient | None = None,
)

DIDResolver for did:plc via a PLC directory. Resolve-only.

With verify=True (default) each resolution fetches {directory}/{did}/log/audit and runs verify_audit_log, so the document comes from the self-certified chain, not the directory's word. With verify=False it fetches the directory's rendered document and trusts it (the ecosystem-typical posture).

Results are cached in a small LRU for cache_ttl seconds (the PLC directory sets no meaningful cache headers, so the TTL is ours) with the same invalidate() seam as WebResolver — a firehose #identity event should invalidate rather than wait out the TTL.

Methods

invalidate

invalidate(did: str) -> None

Drop a cached document so the next resolve refetches.

aclose

async aclose() -> None