Repository navigation
fix: skip auth middleware for internal /__-prefixed routes - #28
Merged
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04edeab9e2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
When auth is enabled, the global auth middleware runs on all Hono routes including internal ones like /__scheduled, /__queue, and /__void/*. When the CronScheduler DO dispatches cron jobs via worker.fetch(), the request hostname is "internal" (not localhost), causing resolveSecret() to throw if BETTER_AUTH_SECRET is not set. Add an early return in runVoidAuthMiddleware for paths starting with /__ to bypass auth on internal platform routes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Brooooooklyn
force-pushed
the
fix/skip-auth-internal-routes
branch
from
March 25, 2026 03:30
04edeab to
a242d43
Compare
cpojer
pushed a commit
that referenced
this pull request
Sep 11, 2026
* feat: add platform worker rollback admin page Add /admin/platform page showing all 5 platform CF Workers (proxy, tail, api, dashboard, dispatch) with their current versions and one-click rollback via the CF Workers Versions/Deployments API. - Overview page with environment toggle (production/staging) - Per-worker detail page with version history and rollback buttons - Dependency graph derived from dependsOn (single source of truth) - Graceful degradation via Promise.allSettled when CF API is unreachable - Warning banner for void-api (self-rollback + migration notes) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add platform rollback audit log, unified rollback, orchestration - Add platform_events table for audit trail (tracks who rolled back what) - Add "Rollback All Workers" with sequential orchestration and stop-on-failure - Add batch rollback results page and GET /events/:batchId for history - Log events for both single and batch rollbacks (success/failure) - Show recent activity on platform overview page - Update progress.md with rollback milestones Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: collapse batch events, add pagination, fix rollback target - Collapse batch rollback events into single rows in activity log - Add paginated activity history (15 entries per page) - Fix rollback target to find first deployment with a different version (prevents rollback-all from undoing a prior single rollback) - Add version diff confirm popup before rollback-all Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: dedup STATUS_COLORS, simplify rollback handler, fix O(n2) collapse - Extract STATUS_COLORS to shared format.ts - Collapse duplicate createPlatformEvent calls in single rollback - Fix PlatformEnv | string to just PlatformEnv - Remove dead logic in allHaveRollbackTarget - Fix O(n2) collapseEvents with pre-built Map - Bulk update skipped batch events in one query Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: sort batch rollback results by execution order, not timestamp Events inserted via Promise.all get non-deterministic timestamps. Sort by reverse deployOrder in the view to match actual rollback execution order. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: scope platform rollback to current worker environment Production and staging use different databases (Hyperdrive), so cross-environment rollback wrote audit logs to the wrong DB. Environment is now determined by PLATFORM_ENV worker var instead of a query parameter. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

When auth is enabled, the global auth middleware runs on all Hono routes including internal ones like /__scheduled, /__queue, and /__void/*. When the CronScheduler DO dispatches cron jobs via worker.fetch(), the request hostname is "internal" (not localhost), causing resolveSecret() to throw if BETTER_AUTH_SECRET is not set.
Add an early return in runVoidAuthMiddleware for paths starting with /__ to bypass auth on internal platform routes.
Note
Medium Risk
Changes global auth middleware behavior to skip authentication on any
'/__'-prefixed path; if any externally reachable route shares this prefix, it could unintentionally bypass auth. Otherwise the change is small and scoped to internal platform endpoints.Overview
Skips running Better Auth for internal
'/__'-prefixed routes (e.g. cron/queue/migration/binding proxy) by adding an early return inrunVoidAuthMiddleware.When skipping, it explicitly sets
c.set('user', null)andc.set('session', null)so downstream middleware sees consistent sentinel values instead ofundefined.Written by Cursor Bugbot for commit a242d43. This will update automatically on new commits. Configure here.