Skip to content

feat(cli): add --dedicated-scope to sso add - #7665

Open
hf wants to merge 7 commits into
developfrom
feat/sso-add-dedicated-scope
Open

hf wants to merge 7 commits into
developfrom
feat/sso-add-dedicated-scope

Conversation

@hf

@hf hf commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Adds a --dedicated-scope flag to supabase sso add, which sets the SAML dedicated_scope option so the provider gets its own entity ID, metadata URL and ACS URL.

  • The field is create-only, so sso update does not accept it.
  • saml.dedicated_scope is included in provider output (sso show, sso list, and the json/yaml/toml formats).
  • sso show, add, remove and update print the provider's own ACS URL and entity ID in the text table when its scope is dedicated. update takes the scope from the provider it fetches first, since its response omits the field.
  • sso info is unchanged.
  • The Management API spec gets the field through openapi-overrides.json until the published spec documents it.

Related: supabase/auth#2893, supabase/platform#42021

🤖 Generated with Claude Code

Pass the SAML dedicated_scope option when creating an SSO provider and
surface saml.dedicated_scope in provider output. The field is create-only,
so sso update does not accept it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@hf
hf requested review from a team and supabase-oss as code owners November 17, 2026 11:07
@hf
hf requested a review from avallete November 17, 2026 11:07

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Verified all four Claude findings against the checked-out code; Codex reported no findings. Confirmed the dedicated-provider URL discoverability gap, incomplete documentation, missing dedicated-scope integration cases, and stale comment. No additional issues found. Tests were not run.

Findings

Severity Location Category Sources Claim
🟡 MINOR apps/cli/src/commands/sso/add/add.command.ts:57 ux claude The CLI can create dedicated-scope providers but does not expose their SP entity ID or ACS URL. sso info still presents only shared project-wide URLs without warning that dedicated providers require different URLs, and provider tables omit the dedicated-scope setting.
🟡 MINOR apps/cli/src/commands/sso/add/add.integration.test.ts:1129 test-coverage claude Dedicated-scope integration tests cover only a bare flag and an absent flag; they do not verify explicit false forwarding, invalid-value rejection before requests, or repeated-flag precedence.
🟡 MINOR apps/cli/src/commands/sso/add/SIDE_EFFECTS.md:57 documentation claude The SsoInvalidFlagValueError exit-code row omits --dedicated-scope, and the consent-prompt documentation omits the new Dedicated scope detail.
⚪ NIT apps/cli/src/commands/sso/add/add.handler.ts:132 documentation claude The scanner comment incorrectly states that --skip-url-validation is the command's only boolean flag.

Findings outside the diff

  • 🟡 MINOR apps/cli/src/commands/sso/add/SIDE_EFFECTS.md:57 — The SsoInvalidFlagValueError exit-code row omits --dedicated-scope, and the consent-prompt documentation omits the new Dedicated scope detail.
  • ⚪ NIT apps/cli/src/commands/sso/add/add.handler.ts:132 — The scanner comment incorrectly states that --skip-url-validation is the command's only boolean flag.

Stats

Claude findings: 4 · Codex findings: 0 · Confirmed: 4 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

@github-actions

Copy link
Copy Markdown
Contributor

CLI benchmark (Lightweight Commands): no changes found

Commit 41ff90a against develop at 317ea77 · 10 runs each · report only, never blocks merging

Command Workload Before After Change
supabase --version version 287 ms 297 ms no real change
supabase --help help 278 ms 278 ms no real change
supabase init init 325 ms 349 ms no real change (+7%, within normal variation)
supabase migration new bench migration-new 330 ms 354 ms no real change (+7%, within normal variation)
supabase config convert config-convert 306 ms 286 ms no real change (-6%, within normal variation)
supabase config validate config-validate 343 ms 366 ms no real change (+7%, within normal variation)
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 371 ms 376 ms no real change
supabase projects list projects-list 311 ms 287 ms no real change (-8%, within normal variation)
supabase functions list --project-ref replayfixtureprojref functions-list 297 ms 289 ms no real change

API calls: unchanged for all 9 commands.

Binary size: 135.2 MB, up 4.0 KB from 135.2 MB.

Details: timing ranges, API calls per command, slowest phases

Timing ranges

