Merge branch 'jenkins_with_weblogic' of
ssh://git@192.168.240.178:18081/eapim/elink-online-common.git into jenkins_with_weblogic
This commit is contained in:
+3
@@ -618,7 +618,10 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
jsonStr = KJB_ROOTLESS_ARRAY + jsonStr + "}";
|
jsonStr = KJB_ROOTLESS_ARRAY + jsonStr + "}";
|
||||||
responseMessage = jsonStr.getBytes(vo.getEncode());
|
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,
|
return assignResponseHeaders(method, responseMessage, headerGroupName, vo.getEncode(), messageType,
|
||||||
relayResponseHeaderKeys, status, responseHeaderProp);
|
relayResponseHeaderKeys, status, responseHeaderProp);
|
||||||
|
|||||||
+22
@@ -14,6 +14,8 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
//import org.apache.commons.net.util.Base64;
|
//import org.apache.commons.net.util.Base64;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
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.HttpMethodType;
|
||||||
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey;
|
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;
|
import com.eactive.eai.common.util.Logger;
|
||||||
|
|
||||||
public class HmacSha256VerifyFilterKjb implements HttpAdapterFilter {
|
public class HmacSha256VerifyFilterKjb implements HttpAdapterFilter {
|
||||||
|
|
||||||
|
static final String KJB_ROOTLESS_ARRAY = "{ \"KJB_ROOTLESS_ARRAY\" : ";
|
||||||
|
|
||||||
static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER);
|
static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER);
|
||||||
|
|
||||||
@@ -58,6 +62,14 @@ public class HmacSha256VerifyFilterKjb implements HttpAdapterFilter {
|
|||||||
String chkBody = inboundBody;
|
String chkBody = inboundBody;
|
||||||
String clientSecret = assignClientSecret(prop, request);
|
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 macUrl = calculateHMAC(chkUrl, clientSecret);
|
||||||
String macBody = calculateHMAC(chkBody, clientSecret);
|
String macBody = calculateHMAC(chkBody, clientSecret);
|
||||||
|
|
||||||
@@ -145,6 +157,15 @@ public class HmacSha256VerifyFilterKjb implements HttpAdapterFilter {
|
|||||||
String outboundBody = (String) resultMessage;
|
String outboundBody = (String) resultMessage;
|
||||||
|
|
||||||
try {
|
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 clientSecret = assignClientSecret(prop, request);
|
||||||
String macBody = calculateHMAC(outboundBody, clientSecret);
|
String macBody = calculateHMAC(outboundBody, clientSecret);
|
||||||
|
|
||||||
@@ -157,5 +178,6 @@ public class HmacSha256VerifyFilterKjb implements HttpAdapterFilter {
|
|||||||
|
|
||||||
return resultMessage;
|
return resultMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user