pub struct CoreResolver<D, P> { /* private fields */ }Expand description
Core resolver that walks the authorization model to resolve checks.
§Caching
CoreResolver uses the AuthzCache trait for two cache layers:
- L2 result cache: Caches check results (disabled for contextual tuples)
- L3 tuple cache: Caches tuple reads (disabled for contextual tuples)
By default both caches are NoopCache (disabled). Callers can inject
cross-request caches via .with_result_cache() / .with_tuple_cache().
Implementations§
Source§impl<D, P> CoreResolver<D, P>
impl<D, P> CoreResolver<D, P>
Sourcepub fn new(datastore: D, policy_provider: P) -> Self
pub fn new(datastore: D, policy_provider: P) -> Self
Create a new CoreResolver with NoopCache (caching disabled by default).
Sourcepub fn with_strategy(self, strategy: CheckStrategy) -> Self
pub fn with_strategy(self, strategy: CheckStrategy) -> Self
Set the check strategy.
Sourcepub fn with_max_concurrent(self, max: usize) -> Self
pub fn with_max_concurrent(self, max: usize) -> Self
Set the maximum concurrent dispatches.
Sourcepub fn with_result_cache(self, cache: Arc<dyn AuthzCache<CheckResult>>) -> Self
pub fn with_result_cache(self, cache: Arc<dyn AuthzCache<CheckResult>>) -> Self
Set the L2 dispatch-result cache.
Sourcepub fn with_tuple_cache(self, cache: Arc<dyn AuthzCache<Vec<Tuple>>>) -> Self
pub fn with_tuple_cache(self, cache: Arc<dyn AuthzCache<Vec<Tuple>>>) -> Self
Set the L3 tuple-iterator cache.
Trait Implementations§
Source§impl<D, P> CheckResolver for CoreResolver<D, P>
impl<D, P> CheckResolver for CoreResolver<D, P>
fn resolve_check<'life0, 'async_trait>(
&'life0 self,
request: ResolveCheckRequest,
) -> Pin<Box<dyn Future<Output = Result<CheckResult, AuthzError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl<D, P> Freeze for CoreResolver<D, P>
impl<D, P> !RefUnwindSafe for CoreResolver<D, P>
impl<D, P> Send for CoreResolver<D, P>
impl<D, P> Sync for CoreResolver<D, P>
impl<D, P> Unpin for CoreResolver<D, P>
impl<D, P> UnsafeUnpin for CoreResolver<D, P>where
D: UnsafeUnpin,
P: UnsafeUnpin,
impl<D, P> !UnwindSafe for CoreResolver<D, P>
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
Attempts to downcast this to
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
Attempts to downcast this to
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
Attempts to downcast this to
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
Attempts to downcast this to
T behind Arc pointerSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more