Repository navigation
fix(relay): allow free plans to use the relay - #5571
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Ready to review this PR? Stage has broken it down into 1 individual chapter for you:
Chapters generated by Stage for commit de920be on Jul 10, 2026 6:03pm UTC. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesHost access authorization
Estimated code review effort: 2 (Simple) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 Preview Deployment🔗 Preview Links
Preview updates automatically with new commits |
…ction, relay reason) (#5573) * docs(plan): headless host registration fixes (4 bugs, diagnosed end-to-end) Diagnosed while bringing a Sprites.dev sandbox online: SUPERSET_API_KEY env never read (middleware.ts:7 / resolve-auth.ts), no --org selection in start (start/command.ts:15), opaque relay 1008 Forbidden (access.ts:40 / index.ts:262), and headless hosts stay unclaimed with no CLI path. Plan captures each with code refs + fix sketch. * docs(plan): note #5571 removed the paidPlan relay gate; Bug 4 (claim) is the remaining blocker * fix(cli,relay): headless host registration — env key, org selection, relay reason - cli: resolveAuth reads SUPERSET_API_KEY env as an override (flag > env > config > oauth), making the documented env var actually work headlessly. - cli: `superset start` gains --org <id|slug|name>; with multiple memberships it prompts on a TTY and refuses (no silent guess) in agent/non-interactive mode instead of registering under the active org. - relay: checkHostAccess returns a denial reason; the 1008/403 Forbidden now carries 'not a member of this org' / 'host not registered to this account' (tunnel-client already logs the close reason). - plan: Bug 4 was a misdiagnosis — host.ensure auto-owns on registration, so a headless host self-claims; corrected the doc. Tests: SUPERSET_API_KEY precedence + org resolution (both OR branches of the non-interactive guard mutation-verified). * refactor(cli): remove unreachable branch in resolveOrganization org picker * feat(cli): --org on hosts list/status/wake/set-wake; docs + relay reason test Fills the headless observability gap: you can register a host under a chosen org (start --org) but previously couldn't list/manage it unless it was your active org — and a pure env-key user (no config.organizationId) hit 'No active organization' outright. - Promote org resolution to lib/resolve-org.ts (shared by start + observe commands); add an active-org fallback and a ctx-aware resolveOrganizationFromContext wrapper. - Wire --org into hosts list, status, hosts wake, hosts set-wake. They default to the active org, resolve --org by id/slug/name, and fetch memberships so a headless key can target any org it belongs to. - docs(remote-workspaces): document the headless flow (SUPERSET_API_KEY + --org). - test(relay): cover accessDenialMessage (incl. the 123-byte WS-close limit) and checkHostAccess's no-network denial branches (invalid_host, not_in_org). Tests: active-org fallback + relay byte-limit mutation-verified. E2E: hosts list --org <other-org> now lists a non-active org's hosts (previously impossible).
Summary
Relay access no longer requires a paid subscription. The relay gate (
checkHostAccess) now grants access based solely onresult.allowedfromhost.checkAccess, dropping the&& result.paidPlanrequirement. Free-plan users whose host is authorized in their org can now use the relay HTTP proxy and/tunnelWebSocket instead of getting403 Forbidden/ a closed socket.Scope is limited to the relay server enforcement — the only place that actually blocked free users. The desktop paywall UI is intentionally left untouched. The
paidPlanfield returned byhost.checkAccessis now unused by any consumer but kept in place to minimize the diff.Test Plan
Summary by cubic
Allow free-plan users with an authorized host to use the relay HTTP proxy and
/tunnelWebSocket. Access now relies only onhost.checkAccessreturningallowed, removing the paid plan check.Written for commit de920be. Summary will update on new commits.
Summary by CodeRabbit