Skip to content

chore(cli): map gen types, signing-key and bearer-jwt permissions - #7149

Merged
Prashansa-K merged 9 commits into
developfrom
chore/cli-permission-map-gen
Oct 15, 2026
Merged

Prashansa-K merged 9 commits into
developfrom
chore/cli-permission-map-gen

Conversation

@Prashansa-K

Copy link
Copy Markdown
Contributor

Maps gen types, gen signing-key and gen bearer-jwt to the Management API operations they call, so a scoped access token can be granted per command. gen keys stays pending.

gen types picks its target from flag values, so it declares flag conditions instead of a database target: --local, --db-url and --postgrest-v9-compat turn every call off. TypeScript calls the types endpoint. Other languages look the project up, fall back to the preview branch config on a 404, and reach the database through the database config resolver (login role, pooler config) and the pooler retry. The project picker and the linked-project cache fill are declared too. signing-key and bearer-jwt make no calls.

Shared block change: a target-free dbConfigPoolerFallbackLinked for commands that choose their target from flag values (dbConfigPoolerFallback is built from the same entries), and the first fallback context is reworded to fit every command. Dump, pull and the db-config tests are unchanged.

gen types runs through the real database config resolver and linked-project cache with the Management API recorded, for the TypeScript, pooler, IPv6 retry, preview branch, picker, --local=false and --db-url paths. On this command the pooler, login-role and network-ban calls are each declared by more than one source, so removing one source alone is not caught by a test; the grants are per operation either way. No operations without FGA permissions. Only typescript and go run through the recording mocks.

🤖 Generated with Claude Code

Prashansa-K and others added 5 commits October 14, 2026 16:39
Declare gen types' remote-target calls: the TypeScript types endpoint, or the project lookup,
preview-branch config and database config for other languages. Add a target-free pooler-fallback
block for commands that choose their target from flag values, and reword its first context to
fit every command.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Both commands only generate keys and tokens locally and make no Management API calls.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Run gen types through the real database config resolver and linked-project cache with the
Management API recorded, for the TypeScript, pooler, IPv6 retry, preview branch, project picker,
--local=false and --db-url paths.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add a --local run, keep the TypeScript run from passing on the cache fill's project lookup, pin the
handler's own lookup and the branch credentials, note that --project-id ignores the saved pooler url
and the ad-hoc password caveat in the declared contexts, and bring the side-effect doc up to date.

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 14, 2026 11:33

@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. Inspection of the changed code, surrounding handlers and shared layers found no additional actionable issues or fundamental conflicts with the supplied next-branch context. 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.

@avallete avallete left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving: the gen types declarations match the calls on every path (local, db-url, v9-compat, TypeScript vs other languages, preview-branch fallback, interactive picker). signing-key and bearer-jwt are correctly API-free. Tests, typecheck and lint pass. On staging, gen types (ts and go) made only declared calls, and signing-key/bearer-jwt made none without a token.

Optional nits:

  • types.integration.test.ts: the test named for --local=false produces the same active flags as passing no flag, so the drift check can't tell them apart. Consider dropping the flag and renaming it to the no-target-flag case.
  • The three "makes no Management API request" tests (--local, --db-url, --postgrest-v9-compat) could be one it.each.
  • gen types inherits two pooler entries keyed on --project-ref, which it doesn't have. They never apply today, but a future docs generator could list them.

Comment thread apps/cli/src/commands/gen/types/types.command.ts
Prashansa-K and others added 3 commits October 15, 2026 08:49
The --local=false case ran with the same active flags as no flag, so the drift check could not
tell them apart; it now names no target flag. The three no-request cases share one table.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Prashansa-K
Prashansa-K added this pull request to the merge queue Oct 15, 2026
Merged via the queue into develop with commit c4ccf77 Oct 15, 2026
38 checks passed
@Prashansa-K
Prashansa-K deleted the chore/cli-permission-map-gen branch October 15, 2026 03:50
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