pub struct Validator<'a> { /* private fields */ }Expand description
Prepared validator with mandatory audience/purpose and optional exact capabilities.
Implementations§
Source§impl Validator<'_>
impl Validator<'_>
pub fn validate( &self, token: &str, now: u64, hook: &dyn ValidationHook, ) -> Result<Arc<Principal>>
Sourcepub fn validate_cached(
&self,
token: &str,
now: u64,
cache: &dyn PrincipalCache,
ttl: Duration,
hook: &dyn ValidationHook,
) -> Result<Arc<Principal>>
pub fn validate_cached( &self, token: &str, now: u64, cache: &dyn PrincipalCache, ttl: Duration, hook: &dyn ValidationHook, ) -> Result<Arc<Principal>>
No token decryption, base64 or claims decoding on a warm cache hit. Hooks still consult current policy; FleetAuth checks its authenticated shared state.
TTL is caller-owned and never exceeds token expiry. Zero/subsecond TTL disables caching. Static checks and the hook run every time. Callers supply current Unix seconds from a trusted clock, never from client input.
Auto Trait Implementations§
impl<'a> Freeze for Validator<'a>
impl<'a> RefUnwindSafe for Validator<'a>
impl<'a> Send for Validator<'a>
impl<'a> Sync for Validator<'a>
impl<'a> Unpin for Validator<'a>
impl<'a> UnsafeUnpin for Validator<'a>
impl<'a> UnwindSafe for Validator<'a>
Blanket Implementations§
Source§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