Repository navigation
fix(auth): serve /brain.html + /brain.js without server auth - #39
Closed
jack-champagne wants to merge 1 commit into
Closed
jack-champagne wants to merge 1 commit into
jack-champagne wants to merge 1 commit into
Conversation
The amico brain graph loads /brain.html (+ /brain.js) in an iframe that can't carry ?auth_token=; with OPENCODE_SERVER_PASSWORD set (always, under the amicode extension) both 401'd and the frame painted opaque white. Same public-shell class as the /assets/* and /amicode/widget-frame exemptions — they were just missed. Regression since the auth refactor between amicode.5 and amicode.7.
Member
Author
|
Superseded — the same fix landed on local/amicode as 4f02fc3 ( |
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.
What
The amico brain graph loads
/brain.html(+/brain.js) in an iframe. Like/assets/*and/amicode/widget-frame, an iframe document/sub-resource cannot carry?auth_token=— so withOPENCODE_SERVER_PASSWORDset (always, under the amicode extension) both/brain.htmland/brain.jsreturned 401, the frame failed to load, and the browser painted the transparent iframe opaque white. That's the "white box instead of the thinking graph."They're the same public-shell class as the existing exemptions (static renderer, no secrets; session touches arrive via the postMessage bridge) — they were simply missed when
c76749add(/assets/*) andca69ef0c1(widget-frame) added the auth bypass. Regression since the?auth_token=auth refactor between amicode.5 and amicode.7.Change
Add
/brain.html+/brain.jstoPUBLIC_UI_PATHS(server/shared/public-ui.ts), sibling to the widget-frame exemption. GET-only; the API surface (e.g./amicode/vaults,/amicode/widgets) stays authed.Test / verify
bun test test/server/httpapi-ui.test.ts→ 15 pass (new: brain frame + script served without auth; POST still 401)./brain.html+/brain.js→ 200 without auth (were 401);/amicode/vaultsstill 401. Browser: the thinking graph renders again (was white).Why separate
Orthogonal to the vault onboarding work (opencode#35 / amicode#183); it unblocks any amicode.7+ release regardless of those.
🤖 Generated with Claude Code