}
}
+/// Result of [`ServerAdapter::check_auth`].
+pub type ServerAdapterCheckAuth<'a> = Pin<
+ Box<
+ dyn Future<Output = Result<(String, Box<dyn UserInformation + Sync + Send>), AuthError>>
+ + Send
+ + 'a,
+ >,
+>;
+
/// User Authentication and index/root page generation methods
pub trait ServerAdapter: Send + Sync {
/// Returns the index/root page
&'a self,
headers: &'a HeaderMap,
method: &'a Method,
- ) -> Pin<
- Box<
- dyn Future<Output = Result<(String, Box<dyn UserInformation + Sync + Send>), AuthError>>
- + Send
- + 'a,
- >,
- >;
+ ) -> ServerAdapterCheckAuth<'a>;
}
lazy_static::lazy_static! {
.try_fold(Vec::new(), |mut acc, chunk| async move {
// FIXME: max request body size?
if acc.len() + chunk.len() < 64 * 1024 {
- acc.extend_from_slice(&*chunk);
+ acc.extend_from_slice(&chunk);
Ok(acc)
} else {
Err(http_err!(BAD_REQUEST, "Request body too large"))