Anubis.Client.Authorization.Challenge (anubis_mcp v2.2.0)

Copy Markdown

An HTTP authorization challenge, including the original WWW-Authenticate values.

scope is the server's requested scope string, independent of metadata's scopes_supported. parse_error identifies malformed or ambiguous Bearer challenges; discovery refuses to use them.

Summary

Functions

Extracts Bearer parameters from response headers without discarding the originals.

Types

t()

@type t() :: %Anubis.Client.Authorization.Challenge{
  error: String.t() | nil,
  error_description: String.t() | nil,
  headers: [String.t()],
  mcp_url: String.t(),
  parse_error: atom() | nil,
  resource_metadata: String.t() | nil,
  scope: String.t() | nil,
  status: pos_integer()
}

Functions

from_response(mcp_url, status, headers)

@spec from_response(String.t(), pos_integer(), [{String.t(), String.t()}]) :: t()

Extracts Bearer parameters from response headers without discarding the originals.

Header and parameter names are case insensitive. Multiple distinct Bearer challenges are reported as ambiguous rather than selecting one implicitly.