mirror of
https://git.proxmox.com/git/proxmox
synced 2025-04-30 17:41:35 +00:00
rest-server: clippy fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
2e929cc386
commit
00f16b4e94
@ -73,6 +73,15 @@ impl From<Error> for AuthError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 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
|
/// User Authentication and index/root page generation methods
|
||||||
pub trait ServerAdapter: Send + Sync {
|
pub trait ServerAdapter: Send + Sync {
|
||||||
/// Returns the index/root page
|
/// Returns the index/root page
|
||||||
@ -90,13 +99,7 @@ pub trait ServerAdapter: Send + Sync {
|
|||||||
&'a self,
|
&'a self,
|
||||||
headers: &'a HeaderMap,
|
headers: &'a HeaderMap,
|
||||||
method: &'a Method,
|
method: &'a Method,
|
||||||
) -> Pin<
|
) -> ServerAdapterCheckAuth<'a>;
|
||||||
Box<
|
|
||||||
dyn Future<Output = Result<(String, Box<dyn UserInformation + Sync + Send>), AuthError>>
|
|
||||||
+ Send
|
|
||||||
+ 'a,
|
|
||||||
>,
|
|
||||||
>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lazy_static::lazy_static! {
|
lazy_static::lazy_static! {
|
||||||
|
@ -362,7 +362,7 @@ async fn get_request_parameters<S: 'static + BuildHasher + Send>(
|
|||||||
.try_fold(Vec::new(), |mut acc, chunk| async move {
|
.try_fold(Vec::new(), |mut acc, chunk| async move {
|
||||||
// FIXME: max request body size?
|
// FIXME: max request body size?
|
||||||
if acc.len() + chunk.len() < 64 * 1024 {
|
if acc.len() + chunk.len() < 64 * 1024 {
|
||||||
acc.extend_from_slice(&*chunk);
|
acc.extend_from_slice(&chunk);
|
||||||
Ok(acc)
|
Ok(acc)
|
||||||
} else {
|
} else {
|
||||||
Err(http_err!(BAD_REQUEST, "Request body too large"))
|
Err(http_err!(BAD_REQUEST, "Request body too large"))
|
||||||
|
Loading…
Reference in New Issue
Block a user