-
-
Notifications
You must be signed in to change notification settings - Fork 467
[4.x] Make forcing RLS configurable #1293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## may25 #1293 +/- ##
=========================================
Coverage 84.71% 84.71%
- Complexity 1078 1079 +1
=========================================
Files 178 178
Lines 3120 3121 +1
=========================================
+ Hits 2643 2644 +1
Misses 477 477 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Any news on this? <3 |
b7dda96
to
e4a32e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds the configurable static property $forceRls to control whether table owners bypass RLS policies and updates tests to validate the behavior with different RLS configurations.
- Introduces the $forceRls property in CreateUserWithRLSPolicies to force RLS policy enforcement.
- Updates tests in TraitManagerTest, TableManagerTest, and PolicyTest to account for configurable RLS behavior using additional test parameters.
- Adds new tests to verify that even table owners and users without BYPASSRLS privilege are correctly affected when forceRls is enabled.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tests/RLS/TraitManagerTest.php | Updated test signatures and configuration for testing implicit RLS and forceRls behavior. |
tests/RLS/TableManagerTest.php | Modified tests to include RLS forcing scenarios and added comprehensive tests for RLS logic. |
tests/RLS/PolicyTest.php | Revised tests to incorporate forceRls parameter and validate tenant session variable failures. |
src/Commands/CreateUserWithRLSPolicies.php | Introduced the $forceRls property with documentation and corresponding logic in the command. |
Co-authored-by: Copilot <[email protected]>
This PR adds the
$forceRls
static property to thetenants:rls
command.If
$forceRls
istrue
(default), the table owners won't be able to query their own tables (unless the owners have the BYPASSRLS privilege). If the property is set tofalse
, table owners will bypass RLS, allowing them to query the owned tables.(follow up on #1288)
Additional context:
BYPASSRLS
permBYPASSRLS
perm