Atex.XRPC.ServiceAuthClient (atex v0.9.1)

View Source

An XRPC client that uses a inter-service auth JWT to interact with another service on a user's behalf. See Atex.ServiceAuth and com.atproto.server.getServiceAuth for more information.

Usage

client = Atex.XRPC.ServiceAuthClient.new("<jwt>")
{:ok, response, _} = Atex.XRPC.get(client, "com.example.authenticatedXRPC")

Summary

Functions

Create a new Atex.XRPC.ServiceAuthClient from a service auth JWT.

Types

t()

@type t() :: %Atex.XRPC.ServiceAuthClient{token: String.t()}

Functions

new(token)

@spec new(String.t()) :: t()

Create a new Atex.XRPC.ServiceAuthClient from a service auth JWT.

The JWT is stored as-is; no validation is performed at construction time. Endpoint resolution and token use happen on the first (and only valid) call to get/3 or post/3.

Examples

iex> Atex.XRPC.ServiceAuthClient.new("eyJ...")
%Atex.XRPC.ServiceAuthClient{token: "eyJ..."}