diff --git a/Cargo.lock b/Cargo.lock index ec07521c..2079f8be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2564,9 +2564,7 @@ dependencies = [ "digest 0.10.3", "ecdsa", "elliptic-curve", - "futures-util", "hmac", - "http", "k256", "mas-iana", "p256", @@ -2584,7 +2582,6 @@ dependencies = [ "signature", "thiserror", "tokio", - "tower", "tracing", "url", ] diff --git a/crates/jose/Cargo.toml b/crates/jose/Cargo.toml index 8f8b41d6..d612ec68 100644 --- a/crates/jose/Cargo.toml +++ b/crates/jose/Cargo.toml @@ -14,9 +14,7 @@ crypto-mac = { version = "0.11.1", features = ["std"] } digest = "0.10.3" ecdsa = { version = "0.14.4", features = ["sign", "verify", "pem", "pkcs8"] } elliptic-curve = { version = "0.12.3", features = ["ecdh", "pem"] } -futures-util = "0.3.23" hmac = "0.12.1" -http = "0.2.8" k256 = { version = "0.11.2", features = ["ecdsa", "pem", "pkcs8"] } p256 = { version = "0.11.1", features = ["ecdsa", "pem", "pkcs8"] } p384 = { version = "0.11.2", features = ["ecdsa", "pem", "pkcs8"] } @@ -32,9 +30,11 @@ serde_with = { version = "2.0.0", features = ["base64"] } sha2 = "0.10.2" signature = "1.6.0" thiserror = "1.0.32" -tokio = { version = "1.20.1", features = ["macros", "rt", "sync"] } -tower = { version = "0.4.13", features = ["util"] } +tokio = { version = "1.20.1", features = [] } tracing = "0.1.36" url = { version = "2.2.2", features = ["serde"] } mas-iana = { path = "../iana" } + +[dev-dependencies] +tokio = { version = "1.20.1", features = ["rt", "macros"] } diff --git a/crates/jose/src/constraints.rs b/crates/jose/src/constraints.rs index 8e95ebbe..c542185b 100644 --- a/crates/jose/src/constraints.rs +++ b/crates/jose/src/constraints.rs @@ -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 Constrainable for Either -where - L: Constrainable, - R: Constrainable, -{ - fn algs(&self) -> Option> { - 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 { - 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(&self, constrainable: &T) -> ConstraintDecision { match self { diff --git a/crates/jose/src/lib.rs b/crates/jose/src/lib.rs index 8d51434d..daa45aec 100644 --- a/crates/jose/src/lib.rs +++ b/crates/jose/src/lib.rs @@ -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},