Repository navigation
fix(desktop): authenticate non-loopback local services - #51076
eivindjonassen wants to merge 1 commit into
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: |
|
The The PR description already includes Local verification passed: eight focused tests, including the real Electron regression, and |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #51075
Type of change
What does this PR do?
Desktop discovers local services bound to non-loopback addresses, but its request-header filter only matches
127.0.0.1andlocalhost. On a Tailscale-bound service, this causes unauthenticated requests, a stuck loading screen, and "Data migration failed" even when migration is complete.Match HTTP(S) requests and let the existing exact-origin check restrict credentials to the registered service. The top-level renderer check and explicit Authorization header handling remain in place.
How did you verify your code works?
401before the fix and passes afterward, including checks for unrelated origins, child frames, untrusted pages, requests without a frame, and explicit credentials.bun run test test/renderer-auth.test.ts src/main/service/sidecar-credentials.test.ts src/main/windows/headers.test.tsfrompackages/desktop.bun run checkpasses from the repository root with Bun 1.4.2.200, session content loads, and event-stream disconnects stop.Screenshots / recordings
Not applicable to this request-authentication fix.
Checklist