Compare commits
4 Commits
5c094ef9b4
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 73a50e5db4 | |||
| ebf3cfa98d | |||
| 15ac0fa2a2 | |||
| e0039aca81 |
@@ -67,7 +67,7 @@ public class DJBApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
"/tsb/{path:^(?!oauth).*$}", "/tsb/{path:^(?!oauth).*$}/**",
|
"/tsb/{path:^(?!oauth).*$}", "/tsb/{path:^(?!oauth).*$}/**",
|
||||||
"/shb/{path:^(?!oauth).*$}", "/shb/{path:^(?!oauth).*$}/**",
|
"/shb/{path:^(?!oauth).*$}", "/shb/{path:^(?!oauth).*$}/**",
|
||||||
"/tst/{path:^(?!oauth).*$}", "/tst/{path:^(?!oauth).*$}/**",
|
"/tst/{path:^(?!oauth).*$}", "/tst/{path:^(?!oauth).*$}/**",
|
||||||
"/**/{path:^(?!oauth).*$}", "/**/{path:^(?!oauth).*$}/**",
|
"/**/{path:^(?!oauth)(?!favicon\\.ico$).*$}", "/**/{path:^(?!oauth)(?!favicon\\.ico$).*$}/**",
|
||||||
})
|
})
|
||||||
public ResponseEntity<String> callApi(HttpServletRequest servletRequest, HttpServletResponse servletResponse)
|
public ResponseEntity<String> callApi(HttpServletRequest servletRequest, HttpServletResponse servletResponse)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
@@ -83,17 +83,25 @@ public class DJBApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
logger.debug("ApiAdapterController] service request uri : " + servletRequest.getRequestURI());
|
logger.debug("ApiAdapterController] service request uri : " + servletRequest.getRequestURI());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (adptUri == null) {
|
|
||||||
logError(servletRequest);
|
|
||||||
String errorMsg = MessageUtil.makeJsonErrorMessage(MessageUtil.ERROR_CODE_SERVICE_NOT_FOUND,
|
|
||||||
"can not find Adapter Uri");
|
|
||||||
return ResponseEntity.status(HttpStatus.NOT_FOUND).contentType(MediaType.APPLICATION_JSON).body(errorMsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Received time , jwhong
|
// Received time , jwhong
|
||||||
long receivedTimeMillis = System.currentTimeMillis(); // 밀리세컨 단위로 보내야함
|
long receivedTimeMillis = System.currentTimeMillis(); // 밀리세컨 단위로 보내야함
|
||||||
String receivedTimeStr = String.valueOf(receivedTimeMillis);
|
String receivedTimeStr = String.valueOf(receivedTimeMillis);
|
||||||
|
|
||||||
|
ResponseEntity<String> responseEntity = null;
|
||||||
|
Properties transactionProp = new Properties();
|
||||||
|
String uuid = UUIDGenerator.getUUID().toString().replaceAll("-", "");
|
||||||
|
transactionProp.setProperty(TransactionContextKeys.TRANSACTION_UUID, uuid);
|
||||||
|
transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeStr);
|
||||||
|
|
||||||
|
if (adptUri == null) {
|
||||||
|
//logError(servletRequest);
|
||||||
|
String errorMsg = MessageUtil.makeJsonErrorMessage(MessageUtil.ERROR_CODE_SERVICE_NOT_FOUND,
|
||||||
|
"can not find Adapter Uri");
|
||||||
|
logError(servletRequest, "HTTP_IN_NO_URI", MessageUtil.ERROR_CODE_SERVICE_NOT_FOUND,
|
||||||
|
errorMsg, transactionProp, null);
|
||||||
|
return ResponseEntity.status(HttpStatus.NOT_FOUND).contentType(MediaType.APPLICATION_JSON).body(errorMsg);
|
||||||
|
}
|
||||||
|
|
||||||
String adapterGroupName = adptUri.getAdptGrpName();
|
String adapterGroupName = adptUri.getAdptGrpName();
|
||||||
String adapterName = adptUri.getAdptName();
|
String adapterName = adptUri.getAdptName();
|
||||||
AdapterGroupVO adapterGroupVO = AdapterManager.getInstance().getAdapterGroupVO(adapterGroupName);
|
AdapterGroupVO adapterGroupVO = AdapterManager.getInstance().getAdapterGroupVO(adapterGroupName);
|
||||||
@@ -101,6 +109,8 @@ public class DJBApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
if (adapterVO == null) {
|
if (adapterVO == null) {
|
||||||
String errorMsg = MessageUtil.makeJsonErrorMessage(MessageUtil.ERROR_CODE_AP_ERROR,
|
String errorMsg = MessageUtil.makeJsonErrorMessage(MessageUtil.ERROR_CODE_AP_ERROR,
|
||||||
"Adapter not found error");
|
"Adapter not found error");
|
||||||
|
logError(servletRequest, adapterGroupName, MessageUtil.ERROR_CODE_AP_ERROR,
|
||||||
|
errorMsg, transactionProp, null);
|
||||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).contentType(MediaType.APPLICATION_JSON)
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).contentType(MediaType.APPLICATION_JSON)
|
||||||
.body(errorMsg);
|
.body(errorMsg);
|
||||||
}
|
}
|
||||||
@@ -112,16 +122,10 @@ public class DJBApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
MediaType mediaType = MediaType.valueOf("application/json;charset=" + encode);
|
MediaType mediaType = MediaType.valueOf("application/json;charset=" + encode);
|
||||||
String errorResponseFormat = httpProp.getProperty(ERROR_RESPONSE_FORMAT);
|
String errorResponseFormat = httpProp.getProperty(ERROR_RESPONSE_FORMAT);
|
||||||
|
|
||||||
ResponseEntity<String> responseEntity = null;
|
|
||||||
Properties transactionProp = new Properties();
|
|
||||||
String uuid = UUIDGenerator.getUUID().toString().replaceAll("-", "");
|
|
||||||
transactionProp.setProperty(TransactionContextKeys.TRANSACTION_UUID, uuid);
|
|
||||||
|
|
||||||
TxSiftContext.begin(uuid);
|
TxSiftContext.begin(uuid);
|
||||||
|
|
||||||
// jwhong, put api received time, eaiSvcCode
|
// jwhong, put api received time, eaiSvcCode
|
||||||
transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeStr);
|
|
||||||
|
|
||||||
String responseData = "";
|
String responseData = "";
|
||||||
try {
|
try {
|
||||||
responseData = service.callApi(servletRequest, servletResponse, httpProp, adapterGroupVO, adapterVO,
|
responseData = service.callApi(servletRequest, servletResponse, httpProp, adapterGroupVO, adapterVO,
|
||||||
|
|||||||
@@ -154,6 +154,8 @@ public class DJBApiAdapterService extends HttpAdapterServiceSupport {
|
|||||||
transactionProp.put(HEADER_GROUP, headerGroupName);
|
transactionProp.put(HEADER_GROUP, headerGroupName);
|
||||||
transactionProp.put(HEADER_KEYS, relayRequestHeaderKeys);
|
transactionProp.put(HEADER_KEYS, relayRequestHeaderKeys);
|
||||||
|
|
||||||
|
transactionProp.put(ADAPTER_TOKEN_HEADER_NAME, httpProp.getProperty(ADAPTER_TOKEN_HEADER_NAME, "")); // OAuth 인증 토큰 헤더 이름
|
||||||
|
transactionProp.put(ADAPTER_APIKEY_HEADER_NAME, httpProp.getProperty(ADAPTER_APIKEY_HEADER_NAME, "")); // API-KEY 인증 헤더 이름
|
||||||
// SEED 컬럼암호하 시 Key로 사용함
|
// SEED 컬럼암호하 시 Key로 사용함
|
||||||
String seedkey = inboundHeaderProp.getOrDefault("x-obp-partnercode", "").toString();
|
String seedkey = inboundHeaderProp.getOrDefault("x-obp-partnercode", "").toString();
|
||||||
ElinkTransactionContext.setSeedKey(seedkey);
|
ElinkTransactionContext.setSeedKey(seedkey);
|
||||||
|
|||||||
+8
-6
@@ -84,12 +84,14 @@ public class HttpClient5AdapterServiceBigTech extends HttpClient5AdapterServiceR
|
|||||||
String timestamp = System.currentTimeMillis() + "";
|
String timestamp = System.currentTimeMillis() + "";
|
||||||
String accessKey = customProp.getProperty("_BTP_ACCESS_KEY", _BTP_ACCESS_KEY);
|
String accessKey = customProp.getProperty("_BTP_ACCESS_KEY", _BTP_ACCESS_KEY);
|
||||||
String secretKey = customProp.getProperty("_BTP_SECRET_KEY", _BTP_SECRET_KEY);
|
String secretKey = customProp.getProperty("_BTP_SECRET_KEY", _BTP_SECRET_KEY);
|
||||||
|
if(logger.isDebug()) {
|
||||||
logger.debug("charset={}", charset);
|
logger.debug("charset={}", charset);
|
||||||
logger.debug("algorithm={}", algorithm);
|
logger.debug("algorithm={}", algorithm);
|
||||||
logger.debug("timestamp={}", timestamp);
|
logger.debug("timestamp={}", timestamp);
|
||||||
logger.debug("accessKey={}", accessKey);
|
logger.debug("accessKey={}", accessKey);
|
||||||
logger.debug("secretKey={}", MaskingUtils.maskPassword(secretKey));
|
logger.debug("secretKey={}", MaskingUtils.maskPassword(secretKey));
|
||||||
|
logger.debug("url={}", method.getRequestUri());
|
||||||
|
}
|
||||||
|
|
||||||
String signature = macHex(charset// charset
|
String signature = macHex(charset// charset
|
||||||
, algorithm// algorithm
|
, algorithm// algorithm
|
||||||
|
|||||||
Reference in New Issue
Block a user