Merge branch 'jenkins_with_weblogic' of ssh://git@192.168.240.178:18081/eapim/eapim-online.git into jenkins_with_weblogic
This commit is contained in:
@@ -34,7 +34,17 @@
|
|||||||
<param-name>contextConfigLocation</param-name>
|
<param-name>contextConfigLocation</param-name>
|
||||||
<param-value>/WEB-INF/applicationContext.xml</param-value>
|
<param-value>/WEB-INF/applicationContext.xml</param-value>
|
||||||
</context-param>
|
</context-param>
|
||||||
|
|
||||||
|
<!-- Weblogic 14.1.2 서블릿 설정 -->
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>default</servlet-name>
|
||||||
|
<servlet-class>weblogic.servlet.FileServlet</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>default</servlet-name>
|
||||||
|
<url-pattern>/static/*</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- oAuth 2.0 인증서버 설정 -->
|
<!-- oAuth 2.0 인증서버 설정 -->
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>authserver</servlet-name>
|
<servlet-name>authserver</servlet-name>
|
||||||
@@ -60,17 +70,17 @@
|
|||||||
</filter-mapping>
|
</filter-mapping>
|
||||||
|
|
||||||
<!-- Dynamic REST API 어댑터 설정 -->
|
<!-- Dynamic REST API 어댑터 설정 -->
|
||||||
<!-- <servlet>-->
|
<servlet>
|
||||||
<!-- <description/>-->
|
<description/>
|
||||||
<!-- <servlet-name>RestApiDynamicInAdapter</servlet-name>-->
|
<servlet-name>RestApiDynamicInAdapter</servlet-name>
|
||||||
<!-- <servlet-class>com.eactive.eai.adapter.http.dynamic.RestApiAdapterMain</servlet-class>-->
|
<servlet-class>com.eactive.eai.adapter.http.dynamic.RestApiAdapterMain</servlet-class>
|
||||||
<!-- <load-on-startup>2</load-on-startup>-->
|
<load-on-startup>2</load-on-startup>
|
||||||
<!-- </servlet>-->
|
</servlet>
|
||||||
<!-- <servlet-mapping>-->
|
<servlet-mapping>
|
||||||
<!-- <servlet-name>RestApiDynamicInAdapter</servlet-name>-->
|
<servlet-name>RestApiDynamicInAdapter</servlet-name>
|
||||||
<!-- <url-pattern>/API/*</url-pattern>-->
|
<url-pattern>/API/*</url-pattern>
|
||||||
<!-- <url-pattern>/api/*</url-pattern>-->
|
<url-pattern>/api/*</url-pattern>
|
||||||
<!-- </servlet-mapping>-->
|
</servlet-mapping>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<listener>
|
<listener>
|
||||||
@@ -155,4 +165,4 @@
|
|||||||
<location>/error.jsp</location>
|
<location>/error.jsp</location>
|
||||||
</error-page>
|
</error-page>
|
||||||
|
|
||||||
</web-app>
|
</web-app>
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ war {
|
|||||||
|
|
||||||
if (profile == "weblogic") {
|
if (profile == "weblogic") {
|
||||||
webXml = file("WebContent/WEB-INF/weblogic-web.xml")
|
webXml = file("WebContent/WEB-INF/weblogic-web.xml")
|
||||||
|
exclude 'WEB-INF/web.xml'
|
||||||
}
|
}
|
||||||
archiveFileName = "eapim-online.war"
|
archiveFileName = "eapim-online.war"
|
||||||
duplicatesStrategy = DuplicatesStrategy.WARN
|
duplicatesStrategy = DuplicatesStrategy.WARN
|
||||||
|
|||||||
@@ -35,15 +35,11 @@ import com.eactive.eai.common.util.Logger;
|
|||||||
import com.eactive.eai.common.util.MessageUtil;
|
import com.eactive.eai.common.util.MessageUtil;
|
||||||
import com.eactive.eai.common.util.UUIDGenerator;
|
import com.eactive.eai.common.util.UUIDGenerator;
|
||||||
import com.eactive.eai.inbound.error.InboundErrorInfoVO;
|
import com.eactive.eai.inbound.error.InboundErrorInfoVO;
|
||||||
import com.kjbank.encrypt.exchange.crypto.AES256Cipher;
|
|
||||||
import com.kjbank.encrypt.exchange.crypto.AES256GCMCipher;
|
|
||||||
import com.kjbank.encrypt.exchange.crypto.AESCipher;
|
|
||||||
|
|
||||||
// jwhong
|
// jwhong
|
||||||
import org.json.simple.JSONObject;
|
import org.json.simple.JSONObject;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.sql.Timestamp;
|
|
||||||
import com.eactive.eai.data.entity.onl.stdmessage.StandardMessageInfo;
|
import com.eactive.eai.data.entity.onl.stdmessage.StandardMessageInfo;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@@ -64,14 +60,27 @@ public class ApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
String apiUri = servletRequest.getRequestURI();
|
String apiUri = servletRequest.getRequestURI();
|
||||||
// /api/v1/public/getUserInfo.svc
|
// /api/v1/public/getUserInfo.svc
|
||||||
apiUri = StringUtils.removeStart(apiUri, servletRequest.getContextPath());
|
apiUri = StringUtils.removeStart(apiUri, servletRequest.getContextPath());
|
||||||
apiUri = StringUtils.removeEnd(apiUri, "/");
|
apiUri = StringUtils.removeEnd(apiUri, "/");
|
||||||
|
|
||||||
HttpDynamicInAdapterUri adptUri = findAdptUri(apiUri, HttpDynamicInAdapterManager.getInstance());
|
//** jwhong TSEAIHS04의 api full path와 비교하여 adapter를 가져온다
|
||||||
|
String methodAndUri = servletRequest.getMethod() + "|" + apiUri;
|
||||||
//Received time , jwhong
|
HttpDynamicInAdapterUri adptUri = null;
|
||||||
long receivedTimeMillis = System.currentTimeMillis();
|
String adapterGrpName ="";
|
||||||
String receivedTimeStr = String.valueOf(receivedTimeMillis);
|
String apiSvcCode = "";
|
||||||
|
try {
|
||||||
|
STDMessageDAO dao = ApplicationContextProvider.getContext().getBean(STDMessageDAO.class);
|
||||||
|
StandardMessageInfo stdInfo = dao.getSTDMsgByPath(methodAndUri);
|
||||||
|
String serviceKey = stdInfo.getBzwksvckeyname();
|
||||||
|
int idx = serviceKey.indexOf(":");
|
||||||
|
adapterGrpName = (idx != -1) ? serviceKey.substring(0, idx) : serviceKey; // ':' 이전 문자열 추출
|
||||||
|
apiSvcCode = stdInfo.getEaisvcname();
|
||||||
|
//아래 원래 Logic
|
||||||
|
adptUri = findAdptUri(apiUri, HttpDynamicInAdapterManager.getInstance(), adapterGrpName);
|
||||||
|
} catch (Exception e) {
|
||||||
|
adptUri = null;
|
||||||
|
}
|
||||||
|
//***
|
||||||
|
|
||||||
if (logger.isDebug()) {
|
if (logger.isDebug()) {
|
||||||
logger.debug("ApiAdapterController] service request uri : " + servletRequest.getRequestURI());
|
logger.debug("ApiAdapterController] service request uri : " + servletRequest.getRequestURI());
|
||||||
}
|
}
|
||||||
@@ -80,8 +89,11 @@ public class ApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
logError(servletRequest);
|
logError(servletRequest);
|
||||||
// throw new Exception("can not find Adapter Uri");
|
// throw new Exception("can not find Adapter Uri");
|
||||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("can not find Adapter Uri");
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("can not find Adapter Uri");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Received time , jwhong
|
||||||
|
long receivedTimeMillis = System.currentTimeMillis(); // 밀리세컨 단위로 보내야함
|
||||||
|
String receivedTimeStr = String.valueOf(receivedTimeMillis);
|
||||||
|
|
||||||
String adapterGroupName = adptUri.getAdptGrpName();
|
String adapterGroupName = adptUri.getAdptGrpName();
|
||||||
String adapterName = adptUri.getAdptName();
|
String adapterName = adptUri.getAdptName();
|
||||||
@@ -102,8 +114,9 @@ public class ApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
String responseType = httpProp.getProperty(RESPONSE_TYPE, "SYNC");
|
String responseType = httpProp.getProperty(RESPONSE_TYPE, "SYNC");
|
||||||
ResponseEntity responseEntity = null;
|
ResponseEntity responseEntity = null;
|
||||||
Properties transactionProp = new Properties();
|
Properties transactionProp = new Properties();
|
||||||
//transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeMillis); // jwhong, put api received time
|
// jwhong, put api received time, eaiSvcCode
|
||||||
transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeStr);
|
transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeStr);
|
||||||
|
transactionProp.put(API_SERVICE_CODE, apiSvcCode);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String responseData = service.callApi(servletRequest, servletResponse, httpProp, adapterGroupVO, adapterVO, transactionProp);
|
String responseData = service.callApi(servletRequest, servletResponse, httpProp, adapterGroupVO, adapterVO, transactionProp);
|
||||||
@@ -170,18 +183,23 @@ public class ApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
* @param apiUri
|
* @param apiUri
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private HttpDynamicInAdapterUri findAdptUri(String apiUri, HttpDynamicInAdapterManager manager) throws Exception {
|
private HttpDynamicInAdapterUri findAdptUri(String apiUri, HttpDynamicInAdapterManager manager, String adapterGrpName) throws Exception {
|
||||||
if (StringUtils.isBlank(apiUri)) {
|
if (StringUtils.isBlank(apiUri)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
//** jwhong TSEAIHS04의 api full path와 비교하여 adapter를 가져온다
|
//* manager 출력
|
||||||
STDMessageDAO dao = ApplicationContextProvider.getContext().getBean(STDMessageDAO.class);
|
logger.warn("===== adptUriMap 상세 내용 =====");
|
||||||
StandardMessageInfo stdInfo = dao.getSTDMsgByPath(apiUri);
|
for (Map.Entry<String, HttpDynamicInAdapterUri> entry : manager.adptUriMap.entrySet()) {
|
||||||
String serviceKey = stdInfo.getBzwksvckeyname();
|
HttpDynamicInAdapterUri uriObj = entry.getValue();
|
||||||
int idx = serviceKey.indexOf(":");
|
logger.warn("GroupName=" + uriObj.getAdptGrpName()
|
||||||
String adapterGrpName = (idx != -1) ? serviceKey.substring(0, idx) : serviceKey; // ':' 이전 문자열 추출
|
+ ", AdapterName=" + uriObj.getAdptName()
|
||||||
//***
|
+ ", URI=" + uriObj.getUri());
|
||||||
|
}
|
||||||
|
logger.warn("================================");
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
HttpDynamicInAdapterUri adptUri = manager.getAdptUri(apiUri);
|
HttpDynamicInAdapterUri adptUri = manager.getAdptUri(apiUri);
|
||||||
|
|||||||
@@ -448,6 +448,7 @@ public class ApiAdapterService extends HttpAdapterServiceSupport {
|
|||||||
// end test source
|
// end test source
|
||||||
|
|
||||||
switch (decryptAlgorithm) {
|
switch (decryptAlgorithm) {
|
||||||
|
case "AES128":
|
||||||
case "AES128-TOSS":
|
case "AES128-TOSS":
|
||||||
try {
|
try {
|
||||||
String key128 = clientSecretKey.substring(22,38); //togetherEncoder 경우는 substring(44,60) 이네??
|
String key128 = clientSecretKey.substring(22,38); //togetherEncoder 경우는 substring(44,60) 이네??
|
||||||
@@ -532,6 +533,7 @@ public class ApiAdapterService extends HttpAdapterServiceSupport {
|
|||||||
String decryptedBodyMessage = "";
|
String decryptedBodyMessage = "";
|
||||||
|
|
||||||
switch (decryptAlgorithm) {
|
switch (decryptAlgorithm) {
|
||||||
|
case "AES128":
|
||||||
case "AES128-TOSS":
|
case "AES128-TOSS":
|
||||||
decryptedJsonKey = "preScreeningRequest";
|
decryptedJsonKey = "preScreeningRequest";
|
||||||
break;
|
break;
|
||||||
@@ -587,6 +589,7 @@ public class ApiAdapterService extends HttpAdapterServiceSupport {
|
|||||||
// end test source
|
// end test source
|
||||||
|
|
||||||
switch (encryptAlgorithm) {
|
switch (encryptAlgorithm) {
|
||||||
|
case "AES128":
|
||||||
case "AES128-TOSS":
|
case "AES128-TOSS":
|
||||||
try {
|
try {
|
||||||
String key128 = clientSecretKey.substring(22,38); //togetherEncoder 경우는 substring(44,60) 이네??
|
String key128 = clientSecretKey.substring(22,38); //togetherEncoder 경우는 substring(44,60) 이네??
|
||||||
|
|||||||
Reference in New Issue
Block a user