Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThis PR implements email verification enforcement, expands 2FA enforcement features, introduces RBAC-based privilege escalation guards, adds read-replica password management tooling, refactors onboarding UI components, and updates multiple database functions with enhanced security checks and row-level security policies. Changes
Estimated code review effort🎯 5 (Critical) | ⏱️ ~110 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5960acaf24
ℹ️ 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_apikey_only" ("keymode" "public"."key_mode"[]) FROM "anon"; | ||
| REVOKE ALL ON FUNCTION "public"."get_identity_apikey_only" ("keymode" "public"."key_mode"[]) FROM "authenticated"; |
There was a problem hiding this comment.
Revoke PUBLIC execute on identity helper functions
Revoking these RPCs from anon/authenticated is not sufficient to block direct calls because PostgreSQL grants EXECUTE on functions to PUBLIC by default, and both API roles inherit PUBLIC. As written, callers can still invoke get_identity_apikey_only (and the other identity helpers) through that inherited grant, so the identity-oracle hardening is bypassed unless you also REVOKE ... FROM PUBLIC before re-granting trusted roles.
Useful? React with 👍 / 👎.
| ALTER DEFAULT PRIVILEGES FOR ROLE "postgres" IN SCHEMA "public" REVOKE ALL ON FUNCTIONS FROM "anon"; | ||
| ALTER DEFAULT PRIVILEGES FOR ROLE "postgres" IN SCHEMA "public" REVOKE ALL ON FUNCTIONS FROM "authenticated"; |
There was a problem hiding this comment.
Revoke PUBLIC default execute for future functions
These default-privilege changes only remove future grants for anon/authenticated, but they leave the default PUBLIC function execute privilege untouched. New functions created by postgres in public will therefore still be executable by API roles via inherited PUBLIC, which undermines the stated goal that future objects should not inherit anonymous/authenticated function access.
Useful? React with 👍 / 👎.
…go/capgo into riderx/fix-apikey-oracle-ci
|



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
New Features
Security Improvements
Bug Fixes
Chores