Bazaar.Plugs.UCPHeaders (Bazaar v0.3.0)

Copy Markdown View Source

Reads the UCP request headers and negotiates the protocol version.

Usage

pipeline :ucp do
  plug Bazaar.Plugs.UCPHeaders
end

Headers

  • UCP-Agent: the platform identifies itself with profile="https://platform.example/.well-known/ucp" and may pin the protocol version it speaks with ; version="YYYY-MM-DD"
  • UCP-Request-ID: request identifier for tracing, generated when absent
  • Request-Signature: request signature, passed through for verification

Values land in conn.assigns: ucp_agent (raw header), ucp_agent_profile, ucp_agent_version, ucp_request_id and ucp_signature.

Options

  • :version - the protocol version this server speaks. A request pinning a different version is rejected with 422. Defaults to Bazaar.DiscoveryProfile.version(); false disables negotiation.

Summary

Functions

Parses a UCP-Agent header value into its profile and version parameters.

Functions

parse_agent(header)

Parses a UCP-Agent header value into its profile and version parameters.

iex> Bazaar.Plugs.UCPHeaders.parse_agent(~s(profile="https://p.example/.well-known/ucp"; version="2026-08-25"))
%{profile: "https://p.example/.well-known/ucp", version: "2026-08-25"}