1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-09 04:22:45 +03:00

Bump the latest axum rc

This commit is contained in:
Quentin Gliech
2022-11-18 14:41:07 +01:00
parent 0ecda1e468
commit c76a1dd2e7
22 changed files with 225 additions and 189 deletions

View File

@@ -18,7 +18,7 @@ use async_trait::async_trait;
use axum::{
body::HttpBody,
extract::{
rejection::{FailedToDeserializeQueryString, FormRejection, TypedHeaderRejectionReason},
rejection::{FailedToDeserializeForm, FormRejection, TypedHeaderRejectionReason},
Form, FromRequest, FromRequestParts, TypedHeader,
},
response::IntoResponse,
@@ -217,7 +217,7 @@ pub struct ClientAuthorization<F = ()> {
#[derive(Debug)]
pub enum ClientAuthorizationError {
InvalidHeader,
BadForm(FailedToDeserializeQueryString),
BadForm(FailedToDeserializeForm),
ClientIdMismatch { credential: String, form: String },
UnsupportedClientAssertion { client_assertion_type: String },
MissingCredentials,
@@ -284,7 +284,7 @@ where
// If it is not a form, continue
Err(FormRejection::InvalidFormContentType(_err)) => (None, None, None, None, None),
// If the form could not be read, return a Bad Request error
Err(FormRejection::FailedToDeserializeQueryString(err)) => {
Err(FormRejection::FailedToDeserializeForm(err)) => {
return Err(ClientAuthorizationError::BadForm(err))
}
// Other errors (body read twice, byte stream broke) return an internal error

View File

@@ -18,7 +18,7 @@ use async_trait::async_trait;
use axum::{
body::HttpBody,
extract::{
rejection::{FailedToDeserializeQueryString, FormRejection, TypedHeaderRejectionReason},
rejection::{FailedToDeserializeForm, FormRejection, TypedHeaderRejectionReason},
Form, FromRequest, FromRequestParts, TypedHeader,
},
response::{IntoResponse, Response},
@@ -109,7 +109,7 @@ impl<F: Send> UserAuthorization<F> {
pub enum UserAuthorizationError {
InvalidHeader,
TokenInFormAndHeader,
BadForm(FailedToDeserializeQueryString),
BadForm(FailedToDeserializeForm),
InternalError(Box<dyn Error>),
}
@@ -311,7 +311,7 @@ where
// If it is not a form, continue
Err(FormRejection::InvalidFormContentType(_err)) => (None, None),
// If the form could not be read, return a Bad Request error
Err(FormRejection::FailedToDeserializeQueryString(err)) => {
Err(FormRejection::FailedToDeserializeForm(err)) => {
return Err(UserAuthorizationError::BadForm(err))
}
// Other errors (body read twice, byte stream broke) return an internal error