Repository navigation
feat: allow operator-trusted self-hosted account origins - #7626
Closed
toolittlecakes wants to merge 1 commit into
Closed
toolittlecakes wants to merge 1 commit into
toolittlecakes wants to merge 1 commit into
Conversation
toolittlecakes
force-pushed
the
feat/trusted-account-origins-v2
branch
from
November 22, 2026 14:07
7ab21ac to
c298a47
Compare
Contributor
|
This is an automated message. We have closed this pull request because it has been open for more than two weeks. |
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.
Human comments
What was wrong
The standalone account plugin accepts only getbb.app and staging in production, so
bb account login --base-url https://bb.example.comand Connect's delegated code redemption cannot use an operator's own account/relay service. Passing a URL is intentionally not sufficient to grant it trust.What changed
BB_ACCOUNT_TRUSTED_ORIGINS, a comma-separated list of additional exact HTTPS origins supplied in the server process environment. Validate the complete list and snapshot trust at account-plugin activation. Keep the existing default site and--base-urlprecedence/selection semantics.--serverorigin before deriving its account origin, while preserving the general URL helper's existing behavior for other consumers.npx bb-app env set ...followed by explicit stop/start, plugin activation/reload behavior, trust implications and sign-out semantics. No database, daemon protocol, native UI, or relay deployment changes.For example, persist
BB_ACCOUNT_TRUSTED_ORIGINS=https://bb.example.comin the server service environment and restart that server; then usebb account login --base-url https://bb.example.comorbb connect --code <code> --base-url https://bb.example.com. The CLI flag itself cannot extend the allowlist. Removing an entry does not revoke a stored pairing;bb account logoutdoes that.How you verified
Rebased onto
mainatda3e60b81; the only conflict was the startup-only env key list inpackages/bb-app/src/launcher.ts, resolved by keeping the new proxy keys and addingBB_ACCOUNT_TRUSTED_ORIGINS. Re-ran on the rebased branch:All four package suites passed: connect-client 28, bb-account 117, Connect 183 and bb-app 228 (556 tests), with all four typechecks (14/14 Turbo tasks). Lint and type-aware lint report 0 warnings and 0 errors; all 18 changed files pass
oxfmt --checkandgit diff --check.Integration tests use the default production plugin policy, real local HTTP handlers and a local WebSocket tunnel. They observe configured-origin success, the unchanged official default request URL, valid same-origin browser approval before foreign-link rejection, and zero attempted fetches for unknown/suffix-spoof/HTTP origins through account redemption, browser login.start and both Connect inputs. They also verify strict parsing, activation-time policy capture, no redemption redirect, selected
--base-urlprecedence over an invalid unused--server, and the launcher's actual restart notice without a misleading reload message.On the original branch, a bounded allow-all policy mutation made all 12 targeted denial tests fail across those four entry paths. Synthetic HTTPS names are mapped to deterministic loopback HTTP in test transport; public TLS/self-host/native E2E was not performed.
Supersedes #6307, which was auto-closed after two weeks without review (its only failed check was a Windows job that timed out downloading frp).
Fixes #5744