This repository was archived by the owner on Jun 8, 2026. It is now read-only.
Conversation
Replace origin-only browser auth with a cryptographic challenge-exchange session model. The browser obtains a short-lived challenge JWT from the API server, exchanges it with the local gateway (which verifies via the API), and receives a session token bound to the requesting origin. Key changes: - Add LocalSessionStore for in-memory session management with TTL - Add local-auth-verifier to verify challenges against the API server - Rewrite isAuthorizedEngineerRequest to require session or gateway token - Add /gateway-auth/exchange route with fail-closed behavior (503 when API key missing, no silent fallback) - Add debug auth UI for dev-only token minting - Update CORS headers and CLAUDE.md documentation - Comprehensive tests for session store, verifier, exchange, and auth
Code Review SummaryStatus: Approved Reviewers: Bug Hunter A, Bug Hunter B, Unified Auditor, Premise Reviewer, electron-specialist Findings
MEDIUM Issues (consider)
Validation Stats
Recommendation: Approve — no blocking or high-priority issues. Consider addressing the medium findings before merge. |
- Hash session tokens with SHA-256 before storing so timingSafeEqual comparison is meaningful instead of comparing raw token bytes - Log non-loopback exchange attempts as security events instead of generic request events
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Replace origin-only browser auth with a cryptographic challenge-exchange session model. The browser obtains a short-lived challenge JWT from the API server, exchanges it with the local gateway (which verifies via the API), and receives a session token bound to the requesting origin.
Key changes: