Skip to main content

authorize

Function authorize 

Source
pub async fn authorize<B: MessageBody>(
    server: &'static str,
    is_allowed: impl FnOnce(&Caller, &Method, &str) -> bool,
    req: ServiceRequest,
    next: Next<B>,
) -> Result<ServiceResponse<B>, Error>
Expand description

Runs next if is_allowed admits the request for the caller of its connection, and refuses it with 401 (no identity) or 403 (another identity) otherwise.