Handle Resolver¶
- class atproto_identity.handle.resolver.AsyncHandleResolver(timeout: float | None = None, backup_nameservers: List[str] | None = None)¶
Asynchronous Handle Resolver.
- Parameters:
timeout – Request timeout.
backup_nameservers – Backup nameservers (for DNS resolve).
- async ensure_resolve(handle: str) str ¶
Ensure handle is resolved to DID.
- Parameters:
handle – Handle.
- Returns:
DID.
- Return type:
str
- Raises:
DidNotFoundError – Handle not found.
- async resolve(handle: str) str | None ¶
Resolve handle to DID.
Uses DNS and HTTP to resolve handle to DID. The first successful result will be returned.
Resolve order: DNS -> HTTP.
- Parameters:
handle – Handle.
- Returns:
DID or
None
if handle not found.- Return type:
str
- async resolve_dns(handle: str) str | None ¶
Resolve handle to DID using DNS.
- Parameters:
handle – Handle.
- Returns:
DID or
None
if handle not found.- Return type:
str
- async resolve_http(handle: str) str | None ¶
Resolve handle to DID using HTTP.
- Parameters:
handle – Handle.
- Returns:
DID or
None
if handle not found.- Return type:
str
- class atproto_identity.handle.resolver.HandleResolver(timeout: float | None = None, backup_nameservers: List[str] | None = None)¶
Handle Resolver.
- Parameters:
timeout – Request timeout.
backup_nameservers – Backup nameservers (for DNS resolve).
- ensure_resolve(handle: str) str ¶
Ensure handle is resolved to DID.
- Parameters:
handle – Handle.
- Returns:
DID.
- Return type:
str
- Raises:
DidNotFoundError – Handle not found.
- resolve(handle: str) str | None ¶
Resolve handle to DID.
Uses DNS and HTTP to resolve handle to DID. The first successful result will be returned.
Resolve order: DNS -> HTTP.
- Parameters:
handle – Handle.
- Returns:
DID or
None
if handle not found.- Return type:
str
- resolve_dns(handle: str) str | None ¶
Resolve handle to DID using DNS.
- Parameters:
handle – Handle.
- Returns:
DID or
None
if handle not found.- Return type:
str
- resolve_http(handle: str) str | None ¶
Resolve handle to DID using HTTP.
- Parameters:
handle – Handle.
- Returns:
DID or
None
if handle not found.- Return type:
str