feat(auth): consume hosted fixed-path credentials - #286
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. |
|
Warning Review limit reached
Next review available in: 3 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6ceddbf1a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/mount/relayfile-cloud-mount-client.ts">
<violation number="1" location="src/mount/relayfile-cloud-mount-client.ts:120">
P1: When hosted credentials are supplied through `cloudAccessTokenUrl` or `cloudAccessTokenProvider`, this guard does not bypass local workspace resolution. Thread the hosted configuration into `resolveFactoryWorkspace()` or skip that resolver for direct hosted providers, otherwise `AGENT_RELAY_BIN` can still run before `fromConfig()`.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Outcome
Give the built Factory CLI a non-interactive hosted credential path without local Cloud login and without invoking
AGENT_RELAY_BIN.When
FACTORY_CLOUD_ACCESS_TOKEN_URLis present,RelayfileCloudMountClient.fromConfig()uses that private endpoint as its Cloud token provider. The provider:relay_pa_access-token class;ensureCloudSession()entirely;An explicit in-process provider remains available to alternate hosts. Existing local Cloud-session behavior is unchanged when neither hosted option is configured.
Verification
npm test -- --run src/mount/relayfile-cloud-mount-client.test.ts— 59/59, exit 0npm run build— exit 0git diff --check— exit 0The tests prove both sides: the private hosted endpoint works even when
AGENT_RELAY_BINpoints at the wrong executable, and a workspace/mint credential (relay_ws) is rejected rather than silently starting.Cutover dependencies
This is the Factory-side consumer only. Live cutover remains fail-closed until:
relay_paidentity for the exact workspace/agent/scopes/audience; andNo live deploy and no merge is performed by this PR.
Related: #268
Summary by cubic
Consumes hosted, fixed RelayAuth path credentials and bypasses local Cloud login and workspace discovery. Previously the client always used the local Cloud session (and could invoke AGENT_RELAY_BIN); now hosted mode validates and uses
relay_pa_*tokens from a private provider and fails closed on errors.Enable hosted mode via
cloudAccessTokenProvider,cloudAccessTokenUrl, orFACTORY_CLOUD_ACCESS_TOKEN_URL; in hosted mode we never callensureCloudSession()or resolve the laptop workspace and join with the defaultrw_7ccfea89.Require a Cloud API URL: when injecting
cloudAccessTokenProvideryou must passcloudApiUrl; when usingcloudAccessTokenUrl/FACTORY_CLOUD_ACCESS_TOKEN_URL, we usecloudApiUrlor infer fromCLOUD_API_URL/defaultApiUrl().Enforce token class for both injected and fetched tokens: reject non-
relay_pa_*before workspace join.Hosted endpoint fetch: 10s timeout, absolute http/https only, no-store headers; cancel body on non-2xx; never read or log failure bodies.
Local session path is unchanged when no hosted option is set.
New config:
cloudAccessTokenUrl,cloudAccessTokenFetch,cloudAccessTokenTimeoutMs.Rollout: Hosts set
FACTORY_CLOUD_ACCESS_TOKEN_URLandCLOUD_API_URL, or injectcloudAccessTokenProviderwithcloudApiUrl; providers must returnrelay_pa_*or startup fails; no action for local development.Written for commit d409a2f. Summary will update on new commits.