Trait AsyncAuthorizeRequest
pub trait AsyncAuthorizeRequest<S, B> {
type RequestBody;
type ResponseBody;
// Required method
fn authorize(
&self,
ctx: Context<S>,
request: Request<B>,
) -> impl Future<Output = Result<(Context<S>, Request<Self::RequestBody>), Response<Self::ResponseBody>>> + Send;
}
Expand description
Trait for authorizing requests.
Required Associated Types§
type RequestBody
type RequestBody
The type of request body returned by authorize
.
Set this to B
unless you need to change the request body type.
type ResponseBody
type ResponseBody
The body type used for responses to unauthorized requests.
Required Methods§
Authorize the request.
If the future resolves to Ok(request)
then the request is allowed through, otherwise not.
Object Safety§
This trait is not object safe.