Accepted adr-005 · 2026-10-03

A Ticket Is Issued over HTTP Only Behind the Consumer's Issuer

Context

Tickets were minted only in-process, by the backend that renders a page for an authenticated person. ontoref and provisioning want agents and scripts to obtain tickets themselves, for answers the backend gives directly (JSON once per ticket) and possibly for links. The only store is redb, which one process locks, so a separate mint command cannot run beside a live backend; and whoever asks for a ticket must be authenticated by the consumer, whose notion of identity openbyname must not acquire.

Decision

openbyname-ticket (feature axum) offers issue_router(tickets, issuer): POST /issue with the same body as /redeem mints a ticket for the claim it names and answers {ticket, expires, link}. The consumer implements the trait Issuer — authenticate(headers) returns an opaque subject or none (401), allows(subject, claim) decides the policy (403) — and the route authenticates before it reads the body. Issuing happens inside the backend process that owns the store. openbyname decides neither who a subject is nor which claims it may hold.

Constraints

Alternatives considered