run cargo fix for rust 2024 changes and rustfmt
Signed-off-by: June Clementine Strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
e97952b7f6
commit
a1e1f40ded
320 changed files with 2212 additions and 2039 deletions
|
@ -2,15 +2,15 @@ use std::{mem, ops::Deref};
|
|||
|
||||
use axum::{async_trait, body::Body, extract::FromRequest};
|
||||
use bytes::{BufMut, Bytes, BytesMut};
|
||||
use conduwuit::{debug, debug_warn, err, trace, utils::string::EMPTY, Error, Result};
|
||||
use conduwuit::{Error, Result, debug, debug_warn, err, trace, utils::string::EMPTY};
|
||||
use ruma::{
|
||||
api::IncomingRequest, CanonicalJsonObject, CanonicalJsonValue, DeviceId, OwnedDeviceId,
|
||||
OwnedServerName, OwnedUserId, ServerName, UserId,
|
||||
CanonicalJsonObject, CanonicalJsonValue, DeviceId, OwnedDeviceId, OwnedServerName,
|
||||
OwnedUserId, ServerName, UserId, api::IncomingRequest,
|
||||
};
|
||||
use service::Services;
|
||||
|
||||
use super::{auth, auth::Auth, request, request::Request};
|
||||
use crate::{service::appservice::RegistrationInfo, State};
|
||||
use crate::{State, service::appservice::RegistrationInfo};
|
||||
|
||||
/// Extractor for Ruma request structs
|
||||
pub(crate) struct Args<T> {
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
use axum::RequestPartsExt;
|
||||
use axum_extra::{
|
||||
headers::{authorization::Bearer, Authorization},
|
||||
typed_header::TypedHeaderRejectionReason,
|
||||
TypedHeader,
|
||||
headers::{Authorization, authorization::Bearer},
|
||||
typed_header::TypedHeaderRejectionReason,
|
||||
};
|
||||
use conduwuit::{debug_error, err, warn, Err, Error, Result};
|
||||
use conduwuit::{Err, Error, Result, debug_error, err, warn};
|
||||
use ruma::{
|
||||
CanonicalJsonObject, CanonicalJsonValue, OwnedDeviceId, OwnedServerName, OwnedUserId, UserId,
|
||||
api::{
|
||||
AuthScheme, IncomingRequest, Metadata,
|
||||
client::{
|
||||
directory::get_public_rooms,
|
||||
error::ErrorKind,
|
||||
|
@ -16,14 +18,12 @@ use ruma::{
|
|||
voip::get_turn_server_info,
|
||||
},
|
||||
federation::openid::get_openid_userinfo,
|
||||
AuthScheme, IncomingRequest, Metadata,
|
||||
},
|
||||
server_util::authorization::XMatrix,
|
||||
CanonicalJsonObject, CanonicalJsonValue, OwnedDeviceId, OwnedServerName, OwnedUserId, UserId,
|
||||
};
|
||||
use service::{
|
||||
server_keys::{PubKeyMap, PubKeys},
|
||||
Services,
|
||||
server_keys::{PubKeyMap, PubKeys},
|
||||
};
|
||||
|
||||
use super::request::Request;
|
||||
|
@ -56,12 +56,12 @@ pub(super) async fn auth(
|
|||
};
|
||||
|
||||
let token = if let Some(token) = token {
|
||||
if let Some(reg_info) = services.appservice.find_from_token(token).await {
|
||||
Token::Appservice(Box::new(reg_info))
|
||||
} else if let Ok((user_id, device_id)) = services.users.find_from_token(token).await {
|
||||
Token::User((user_id, device_id))
|
||||
} else {
|
||||
Token::Invalid
|
||||
match services.appservice.find_from_token(token).await {
|
||||
| Some(reg_info) => Token::Appservice(Box::new(reg_info)),
|
||||
| _ => match services.users.find_from_token(token).await {
|
||||
| Ok((user_id, device_id)) => Token::User((user_id, device_id)),
|
||||
| _ => Token::Invalid,
|
||||
},
|
||||
}
|
||||
} else {
|
||||
Token::None
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use axum::{
|
||||
Router,
|
||||
extract::FromRequestParts,
|
||||
response::IntoResponse,
|
||||
routing::{on, MethodFilter},
|
||||
Router,
|
||||
routing::{MethodFilter, on},
|
||||
};
|
||||
use conduwuit::Result;
|
||||
use futures::{Future, TryFutureExt};
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use std::str;
|
||||
|
||||
use axum::{extract::Path, RequestExt, RequestPartsExt};
|
||||
use axum::{RequestExt, RequestPartsExt, extract::Path};
|
||||
use bytes::Bytes;
|
||||
use conduwuit::{err, Result};
|
||||
use conduwuit::{Result, err};
|
||||
use http::request::Parts;
|
||||
use serde::Deserialize;
|
||||
use service::Services;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
use axum::response::{IntoResponse, Response};
|
||||
use bytes::BytesMut;
|
||||
use conduwuit::{error, Error};
|
||||
use conduwuit::{Error, error};
|
||||
use http::StatusCode;
|
||||
use http_body_util::Full;
|
||||
use ruma::api::{client::uiaa::UiaaResponse, OutgoingResponse};
|
||||
use ruma::api::{OutgoingResponse, client::uiaa::UiaaResponse};
|
||||
|
||||
pub(crate) struct RumaResponse<T>(pub(crate) T)
|
||||
where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue