ProtoRune. Atproto. Identity. HandleResolver
(proto_rune v0.5.2)
Copy Markdown
Handles AT Protocol handle resolution to DIDs through DNS and HTTPS methods.
Implements the handle resolution specification from AT Protocol:
- DNS TXT record lookup at _atproto.<handle>
- HTTPS lookup at https://<handle>/.well-known/atproto-did
Summary
Functions
Attempts to resolve a handle to a DID using DNS TXT records.
Attempts to resolve a handle to a DID using HTTPS lookup.
Types
@type error_reason() :: :not_found | :network_error | :invalid_response | :timeout
@type resolution_opts() :: [timeout: pos_integer(), retry_count: non_neg_integer()]
Functions
@spec resolve_dns(String.t(), resolution_opts()) :: {:ok, String.t()} | {:error, error_reason()}
Attempts to resolve a handle to a DID using DNS TXT records.
Looks for a TXT record at _atproto.<handle> that starts with "did=".
@spec resolve_https(String.t(), resolution_opts()) :: {:ok, String.t()} | {:error, error_reason()}
Attempts to resolve a handle to a DID using HTTPS lookup.
Makes a GET request to https://<handle>/.well-known/atproto-did.