1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2025-07-27 17:28:36 +00:00

chore(ruma): upgrade

This commit is contained in:
Matthias Ahouansou 2025-03-08 11:35:21 +00:00
parent 4dc15a4605
commit b726ccaab8
No known key found for this signature in database
3 changed files with 30 additions and 33 deletions

View file

@ -15,8 +15,10 @@ use axum_extra::{
use bytes::{BufMut, BytesMut};
use http::{Request, StatusCode};
use ruma::{
api::{client::error::ErrorKind, AuthScheme, IncomingRequest, OutgoingResponse},
server_util::authorization::XMatrix,
api::{
client::error::ErrorKind, federation::authentication::XMatrix, AuthScheme, IncomingRequest,
OutgoingResponse,
},
CanonicalJsonValue, MilliSecondsSinceUnixEpoch, OwnedDeviceId, OwnedUserId, UserId,
};
use serde::Deserialize;
@ -110,7 +112,10 @@ where
));
}
}
(AuthScheme::AccessToken, Token::Appservice(info)) => {
(
AuthScheme::AccessToken | AuthScheme::AppserviceToken,
Token::Appservice(info),
) => {
let user_id = query_params
.user_id
.map_or_else(
@ -144,11 +149,11 @@ where
}
(
AuthScheme::None
| AuthScheme::AppserviceToken
| AuthScheme::AppserviceTokenOptional
| AuthScheme::AccessTokenOptional,
Token::Appservice(info),
) => (None, None, None, Some(*info)),
(AuthScheme::AccessToken, Token::None) => {
(AuthScheme::AppserviceToken | AuthScheme::AccessToken, Token::None) => {
return Err(Error::BadRequest(
ErrorKind::MissingToken,
"Missing access token.",
@ -287,7 +292,7 @@ where
}
(
AuthScheme::None
| AuthScheme::AppserviceToken
| AuthScheme::AppserviceTokenOptional
| AuthScheme::AccessTokenOptional,
Token::None,
) => (None, None, None, None),
@ -297,7 +302,10 @@ where
"Only server signatures should be used on this endpoint.",
));
}
(AuthScheme::AppserviceToken, Token::User(_)) => {
(
AuthScheme::AppserviceToken | AuthScheme::AppserviceTokenOptional,
Token::User(_),
) => {
return Err(Error::BadRequest(
ErrorKind::Unauthorized,
"Only appservice access tokens should be used on this endpoint.",