Skip to content

fix(cli): drop the entitlements lookup from sso commands - #7471

Closed
pamelachia wants to merge 2 commits into
developfrom
pamela/growth-1000-delete-sso-entitlements-fallback
Closed

pamelachia wants to merge 2 commits into
developfrom
pamela/growth-1000-delete-sso-entitlements-fallback

Conversation

@pamelachia

Copy link
Copy Markdown
Contributor

The admin SSO provider routes behind the sso commands are not plan-gated, so a 4xx from them never means the organization lacks SAML. These commands ran an entitlements lookup on every 4xx. That added two extra requests, and the commands then printed an upgrade hint on unrelated failures (unknown provider ID, permissions, validation) and classified those failures as plan_limit.

Changed:

  • No upgrade hint on unrelated SSO errors: sso list, add, update and remove no longer look up the organization's entitlements after a 4xx. sso add still suggests an upgrade when the response carries the entitlement_required error, with no extra requests. branches update keeps its lookup.
  • 404s report the API error: sso list and sso add reported every 404 as "SAML 2.0 support is not enabled". A 404 there means the project or provider was not found, so they now surface the API's message.

Note: this overlaps #7441 in upgrade-suggest.ts and error-actionability.ts, so whichever merges second needs a rebase.

Linear

  • part of GROWTH-1000

The admin SSO provider routes are not plan-gated, so a 4xx from them never
means the org lacks SAML. The lookup only added two requests and a false
upgrade hint on unrelated errors. sso add keeps the envelope-only upgrade
suggestion; the SAML-disabled 404 errors are removed.
Only sso add and update passed apiUrl and accessToken, for the fallback
lookup. Also updates the sso e2e 404 assertion and the sso SIDE_EFFECTS
notes that still described the lookup.
@pamelachia pamelachia self-assigned this Nov 3, 2026
@pamelachia pamelachia closed this Nov 3, 2026
sundeep8967 pushed a commit to sundeep8967/cli that referenced this pull request Nov 23, 2026
The `sso list`, `add`, `update` and `remove` commands looked up the
organization's entitlements after any 4xx to decide whether to print an
upgrade hint. The SSO provider routes had no plan gate when that was
written, so the lookup added two requests and printed the hint on
unrelated failures. The Management API now answers provider create and
update with the `entitlement_required` error for organizations without
SAML (rolling out), and the shared output and telemetry paths already
handle that error, so I deleted the lookup. It was the last one in the
CLI.

**Changed:**
- **No upgrade hint on unrelated SSO errors**: the four commands make no
extra requests after a 4xx. The hint, the JSON `error.entitlement` and
`cli_upgrade_suggested` come only from a response that carries the
`entitlement_required` error, and only such a failure classifies as
`plan_limit`.
- **404s report the API error**: `sso list` and `sso add` reported every
404 as "SAML 2.0 support is not enabled". A 404 there means the project
was not found, so they now surface the API's message and classify the
failure as invalid input. I removed the `SsoListSamlDisabledError` and
`SsoAddSamlDisabledError` classes, so their tags leave the error-tag
snapshot.
- **Also removed**: I deleted `suggestUpgrade` and its permission block,
the `upgradeSuggested` option of `statusCodeActionability` and the
`saml_disabled` fingerprint suffix, which only these commands used.

**Note:** this supersedes supabase#7471, which kept the lookup helper for `sso
add`. Against an API without the gate, `sso add` for an organization
without SAML succeeds and prints no hint, as it does today.

## Linear
- fixes GROWTH-1460
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant