Inject RLS predicates into physical tasks after plan conversion. This is the read-path RLS enforcement entry point. For each task: 1. Extracts the collection name from the physical plan. 2. Fetches RLS read policies for `(tenant_id, collection)`. 3. Substitutes `$auth.*` references using the `AuthContext`. 4. Injects the resulting concrete filters into the plan: - **Scans**: merged into the exist
(
tasks: &mut [PhysicalTask],
rls_store: &RlsPolicyStore,
auth: &AuthContext,
)
| 33 | /// |
| 34 | /// Returns `Err` if a required `$auth` field is missing (fail-closed). |
| 35 | pub fn inject_rls( |
| 36 | tasks: &mut [PhysicalTask], |
| 37 | rls_store: &RlsPolicyStore, |
| 38 | auth: &AuthContext, |
| 39 | ) -> crate::Result<()> { |
| 40 | for task in tasks.iter_mut() { |
| 41 | let tenant_id = task.tenant_id.as_u64(); |
| 42 | inject_rls_for_plan(tenant_id, &mut task.plan, rls_store, auth)?; |
| 43 | } |
| 44 | Ok(()) |
| 45 | } |
| 46 | |
| 47 | /// Inject RLS into a single physical plan (public for native protocol dispatch). |
| 48 | pub fn inject_rls_for_single_plan( |
no test coverage detected