Repository navigation
Dashboard: automatic browser access, no token entry - #296
Merged
Merged
Conversation
Bump the Pi test host to @earendil-works/pi-coding-agent 1.4.0 and pin the patched undici and minimatch leaves with package.json overrides. The shrinkwrap now resolves to fixed versions, so the post-install leaf repair and its version assertions are neither needed nor valid. Verified locally: npm ci --ignore-scripts, npm run verify, npm run test:integration, npm audit --omit=dev, and npm audit --no-package-lock --include=dev all pass with zero vulnerabilities.
Remove the browser token form and the window.prompt() token exchange. The dashboard mints its HttpOnly session for any same-origin browser request that reaches it: loopback, a literal address, a single-label/mDNS name, or the host in ENGRAPHIS_DASHBOARD_URL, still gated by the custom browser header, an exact Origin/Host match, and a trusted-proxy check for forwarding headers. Machine clients and /mcp still require Authorization: Bearer ENGRAPHIS_API_TOKEN. ENGRAPHIS_BROWSER_AUTO_SESSION=0 restores the hardened token gate with one-time links: POST /api/auth/link (bearer-protected) and engraphis-dashboard --link mint a single-use code, signed with the token plus a per-process epoch, delivered in a URL fragment, valid for 15 minutes, and redeemed at POST /api/auth/handoff for a 12-hour session. Re-export the offline evidence artifact because the registry binds the hashes of every public Python source file, and refresh both rendered images.
The release-floor test pinned the removed post-install repair. It now checks the overrides and dev-host pin that make the lock itself resolve patched minimatch and undici, and that CI no longer rewrites node_modules before auditing.
The lock resolves the patched leaves through package.json overrides, so the development steps no longer rewrite the installed host.
Keep the file byte-compatible with the repository copy so the dependency-repair documentation change reviews as prose only.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
CodeQL py/stack-trace-exposure flagged the /api/auth/link error path. The value is already validated at startup; return the constant message instead.
The evidence registry binds the SHA-256 of every public Python source file. The stack-trace-exposure fix changed engraphis/dashboard_app.py after the previous export, so the pinned artifact no longer matched the tree. This immutable export records the final source manifest; the three fixture results are unchanged. Updated the registry constants, benchmark guide, README checksum prefix, and both rendered SVG/PNG pairs.
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.
Why
The dashboard asked a person to type
ENGRAPHIS_API_TOKENinto a web form whenever the deployment had a token configured. A deployment secret does not belong in a browser, and a single-user node should not gate its own human surface with a credential prompt.What changed
Browsers never enter a token. The remote sign-in dialog and the
window.prompt()exchange are gone.Automatic access is the default.
POST /api/auth/local-sessionmints the HttpOnly session for any same-origin browser request that reaches the deployment:X-Engraphis-Browser-Sessionheader is required;Originmust exactly match a publishedHost: loopback, any literal address, a single-label/mDNS name (.local,.home.arpa), or the host inENGRAPHIS_DASHBOARD_URL;ENGRAPHIS_FORWARDED_ALLOW_IPS, andX-Forwarded-Protodecides the scheme behind that proxy.Public hostnames must be configured (the Railway template already sets
ENGRAPHIS_DASHBOARD_URL), which keeps DNS rebinding out.Machine clients are unchanged.
/api/*and/mcpstill requireAuthorization: Bearer ENGRAPHIS_API_TOKEN.Hardened mode is one switch away.
ENGRAPHIS_BROWSER_AUTO_SESSION=0restores the token gate and enables one-time links:POST /api/auth/link(bearer-protected) mints a code signed with the token plus a per-process epoch;engraphis-dashboard --linkprints the link;POST /api/auth/handofffor a 12-hour session;Security posture
This deliberately changes the decision recorded in PR #270. That decision was: with a token configured, no automatic session, because every signal the browser path reads (
Origin,Sec-Fetch-Site, the marker header) is writable by a raw loopback tunnel, so the token is the only reliable gate. This PR keeps that reasoning but makes the trade explicit and configurable: the deployment's network reachability becomes the dashboard boundary by default, and operators who expose the port to an untrusted network setENGRAPHIS_BROWSER_AUTO_SESSION=0to get the previous behavior plus click-to-enter links. API and MCP credentials are unaffected either way.SECURITY.md,docs/CONFIGURATION.md,docs/DOCKER.md,docs/HOSTING_RAILWAY.md,docs/AGENT_CONNECT.md, and.env.exampledocument the change and the exposure warning.Evidence artifact
docs/benchmark-evidence/offline-fixtures-automatic-browser-access-20261031.jsonis a fresh immutable export. The registry binds SHA-256 hashes of every public Python source file, and this change touches three of them, so the previous artifact no longer matched the tree. The three fixture results are byte-identical to the 1.7.11 artifact; only provenance and the source manifest changed.BENCHMARKS.md,README.md, and both rendered SVGs/PNGs were refreshed to the new digest.Verification
python -m pytest tests/ -qnpx playwright test tests/e2e/ledger.spec.js tests/e2e/commercial.spec.js --project=chromium(136 passed)python -m pytest tests/test_local_browser_access.py tests/test_local_auth_browser_session.py tests/test_dashboard_auth_placement.py tests/test_start_dashboard.py tests/test_benchmark_evidence.py -qruff check .,python scripts/externalize_dashboard_assets.py--link, redeem for an HttpOnly cookie, authenticated/api/bootstrap200, replay 401.Relationship to other PRs
feat/file-guard-protection. That branch is an older snapshot of the tree and is currently conflicting withmain, so this change was reapplied tomaindirectly.Nothing merged, deployed, or released.