Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d79bcf8430 | |||
| e049420ca3 | |||
| 10bbd57c78 | |||
| 70c636d719 | |||
| 1b37fc5e1b | |||
| 9a730dc0b7 | |||
| 0ff2259f78 |
+1
-1
Submodule elink-online-common updated: a923ff3f9f...44093681b7
+1
-1
Submodule elink-online-core updated: 2929fc753f...495241c5d0
+1
-1
Submodule elink-online-core-jpa updated: 9620845daf...138621f2d0
+1
-1
Submodule elink-online-transformer updated: a1d822c2d7...229156d51d
@@ -51,6 +51,7 @@ public class DJBApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
@Autowired
|
@Autowired
|
||||||
DJBApiAdapterService service;
|
DJBApiAdapterService service;
|
||||||
|
|
||||||
|
EAIServerManager eaiServerManager;
|
||||||
/**
|
/**
|
||||||
* DJErp OAuth 조기 적용을 위한 Controller
|
* DJErp OAuth 조기 적용을 위한 Controller
|
||||||
*
|
*
|
||||||
@@ -89,7 +90,13 @@ public class DJBApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
|
|
||||||
ResponseEntity<String> responseEntity = null;
|
ResponseEntity<String> responseEntity = null;
|
||||||
Properties transactionProp = new Properties();
|
Properties transactionProp = new Properties();
|
||||||
String uuid = UUIDGenerator.getUUID().toString().replaceAll("-", "");
|
|
||||||
|
if(eaiServerManager == null)
|
||||||
|
eaiServerManager = EAIServerManager.getInstance();
|
||||||
|
|
||||||
|
String instid = eaiServerManager.getGroupInstId();
|
||||||
|
String uuid = instid+UUIDGenerator.getUUID().toString().replaceAll("-", "");
|
||||||
|
|
||||||
transactionProp.setProperty(TransactionContextKeys.TRANSACTION_UUID, uuid);
|
transactionProp.setProperty(TransactionContextKeys.TRANSACTION_UUID, uuid);
|
||||||
transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeStr);
|
transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeStr);
|
||||||
|
|
||||||
@@ -154,14 +161,14 @@ public class DJBApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
responseEntity = ResponseEntity.status(e1.getStatus()).contentType(mediaType).body(responseErrorMsg);
|
responseEntity = ResponseEntity.status(e1.getStatus()).contentType(mediaType).body(responseErrorMsg);
|
||||||
} else if (e instanceof JwtAuthException) {
|
} else if (e instanceof JwtAuthException) {
|
||||||
responseErrorMsg = genErrorResponseMessage(adapterGroupName, adapterName,
|
responseErrorMsg = genErrorResponseMessage(adapterGroupName, adapterName,
|
||||||
transactionProp, MessageUtil.ERROR_CODE_AP_ERROR, e, adptMsgType, encode, errorResponseFormat);
|
transactionProp, MessageUtil.ERROR_CODE_AUTH_FAIL, e, adptMsgType, encode, errorResponseFormat);
|
||||||
JwtAuthException e1 = (JwtAuthException) e;
|
JwtAuthException e1 = (JwtAuthException) e;
|
||||||
this.logError(servletRequest, adapterGroupName, e1.getCode(), responseErrorMsg, transactionProp, e);
|
this.logError(servletRequest, adapterGroupName, e1.getCode(), responseErrorMsg, transactionProp, e);
|
||||||
logger.error("ApiAdapterController] " + adapterGroupName + "-" + adapterName + ">>" + e.getMessage(), e);
|
logger.error("ApiAdapterController] " + adapterGroupName + "-" + adapterName + ">>" + e.getMessage(), e);
|
||||||
responseEntity = ResponseEntity.status(HttpStatus.UNAUTHORIZED).contentType(mediaType).body(responseErrorMsg);
|
responseEntity = ResponseEntity.status(HttpStatus.UNAUTHORIZED).contentType(mediaType).body(responseErrorMsg);
|
||||||
} else if (e instanceof HttpStatusException) {
|
} else if (e instanceof HttpStatusException) {
|
||||||
responseErrorMsg = genErrorResponseMessage(adapterGroupName, adapterName,
|
responseErrorMsg = genErrorResponseMessage(adapterGroupName, adapterName,
|
||||||
transactionProp, MessageUtil.ERROR_CODE_AUTH_FAIL, e, adptMsgType, encode, errorResponseFormat);
|
transactionProp, MessageUtil.ERROR_CODE_AP_ERROR, e, adptMsgType, encode, errorResponseFormat);
|
||||||
logger.error("ApiAdapterController] " + adapterGroupName + "-" + adapterName + ">>" + e.getMessage());
|
logger.error("ApiAdapterController] " + adapterGroupName + "-" + adapterName + ">>" + e.getMessage());
|
||||||
HttpStatusException e1 = (HttpStatusException) e;
|
HttpStatusException e1 = (HttpStatusException) e;
|
||||||
responseEntity = ResponseEntity.status(e1.getStatus()).contentType(mediaType).body(responseErrorMsg);
|
responseEntity = ResponseEntity.status(e1.getStatus()).contentType(mediaType).body(responseErrorMsg);
|
||||||
|
|||||||
+2
-11
@@ -6,7 +6,6 @@ import java.util.Properties;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.json.simple.JSONObject;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
||||||
import com.eactive.eai.adapter.http.dynamic.filter.FilterException;
|
import com.eactive.eai.adapter.http.dynamic.filter.FilterException;
|
||||||
@@ -16,6 +15,7 @@ import com.eactive.eai.common.security.ARIACryptoModuleExtension;
|
|||||||
import com.eactive.eai.common.security.CryptoModuleExtension;
|
import com.eactive.eai.common.security.CryptoModuleExtension;
|
||||||
import com.eactive.eai.common.util.Logger;
|
import com.eactive.eai.common.util.Logger;
|
||||||
import com.eactive.eai.util.HexaConverter;
|
import com.eactive.eai.util.HexaConverter;
|
||||||
|
import com.eactive.eai.util.JsonPathUtil;
|
||||||
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;
|
||||||
@@ -30,16 +30,7 @@ public class DecrytTestFilter implements HttpAdapterFilter {
|
|||||||
public Object doPreFilter(String adptGrpName, String adptName, Object message, Properties prop,
|
public Object doPreFilter(String adptGrpName, String adptName, Object message, Properties prop,
|
||||||
HttpServletRequest request, HttpServletResponse response) throws Exception {
|
HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||||
try {
|
try {
|
||||||
ObjectNode rootNode = null;
|
ObjectNode rootNode = (ObjectNode)JsonPathUtil.toTree(message);
|
||||||
String jsonStr = null;
|
|
||||||
if (message instanceof String) {
|
|
||||||
jsonStr = (String) message;
|
|
||||||
} else if (message instanceof JSONObject) {
|
|
||||||
jsonStr = ((JSONObject) message).toJSONString();
|
|
||||||
} else {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
rootNode = (ObjectNode) OBJECT_MAPPER.readTree(jsonStr);
|
|
||||||
|
|
||||||
JsonNode alg = rootNode.get("alg");
|
JsonNode alg = rootNode.get("alg");
|
||||||
JsonNode mode = rootNode.get("mode");
|
JsonNode mode = rootNode.get("mode");
|
||||||
|
|||||||
+2
-14
@@ -8,7 +8,6 @@ import javax.crypto.SecretKey;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.json.simple.JSONObject;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
||||||
import com.eactive.eai.adapter.http.dynamic.filter.FilterException;
|
import com.eactive.eai.adapter.http.dynamic.filter.FilterException;
|
||||||
@@ -19,6 +18,7 @@ import com.eactive.eai.common.security.ARIACryptoModuleExtension;
|
|||||||
import com.eactive.eai.common.security.CryptoModuleExtension;
|
import com.eactive.eai.common.security.CryptoModuleExtension;
|
||||||
import com.eactive.eai.common.util.Logger;
|
import com.eactive.eai.common.util.Logger;
|
||||||
import com.eactive.eai.util.HexaConverter;
|
import com.eactive.eai.util.HexaConverter;
|
||||||
|
import com.eactive.eai.util.JsonPathUtil;
|
||||||
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;
|
||||||
@@ -33,19 +33,7 @@ public class EncrytTestFilter implements HttpAdapterFilter {
|
|||||||
public Object doPreFilter(String adptGrpName, String adptName, Object message, Properties prop,
|
public Object doPreFilter(String adptGrpName, String adptName, Object message, Properties prop,
|
||||||
HttpServletRequest request, HttpServletResponse response) throws Exception {
|
HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||||
try {
|
try {
|
||||||
ObjectNode rootNode = null;
|
ObjectNode rootNode = (ObjectNode)JsonPathUtil.toTree(message);
|
||||||
String jsonStr = null;
|
|
||||||
if (message instanceof String) {
|
|
||||||
jsonStr = (String) message;
|
|
||||||
} else if (message instanceof ObjectNode) {
|
|
||||||
rootNode = (ObjectNode) message;
|
|
||||||
} else if (message instanceof JSONObject) {
|
|
||||||
jsonStr = ((JSONObject) message).toJSONString();
|
|
||||||
} else {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
if(rootNode == null)
|
|
||||||
rootNode = (ObjectNode) OBJECT_MAPPER.readTree(jsonStr);
|
|
||||||
|
|
||||||
// 1. HSM에서 키 가져오기
|
// 1. HSM에서 키 가져오기
|
||||||
byte[] hsmKeyBytes = null;
|
byte[] hsmKeyBytes = null;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import java.util.Properties;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.json.simple.JSONObject;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
||||||
import com.eactive.eai.adapter.http.dynamic.filter.FilterException;
|
import com.eactive.eai.adapter.http.dynamic.filter.FilterException;
|
||||||
@@ -18,6 +17,7 @@ import com.eactive.eai.common.util.Logger;
|
|||||||
import com.eactive.eai.custom.common.security.keyderiv.HsmContextSha256KeyDerivationStrategy;
|
import com.eactive.eai.custom.common.security.keyderiv.HsmContextSha256KeyDerivationStrategy;
|
||||||
import com.eactive.eai.custom.common.security.keyderiv.HsmKeyAndIvSliceDerivationStrategy;
|
import com.eactive.eai.custom.common.security.keyderiv.HsmKeyAndIvSliceDerivationStrategy;
|
||||||
import com.eactive.eai.util.HexaConverter;
|
import com.eactive.eai.util.HexaConverter;
|
||||||
|
import com.eactive.eai.util.JsonPathUtil;
|
||||||
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;
|
||||||
@@ -32,16 +32,7 @@ public class GenKeyFilter implements HttpAdapterFilter {
|
|||||||
public Object doPreFilter(String adptGrpName, String adptName, Object message, Properties prop,
|
public Object doPreFilter(String adptGrpName, String adptName, Object message, Properties prop,
|
||||||
HttpServletRequest request, HttpServletResponse response) throws Exception {
|
HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||||
try {
|
try {
|
||||||
ObjectNode rootNode = null;
|
ObjectNode rootNode = (ObjectNode)JsonPathUtil.toTree(message);
|
||||||
String jsonStr = null;
|
|
||||||
if (message instanceof String) {
|
|
||||||
jsonStr = (String) message;
|
|
||||||
} else if (message instanceof JSONObject) {
|
|
||||||
jsonStr = ((JSONObject) message).toJSONString();
|
|
||||||
} else {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
rootNode = (ObjectNode) OBJECT_MAPPER.readTree(jsonStr);
|
|
||||||
|
|
||||||
JsonNode hsmKey = rootNode.get("hsmKey");
|
JsonNode hsmKey = rootNode.get("hsmKey");
|
||||||
JsonNode hsmIv = rootNode.get("hsmIv");
|
JsonNode hsmIv = rootNode.get("hsmIv");
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public final class GUIDGeneratorDJB {
|
|||||||
|
|
||||||
static {
|
static {
|
||||||
// 노드번호(2): 서버명 마지막 2자리, 없으면 "00"
|
// 노드번호(2): 서버명 마지막 2자리, 없으면 "00"
|
||||||
String serverName = System.getProperty("server.key", "");
|
String serverName = System.getProperty(com.eactive.eai.common.server.Keys.SERVER_KEY, "");
|
||||||
if (serverName.length() >= 2) {
|
if (serverName.length() >= 2) {
|
||||||
NODE_NO = serverName.substring(serverName.length() - 2);
|
NODE_NO = serverName.substring(serverName.length() - 2);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user