Skip to main content

AuthZResolverClient

Trait AuthZResolverClient 

Source
pub trait AuthZResolverClient: Send + Sync {
    // Required method
    fn evaluate<'life0, 'async_trait>(
        &'life0 self,
        request: EvaluationRequest,
    ) -> Pin<Box<dyn Future<Output = Result<EvaluationResponse, AuthZResolverError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Public API trait for the AuthZ resolver gateway.

This trait is registered in ClientHub by the module and can be consumed by other modules acting as PEPs:

let authz = hub.get::<dyn AuthZResolverClient>()?;

let response = authz.evaluate(request).await?;

Required Methods§

Source

fn evaluate<'life0, 'async_trait>( &'life0 self, request: EvaluationRequest, ) -> Pin<Box<dyn Future<Output = Result<EvaluationResponse, AuthZResolverError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Evaluate an authorization request.

Returns a decision (allow/deny) with optional row-level constraints.

§Errors
  • Denied if the PDP explicitly denies access
  • NoPluginAvailable if no AuthZ plugin is registered
  • ServiceUnavailable if the plugin is not ready
  • Internal for unexpected errors

Implementors§