From 62276155f667b1d05080144a63259cc35c4bcb1d Mon Sep 17 00:00:00 2001 From: sophia chen Date: Mon, 5 May 2025 14:42:21 +1000 Subject: [PATCH 1/5] added logs for debugging --- .../uid2/shared/attest/AttestationResponseHandler.java | 8 ++++---- src/main/java/com/uid2/shared/attest/UidCoreClient.java | 1 + .../com/uid2/shared/middleware/AttestationMiddleware.java | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/uid2/shared/attest/AttestationResponseHandler.java b/src/main/java/com/uid2/shared/attest/AttestationResponseHandler.java index 183a4f29..504842f0 100644 --- a/src/main/java/com/uid2/shared/attest/AttestationResponseHandler.java +++ b/src/main/java/com/uid2/shared/attest/AttestationResponseHandler.java @@ -257,8 +257,8 @@ private static String getAttestationTokenExpiresAt(JsonObject responseBody) { private void setOptoutJWTFromResponse(JsonObject responseBody) { String jwt = responseBody.getString("attestation_jwt_optout"); - if (jwt == null) { - LOGGER.info("Optout JWT not received"); + if (jwt == null || jwt.isBlank()) { + LOGGER.info("Optout JWT not received. App version: {}", this.appVersion.getAppVersion()); } else { LOGGER.info("Optout JWT received"); this.optOutJwt.set(jwt); @@ -267,8 +267,8 @@ private void setOptoutJWTFromResponse(JsonObject responseBody) { private void setCoreJWTFromResponse(JsonObject responseBody) { String jwt = responseBody.getString("attestation_jwt_core"); - if (jwt == null) { - LOGGER.info("Core JWT not received"); + if (jwt == null || jwt.isBlank()) { + LOGGER.info("Core JWT not received. App version: {}", this.appVersion.getAppVersion()); } else { LOGGER.info("Core JWT received"); this.coreJwt.set(jwt); diff --git a/src/main/java/com/uid2/shared/attest/UidCoreClient.java b/src/main/java/com/uid2/shared/attest/UidCoreClient.java index 813819cb..3ac2e8f5 100644 --- a/src/main/java/com/uid2/shared/attest/UidCoreClient.java +++ b/src/main/java/com/uid2/shared/attest/UidCoreClient.java @@ -129,6 +129,7 @@ private HttpResponse sendHttpRequest(String path, String attestationToke String jwtToken = this.getJWT(); if (jwtToken != null && !jwtToken.isBlank()) { headers.put(Const.Attestation.AttestationJWTHeader, jwtToken); + LOGGER.info("Setting JWT token in header. JWT Token length: {}. Operator version: {}", jwtToken.length(), this.appVersionHeader); } else { LOGGER.warn("getJWT returned an empty or null string for the JWT"); } diff --git a/src/main/java/com/uid2/shared/middleware/AttestationMiddleware.java b/src/main/java/com/uid2/shared/middleware/AttestationMiddleware.java index 4f6862e9..7406e05c 100644 --- a/src/main/java/com/uid2/shared/middleware/AttestationMiddleware.java +++ b/src/main/java/com/uid2/shared/middleware/AttestationMiddleware.java @@ -105,13 +105,15 @@ public void handle(RoutingContext rc) { } else { if (this.enforceJwt) { LOGGER.info("JWT is required, but was not received. Attestation validation failed. SiteId: {}, Name: {}, Contact: {}", operatorKey.getSiteId(), operatorKey.getName(), operatorKey.getContact()); + } else { + LOGGER.info("JWT is {} but is not required. SiteId: {}, Name: {}", jwt == null ? "null" : "blank", operatorKey.getSiteId(), operatorKey.getName()); } } } } if (success && !isJwtValid && this.enforceJwt) { - LOGGER.info("JWT validation has failed."); + LOGGER.error("JWT validation has failed."); success = false; } else if (success && !isJwtValid && !this.enforceJwt) { LOGGER.info("JWT validation has failed, but JWTs are not being enforced."); From 4f9a82c4e48eda740c285d44ab8f6fc9fd1d8862 Mon Sep 17 00:00:00 2001 From: Release Workflow Date: Mon, 5 May 2025 04:54:48 +0000 Subject: [PATCH 2/5] [CI Pipeline] Released Snapshot version: 9.2.4-alpha-223-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 13422a99..640facd0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.uid2 uid2-shared - 9.2.3 + 9.2.4-alpha-223-SNAPSHOT ${project.groupId}:${project.artifactId} Library for all the shared uid2 operations https://github.com/IABTechLab/uid2docs From ea503dcba11a1eeddb1872752e586b2f22ffada1 Mon Sep 17 00:00:00 2001 From: Release Workflow Date: Mon, 5 May 2025 05:03:18 +0000 Subject: [PATCH 3/5] [CI Pipeline] Released Snapshot version: 9.3.1-alpha-224-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index adf3c3a7..8b6b9e33 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.uid2 uid2-shared - 9.3.0 + 9.3.1-alpha-224-SNAPSHOT ${project.groupId}:${project.artifactId} Library for all the shared uid2 operations https://github.com/IABTechLab/uid2docs From 4346cfabd2fbcd621229f468d8ed01fe369370c3 Mon Sep 17 00:00:00 2001 From: sophia chen Date: Mon, 5 May 2025 16:15:29 +1000 Subject: [PATCH 4/5] logged uri --- .../shared/attest/AttestationResponseHandler.java | 14 ++++++++++---- .../java/com/uid2/shared/attest/UidCoreClient.java | 1 - .../shared/middleware/AttestationMiddleware.java | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/uid2/shared/attest/AttestationResponseHandler.java b/src/main/java/com/uid2/shared/attest/AttestationResponseHandler.java index 504842f0..7117fe99 100644 --- a/src/main/java/com/uid2/shared/attest/AttestationResponseHandler.java +++ b/src/main/java/com/uid2/shared/attest/AttestationResponseHandler.java @@ -257,9 +257,12 @@ private static String getAttestationTokenExpiresAt(JsonObject responseBody) { private void setOptoutJWTFromResponse(JsonObject responseBody) { String jwt = responseBody.getString("attestation_jwt_optout"); - if (jwt == null || jwt.isBlank()) { - LOGGER.info("Optout JWT not received. App version: {}", this.appVersion.getAppVersion()); + if (jwt == null) { + LOGGER.info("Optout JWT not received"); } else { + if (jwt.isBlank()) { + LOGGER.info("Optout JWT is blank. App version: {}", this.appVersion.getAppVersion()); + } LOGGER.info("Optout JWT received"); this.optOutJwt.set(jwt); } @@ -267,9 +270,12 @@ private void setOptoutJWTFromResponse(JsonObject responseBody) { private void setCoreJWTFromResponse(JsonObject responseBody) { String jwt = responseBody.getString("attestation_jwt_core"); - if (jwt == null || jwt.isBlank()) { - LOGGER.info("Core JWT not received. App version: {}", this.appVersion.getAppVersion()); + if (jwt == null) { + LOGGER.info("Core JWT not received"); } else { + if (jwt.isBlank()) { + LOGGER.info("Core JWT is blank. App version: {}", this.appVersion.getAppVersion()); + } LOGGER.info("Core JWT received"); this.coreJwt.set(jwt); } diff --git a/src/main/java/com/uid2/shared/attest/UidCoreClient.java b/src/main/java/com/uid2/shared/attest/UidCoreClient.java index 3ac2e8f5..813819cb 100644 --- a/src/main/java/com/uid2/shared/attest/UidCoreClient.java +++ b/src/main/java/com/uid2/shared/attest/UidCoreClient.java @@ -129,7 +129,6 @@ private HttpResponse sendHttpRequest(String path, String attestationToke String jwtToken = this.getJWT(); if (jwtToken != null && !jwtToken.isBlank()) { headers.put(Const.Attestation.AttestationJWTHeader, jwtToken); - LOGGER.info("Setting JWT token in header. JWT Token length: {}. Operator version: {}", jwtToken.length(), this.appVersionHeader); } else { LOGGER.warn("getJWT returned an empty or null string for the JWT"); } diff --git a/src/main/java/com/uid2/shared/middleware/AttestationMiddleware.java b/src/main/java/com/uid2/shared/middleware/AttestationMiddleware.java index 7406e05c..6e71fc2a 100644 --- a/src/main/java/com/uid2/shared/middleware/AttestationMiddleware.java +++ b/src/main/java/com/uid2/shared/middleware/AttestationMiddleware.java @@ -106,7 +106,7 @@ public void handle(RoutingContext rc) { if (this.enforceJwt) { LOGGER.info("JWT is required, but was not received. Attestation validation failed. SiteId: {}, Name: {}, Contact: {}", operatorKey.getSiteId(), operatorKey.getName(), operatorKey.getContact()); } else { - LOGGER.info("JWT is {} but is not required. SiteId: {}, Name: {}", jwt == null ? "null" : "blank", operatorKey.getSiteId(), operatorKey.getName()); + LOGGER.info("JWT is {} but is not required. SiteId: {}, Name: {}, Url: {}", jwt == null ? "null" : "blank", operatorKey.getSiteId(), operatorKey.getName(), rc.request().uri()); } } } From 85a665e98446e3fd9983e62debc7ec4fa954473c Mon Sep 17 00:00:00 2001 From: Release Workflow Date: Mon, 5 May 2025 06:20:03 +0000 Subject: [PATCH 5/5] [CI Pipeline] Released Snapshot version: 9.3.2-alpha-225-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8b6b9e33..365a3f92 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.uid2 uid2-shared - 9.3.1-alpha-224-SNAPSHOT + 9.3.2-alpha-225-SNAPSHOT ${project.groupId}:${project.artifactId} Library for all the shared uid2 operations https://github.com/IABTechLab/uid2docs