diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index c91c3f3..0000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[net] -git-fetch-with-cli = true diff --git a/src/core/authorization_request/mod.rs b/src/core/authorization_request/mod.rs index 354a647..53d2850 100644 --- a/src/core/authorization_request/mod.rs +++ b/src/core/authorization_request/mod.rs @@ -17,7 +17,7 @@ use self::{ use super::{ object::{ParsingErrorContext, UntypedObject}, - util::{base_request, HttpClient}, + util::{base_request, AsyncHttpClient}, }; pub mod parameters; @@ -204,7 +204,7 @@ impl AuthorizationRequestObject { &self.2 } - pub async fn resolve_presentation_definition( + pub async fn resolve_presentation_definition( &self, http_client: &H, ) -> Result { diff --git a/src/core/authorization_request/parameters.rs b/src/core/authorization_request/parameters.rs index 0551291..80633f2 100644 --- a/src/core/authorization_request/parameters.rs +++ b/src/core/authorization_request/parameters.rs @@ -2,7 +2,7 @@ use std::fmt; use crate::core::{ object::{ParsingErrorContext, TypedParameter, UntypedObject}, - util::{base_request, HttpClient}, + util::{base_request, AsyncHttpClient}, }; use anyhow::{bail, Context, Error, Ok}; use serde::{Deserialize, Serialize}; @@ -130,7 +130,7 @@ impl ClientMetadata { /// /// If the client metadata is not passed by reference or value if the Authorization Request Object, /// then this function will return an error. - pub async fn resolve( + pub async fn resolve( request: &AuthorizationRequestObject, http_client: &H, ) -> Result { diff --git a/src/core/util/mod.rs b/src/core/util/mod.rs index f43d3b8..0fb529d 100644 --- a/src/core/util/mod.rs +++ b/src/core/util/mod.rs @@ -8,7 +8,7 @@ use http::{Request, Response}; /// /// A trait is used here so to facilitate native HTTP/TLS when compiled for mobile applications. #[async_trait] -pub trait HttpClient { +pub trait AsyncHttpClient { async fn execute(&self, request: Request>) -> Result>>; } @@ -32,7 +32,7 @@ impl ReqwestClient { #[cfg(feature = "reqwest")] #[async_trait] -impl HttpClient for ReqwestClient { +impl AsyncHttpClient for ReqwestClient { async fn execute(&self, request: Request>) -> Result>> { let response = self .0 diff --git a/src/wallet.rs b/src/wallet.rs index 95fb96d..074d0a4 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -11,12 +11,12 @@ use crate::core::{ }, metadata::WalletMetadata, response::{AuthorizationResponse, PostRedirection}, - util::{base_request, HttpClient}, + util::{base_request, AsyncHttpClient}, }; #[async_trait] pub trait Wallet: RequestVerifier + Sync { - type HttpClient: HttpClient + Send + Sync; + type HttpClient: AsyncHttpClient + Send + Sync; fn metadata(&self) -> &WalletMetadata; fn http_client(&self) -> &Self::HttpClient; diff --git a/tests/jwt_vc.rs b/tests/jwt_vc.rs index 99c4ef9..0c218b7 100644 --- a/tests/jwt_vc.rs +++ b/tests/jwt_vc.rs @@ -12,7 +12,7 @@ use oid4vp::{ }, metadata::WalletMetadata, response::AuthorizationResponse, - util::HttpClient, + util::AsyncHttpClient, }, verifier::{ request_signer::P256Signer, @@ -137,7 +137,7 @@ impl RequestVerifier for JwtVcWallet { } #[async_trait] -impl HttpClient for MockHttpClient { +impl AsyncHttpClient for MockHttpClient { async fn execute(&self, request: Request>) -> Result>> { // Only expect submission. let body = request.body();