1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

Use associated error type in claims validator instead of anyhow.

This commit is contained in:
Quentin Gliech
2022-12-01 12:48:22 +01:00
parent 88f6e0ff28
commit 0ca4366f75
4 changed files with 71 additions and 34 deletions

View File

@ -23,7 +23,7 @@ use mas_axum_utils::client_authorization::{ClientAuthorization, CredentialsVerif
use mas_data_model::{AuthorizationGrantStage, Client, TokenType};
use mas_iana::jose::JsonWebSignatureAlg;
use mas_jose::{
claims::{self, hash_token, ClaimError},
claims::{self, hash_token, ClaimError, TokenHashError},
constraints::Constrainable,
jwt::{JsonWebSignatureHeader, Jwt, JwtSignatureError},
};
@ -177,6 +177,12 @@ impl From<ClaimError> for RouteError {
}
}
impl From<TokenHashError> for RouteError {
fn from(e: TokenHashError) -> Self {
Self::Internal(Box::new(e))
}
}
impl From<JwtSignatureError> for RouteError {
fn from(e: JwtSignatureError) -> Self {
Self::Internal(Box::new(e))