Skip to content

Commit

Permalink
feature: expose authorizer runtime values
Browse files Browse the repository at this point in the history
- execution time
- number of iterations
- number of facts
  • Loading branch information
divarvel committed Jul 11, 2023
1 parent 2a84d9e commit a698d94
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions biscuit-auth/src/token/authorizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,21 @@ impl Authorizer {
self.add_policy("deny if true")
}

/// returns the elapsed execution time
pub fn execution_time(&self) -> Duration {
self.execution_time
}

/// returns the number of fact generation iterations
pub fn iterations(&self) -> u64 {
self.world.iterations
}

/// returns the number of facts
pub fn fact_count(&self) -> usize {
self.world.facts.len()
}

/// verifies the checks and policies
///
/// on error, this can return a list of all the failed checks or deny policy
Expand Down

0 comments on commit a698d94

Please sign in to comment.