diff --git a/src/main/java/com/eactive/eai/adapter/http/client/impl/HttpClient5AdapterServiceRest.java b/src/main/java/com/eactive/eai/adapter/http/client/impl/HttpClient5AdapterServiceRest.java index 8cd4cf4..d2d2361 100644 --- a/src/main/java/com/eactive/eai/adapter/http/client/impl/HttpClient5AdapterServiceRest.java +++ b/src/main/java/com/eactive/eai/adapter/http/client/impl/HttpClient5AdapterServiceRest.java @@ -618,7 +618,10 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp jsonStr = KJB_ROOTLESS_ARRAY + jsonStr + "}"; responseMessage = jsonStr.getBytes(vo.getEncode()); } +<<<<<<< HEAD +======= +>>>>>>> branch 'jenkins_with_weblogic' of ssh://git@192.168.240.178:18081/eapim/elink-online-common.git return assignResponseHeaders(method, responseMessage, headerGroupName, vo.getEncode(), messageType, relayResponseHeaderKeys, status, responseHeaderProp); diff --git a/src/main/java/com/eactive/eai/adapter/http/dynamic/filter/HmacSha256VerifyFilterKjb.java b/src/main/java/com/eactive/eai/adapter/http/dynamic/filter/HmacSha256VerifyFilterKjb.java index 4d73b4e..92bed3d 100644 --- a/src/main/java/com/eactive/eai/adapter/http/dynamic/filter/HmacSha256VerifyFilterKjb.java +++ b/src/main/java/com/eactive/eai/adapter/http/dynamic/filter/HmacSha256VerifyFilterKjb.java @@ -14,6 +14,8 @@ import javax.servlet.http.HttpServletResponse; //import org.apache.commons.net.util.Base64; import org.springframework.http.HttpStatus; import org.apache.commons.lang3.StringUtils; +import org.json.simple.JSONObject; +import org.json.simple.JSONValue; import com.eactive.eai.adapter.http.HttpMethodType; import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey; @@ -24,6 +26,8 @@ import com.eactive.eai.common.TransactionContextKeys; import com.eactive.eai.common.util.Logger; public class HmacSha256VerifyFilterKjb implements HttpAdapterFilter { + + static final String KJB_ROOTLESS_ARRAY = "{ \"KJB_ROOTLESS_ARRAY\" : "; static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER); @@ -58,6 +62,14 @@ public class HmacSha256VerifyFilterKjb implements HttpAdapterFilter { String chkBody = inboundBody; String clientSecret = assignClientSecret(prop, request); + if (chkBody.startsWith(KJB_ROOTLESS_ARRAY)) { + chkBody = chkBody.substring(KJB_ROOTLESS_ARRAY.length()); + + if (chkBody.endsWith("}")) { + chkBody = chkBody.substring(0, chkBody.length() - 1); + } + } + String macUrl = calculateHMAC(chkUrl, clientSecret); String macBody = calculateHMAC(chkBody, clientSecret); @@ -145,6 +157,15 @@ public class HmacSha256VerifyFilterKjb implements HttpAdapterFilter { String outboundBody = (String) resultMessage; try { + + if (outboundBody.startsWith(KJB_ROOTLESS_ARRAY)) { + outboundBody = outboundBody.substring(KJB_ROOTLESS_ARRAY.length()); + + if (outboundBody.endsWith("}")) { + outboundBody = outboundBody.substring(0, outboundBody.length() - 1); + } + } + String clientSecret = assignClientSecret(prop, request); String macBody = calculateHMAC(outboundBody, clientSecret); @@ -157,5 +178,6 @@ public class HmacSha256VerifyFilterKjb implements HttpAdapterFilter { return resultMessage; } + }