4 Commits

Author SHA1 Message Date
curry772 73a50e5db4 미확인 오류 로그 출력 수정 및 favicon.ico 처리하지않도록 변경 2026-07-20 11:13:27 +09:00
curry772 ebf3cfa98d 어댑터별 apikey 헤더명 동적 적용 2026-07-20 11:12:28 +09:00
curry772 15ac0fa2a2 BigTech 어댑터 로그 출력 부분 수정 2026-07-10 10:11:46 +09:00
curry772 e0039aca81 BigTech signature 생성 파라미터(UR) 로그 추가 2026-07-10 10:10:33 +09:00
3 changed files with 28 additions and 20 deletions
@@ -67,7 +67,7 @@ public class DJBApiAdapterController implements HttpAdapterServiceKey {
"/tsb/{path:^(?!oauth).*$}", "/tsb/{path:^(?!oauth).*$}/**",
"/shb/{path:^(?!oauth).*$}", "/shb/{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)
throws Exception {
@@ -83,17 +83,25 @@ public class DJBApiAdapterController implements HttpAdapterServiceKey {
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
long receivedTimeMillis = System.currentTimeMillis(); // 밀리세컨 단위로 보내야함
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 adapterName = adptUri.getAdptName();
AdapterGroupVO adapterGroupVO = AdapterManager.getInstance().getAdapterGroupVO(adapterGroupName);
@@ -101,6 +109,8 @@ public class DJBApiAdapterController implements HttpAdapterServiceKey {
if (adapterVO == null) {
String errorMsg = MessageUtil.makeJsonErrorMessage(MessageUtil.ERROR_CODE_AP_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)
.body(errorMsg);
}
@@ -112,16 +122,10 @@ public class DJBApiAdapterController implements HttpAdapterServiceKey {
MediaType mediaType = MediaType.valueOf("application/json;charset=" + encode);
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);
// jwhong, put api received time, eaiSvcCode
transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeStr);
String responseData = "";
try {
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_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로 사용함
String seedkey = inboundHeaderProp.getOrDefault("x-obp-partnercode", "").toString();
ElinkTransactionContext.setSeedKey(seedkey);
@@ -84,12 +84,14 @@ public class HttpClient5AdapterServiceBigTech extends HttpClient5AdapterServiceR
String timestamp = System.currentTimeMillis() + "";
String accessKey = customProp.getProperty("_BTP_ACCESS_KEY", _BTP_ACCESS_KEY);
String secretKey = customProp.getProperty("_BTP_SECRET_KEY", _BTP_SECRET_KEY);
if(logger.isDebug()) {
logger.debug("charset={}", charset);
logger.debug("algorithm={}", algorithm);
logger.debug("timestamp={}", timestamp);
logger.debug("accessKey={}", accessKey);
logger.debug("secretKey={}", MaskingUtils.maskPassword(secretKey));
logger.debug("url={}", method.getRequestUri());
}
String signature = macHex(charset// charset
, algorithm// algorithm