From 5d66316bdae39740f3524bbb81fc5bacd655cb03 Mon Sep 17 00:00:00 2001 From: Viraj Salaka Date: Tue, 19 Dec 2023 11:51:24 +0530 Subject: [PATCH] Add a log to indicate subscription validation failures --- .../connect/enforcer/security/KeyValidator.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/security/KeyValidator.java b/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/security/KeyValidator.java index c1d4896956..7436f3171e 100644 --- a/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/security/KeyValidator.java +++ b/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/security/KeyValidator.java @@ -160,20 +160,20 @@ public static APIKeyValidationInfoDTO validateSubscription(APIConfig apiConfig, String apiContextTemplate = apiContext.substring(0, lastIndexOfVersion); sub = datastore.getSubscriptionByAppIdApiContextVersionRange(app.getUUID(), apiContextTemplate, "v" + apiSemVersion.getMajor()); - if (sub == null) { - log.info( - "Valid subscription not found for oauth access token. application:" + - " {} app_UUID: {} API_Context:API_Version: {} API_UUID : {}", - app.getName(), app.getUUID(), apiContext + ":" + apiVersion, uuid); - } else { - log.debug("All information is retrieved from the in-memory data store."); - } } catch (EnforcerException e) { log.debug("API version: {} is not a valid semantic version", apiVersion); } } else { log.debug("All information is retrieved from the in-memory data store."); } + if (sub == null) { + log.info( + "Valid subscription not found for oauth access token. application:" + + " {} app_UUID: {} API_Context:API_Version: {} API_UUID : {}", + app.getName(), app.getUUID(), apiContext + ":" + apiVersion, uuid); + } else { + log.debug("All information is retrieved from the in-memory data store."); + } } else { log.info("Application not found in the data store for uuid " + key.getApplicationUUID()); }