Latch. XRPC
(latch v0.5.0)
Copy Markdown
DPoP-authenticated XRPC calls to a session's PDS.
Each request carriers Authorization: DPoP <token and a DPoP proof bound to
the acess token ath. The PDS issues its own DPoP nonces, so a request is
attempted once and retried with the nonce the PDS returns. Token refresh and
persistence are the caller's concerns, not this module's.
Summary
Functions
Performs and authenticated XRPC procedure against the session's PDS.
Performs and authenticated XRPC query against the session's PDS.
Uploads raw bytes of content_type as a blob, returning the response with the blog reference.
Types
@type error() :: Latch.Error.InvalidResponse.t() | Latch.Error.MissingDPoPNonce.t() | Latch.Error.Transport.t() | Latch.Error.XRPC.t()
Functions
@spec procedure(Latch.Config.t(), Latch.Session.t(), String.t(), map(), keyword()) :: {:ok, map()} | {:error, error()}
Performs and authenticated XRPC procedure against the session's PDS.
@spec query(Latch.Config.t(), Latch.Session.t(), String.t(), keyword()) :: {:ok, map()} | {:error, error()}
Performs and authenticated XRPC query against the session's PDS.
@spec upload_blob( Latch.Config.t(), Latch.Session.t(), binary(), String.t(), keyword() ) :: {:ok, map()} | {:error, error()}
Uploads raw bytes of content_type as a blob, returning the response with the blog reference.