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

Remove unnecessary dependencies

This commit is contained in:
Quentin Gliech
2022-08-29 18:40:50 +02:00
parent 2c400d4cc1
commit 768c48234a
4 changed files with 4 additions and 44 deletions

View File

@@ -14,7 +14,6 @@
use std::collections::HashSet;
use futures_util::future::Either;
use mas_iana::jose::{JsonWebKeyType, JsonWebKeyUse, JsonWebSignatureAlg};
use crate::JsonWebSignatureHeader;
@@ -96,40 +95,6 @@ pub trait Constrainable {
fn kty(&self) -> JsonWebKeyType;
}
impl<L, R> Constrainable for Either<L, R>
where
L: Constrainable,
R: Constrainable,
{
fn algs(&self) -> Option<Vec<JsonWebSignatureAlg>> {
match self {
Either::Left(l) => l.algs(),
Either::Right(r) => r.algs(),
}
}
fn kid(&self) -> Option<&str> {
match self {
Either::Left(l) => l.kid(),
Either::Right(r) => r.kid(),
}
}
fn use_(&self) -> Option<JsonWebKeyUse> {
match self {
Either::Left(l) => l.use_(),
Either::Right(r) => r.use_(),
}
}
fn kty(&self) -> JsonWebKeyType {
match self {
Either::Left(l) => l.kty(),
Either::Right(r) => r.kty(),
}
}
}
impl<'a> Constraint<'a> {
fn decide<T: Constrainable>(&self, constrainable: &T) -> ConstraintDecision {
match self {

View File

@@ -26,8 +26,6 @@ mod keystore;
pub mod signer;
pub mod verifier;
pub use futures_util::future::Either;
pub use self::{
jwt::{DecodedJsonWebToken, JsonWebSignatureHeader, JsonWebTokenParts, Jwt, JwtSignatureError},
keystore::{SigningKeystore, StaticKeystore, VerifyingKeystore},