Command Workload Before range After range Change Verdict
supabase --version version 244-337 ms 249-356 ms +9 ms (+3%) within noise
supabase --help help 250-307 ms 232-375 ms +0 ms (+0%) within noise
supabase init init 294-497 ms 264-416 ms +23 ms (+7%) within noise
supabase migration new bench migration-new 286-436 ms 300-403 ms +24 ms (+7%) within noise
supabase config convert config-convert 266-349 ms 253-418 ms -20 ms (-6%) within noise
supabase config validate config-validate 286-458 ms 322-410 ms +23 ms (+7%) within noise
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 334-439 ms 317-476 ms +5 ms (+1%) within noise
supabase projects list projects-list 236-397 ms 222-367 ms -24 ms (-8%) within noise
supabase functions list --project-ref replayfixtureprojref functions-list 250-328 ms 232-320 ms -8 ms (-3%) within noise

API calls per command

Command Workload Before After Endpoint changes
supabase --version version 0 0
supabase --help help 0 0
supabase init init 0 0
supabase migration new bench migration-new 0 0
supabase config convert config-convert 0 0
supabase config validate config-validate 0 0
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 2 2
supabase projects list projects-list 1 1
supabase functions list --project-ref replayfixtureprojref functions-list 2 2

Slowest phases

No command moved beyond noise, so there are no phase deltas.

Workflow run

Comment /bench to run the lightweight benchmark (this comment) again on the latest commit, or /bench full to also run the integration-heavy benchmark, which posts in its own comment.

hf and others added 3 commits November 17, 2026 12:12
sso show, add and remove print the provider's own ACS URL and entity ID
when its SAML scope is dedicated, and sso info accepts an optional
provider ID to print those URLs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@Prashansa-K Prashansa-K left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

Here are the review findings that can be blocking for this change:

  1. sso update output is inconsistent with show, add and remove. The PR adds dedicated_scope to the Create, Get, Delete and List response overrides. It does not add one for UpdateProviderResponse_Output.
  2. sso info <provider-id> is outside this PR’s stated scope: it prints URLs for any UUID with no provider lookup (I confirmed a nonexistent ID succeeds with zero API calls), validates the UUID only after the project picker’s API call, and adds a note to the default sso info output. Add the relevant corrections here and describe the info changes in PR description. It is fine to split it into its own PR if necessary.

Comment thread apps/cli/src/commands/sso/sso.format.ts Resolved
… changes

sso update now renders the dedicated-scope rows from the provider it
fetched before the update, and renderSingleProvider requires the project
ref so every caller must pass it. The sso info changes move to a separate
branch.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@avallete

Copy link
Copy Markdown
Member

Dogfooded 435fc8435 against staging.

Merge gate: please hold this until supabase/platform#42021 is merged and deployed to staging. Staging accepts dedicated_scope on create today, but no Management API response returns saml.dedicated_scope, not even a raw GET /v1/projects/{ref}/config/auth/sso/providers. So the new output (the DEDICATED SCOPE / SP ACS URL / SP ENTITY ID rows and the dedicated_scope key in json/yaml/toml) never shows, and we can't confirm the setting is stored. I'll re-run the staging pass once the platform change is live.

Checks that passed, at 435fc8435:

  • --dedicated-scope is listed in sso add --help; sso update --dedicated-scope is rejected before any request is sent.
  • sso info <uuid> prints /auth/v1/sso/<id>/saml/{acs,metadata}, including with -o json, -o env and -o yaml; sso info not-a-uuid fails with a clear error.
  • sso add without the flag and with --dedicated-scope=false, then sso update and sso remove, all work.

A separate local cross-review agrees with the points already raised on sso update (update.handler.ts:459 omits ref) and on sso info accepting any UUID. Nothing to add beyond those.

@hf

hf commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

@Prashansa-K This is by design, the variables / URLs follow a convention... You also get sso info if SAML is not enabled on the project. It's not a necessary precondition.

@hf
hf requested a review from Prashansa-K November 17, 2026 11:54
hf added 2 commits November 19, 2026 22:53
…so-add-dedicated-scope

# Conflicts:
#	packages/api/src/generated/openapi.json
…so-add-dedicated-scope

# Conflicts:
#	apps/cli/src/commands/sso/add/SIDE_EFFECTS.md
#	apps/cli/src/commands/sso/remove/SIDE_EFFECTS.md
#	apps/cli/src/commands/sso/show/SIDE_EFFECTS.md

This branch has not been deployed

No deployments
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.

3 participants