Skip to main content

FilteredExecutor

Trait FilteredExecutor 

Source
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:

  1. Filter is provided upfront, not as post-processing
  2. Auth scope is non-optional
  3. Results are guaranteed to satisfy the effective filter

Required Associated Types§

Source

type QueryOp

The query operation type (varies by executor)

Source

type Result

The result type

Source

type Error

The error type

Required Methods§

Source

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:

  1. Compute effective_filter = auth_scope.to_filter_ir() ∧ filter_ir
  2. Apply effective_filter BEFORE generating candidates
  3. Guarantee all results satisfy effective_filter

The executor MUST NOT:

  1. Return any result outside effective_filter
  2. Apply filtering after candidate scoring
  3. Ignore or bypass auth_scope

Provided Methods§

Source

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.

Implementors§