Merge remote-tracking branch 'origin/jenkins_with_weblogic' of C:/DeployHome/bndle_import/bundles/251222/elink-online-common_incremental_2025-12-01.bundle into jenkins_with_weblogic
This commit is contained in:
+24
-10
@@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
@@ -52,8 +53,6 @@ import org.springframework.security.oauth2.provider.ClientDetails;
|
|||||||
import org.springframework.web.util.UriComponents;
|
import org.springframework.web.util.UriComponents;
|
||||||
import org.springframework.web.util.UriComponentsBuilder;
|
import org.springframework.web.util.UriComponentsBuilder;
|
||||||
|
|
||||||
import com.eactive.eai.adapter.AdapterGroupVO;
|
|
||||||
import com.eactive.eai.adapter.AdapterManager;
|
|
||||||
import com.eactive.eai.adapter.AdapterPropManager;
|
import com.eactive.eai.adapter.AdapterPropManager;
|
||||||
import com.eactive.eai.adapter.http.HttpMemoryLogger;
|
import com.eactive.eai.adapter.http.HttpMemoryLogger;
|
||||||
import com.eactive.eai.adapter.http.HttpMethodType;
|
import com.eactive.eai.adapter.http.HttpMethodType;
|
||||||
@@ -61,12 +60,6 @@ import com.eactive.eai.adapter.http.client.HttpClient5AdapterServiceSupport;
|
|||||||
import com.eactive.eai.adapter.http.client.HttpClientAdapterServiceKey;
|
import com.eactive.eai.adapter.http.client.HttpClientAdapterServiceKey;
|
||||||
import com.eactive.eai.adapter.http.client.HttpClientAdapterVO;
|
import com.eactive.eai.adapter.http.client.HttpClientAdapterVO;
|
||||||
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey;
|
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey;
|
||||||
import com.eactive.eai.adapter.http.dynamic.filter.AdapterAllowIPListFilter;
|
|
||||||
import com.eactive.eai.adapter.http.dynamic.filter.ApiAuthFilter;
|
|
||||||
import com.eactive.eai.adapter.http.dynamic.filter.HttpAdapterFilter;
|
|
||||||
import com.eactive.eai.adapter.http.dynamic.filter.HttpAdapterFilterType;
|
|
||||||
import com.eactive.eai.adapter.http.dynamic.filter.IpWhiteListFilter;
|
|
||||||
import com.eactive.eai.adapter.http.dynamic.filter.JwtAuthFilter;
|
|
||||||
import com.eactive.eai.common.TransactionContextKeys;
|
import com.eactive.eai.common.TransactionContextKeys;
|
||||||
import com.eactive.eai.common.authoutbound.AccessTokenManagerByDB;
|
import com.eactive.eai.common.authoutbound.AccessTokenManagerByDB;
|
||||||
import com.eactive.eai.common.exception.ExceptionUtil;
|
import com.eactive.eai.common.exception.ExceptionUtil;
|
||||||
@@ -167,6 +160,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
// 레이아웃 메시지 타입 REST URL 추출 시 활용. Default JSON
|
// 레이아웃 메시지 타입 REST URL 추출 시 활용. Default JSON
|
||||||
String messageType = prop.getProperty("MESSAGE_TYPE", MessageType.JSON);
|
String messageType = prop.getProperty("MESSAGE_TYPE", MessageType.JSON);
|
||||||
String inboundMethod = tempProp.getProperty(HttpAdapterServiceKey.INBOUND_METHOD, "POST");
|
String inboundMethod = tempProp.getProperty(HttpAdapterServiceKey.INBOUND_METHOD, "POST");
|
||||||
|
String inboundToken = tempProp.getProperty(HttpAdapterServiceKey.INBOUND_TOKEN, "");
|
||||||
|
|
||||||
//Outbound 요청에 대한 응답 메시지의 복호화 여부 결정위해 jwhong
|
//Outbound 요청에 대한 응답 메시지의 복호화 여부 결정위해 jwhong
|
||||||
encryptResponseApply = StringUtils.equalsIgnoreCase(prop.getProperty("ENCRYPT_RESPONSE_APPLY", "N"), "Y");
|
encryptResponseApply = StringUtils.equalsIgnoreCase(prop.getProperty("ENCRYPT_RESPONSE_APPLY", "N"), "Y");
|
||||||
@@ -352,6 +346,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
// 여기 까지
|
// 여기 까지
|
||||||
|
|
||||||
configureHttpClient(requestConfigBuilder, vo, method);
|
configureHttpClient(requestConfigBuilder, vo, method);
|
||||||
|
assignFilterHeaders(method, tempProp); // OutBound PreFilter에서 설정한 Header내용 설정.
|
||||||
|
|
||||||
switch (HttpMethodType.getValue(rmethod)) {
|
switch (HttpMethodType.getValue(rmethod)) {
|
||||||
case GET:
|
case GET:
|
||||||
@@ -376,7 +371,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
// assignPostBody(dataObject, contentType, vo.getEncode(), method);
|
// assignPostBody(dataObject, contentType, vo.getEncode(), method);
|
||||||
//assignPostBody(dataContent, contentType, vo.getEncode(), method); // jwhong commnet
|
//assignPostBody(dataContent, contentType, vo.getEncode(), method); // jwhong commnet
|
||||||
// KJBank API 추적정보를 Header에 제공. jwhong
|
// KJBank API 추적정보를 Header에 제공. jwhong
|
||||||
String inboundToken= assignRequestKJHeaders(method, prop, tempProp );
|
// String inboundToken= assignRequestKJHeaders(method, prop, tempProp );
|
||||||
assignPostBody(dataContent, contentType, vo.getEncode(), method, vo.getAdapterName(), auth, inboundToken, currentDate);
|
assignPostBody(dataContent, contentType, vo.getEncode(), method, vo.getAdapterName(), auth, inboundToken, currentDate);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -808,6 +803,25 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void assignFilterHeaders(HttpUriRequestBase method, Properties tempProp) {
|
||||||
|
try {
|
||||||
|
Properties filterHeaders = (Properties)tempProp.get("FILTERHEADER");
|
||||||
|
if (filterHeaders != null){
|
||||||
|
for (Entry<Object, Object> e : filterHeaders.entrySet()) {
|
||||||
|
String key = (String) e.getKey();
|
||||||
|
String value = (String) e.getValue();
|
||||||
|
method.setHeader(key, value);
|
||||||
|
|
||||||
|
if (logger.isDebugEnabled()) {
|
||||||
|
logger.debug("OutBound Filter] Request Header :" + key + "=[" + value + "]");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* KJBank Target System으로 요청 보낼때 header에 clientId(업체정보), APIM거래추적자(UUID), 최초 요청시간, guid 추가해서 보낸다. jwhong
|
* KJBank Target System으로 요청 보낼때 header에 clientId(업체정보), APIM거래추적자(UUID), 최초 요청시간, guid 추가해서 보낸다. jwhong
|
||||||
@@ -1000,7 +1014,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
return responseMessage;
|
return responseMessage;
|
||||||
|
|
||||||
}
|
}
|
||||||
private String doOutboundPreEncrypt(Object eaiBody, String encryptAlgorithm, String clientSecretKey, String encryptAES256Iv, String encryptAES256Key, String certPath, Date currentDate ) {
|
private String doOutboundPreEncrypt(Object eaiBody, String encryptAlgorithm, String clientSecretKey, String encryptAES256Iv, String encryptAES256Key, String certPath, Date currentDate) {
|
||||||
|
|
||||||
String encryptedMessage = "";
|
String encryptedMessage = "";
|
||||||
String encryptedJsonKey = "";
|
String encryptedJsonKey = "";
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public interface HttpAdapterServiceKey {
|
|||||||
static final String ENC_PATHS = "ENC_PATHS";
|
static final String ENC_PATHS = "ENC_PATHS";
|
||||||
|
|
||||||
static final String ENCRYPT_ALGORITHM = "ENCRYPT_ALGORITHM"; //jwhong
|
static final String ENCRYPT_ALGORITHM = "ENCRYPT_ALGORITHM"; //jwhong
|
||||||
static final String INBOUND_TOKEN = "authorization"; // jwhong
|
static final String INBOUND_TOKEN = "AUTHORIZATION"; // jwhong
|
||||||
static final String ENCRYPT_BASE_TYPE = "ENCRYPT_BASE_TYPE"; // jwhong
|
static final String ENCRYPT_BASE_TYPE = "ENCRYPT_BASE_TYPE"; // jwhong
|
||||||
static final String ENCRYPT_AES256_IV = "ENCRYPT_AES256_IV"; // jwhong
|
static final String ENCRYPT_AES256_IV = "ENCRYPT_AES256_IV"; // jwhong
|
||||||
static final String ENCRYPT_AES256_KEY = "ENCRYPT_AES256_KEY"; // jwhong
|
static final String ENCRYPT_AES256_KEY = "ENCRYPT_AES256_KEY"; // jwhong
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import com.solab.iso8583.IsoMessage;
|
|||||||
public final class MessageUtil {
|
public final class MessageUtil {
|
||||||
static Logger logger = LoggerFactory.getLogger(MessageUtil.class);
|
static Logger logger = LoggerFactory.getLogger(MessageUtil.class);
|
||||||
|
|
||||||
public static final String ERROR_MESSAGE_DEFAULT_FORMAT = "{\"error\":\"%s\",\"error_description\":\"%s\"}";
|
public static final String ERROR_MESSAGE_DEFAULT_FORMAT = "{\"error\":{\"code\":\"%s\",\"message\":\"%s\"}}";
|
||||||
|
|
||||||
public static final String ERROR_CODE_AP_ERROR = "E.GW.AP_ERROR";
|
public static final String ERROR_CODE_AP_ERROR = "E.GW.AP_ERROR";
|
||||||
public static final String ERROR_CODE_AUTH_FAIL = "E.GW.AUTH_FAIL";
|
public static final String ERROR_CODE_AUTH_FAIL = "E.GW.AUTH_FAIL";
|
||||||
|
|||||||
@@ -5,14 +5,12 @@ import java.util.Properties;
|
|||||||
|
|
||||||
import com.eactive.eai.common.TransactionContextKeys;
|
import com.eactive.eai.common.TransactionContextKeys;
|
||||||
import com.eactive.eai.common.circuitBreaker.CircuitBreakerManager;
|
import com.eactive.eai.common.circuitBreaker.CircuitBreakerManager;
|
||||||
import com.eactive.eai.common.util.SMSLogUtil;
|
|
||||||
import com.eactive.eai.message.StandardMessage;
|
import com.eactive.eai.message.StandardMessage;
|
||||||
import com.eactive.eai.util.PropertiesUtil;
|
import com.eactive.eai.util.PropertiesUtil;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
import com.initech.core.util.PropertiesManager;
|
import com.initech.core.util.PropertiesManager;
|
||||||
import io.github.resilience4j.circuitbreaker.CallNotPermittedException;
|
|
||||||
import io.github.resilience4j.circuitbreaker.CircuitBreaker;
|
import io.github.resilience4j.circuitbreaker.CircuitBreaker;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
@@ -23,6 +21,7 @@ import com.eactive.eai.adapter.AdapterVO;
|
|||||||
import com.eactive.eai.adapter.http.HttpStatusException;
|
import com.eactive.eai.adapter.http.HttpStatusException;
|
||||||
import com.eactive.eai.adapter.http.client.HttpClientAdapterServiceKey;
|
import com.eactive.eai.adapter.http.client.HttpClientAdapterServiceKey;
|
||||||
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey;
|
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey;
|
||||||
|
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceSupport;
|
||||||
import com.eactive.eai.common.EAIKeys;
|
import com.eactive.eai.common.EAIKeys;
|
||||||
import com.eactive.eai.common.exception.ExceptionUtil;
|
import com.eactive.eai.common.exception.ExceptionUtil;
|
||||||
import com.eactive.eai.common.header.HeaderAction;
|
import com.eactive.eai.common.header.HeaderAction;
|
||||||
@@ -107,12 +106,7 @@ public class RESTProcess extends HTTPProcess {
|
|||||||
combinedNode.set("metrics", objectMapper.valueToTree(circuitBreaker.getMetrics()));
|
combinedNode.set("metrics", objectMapper.valueToTree(circuitBreaker.getMetrics()));
|
||||||
|
|
||||||
logger.info("CircuitBreaker state "+combinedNode.toString());
|
logger.info("CircuitBreaker state "+combinedNode.toString());
|
||||||
try {
|
this.resObject = circuitBreaker.executeCallable(() -> HttpSender.callService(this.adapterGroupName, this.outboundProp, this.reqObject, this.tempProp));
|
||||||
this.resObject = circuitBreaker.executeCallable(() -> HttpSender.callService(this.adapterGroupName, this.outboundProp, this.reqObject, this.tempProp));
|
|
||||||
}catch(CallNotPermittedException callNotPermittedException){
|
|
||||||
SMSLogUtil.loggingSMS(reqEaiMsg.getEAISvcCd(), "CIRCUIT_IS_OPEN!");
|
|
||||||
throw callNotPermittedException;
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
this.resObject = HttpSender.callService(this.adapterGroupName, this.outboundProp, this.reqObject, this.tempProp);
|
this.resObject = HttpSender.callService(this.adapterGroupName, this.outboundProp, this.reqObject, this.tempProp);
|
||||||
}
|
}
|
||||||
@@ -448,6 +442,8 @@ public class RESTProcess extends HTTPProcess {
|
|||||||
PropertiesUtil.copyPropertyIfPresent(this.callProp, this.tempProp, HttpAdapterServiceKey.INBOUND_SCHEME);
|
PropertiesUtil.copyPropertyIfPresent(this.callProp, this.tempProp, HttpAdapterServiceKey.INBOUND_SCHEME);
|
||||||
PropertiesUtil.copyPropertyIfPresent(this.callProp, this.tempProp, HttpAdapterServiceKey.INBOUND_REQUESTED_TIME); // jwhong
|
PropertiesUtil.copyPropertyIfPresent(this.callProp, this.tempProp, HttpAdapterServiceKey.INBOUND_REQUESTED_TIME); // jwhong
|
||||||
PropertiesUtil.copyPropertyIfPresent(this.callProp, this.tempProp, HttpAdapterServiceKey.GUID); // jwhong
|
PropertiesUtil.copyPropertyIfPresent(this.callProp, this.tempProp, HttpAdapterServiceKey.GUID); // jwhong
|
||||||
|
PropertiesUtil.copyPropertyIfPresent(this.callProp, this.tempProp, HttpAdapterServiceKey.INBOUND_TOKEN); // jwhong
|
||||||
|
PropertiesUtil.copyPropertyIfPresent(this.callProp, this.tempProp, HttpAdapterServiceSupport.PROPERTIES_NAME_CLIENT_ID); // jwhong
|
||||||
|
|
||||||
String svcName = getServiceId(this.reqEaiMsg);
|
String svcName = getServiceId(this.reqEaiMsg);
|
||||||
if (svcName == null) {
|
if (svcName == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user