From b0e0800b4d3db8e5d7aa111e6329c8218c3df1d4 Mon Sep 17 00:00:00 2001 From: Juliano Cezar Chagas Tavares Date: Thu, 1 Aug 2024 18:16:14 -0300 Subject: [PATCH 1/3] Add warning and continue flow --- src/core/authorization_request/parameters.rs | 6 ++++-- src/core/authorization_request/verification/mod.rs | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/authorization_request/parameters.rs b/src/core/authorization_request/parameters.rs index 80633f2..917792e 100644 --- a/src/core/authorization_request/parameters.rs +++ b/src/core/authorization_request/parameters.rs @@ -163,9 +163,11 @@ impl ClientMetadata { ))? .try_into() .context("failed to parse client metadata from JSON"); + } else { + // bail!("the client metadata was not passed by reference or value") + println!("[WARNING] the client metadata was not passed by reference or value"); + return Ok(ClientMetadata(UntypedObject::default())) } - - bail!("the client metadata was not passed by reference or value") } } diff --git a/src/core/authorization_request/verification/mod.rs b/src/core/authorization_request/verification/mod.rs index 01faab7..b34f656 100644 --- a/src/core/authorization_request/verification/mod.rs +++ b/src/core/authorization_request/verification/mod.rs @@ -60,7 +60,9 @@ pub trait RequestVerifier { decoded_request: &AuthorizationRequestObject, request_jwt: String, ) -> Result<(), Error> { - bail!("'redirect_uri' client verification not implemented") + println!("[WARNING] 'redirect_uri' client verification not implemented"); + // bail!("'redirect_uri' client verification not implemented") + Ok(()) } /// Performs verification on Authorization Request Objects when `client_id_scheme` is `verifier_attestation`. From bcede2e954711d2812b723e355c3fe4678944909 Mon Sep 17 00:00:00 2001 From: Jacob Date: Fri, 2 Aug 2024 14:45:58 +0100 Subject: [PATCH 2/3] Using tracing::warn instead of println --- src/core/authorization_request/parameters.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/authorization_request/parameters.rs b/src/core/authorization_request/parameters.rs index 917792e..517ab54 100644 --- a/src/core/authorization_request/parameters.rs +++ b/src/core/authorization_request/parameters.rs @@ -163,11 +163,10 @@ impl ClientMetadata { ))? .try_into() .context("failed to parse client metadata from JSON"); - } else { - // bail!("the client metadata was not passed by reference or value") - println!("[WARNING] the client metadata was not passed by reference or value"); - return Ok(ClientMetadata(UntypedObject::default())) } + + tracing::warn!("the client metadata was not passed by reference or value"); + Ok(ClientMetadata(UntypedObject::default())) } } From 998d8d756c704cd5de8bd179562ec64e478bd02e Mon Sep 17 00:00:00 2001 From: Jacob Date: Fri, 2 Aug 2024 15:01:00 +0100 Subject: [PATCH 3/3] Undo changes to redirect_uri default impl --- src/core/authorization_request/verification/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/authorization_request/verification/mod.rs b/src/core/authorization_request/verification/mod.rs index b34f656..01faab7 100644 --- a/src/core/authorization_request/verification/mod.rs +++ b/src/core/authorization_request/verification/mod.rs @@ -60,9 +60,7 @@ pub trait RequestVerifier { decoded_request: &AuthorizationRequestObject, request_jwt: String, ) -> Result<(), Error> { - println!("[WARNING] 'redirect_uri' client verification not implemented"); - // bail!("'redirect_uri' client verification not implemented") - Ok(()) + bail!("'redirect_uri' client verification not implemented") } /// Performs verification on Authorization Request Objects when `client_id_scheme` is `verifier_attestation`.