fix(router): remove AdminAuth from test-token — unblocks E2E CI bootstrap - #708
Merged
Merged
Conversation
#612 added AdminAuth to GET /admin/workspaces/:id/test-token, breaking the chicken-and-egg bootstrap that E2E tests rely on: 1. POST /workspaces creates first workspace (fail-open, no tokens) 2. Provision generates a workspace auth token → inserts into DB 3. AdminAuth now sees a live token → requires auth on ALL routes 4. E2E calls test-token to get its first admin bearer → 401 5. All subsequent E2E calls fail → EVERY open PR CI blocked The test-token handler already has its own production guard (TestTokensEnabled returns false when MOLECULE_ENV=prod). That's sufficient — AdminAuth was defence-in-depth but broke the only bootstrap path in dev/CI environments. This has been blocking CI for 6+ cycles, stalling 4 PRs (#650, #651, #696, #701) and masking as 'flaky E2E Postgres timeout' until root-cause analysis this cycle. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
molecule-ai Bot
pushed a commit
that referenced
this pull request
Apr 21, 2026
fix(router): remove AdminAuth from test-token — unblocks E2E CI bootstrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reverts the AdminAuth gate on
GET /admin/workspaces/:id/test-tokenthat #612 added. This endpoint is the bootstrap path for E2E tests and fresh installs to obtain their first admin bearer token. With AdminAuth, it's a chicken-and-egg deadlock:The handler's own guard (
TestTokensEnabled() == falsewhenMOLECULE_ENV=prod) is the correct production gate. AdminAuth was defence-in-depth that broke the only bootstrap path.Impact
This has been blocking ALL open PR CI for 6+ maintenance cycles. Combined with the migration 028 FK bug (fixed in #670), these two issues explain why the team's PRs have been stuck despite active development.
Timeline of CI blockers this session:
Test plan
test-token response: {"error":"admin auth required"}🤖 Generated with Claude Code