Struct biscuit_auth::Authorizer
source ·
[−]pub struct Authorizer<'t> { /* private fields */ }Expand description
used to check authorization policies on a token
can be created from Biscuit::authorizer or Authorizer::new
Implementations
creates a new empty authorizer
this can be used to check policies when:
- there is no token (unauthenticated case)
- there is a lot of data to load in the authorizer on each check
In the latter case, we can create an empty authorizer, load it
with the facts, rules and checks, and each time a token must be checked,
clone the authorizer and load the token with Authorizer::add_token
creates an Authorizer from a serialized crate::format::schema::AuthorizerPolicies
add a token to an empty authorizer
serializes a authorizer’s content
you can use this to save a set of policies and load them quickly before verification, or to store a verification context to debug it later
add a fact to the authorizer
add a rule to the authorizer
run a query over the authorizer’s Datalog engine to gather data
let res: Vec<(String, i64)> = authorizer.query("data($name, $id) <- user($name, $id)").unwrap();run a query over the authorizer’s Datalog engine to gather data
this method can specify custom runtime limits
add a check to the authorizer
add a policy to the authorizer
verifies the checks and policiies
on error, this can return a list of all the failed checks or deny policy on success, it returns the index of the policy that matched
verifies the checks and policiies
on error, this can return a list of all the failed checks or deny policy
this method can specify custom runtime limits
prints the content of the authorizer
Trait Implementations
Auto Trait Implementations
impl<'t> RefUnwindSafe for Authorizer<'t>
impl<'t> Send for Authorizer<'t>
impl<'t> Sync for Authorizer<'t>
impl<'t> Unpin for Authorizer<'t>
impl<'t> UnwindSafe for Authorizer<'t>
Blanket Implementations
Mutably borrows from an owned value. Read more
