pub struct Verifier { /* private fields */ }Expand description
Decides whether a token allows an access request, and for how long.
Implementations§
Source§impl Verifier
impl Verifier
Sourcepub fn new(root_key: PublicKey, policies: &str) -> Result<Self, Error>
pub fn new(root_key: PublicKey, policies: &str) -> Result<Self, Error>
Creates a verifier accepting tokens signed by root_key, and applying
policies (Datalog policies, see DEFAULT_POLICY).
Checks that token allows request, and finds how long it keeps
allowing it, up to lifetime.
Token checks are arbitrary Datalog, so the expiry cannot be read from
them. Instead the request is evaluated at each second (the resolution
of Biscuit dates) from request.time, and the window stops at the
first refusal: credentials bounded by Authorization::valid_until
never outlive what the token allows, whatever its time checks are.
Only a policy refusal ends the window; any other failure (execution limits, Datalog errors) rejects the whole request.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Verifier
impl !UnwindSafe for Verifier
impl Forget for Verifier
impl Freeze for Verifier
impl Send for Verifier
impl Sync for Verifier
impl Unpin for Verifier
impl UnsafeUnpin for Verifier
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