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

Copy Markdown View Source

An OAuth client registered with one authorization server.

:source says how the client was obtained:

  • :pre_registered - supplied by the application through :pre_registered.
  • :cimd - a Client ID Metadata Document; client_id is the document's URL.
  • :dcr - registered through Dynamic Client Registration (RFC 7591) and persisted with AshAi.Mcp.OAuth.Store.put_client/3.

Credentials belong to the authorization server that issued them, named by :issuer.

Summary

Functions

Builds a client from a map produced by to_map/1.

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

Types

t()

@type t() :: %AshAi.Mcp.OAuth.Client{
  client_id: String.t(),
  client_secret: String.t() | nil,
  client_secret_expires_at: DateTime.t() | nil,
  issuer: String.t(),
  redirect_uris: [String.t()],
  registration_access_token: String.t() | nil,
  registration_client_uri: String.t() | nil,
  source: :pre_registered | :cimd | :dcr,
  token_endpoint_auth_method: String.t()
}

Functions

from_map(map)

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

Builds a client from a map produced by to_map/1.

to_map(client)

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

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