1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-31 09:24:31 +03:00

WIP: better JOSE

This commit is contained in:
Quentin Gliech
2022-08-23 17:45:23 +02:00
parent 495285162b
commit ca125a14c5
16 changed files with 690 additions and 157 deletions

View File

@ -40,7 +40,7 @@ serde_urlencoded = "0.7.1"
argon2 = { version = "0.4.1", features = ["password-hash"] }
# Crypto, hashing and signing stuff
rsa = "0.7.0-pre"
rsa = { git = "https://github.com/RustCrypto/RSA.git" }
pkcs8 = { version = "0.9.0", features = ["pem"] }
elliptic-curve = { version = "0.12.3", features = ["pem"] }
sha2 = "0.10.2"

View File

@ -26,7 +26,7 @@ use mas_data_model::{AuthorizationGrantStage, Client, TokenType};
use mas_iana::jose::JsonWebSignatureAlg;
use mas_jose::{
claims::{self, ClaimError},
DecodedJsonWebToken, SigningKeystore, StaticKeystore,
DecodedJsonWebToken, JwtSignatureError, SigningKeystore, StaticKeystore,
};
use mas_router::UrlBuilder;
use mas_storage::{
@ -173,6 +173,12 @@ impl From<ClaimError> for RouteError {
}
}
impl From<JwtSignatureError> for RouteError {
fn from(e: JwtSignatureError) -> Self {
Self::Internal(Box::new(e))
}
}
#[tracing::instrument(skip_all, err)]
pub(crate) async fn post(
client_authorization: ClientAuthorization<AccessTokenRequest>,