diff --git a/src/core/authorization_request/parameters.rs b/src/core/authorization_request/parameters.rs index ffb10f6..ae2807e 100644 --- a/src/core/authorization_request/parameters.rs +++ b/src/core/authorization_request/parameters.rs @@ -102,7 +102,7 @@ impl fmt::Display for ClientIdScheme { ClientIdScheme::RedirectUri => REDIRECT_URI, ClientIdScheme::X509SanDns => X509_SAN_DNS, ClientIdScheme::X509SanUri => X509_SAN_URI, - ClientIdScheme::Other(o) => &o, + ClientIdScheme::Other(o) => o, } .fmt(f) } diff --git a/src/core/authorization_request/verification/did.rs b/src/core/authorization_request/verification/did.rs index 1d69eeb..68c6639 100644 --- a/src/core/authorization_request/verification/did.rs +++ b/src/core/authorization_request/verification/did.rs @@ -70,7 +70,7 @@ pub async fn verify_with_resolver( "expected a DID verification method in 'kid' header, received '{kid}'" ))?; - if &client_id.0 != did { + if client_id.0 != did { bail!( "DIDs from 'kid' ({did}) and 'client_id' ({}) do not match", client_id.0 @@ -83,18 +83,6 @@ pub async fn verify_with_resolver( } } - println!( - "{}", - serde_json::to_string_pretty( - &didkit::dereference(resolver, did, &Default::default()) - .await - .1 - ) - .unwrap() - ); - - println!("{kid:?}"); - let jwk = resolve_key(&kid, resolver) .await .context("unable to resolve verification method from 'kid' header")?; diff --git a/src/core/authorization_request/verification/mod.rs b/src/core/authorization_request/verification/mod.rs index 459f98e..43fac7b 100644 --- a/src/core/authorization_request/verification/mod.rs +++ b/src/core/authorization_request/verification/mod.rs @@ -104,7 +104,7 @@ pub(crate) async fn verify_request( ClientIdScheme::RedirectUri => profile.redirect_uri(&request, jwt).await?, ClientIdScheme::X509SanDns => profile.x509_san_dns(&request, jwt).await?, ClientIdScheme::X509SanUri => profile.x509_san_uri(&request, jwt).await?, - ClientIdScheme::Other(scheme) => profile.other(&scheme, &request, jwt).await?, + ClientIdScheme::Other(scheme) => profile.other(scheme, &request, jwt).await?, }; Ok(request) diff --git a/src/core/authorization_request/verification/x509_san_dns.rs b/src/core/authorization_request/verification/x509_san_dns.rs index 5e0d923..615a356 100644 --- a/src/core/authorization_request/verification/x509_san_dns.rs +++ b/src/core/authorization_request/verification/x509_san_dns.rs @@ -119,7 +119,7 @@ pub trait Verifier: Sized { /// ## Params /// * `spki` - the public key information necessary to construct a [Verifier]. /// * `algorithm` - the value taken from the `alg` header of the request, to hint at what curve should be used by the [Verifier]. - fn from_spki<'a>(spki: SubjectPublicKeyInfoRef<'a>, algorithm: String) -> Result; + fn from_spki(spki: SubjectPublicKeyInfoRef<'_>, algorithm: String) -> Result; fn verify(&self, payload: &[u8], signature: &[u8]) -> Result<()>; } @@ -127,7 +127,7 @@ pub trait Verifier: Sized { pub struct P256Verifier(p256::ecdsa::VerifyingKey); impl Verifier for P256Verifier { - fn from_spki<'a>(spki: SubjectPublicKeyInfoRef<'a>, algorithm: String) -> Result { + fn from_spki(spki: SubjectPublicKeyInfoRef<'_>, algorithm: String) -> Result { if algorithm != "ES256" { bail!("P256Verifier cannot verify requests signed with '{algorithm}'") } diff --git a/src/core/authorization_request/verification/x509_san_uri.rs b/src/core/authorization_request/verification/x509_san_uri.rs index 30e6489..16e09ff 100644 --- a/src/core/authorization_request/verification/x509_san_uri.rs +++ b/src/core/authorization_request/verification/x509_san_uri.rs @@ -133,7 +133,7 @@ pub trait Verifier: Sized { /// ## Params /// * `spki` - the public key information necessary to construct a [Verifier]. /// * `algorithm` - the value taken from the `alg` header of the request, to hint at what curve should be used by the [Verifier]. - fn from_spki<'a>(spki: SubjectPublicKeyInfoRef<'a>, algorithm: String) -> Result; + fn from_spki(spki: SubjectPublicKeyInfoRef<'_>, algorithm: String) -> Result; fn verify(&self, payload: &[u8], signature: &[u8]) -> Result<()>; } @@ -141,7 +141,7 @@ pub trait Verifier: Sized { pub struct P256Verifier(p256::ecdsa::VerifyingKey); impl Verifier for P256Verifier { - fn from_spki<'a>(spki: SubjectPublicKeyInfoRef<'a>, algorithm: String) -> Result { + fn from_spki(spki: SubjectPublicKeyInfoRef<'_>, algorithm: String) -> Result { if algorithm != "ES256" { bail!("P256Verifier cannot verify requests signed with '{algorithm}'") } diff --git a/src/core/verifier/builder/mod.rs b/src/core/verifier/builder/mod.rs index 2e7b55f..6b5f6bb 100644 --- a/src/core/verifier/builder/mod.rs +++ b/src/core/verifier/builder/mod.rs @@ -66,7 +66,7 @@ impl SessionBuilder { if !wallet_metadata .client_id_schemes_supported() .0 - .contains(&client_id_scheme) + .contains(client_id_scheme) { bail!("wallet does not support client_id_scheme '{client_id_scheme}'") } diff --git a/src/presentation_exchange.rs b/src/presentation_exchange.rs index 143b135..3e6f172 100644 --- a/src/presentation_exchange.rs +++ b/src/presentation_exchange.rs @@ -237,7 +237,7 @@ pub(crate) mod tests { let path = path.unwrap().path(); if let Some(ext) = path.extension() { if ext != OsStr::new("json") - || vec!["VC_expiration_example.json", "VC_revocation_example.json"] // TODO bad format + || ["VC_expiration_example.json", "VC_revocation_example.json"] // TODO bad format .contains(&path.file_name().unwrap().to_str().unwrap()) { continue; @@ -267,10 +267,8 @@ pub(crate) mod tests { let path = path.unwrap().path(); if let Some(ext) = path.extension() { if ext != OsStr::new("json") - || vec![ - "appendix_DIDComm_example.json", - "appendix_CHAPI_example.json", - ] + || ["appendix_DIDComm_example.json", + "appendix_CHAPI_example.json"] .contains(&path.file_name().unwrap().to_str().unwrap()) { continue; @@ -299,7 +297,7 @@ pub(crate) mod tests { let path = path.unwrap().path(); if let Some(ext) = path.extension() { if ext != OsStr::new("json") - || vec!["schema.json"].contains(&path.file_name().unwrap().to_str().unwrap()) + || ["schema.json"].contains(&path.file_name().unwrap().to_str().unwrap()) { continue; }