Skip to content

fix(auth): [FDE-2844] sign in through the router and discover the tenant data host - #171

Merged
dnjg merged 1 commit into
mainfrom
patch/fde-2844-router-cli-login
Oct 30, 2026
Merged

dnjg merged 1 commit into
mainfrom
patch/fde-2844-router-cli-login

Conversation

@dnjg

@dnjg dnjg commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Claude

SSO (Entra/GitLab) users on routed tenants could not use the CLI: the tenant host offers only GitHub sign-in, and the router host that offers SSO serves no data endpoints.

  • nullify auth login with no host (or nullify.ai / app.nullify.ai / api.nullify.ai) signs in through the router, then calls /admin/installations and stores the selected installation's data host and query parameters. Several installations prompt on a TTY or take --installation; nullify auth switch --installation changes the selection.
  • Data calls (commands, MCP) go to the data host; token lookup and refresh stay on the router. A router session with no selected installation is an error, never a data call to the router.
  • nullifyBaseUrl must be a plain https://api.<tenant>.nullify.ai origin before the token is sent to it.
  • Explicit --host <tenant> and existing config hosts keep the single-host behaviour, including refresh query parameters and the GitHub Actions exchange (which is refused on the router host).
  • nullify open sends router users to app.nullify.ai; wizard, help text, README and install.sh updated.

Not run live: a browser SSO login against the router followed by a data call to a routed tenant. That is the acceptance test before release.

Follow-ups: pentest still sends no tenant query parameters; the transports attach the token without checking the request host.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…ant data host

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dnjg dnjg added the minor Minor version updates (features) label Oct 30, 2026
@dnjg
dnjg marked this pull request as ready for review October 30, 2026 01:56
@dnjg
dnjg enabled auto-merge October 30, 2026 01:56
@dnjg
dnjg added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit dd0139a Oct 30, 2026
3 of 4 checks passed
@dnjg
dnjg deleted the patch/fde-2844-router-cli-login branch October 30, 2026 01:59
whiskeylotus pushed a commit that referenced this pull request Oct 30, 2026
Adopts #171's model: a router login stored under the router key with a
selected org (DataHost, Installation, QueryParameters, which v0.26.0 also
reads), and the router as the default host. On top of it:

- Router environments: prod (nullify.ai) and dev (router.dev.nullify.ai),
  each accepting only its own tenant origins from the org list.
- Login on a tenant asks it where to sign in (/auth/cli/config); a router
  login binds every tenant it lists and retires their old tenant logins.
- One org list and one picker (Org) for login, 'org use', 'auth switch
  --installation' (hidden alias) and the per-command resolver; every
  choice saves through SelectOrg.
- Org precedence: --org, NULLIFY_ORG, NULLIFY_GITHUB_OWNER_ID, git remote
  owner, saved default (an unavailable one is an error, never another
  org), only org. A v0.26.0 selection is taken over as the default.
- Host input parsed as a URL authority: fragment, userinfo and port are
  rejected (api.attacker.example#.nullify.ai no longer passes).
- Credential and host writes under a cross-process lock; a refresh is
  saved only over the login it started from and never changes the org;
  one refresh per auth host at a time in a process.
- MCP: data host fixed per server, default org fixed at start, per-call
  org from a cached list refetched once on a miss, results name the org.

Plan-Step: 5/9

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Minor version updates (features)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants