From 3fa11146fdd0709d3fac050d574ab3fd31c79654 Mon Sep 17 00:00:00 2001 From: Kenneth Ezekiel <88850771+KenEzekiel@users.noreply.github.com> Date: Fri, 17 Nov 2023 14:43:03 +0700 Subject: [PATCH] fix: delete souts --- src/main/java/com/letterpaw/soap/util/Auth.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/letterpaw/soap/util/Auth.java b/src/main/java/com/letterpaw/soap/util/Auth.java index 50ab18b..15a0615 100644 --- a/src/main/java/com/letterpaw/soap/util/Auth.java +++ b/src/main/java/com/letterpaw/soap/util/Auth.java @@ -17,10 +17,11 @@ public class Auth { public static boolean IsAuthenticated(WebServiceContext ctx, ServiceType type) { @SuppressWarnings("unchecked") // Check the request with the API Key - // Check if the service is authenticated or not, message context is used to get HTTP request headers, which contains the key, + // Check if the service is authenticated or not, message context is used to get + // HTTP request headers, which contains the key, // which is then compared with the actual key - Map<String, List<String>> headers = (Map<String, List<String>>) - ctx.getMessageContext().get(MessageContext.HTTP_REQUEST_HEADERS); + Map<String, List<String>> headers = (Map<String, List<String>>) ctx.getMessageContext() + .get(MessageContext.HTTP_REQUEST_HEADERS); // Get header for authorization List<String> auth = headers.get("authorization"); String key = ""; @@ -30,10 +31,10 @@ public class Auth { } else if (type == ServiceType.PHP) { key = PHPAPIKey; } - System.out.println(auth.get(0)); - System.out.println(key); - System.out.println(!auth.isEmpty() && auth.get(0).equals("Bearer " + key)); -// return true; + // System.out.println(auth.get(0)); + // System.out.println(key); + // System.out.println(!auth.isEmpty() && auth.get(0).equals("Bearer " + key)); + // return true; // Check the key validity return !auth.isEmpty() && auth.get(0).equals("Bearer " + key); } -- GitLab