Trait tower_http::auth::AuthorizeRequest
source · pub trait AuthorizeRequest<B> {
type ResponseBody;
fn authorize(
&mut self,
request: &mut Request<B>
) -> Result<(), Response<Self::ResponseBody>>;
}
Available on crate feature
auth
only.Expand description
Trait for authorizing requests.
Required Associated Types§
sourcetype ResponseBody
type ResponseBody
The body type used for responses to unauthorized requests.
Required Methods§
Authorize the request.
If Ok(())
is returned then the request is allowed through, otherwise not.