Skip to main content

AuthorizeFn

Type Alias AuthorizeFn 

Source
pub type AuthorizeFn = Arc<dyn Fn(EnvelopeContext, String, String) -> Pin<Box<dyn Future<Output = Result<bool>> + Send>> + Send + Sync>;
Expand description

Authorization callback for policy checks.

Parameters: (verified ingress context, resource, operation) -> allowed. Carry the original evidence with the context; a subject string and bearer alone cannot prove a service holder’s request to a mediator. Services store this and call it from their authorize() handler method. The concrete implementation typically wraps PolicyClient::check_policy().

Returns a boxed future to support async policy checks on single-threaded runtimes.

Aliased Type§

pub struct AuthorizeFn { /* private fields */ }