Skip to content

fix: uniform 401 for every rejected bearer on run routes - #24

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-10972-return-one-401-for-every-rejected-bearer-on-artifacts-run
Oct 21, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-10972-return-one-401-for-every-rejected-bearer-on-artifacts-run

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

Every rejection path — missing bearer, invalid token, unbound token, unknown run, wrong tenant, and missing tenant middleware — now returns the same 401 { error: "unauthorized" }. Previously, a missing tenant middleware caused a 500, which revealed that the route existed.

Changes:

Verification

  • bun run check: passes (tsc, oxlint, oxfmt, tests)
  • bun run build: passes

Closes CL-10972

@linear-code

linear-code Bot commented Oct 21, 2026

Copy link
Copy Markdown

CL-10972

@corbits-triage

corbits-triage Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Triage: Fail

@TheGreatAxios, please address the following:

  • merge conflicts with base

Waiting on a maintainer to approve: request changes.

Changed since the last verdict (Pass at c295a19): 3 new commits.

@TheGreatAxios
TheGreatAxios force-pushed the cl-10968-bind-each-agent-token-to-the-run-it-was-issued-for branch from 0c28bed to 600d87d Compare October 21, 2026 03:10
@TheGreatAxios
TheGreatAxios force-pushed the cl-10972-return-one-401-for-every-rejected-bearer-on-artifacts-run branch from c295a19 to 115d88e Compare October 21, 2026 03:11
Every rejection path — missing bearer, invalid token, unbound token,
wrong run, wrong tenant, and missing tenant middleware — now returns the
same 401 { error: unauthorized }.  Previously, a missing tenant
middleware caused a 500, which revealed that the route existed.

Changes:
- requireAgentToken catches host-side errors and returns 401
- requireRunBoundToken catches host-side errors and returns 401
- Updated existing test expectation from 500 to 401 for missing tenant
- Added test for requireRunBoundToken without tenant middleware

Closes CL-10972
@TheGreatAxios
TheGreatAxios changed the base branch from cl-10968-bind-each-agent-token-to-the-run-it-was-issued-for to main October 21, 2026 03:12
@TheGreatAxios
TheGreatAxios force-pushed the cl-10972-return-one-401-for-every-rejected-bearer-on-artifacts-run branch from 115d88e to cdde7ce Compare October 21, 2026 03:12
@TheGreatAxios
TheGreatAxios merged commit c6daf52 into main Oct 21, 2026
2 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-10972-return-one-401-for-every-rejected-bearer-on-artifacts-run branch October 21, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant