DID Resolver

class atproto_identity.did.resolver.AsyncDidResolver(plc_url: str | None = None, timeout: float | None = None, cache: AsyncDidBaseCache | None = None)

Asynchronous DID Resolver.

Supported DID methods: PLC, Web.

Parameters:
  • plc_url – PLC directory URL.

  • timeout – Request timeout.

  • cache – DID cache.

async ensure_resolve(did: str, force_refresh: bool = False) DidDocument

Ensure DID is resolved.

Parameters:
  • did – DID.

  • force_refresh – Force refresh cache.

Returns:

DID document.

Return type:

DidDocument

Raises:

DidNotFoundError – DID not find.

async refresh_cache(did: str) None

Refresh cached DID.

Parameters:

did – DID.

async resolve(did: str, force_refresh: bool = False) DidDocument | None

Resolve DID.

Parameters:
  • did – DID.

  • force_refresh – Force refresh cache.

Returns:

DID document or None if not found.

Return type:

DidDocument

async resolve_atproto_data(did: str, force_refresh: bool = False) AtprotoData

Resolve AT Protocol Data.

Parameters:
  • did – DID.

  • force_refresh – Force refresh cache.

Returns:

AT Protocol data.

Return type:

AtprotoData

Raises:
async resolve_atproto_key(did: str, force_refresh: bool = False) str

Resolve AT Protocol signing key.

Parameters:
  • did – DID.

  • force_refresh – Force refresh cache.

Returns:

AT Protocol signing key.

Return type:

str

Raises:
async resolve_no_cache(did: str) DidDocument | None

Resolve DID without a cache.

Parameters:

did – DID.

Returns:

DID document or None if not found.

Return type:

DidDocument

async resolve_without_validation(did: str) Dict[str, Any] | None

Resolve DID without validation.

Parameters:

did – DID.

Returns:

DID document or None if DID not found.

Return type:

dict

static validate_did_doc(did: str, value: Dict[str, Any]) DidDocument
class atproto_identity.did.resolver.DidResolver(plc_url: str | None = None, timeout: float | None = None, cache: DidBaseCache | None = None)

DID Resolver.

Supported DID methods: PLC, Web.

Parameters:
  • plc_url – PLC directory URL.

  • timeout – Request timeout.

  • cache – DID cache.

ensure_resolve(did: str, force_refresh: bool = False) DidDocument

Ensure DID is resolved.

Parameters:
  • did – DID.

  • force_refresh – Force refresh cache.

Returns:

DID document.

Return type:

DidDocument

Raises:

DidNotFoundError – DID not find.

refresh_cache(did: str) None

Refresh cached DID.

Parameters:

did – DID.

resolve(did: str, force_refresh: bool = False) DidDocument | None

Resolve DID.

Parameters:
  • did – DID.

  • force_refresh – Force refresh cache.

Returns:

DID document or None if not found.

Return type:

DidDocument

resolve_atproto_data(did: str, force_refresh: bool = False) AtprotoData

Resolve AT Protocol Data.

Parameters:
  • did – DID.

  • force_refresh – Force refresh cache.

Returns:

AT Protocol data.

Return type:

AtprotoData

Raises:
resolve_atproto_key(did: str, force_refresh: bool = False) str

Resolve AT Protocol signing key.

Parameters:
  • did – DID.

  • force_refresh – Force refresh cache.

Returns:

AT Protocol signing key.

Return type:

str

Raises:
resolve_no_cache(did: str) DidDocument | None

Resolve DID without a cache.

Parameters:

did – DID.

Returns:

DID document or None if not found.

Return type:

DidDocument

resolve_without_validation(did: str) Dict[str, Any] | None

Resolve DID without validation.

Parameters:

did – DID.

Returns:

DID document or None if DID not found.

Return type:

dict

static validate_did_doc(did: str, value: Dict[str, Any]) DidDocument