AshAi.Mcp.OAuth.Pending (ash_ai v1.5.6)

Copy Markdown View Source

An authorization in progress, from AshAi.Mcp.OAuth.authorize_url/3 until AshAi.Mcp.OAuth.handle_callback/3.

It holds the PKCE code_verifier, which is a secret, and the issuer recorded from the authorization server's validated metadata, which the callback checks the response's iss against (RFC 9207).

owner is stored as given, so it must be JSON-safe for to_map/1 to be.

Summary

Functions

Builds a pending authorization from a map produced by to_map/1.

Converts the pending authorization to a JSON-safe map with string keys.

Types

t()

@type t() :: %AshAi.Mcp.OAuth.Pending{
  client_id: String.t(),
  code_verifier: String.t(),
  created_at: DateTime.t(),
  iss_parameter_supported: boolean(),
  issuer: String.t(),
  owner: term(),
  redirect_uri: String.t(),
  resource: String.t(),
  scope: String.t() | nil,
  server_url: String.t(),
  state: String.t(),
  token_endpoint: String.t()
}

Functions

from_map(map)

@spec from_map(map()) :: t()

Builds a pending authorization from a map produced by to_map/1.

to_map(pending)

@spec to_map(t()) :: map()

Converts the pending authorization to a JSON-safe map with string keys.