Repository navigation
fix(envoy): only accept asymmetric api keys when sb translation is enabled - #45195
Conversation
|
Thanks for contributing to Supabase! ❤️ Our team will review your PR. A few tips for a smoother review process:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@luizfelmach is attempting to deploy a commit to the Supabase Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Lua 401-validation logic for protected routes in Envoy's configuration now checks for both Supabase keys and asymmetric JWT keys to determine translation enablement. When translation prerequisites are not satisfied, asymmetric API key values are rejected during authorization validation. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Braintrust eval report
|
I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
Bug fix (Envoy API key validation behavior)
What is the current behavior?
When
SUPABASE_PUBLISHABLE_KEY/SUPABASE_SECRET_KEYare not configured (translation mode disabled), requests can still pass API key validation usingANON_KEY_ASYMMETRICorSERVICE_ROLE_KEY_ASYMMETRICif those values are set.This allows asymmetric internal JWTs to be accepted directly as API keys outside the intended
sb_* -> internal JWTtranslation flow.What is the new behavior?
Asymmetric keys are now accepted by the
401API key validation filter only when translation mode is enabled (all required translation env vars are present).Additional context
This is a minimal, low-risk fix in
docker/volumes/api/envoy/lds.template.yaml:TRANSLATION_ENABLEDcheck in the API key validation Lua filter.ANON_KEY_ASYMMETRICandSERVICE_ROLE_KEY_ASYMMETRICbehind that condition.Summary by CodeRabbit
Release Notes