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:
Yunsam
2025-12-22 13:03:03 +09:00
4 changed files with 30 additions and 20 deletions
@@ -12,6 +12,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.regex.Matcher;
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.UriComponentsBuilder;
import com.eactive.eai.adapter.AdapterGroupVO;
import com.eactive.eai.adapter.AdapterManager;
import com.eactive.eai.adapter.AdapterPropManager;
import com.eactive.eai.adapter.http.HttpMemoryLogger;
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.HttpClientAdapterVO;
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.authoutbound.AccessTokenManagerByDB;
import com.eactive.eai.common.exception.ExceptionUtil;
@@ -167,6 +160,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
// 레이아웃 메시지 타입 REST URL 추출 시 활용. Default JSON
String messageType = prop.getProperty("MESSAGE_TYPE", MessageType.JSON);
String inboundMethod = tempProp.getProperty(HttpAdapterServiceKey.INBOUND_METHOD, "POST");
String inboundToken = tempProp.getProperty(HttpAdapterServiceKey.INBOUND_TOKEN, "");
//Outbound 요청에 대한 응답 메시지의 복호화 여부 결정위해 jwhong
encryptResponseApply = StringUtils.equalsIgnoreCase(prop.getProperty("ENCRYPT_RESPONSE_APPLY", "N"), "Y");
@@ -352,6 +346,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
// 여기 까지
configureHttpClient(requestConfigBuilder, vo, method);
assignFilterHeaders(method, tempProp); // OutBound PreFilter에서 설정한 Header내용 설정.
switch (HttpMethodType.getValue(rmethod)) {
case GET:
@@ -376,7 +371,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
// assignPostBody(dataObject, contentType, vo.getEncode(), method);
//assignPostBody(dataContent, contentType, vo.getEncode(), method); // jwhong commnet
// 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);
break;
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
@@ -1000,7 +1014,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
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 encryptedJsonKey = "";
@@ -73,7 +73,7 @@ public interface HttpAdapterServiceKey {
static final String ENC_PATHS = "ENC_PATHS";
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_AES256_IV = "ENCRYPT_AES256_IV"; // jwhong
static final String ENCRYPT_AES256_KEY = "ENCRYPT_AES256_KEY"; // jwhong
@@ -34,7 +34,7 @@ import com.solab.iso8583.IsoMessage;
public final class MessageUtil {
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_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.circuitBreaker.CircuitBreakerManager;
import com.eactive.eai.common.util.SMSLogUtil;
import com.eactive.eai.message.StandardMessage;
import com.eactive.eai.util.PropertiesUtil;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.initech.core.util.PropertiesManager;
import io.github.resilience4j.circuitbreaker.CallNotPermittedException;
import io.github.resilience4j.circuitbreaker.CircuitBreaker;
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.client.HttpClientAdapterServiceKey;
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.exception.ExceptionUtil;
import com.eactive.eai.common.header.HeaderAction;
@@ -107,12 +106,7 @@ public class RESTProcess extends HTTPProcess {
combinedNode.set("metrics", objectMapper.valueToTree(circuitBreaker.getMetrics()));
logger.info("CircuitBreaker state "+combinedNode.toString());
try {
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;
}
this.resObject = circuitBreaker.executeCallable(() -> HttpSender.callService(this.adapterGroupName, this.outboundProp, this.reqObject, this.tempProp));
}else{
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_REQUESTED_TIME); // 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);
if (svcName == null) {