pub trait FilteredExecutor {
type QueryOp;
type Result;
type Error;
// Required method
fn execute(
&self,
query: &Self::QueryOp,
filter_ir: &FilterIR,
auth_scope: &AuthScope,
) -> Result<Self::Result, Self::Error>;
// Provided method
fn effective_filter(
&self,
filter_ir: &FilterIR,
auth_scope: &AuthScope,
) -> FilterIR { ... }
}Expand description
The pushdown contract that every executor MUST implement
This trait enforces:
- Filter is provided upfront, not as post-processing
- Auth scope is non-optional
- Results are guaranteed to satisfy the effective filter
Required Associated Types§
Required Methods§
Sourcefn execute(
&self,
query: &Self::QueryOp,
filter_ir: &FilterIR,
auth_scope: &AuthScope,
) -> Result<Self::Result, Self::Error>
fn execute( &self, query: &Self::QueryOp, filter_ir: &FilterIR, auth_scope: &AuthScope, ) -> Result<Self::Result, Self::Error>
Execute a query with mandatory filtering
§Contract
filter_ir: User-provided filter (may be empty = all)auth_scope: Non-optional security context
The executor MUST:
- Compute
effective_filter = auth_scope.to_filter_ir() ∧ filter_ir - Apply
effective_filterBEFORE generating candidates - Guarantee all results satisfy
effective_filter
The executor MUST NOT:
- Return any result outside
effective_filter - Apply filtering after candidate scoring
- Ignore or bypass
auth_scope
Provided Methods§
Sourcefn effective_filter(
&self,
filter_ir: &FilterIR,
auth_scope: &AuthScope,
) -> FilterIR
fn effective_filter( &self, filter_ir: &FilterIR, auth_scope: &AuthScope, ) -> FilterIR
Compute the effective filter (auth ∧ user)
This is a convenience method that executors can use.