Skip to content

chore(cli): map project network command permissions - #7171

Merged
Prashansa-K merged 7 commits into
developfrom
chore/cli-permission-map-project-network
Oct 15, 2026
Merged

Prashansa-K merged 7 commits into
developfrom
chore/cli-permission-map-project-network

Conversation

@Prashansa-K

@Prashansa-K Prashansa-K commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Declares the Management API permissions for the project network commands: vanity-subdomains (get, check-availability, activate, delete), ssl-enforcement (get, update), encryption (get-root-key, update-root-key), network-bans (get, remove), network-restrictions (get, update) and postgres-config (get, update, delete). Each leaf composes the project-ref picker and the linked-project cache.

Shared change: postgresConfigRead and postgresConfigWrite are new blocks in postgres-config.shared.ts, next to the helpers that issue the calls (postgres-config reaches the API through executeRaw on the typed client, so the drift matcher resolves them). get uses the read block, update the read block (only when --replace-existing-overrides is false) plus the write block, and delete both.

Conditions declared

  • network-restrictions update: is on --append selects the POST /apply or the PATCH.
  • ssl-enforcement update: the PUT is declared once per switch (--enable-db-ssl-enforcement, --disable-db-ssl-enforcement), each with is: true.
  • vanity-subdomains activate and check-availability: the call is declared for --desired-subdomain present and for oneOf: [""], because the handlers send an empty value to the API. Both also compose upgradeSuggestion.

Findings

  • v1-get-pgsodium-config is a GET that needs project_admin_write, and check-availability is a POST that needs vanity_subdomain_write.
  • postgres-config makes no restart call and has no delete endpoint: delete is a GET followed by a PUT, and --no-restart only shapes the PUT body.
  • network-bans remove fills the linked-project cache even when an IP is invalid, while network-restrictions update and ssl-enforcement update validate before resolving the ref and fill nothing. postgres-config update only checks that each --config value is a key=value pair before resolving; an unknown key is rejected after the ref resolves and the GET, so the cache is still filled. encryption resolves the ref outside the cache-fill scope.
  • The SIDE_EFFECTS docs pointed the cache at ~/.supabase/<workdir-hash>/, described a .supabase/config.json that nothing reads, and omitted the picker and cache-fill routes. They now match the code.

Not covered

  • The experimental gate is not modelled; declarations describe a run whose gate is open.
  • ssl-enforcement update over-declares when both switches are true, a run that fails before any call.
  • Picker, cache and upgrade-lookup entries carry a context, so they are checked by request sequence rather than by the exact drift check. Dropping linkedProjectCache from vanity activate or check-availability fails no test, because upgradeSuggestion also declares v1-get-project.
  • --switch=false and --desired-subdomain= are exercised with parsed values, not through the flag parser.
  • No new entries in OPERATIONS_WITHOUT_FGA.

🤖 Generated with Claude Code

Prashansa-K and others added 5 commits October 15, 2026 14:09
…work command permissions

Declares the Management API operations that vanity-subdomains, ssl-enforcement, encryption,

network-bans and network-restrictions commands call, so the permission registry covers them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds postgresConfigRead and postgresConfigWrite blocks beside the shared helpers and composes them

into get, update and delete. update only reads first when --replace-existing-overrides is false.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Runs the picker and the real linked-project cache together for each of the 15 commands and checks

recorded requests against the declarations, including guards for the flag-gated calls.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Points the linked-project cache at <workdir>/supabase/.temp/linked-project.json and adds the

project picker and cache-fill routes. Replaces claims about a .supabase/config.json file that

nothing reads.

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

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Prashansa-K
Prashansa-K requested a review from a team as a code owner October 15, 2026 08:52

@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

Both independent reviews completed and reported zero findings. Reading the permission declarations, corresponding handlers, shared picker/cache logic, and trusted conventions revealed no additional concrete defects. No fundamental conflict was identified in the supplied next-branch context. Runtime tests were not run.

Findings

No issues found.

Stats

Claude findings: 0 · Codex findings: 0 · Confirmed: 0 · 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.

@Coly010 Coly010 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.

LGTM, thanks! one small wording nit inline, happy for you to take it or leave it

Comment thread apps/cli/src/commands/postgres-config/update/SIDE_EFFECTS.md Outdated
Prashansa-K and others added 2 commits October 15, 2026 15:17
…ey=value check

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Prashansa-K
Prashansa-K enabled auto-merge October 15, 2026 09:48
@Prashansa-K
Prashansa-K added this pull request to the merge queue Oct 15, 2026
Merged via the queue into develop with commit 97b1e4b Oct 15, 2026
43 of 44 checks passed
@Prashansa-K
Prashansa-K deleted the chore/cli-permission-map-project-network branch October 15, 2026 09:54
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.

2 participants