Repository navigation
fix(smoke): seed the preview smoke user with an sb_secret_ service-role key - #704
Conversation
…o sb_secret_ keys work
✅ No issues foundOne-file CI helper fix: the Auth admin calls now send the service-role key as both 1 advisory finding below the confidence bar — see Less certain below. Checked: 1 of 1 changed file read · 3 possible issues → 0 confirmed → 0 posted Less certain (1) — advisory, below the confidence bar
Review details
Found Quality — produced 3 → posted inline 0 · cleared 0 · carried forward 0 · deferred 0 · below-bar 1 Run full · 33 lines in delta · tier deep · depth checkout Nothing to report — severity, reach diagram (impact graph found no consumer or importer), 0 files skipped.
|
Why
After #702, the deploy run's "Ensure the fixed smoke user exists on preview" step ran but could not create the user (run 39131692320):
The preview
SUPABASE_SERVICE_ROLE_KEYis a new-generationsb_secret_…key.seed-smoke-user.mjssent the anon key asapikeyand the service key only asAuthorization: Bearer. With an opaque secret key, GoTrue then parses the secret as a JWT and rejects it. So the orgs REST smoke stayed skipped.What changed
scripts/smoke/seed-smoke-user.mjs: the Auth admin calls (create, list, update) now send the service-role key in bothapikeyandAuthorization. This is the shapescripts/load-test/already uses, and both key generations accept it (seedocs/benchmarking.md). The sign-in check still uses the anon key. The key is also trimmed.How to verify
Against a local Supabase (CLI default keys):
sb_secret_…+sb_publishable_…(CI's shape)403 not_admin¹service_role+anonJWTsalready seeded)¹ Local GoTrue answers the mismatched pair with
not_admin; the hosted project answers it withbad_jwt(the CI log above). Both are the same rejection of an anonapikeypaired with a secret-key Bearer.After merge, the deploy run's smoke-preview should log
ok — smoke user seededand the orgs REST suite should run.User-facing docs/llms.txt: none applied, because this is a CI helper script fix with no user-visible change.