Merge remote-tracking branch 'origin/jenkins_with_weblogic' of C:/KJB_DEV/git-bundles/bundles/251219/elink-online-common_incremental_2025-12-01.bundle into jenkins_with_weblogic
This commit is contained in:
+9
-9
@@ -303,6 +303,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
// OAuth2AccessToken check 부분을 뒤에서 여기로 위치를 옮김, 나이스지키미 암호화 KEY를 얻기 위해서. JWHONG
|
// OAuth2AccessToken check 부분을 뒤에서 여기로 위치를 옮김, 나이스지키미 암호화 KEY를 얻기 위해서. JWHONG
|
||||||
OAuth2AccessTokenVO accessToken = null;
|
OAuth2AccessTokenVO accessToken = null;
|
||||||
String auth ="";
|
String auth ="";
|
||||||
|
Date currentDate = new Date();
|
||||||
if (useAdapterToken) {
|
if (useAdapterToken) {
|
||||||
AccessTokenManagerByDB tokenManager = AccessTokenManagerByDB.getInstance();
|
AccessTokenManagerByDB tokenManager = AccessTokenManagerByDB.getInstance();
|
||||||
accessToken = (OAuth2AccessTokenVO) tokenManager.getAccessTokenVO(vo.getAdapterGroupName());
|
accessToken = (OAuth2AccessTokenVO) tokenManager.getAccessTokenVO(vo.getAdapterGroupName());
|
||||||
@@ -327,8 +328,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
if ( niceToken == null || niceToken == "") {
|
if ( niceToken == null || niceToken == "") {
|
||||||
throw new Exception("NiceOn Token is empty, TOKEN failed to be issued, TOKEN = [" + niceToken + "]");
|
throw new Exception("NiceOn Token is empty, TOKEN failed to be issued, TOKEN = [" + niceToken + "]");
|
||||||
}
|
}
|
||||||
String clientId = accessToken.getClientId(); // HttpClientAccessTokenServiceWithBase64NiceOn 서 넣어줌
|
String clientId = accessToken.getClientId(); // HttpClientAccessTokenServiceWithBase64NiceOn 서 넣어줌
|
||||||
Date currentDate = new Date();
|
|
||||||
long currentTime = currentDate.getTime() / 1000;
|
long currentTime = currentDate.getTime() / 1000;
|
||||||
auth = niceToken + ":" + currentTime + ":" + clientId ;
|
auth = niceToken + ":" + currentTime + ":" + clientId ;
|
||||||
logger.debug("HttpClientAdapterServiceRest] NiceOn auth = [" + auth + "]");
|
logger.debug("HttpClientAdapterServiceRest] NiceOn auth = [" + auth + "]");
|
||||||
@@ -377,7 +377,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
//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);
|
assignPostBody(dataContent, contentType, vo.getEncode(), method, vo.getAdapterName(), auth, inboundToken, currentDate);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -928,7 +928,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private void assignPostBody(Object eaiBody, String contentType, String charset, HttpUriRequestBase method, String adapterName, String niceAuth, String inboundToken) {
|
private void assignPostBody(Object eaiBody, String contentType, String charset, HttpUriRequestBase method, String adapterName, String niceAuth, String inboundToken, Date currentDate) {
|
||||||
if (eaiBody == null) {
|
if (eaiBody == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -949,7 +949,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
} else {
|
} else {
|
||||||
ContentType contentTypeObj = ContentType.create(contentType, charset);
|
ContentType contentTypeObj = ContentType.create(contentType, charset);
|
||||||
|
|
||||||
String eaiBodyMessage = doOutboundPreFilter(eaiBody, adapterName, niceAuth, inboundToken); // jwhong
|
String eaiBodyMessage = doOutboundPreFilter(eaiBody, adapterName, niceAuth, inboundToken, currentDate); // jwhong
|
||||||
StringEntity entity = new StringEntity(eaiBodyMessage, contentTypeObj);
|
StringEntity entity = new StringEntity(eaiBodyMessage, contentTypeObj);
|
||||||
// 요청 본문을 StringEntity 객체로 생성
|
// 요청 본문을 StringEntity 객체로 생성
|
||||||
//StringEntity entity = new StringEntity(eaiBody.toString(), contentTypeObj);
|
//StringEntity entity = new StringEntity(eaiBody.toString(), contentTypeObj);
|
||||||
@@ -960,7 +960,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
}
|
}
|
||||||
|
|
||||||
// from here by jwhong
|
// from here by jwhong
|
||||||
private String doOutboundPreFilter(Object eaiBody, String adapterName, String niceAuth, String inboundToken) {
|
private String doOutboundPreFilter(Object eaiBody, String adapterName, String niceAuth, String inboundToken, Date currentDate) {
|
||||||
|
|
||||||
Properties properties = AdapterPropManager.getInstance().getProperties(adapterName); // jwhong
|
Properties properties = AdapterPropManager.getInstance().getProperties(adapterName); // jwhong
|
||||||
String encryptAlgorithm = properties.getProperty("ENCRYPT_ALGORITHM",""); // jwhong
|
String encryptAlgorithm = properties.getProperty("ENCRYPT_ALGORITHM",""); // jwhong
|
||||||
@@ -995,12 +995,12 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
|
|
||||||
// 여기서 SECRETY인지 nice-auth 인지 check 하여 clientSecret 값을 정하는 logic 추가하여 넘겨야한다.
|
// 여기서 SECRETY인지 nice-auth 인지 check 하여 clientSecret 값을 정하는 logic 추가하여 넘겨야한다.
|
||||||
|
|
||||||
String responseMessage = doOutboundPreEncrypt(eaiBody, encryptAlgorithm, clientSecret, encryptAES256Iv, encryptAES256Key, certPath);
|
String responseMessage = doOutboundPreEncrypt(eaiBody, encryptAlgorithm, clientSecret, encryptAES256Iv, encryptAES256Key, certPath, currentDate);
|
||||||
logger.debug("outbound pre encrypte value is :"+responseMessage);
|
logger.debug("outbound pre encrypte value is :"+responseMessage);
|
||||||
return responseMessage;
|
return responseMessage;
|
||||||
|
|
||||||
}
|
}
|
||||||
private String doOutboundPreEncrypt(Object eaiBody, String encryptAlgorithm, String clientSecretKey, String encryptAES256Iv, String encryptAES256Key, String certPath ) {
|
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 = "";
|
||||||
@@ -1107,7 +1107,7 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
String goodsCls = PropManager.getInstance().getProperty("NiceOnProperty","goods.cls.value");
|
String goodsCls = PropManager.getInstance().getProperty("NiceOnProperty","goods.cls.value");
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
SimpleDateFormat sdfDateTime =new SimpleDateFormat("yyyyMMddHHmmss");
|
SimpleDateFormat sdfDateTime =new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
map.put("req_dtm", sdfDateTime);
|
map.put("req_dtm", sdfDateTime.format(currentDate));
|
||||||
map.put("goods_cls", goodsCls);
|
map.put("goods_cls", goodsCls);
|
||||||
map.put(encryptedJsonKey, encryptedMessage);
|
map.put(encryptedJsonKey, encryptedMessage);
|
||||||
JSONObject dataBody = new JSONObject();
|
JSONObject dataBody = new JSONObject();
|
||||||
|
|||||||
Reference in New Issue
Block a user