You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Request]: declarative bearer/API-key auth with scopes, expiry and revocation #571
Evidence comes from a first-party hosted URLCode service (private repository) built on core 0.5.9. It had to hand-write the code named below. routes.*.auth is session-only, so an API that authenticates agents with bearer tokens needs two trusted modules (token parsing and peppered-hash lookup, plus a scope check per route) and an out-of-band issuing/revoking script. Every route repeats the check.
Proposed behavior and alternatives
A declarative credential mode, e.g. auth: {bearer: {scopes: [reference]}}, backed by an operator-supplied token store (hashed at rest, with expiry and revocation) and exposing the principal/scopes to the handler context. Alternative: an extension package on the existing contract. Either way the scope check and the 401/403 shapes should be host-owned.
Triage decision: accept bearer/API-key authentication as an optional auth extension capability, not a core YAML feature. The extension owns credential hashing, expiry/revocation, scope enforcement, principal context, and consistent 401/403 responses. An operator supplies the credential store and its configuration outside route YAML. This preserves core portability and its dependency boundary. Leave open for extension contract/evidence work and remove needs-decision.
Opened #635: bearer/API-key authentication as an optional auth extension
capability, per the triage decision — credential hashing (scrypt, same
derivation as passwords, looked up by a public id rather than a hash of the
secret), expiry, revocation, scope enforcement, and RFC 6750-shaped 401/403
responses, plus operator CLI commands and the auth: {bearer: {scopes:[...]}}
route short form.
Scoped down one piece: the triage decision also asks the extension to expose
"the principal/scopes to the handler context." Implementing this found that no
extension has any mechanism today to hand data into a route's own trusted function/middleware context — only to gate the request. Closing that
cleanly needs a small but genuine new core seam (and touches a boundary
SECURITY.md documents as deliberate: Authorization is already always
stripped before a guest sees it). Filed that as its own issue, #618, with a
traced design, rather than bundling an unreviewed core change into this PR. #635's gate still fully enforces authentication and scopes — a protected
route just can't yet read which key authenticated it.
Implemented in #635: bearer/API-key authentication as an optional capability of the auth extension. One follow-up was scoped out and tracked separately in #618 (exposing the authenticated principal/scopes to the route's own handler) since it touches a documented core security boundary (credentials never crossing into application guests) and needs its own design review.
Activity
jimhoyd commentedon Sep 24, 2026
Triage decision: accept bearer/API-key authentication as an optional
authextension capability, not a core YAML feature. The extension owns credential hashing, expiry/revocation, scope enforcement, principal context, and consistent 401/403 responses. An operator supplies the credential store and its configuration outside route YAML. This preserves core portability and its dependency boundary. Leave open for extension contract/evidence work and removeneeds-decision.jimhoyd commentedon Sep 24, 2026
Opened #635: bearer/API-key authentication as an optional
authextensioncapability, per the triage decision — credential hashing (scrypt, same
derivation as passwords, looked up by a public id rather than a hash of the
secret), expiry, revocation, scope enforcement, and RFC 6750-shaped 401/403
responses, plus operator CLI commands and the
auth: {bearer: {scopes:[...]}}route short form.
Scoped down one piece: the triage decision also asks the extension to expose
"the principal/scopes to the handler context." Implementing this found that no
extension has any mechanism today to hand data into a route's own trusted
function/middlewarecontext — only to gate the request. Closing thatcleanly needs a small but genuine new core seam (and touches a boundary
SECURITY.md documents as deliberate:
Authorizationis already alwaysstripped before a guest sees it). Filed that as its own issue, #618, with a
traced design, rather than bundling an unreviewed core change into this PR.
#635's gate still fully enforces authentication and scopes — a protected
route just can't yet read which key authenticated it.
feat(auth): bearer/API-key authentication (#571) (#635)
jimhoyd commentedon Sep 24, 2026
Implemented in #635: bearer/API-key authentication as an optional capability of the
authextension. One follow-up was scoped out and tracked separately in #618 (exposing the authenticated principal/scopes to the route's own handler) since it touches a documented core security boundary (credentials never crossing into application guests) and needs its own design review.feat(core,auth): expose an authorized extension's principal to route …