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

Functions

procedure(config, session, method, body, opts)

@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.

query(config, session, method, opts)

@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.

upload_blob(config, session, bytes, content_type, opts)

@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.