ProtoRune. Atproto. Identity. Behaviour behaviour
(proto_rune v0.5.2)
Copy Markdown
Defines the behaviour for AT Protocol identity management operations.
This behaviour specifies the contract for handling:
- Handle resolution
- DID resolution
- Identity validation
- Signature verification
Summary
Callbacks
Forces a refresh of cached DID document.
Forces a refresh of cached handle resolution data.
Resolves a DID to its full DID document.
Resolves a handle to its corresponding DID.
Runtime check for valid DID format, syntactically.
Runtime check for valid handle format, syntactically.
Validates the full identity chain from handle to DID document, ensuring bidirectional verification.
Verifies a signature against a DID's public key.
Types
@type did() :: String.t()
@type error_reason() :: :not_found | :network_error | :invalid_format | :unsupported_did_method | :invalid_signature | :rate_limited | {:http_error, pos_integer()}
@type handle() :: String.t()
@type message() :: binary()
@type signature() :: binary()
Callbacks
@callback refresh_did(did()) :: :ok
Forces a refresh of cached DID document.
@callback refresh_handle(handle()) :: :ok
Forces a refresh of cached handle resolution data.
@callback resolve_did(did()) :: {:ok, did_document()} | {:error, error_reason()}
Resolves a DID to its full DID document.
@callback resolve_handle(handle()) :: {:ok, did()} | {:error, error_reason()}
Resolves a handle to its corresponding DID.
Runtime check for valid DID format, syntactically.
Runtime check for valid handle format, syntactically.
@callback validate_identity(handle()) :: {:ok, did_document()} | {:error, error_reason()}
Validates the full identity chain from handle to DID document, ensuring bidirectional verification.
@callback verify_signature(did(), message(), signature()) :: :ok | {:error, error_reason()}
Verifies a signature against a DID's public key.