Repository navigation
chore(cli): map gen types, signing-key and bearer-jwt permissions - #7149
Conversation
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>
There was a problem hiding this comment.
🤖 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
left a comment
There was a problem hiding this comment.
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=falseproduces 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 oneit.each. gen typesinherits two pooler entries keyed on--project-ref, which it doesn't have. They never apply today, but a future docs generator could list them.
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>
…to chore/cli-permission-map-gen
Maps
gen types,gen signing-keyandgen bearer-jwtto the Management API operations they call, so a scoped access token can be granted per command.gen keysstays pending.gen typespicks its target from flag values, so it declares flag conditions instead of a database target:--local,--db-urland--postgrest-v9-compatturn 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-keyandbearer-jwtmake no calls.Shared block change: a target-free
dbConfigPoolerFallbackLinkedfor commands that choose their target from flag values (dbConfigPoolerFallbackis 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 typesruns 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=falseand--db-urlpaths. 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. Onlytypescriptandgorun through the recording mocks.🤖 Generated with Claude Code