Atex.IdentityResolver
(atex v0.10.0)
View Source
Resolves AT Protocol identifiers (DIDs and handles) to Atex.IdentityResolver.Identity structs.
Resolution results are cached in Atex.IdentityResolver.Cache (ETS) to avoid
repeated network calls. Handle resolution strategy is compile-time configurable:
config :atex, handle_resolver_strategy: :dns_first # default: :dns_firstExamples
{:ok, identity} = Atex.IdentityResolver.resolve("user.bsky.social")
{:ok, identity} = Atex.IdentityResolver.resolve("did:plc:abc123")
Summary
Functions
Resolve a DID or handle to an Atex.IdentityResolver.Identity struct.
Types
@type options() :: {:skip_cache, boolean()}
Functions
@spec resolve(String.t(), [options()]) :: {:ok, Atex.IdentityResolver.Identity.t()} | {:error, any()}
Resolve a DID or handle to an Atex.IdentityResolver.Identity struct.
For a DID, resolves the DID document and optionally cross-checks the handle declared in it. For a handle, resolves to a DID via DNS or HTTP, then fetches and validates the DID document.
Results are cached. Pass skip_cache: true to force a fresh resolution.
Parameters
identifier- A DID string (e.g.,"did:plc:abc123") or a handle (e.g.,"user.bsky.social")opts- Keyword options::skip_cache- Iftrue, bypass the cache (default:false)
Returns
{:ok, identity}- Successfully resolved identity{:error, :handle_mismatch}- Handle in DID document does not match resolved handle{:error, reason}- Resolution or network failure