fix(cli): honor local auth overrides (CLI-2349) - #6523
Open
7ttp wants to merge 3 commits into
Open
Conversation
Contributor
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@4f113052c62c735781e80bfcc16a1171e4065381Preview package for commit |
Contributor
There was a problem hiding this comment.
🤖 AI Review
All five Claude findings are confirmed after reading the cited code; Codex reported no findings. Two minor findings concern local service-role token consistency, one concerns incomplete side-effect documentation, and two are polish issues. The documentation finding was narrowed because db reset does not itself exercise the cited shadow-cache path. No critical or major issues were identified.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟡 MINOR | apps/cli/src/command-internal/legacy-storage-credentials.ts:287 |
correctness |
claude | When no service-role key is configured, the local Storage credential resolver generates a token with a different claim shape from the service-role token resolved for the running stack and displayed by status. |
| 🟡 MINOR | apps/cli/src/commands/db/reset/SIDE_EFFECTS.md:143 |
documentation |
claude | The environment-variable row incorrectly limits SUPABASE_AUTH_JWT_SECRET and SUPABASE_AUTH_SERVICE_ROLE_KEY to bucket seeding even though they also affect local database recreation and setup. |
| 🟡 MINOR | apps/cli/src/command-internal/db-bootstrap/reset-local-database.ts:234 |
consistency |
claude | With auth.signing_keys_path configured and no explicit service-role key, db reset bucket seeding passes raw config and therefore derives a symmetric key instead of reusing the asymmetric values.serviceRoleKey resolved for the running stack. |
| ⚪ NIT | apps/cli/src/command-internal/legacy-storage-credentials.ts:257 |
maintainability |
claude | resolveLocalServiceRoleKey duplicates the auth member shape instead of referencing LegacyStorageConfigView["auth"], allowing the declarations to drift. |
| ⚪ NIT | apps/cli/src/commands/seed/buckets/buckets.integration.test.ts:239 |
test-isolation |
claude | The test comment says all ambient DOTENV_PRIVATE_KEY* variables are unset, but the setup only clears DOTENV_PRIVATE_KEY and DOTENV_PRIVATE_KEY_LOCAL. |
Findings outside the diff
- 🟡 MINOR
apps/cli/src/command-internal/db-bootstrap/reset-local-database.ts:234— With auth.signing_keys_path configured and no explicit service-role key, db reset bucket seeding passes raw config and therefore derives a symmetric key instead of reusing the asymmetric values.serviceRoleKey resolved for the running stack.
Stats
Claude findings: 5 · Codex findings: 0 · Confirmed: 5 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5 + gpt-5.6-sol · Trigger: auto · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
Coly010
approved these changes
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
fixes
seed buckets,db resetandstorage --localgetting rejected by the local storage gateway whenSUPABASE_AUTH_JWT_SECRETorSUPABASE_AUTH_SERVICE_ROLE_KEYcomes fromsupabase/.envor is stored as anencrypted:value...whats broken?
supabase startresolvesauth.jwt_secretandauth.service_role_keythrough the env/dotenv override and decrypt path, but the shared storage credentials resolver reads the two vars from the shell env only and uses anencrypted:value as literal key material. a key set insupabase/.envstarts the stack with one service-role key while
seed bucketsandstorage lssign with another, and the gateway returns 401. ondb resetthat lands after the migrations already ran...now fixed by:
resolving both fields in
resolveLocalServiceRoleKeythrough the samelegacyEnvOverride->legacyDecryptAuthSecretcomposition thestart/status/stopresolver already applies to them, over the dotenv map the resolver already loads. the same checks now also run on theseed bucketsno-op path (nothing configured to seed)which previously exited 0 without reading
[auth]: a shortauth.jwt_secretor an undecryptableencrypted:value now exits 1 there with the config errorstartalready raises.--linkedis untouched.ref:
SUPABASE_API_*overrides (CLI-2318) #6467