Skip to main content

Authorizer

Trait Authorizer 

Source
pub trait Authorizer:
    Send
    + Sync
    + Debug {
    // Required method
    fn authorize<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        command_path: &'life1 str,
        args: &'life2 ValueMap,
        credential: Option<&'life3 Credential>,
        reason: &'life4 str,
        tier: Tier,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
}
Expand description

Authorization hook called after credential resolution and before business logic.

Required Methods§

Source

fn authorize<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, command_path: &'life1 str, args: &'life2 ValueMap, credential: Option<&'life3 Credential>, reason: &'life4 str, tier: Tier, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Verifies whether command_path may run with the provided args, reason, and tier.

Implementors§