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: &'life3 CredentialResolver,
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 before business logic.
The authorizer receives a CredentialResolver rather than an
already-resolved credential so authorization remains lazy: an authorizer that
does not need identity never triggers a credential/auth flow. Call
CredentialResolver::try_resolve only when a decision actually depends on
the credential.
Required Methods§
Verifies whether command_path may run with the provided args, reason, and tier.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".