Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new database migration introduces Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 SQLFluff (4.0.4)supabase/migrations/20260227000000_fix_identity_oracle_and_org_rpc_exposure.sqlUser Error: No dialect was specified. You must configure a dialect or specify one on the command line using --dialect after the command. Available dialects: 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b63d36cc0a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| REVOKE ALL ON FUNCTION "public"."get_identity_org_allowed" ("keymode" "public"."key_mode"[], "org_id" "uuid") FROM "anon"; | ||
| REVOKE ALL ON FUNCTION "public"."get_identity_org_allowed" ("keymode" "public"."key_mode"[], "org_id" "uuid") FROM "authenticated"; |
There was a problem hiding this comment.
Preserve anon/auth execute on RLS identity helpers
Revoking EXECUTE from anon/authenticated on get_identity_org_allowed (and similarly get_identity_org_appid) will break any RLS policy that calls these helpers for those roles, because policy expressions still require function execute privileges; for example, supabase/migrations/20260226000100_fix_org_rls_2fa_function_permissions.sql defines an anon/authenticated policy that directly calls get_identity_org_allowed, so those requests will start failing with permission denied for function ... instead of applying RLS.
Useful? React with 👍 / 👎.
|



Summary
get_identity_apikey_only,get_identity_org_allowed,get_identity_org_appid) fromanonandauthenticatedroles.public.get_orgs_v6(userid uuid)to enforce that callable user IDs match the authenticated caller identity, preventing user-id probing and unauthorized org membership leaks.get_orgs_v6(userid uuid)and identity helpers available only to trusted roles and revoked broad default anonymous/authenticated function/table privilege inheritance for new objects.Test plan
bun lint.git diff origin/main...for the migration scope and ensure no unrelated objects changed.get_identity_apikey_only/get_identity_org_allowed/get_identity_org_appidare not callable asanon.get_orgs_v6(<other-user>)is denied for non-service roles.Screenshots
Checklist
bun run lint:backend && bun run lint.accordingly.
my tests
Summary by CodeRabbit