Skip to content

Comments

Riderx/2fa rls guard#1694

Merged
riderx merged 2 commits intomainfrom
riderx/2fa-rls-guard
Feb 25, 2026
Merged

Riderx/2fa rls guard#1694
riderx merged 2 commits intomainfrom
riderx/2fa-rls-guard

Conversation

@riderx
Copy link
Member

@riderx riderx commented Feb 25, 2026

Summary

Test plan

Screenshots

Checklist

  • My code follows the code style of this project and passes
    bun run lint:backend && bun run lint.
  • My change requires a change to the documentation.
  • I have updated the documentation
    accordingly.
  • My change has adequate E2E test coverage.
  • I have tested my code manually, and I have provided steps how to reproduce
    my tests

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

Warning

Rate limit exceeded

@riderx has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 50 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between cc5587c and 6c7028b.

📒 Files selected for processing (5)
  • messages/en.json
  • src/pages/settings/organization/Security.vue
  • supabase/functions/_backend/public/organization/index.ts
  • supabase/functions/_backend/public/organization/put.ts
  • supabase/migrations/20260226000000_org_rls_require_self_2fa_update.sql
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch riderx/2fa-rls-guard

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@riderx riderx merged commit 11ff446 into main Feb 25, 2026
10 of 11 checks passed
@riderx riderx deleted the riderx/2fa-rls-guard branch February 25, 2026 05:56
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c7028b278

ℹ️ 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".

)
AND (
"enforcing_2fa" IS NOT TRUE
OR "public"."has_2fa_enabled"((auth.uid())::uuid)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use API-key-aware identity in 2FA policy check

The new WITH CHECK clause gates enforcing_2fa with has_2fa_enabled(auth.uid()), but API-key writes run as anon with a capgkey header (see supabase/functions/_backend/utils/supabase.ts), so auth.uid() is null in that path. This means valid admin API keys cannot set enforcing_2fa = true (and cannot keep enforcing_2fa = true while updating other org fields), which is a backward-incompatible regression for PUT /organization; the check should use the resolved key identity/user id rather than auth.uid().

Useful? React with 👍 / 👎.

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant