Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b37fc5e1b | |||
| 9a730dc0b7 | |||
| 0ff2259f78 | |||
| 8231318f14 |
@@ -5,6 +5,7 @@ gradle.properties
|
|||||||
|
|
||||||
src/main/generated
|
src/main/generated
|
||||||
WebContent/generated
|
WebContent/generated
|
||||||
|
src/main/resources/version.info
|
||||||
|
|
||||||
# Eclipse #
|
# Eclipse #
|
||||||
.metadata
|
.metadata
|
||||||
|
|||||||
@@ -172,6 +172,54 @@ task initDirs() {
|
|||||||
file(generatedJavaDir).mkdirs()
|
file(generatedJavaDir).mkdirs()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// version.info 를 classpath 리소스로 생성해 WAR의 WEB-INF/classes에 포함시킨다.
|
||||||
|
// elink-online-common 등 공유 라이브러리 모듈이 아니라, 실제 배포 아티팩트(eapim-online.war)를
|
||||||
|
// 만드는 이 루트 프로젝트에서 생성해야 "지금 배포된 게이트웨이가 정확히 어느 커밋인지"를
|
||||||
|
// eapim-online 소스 변경 여부와 무관하게 항상 최신으로 반영한다.
|
||||||
|
// ToolsController(/manage/tools/version, elink-online-common 모듈)는 이 파일을
|
||||||
|
// Class.getResourceAsStream("/version.info")로 읽는데, WAR는 WEB-INF/classes와
|
||||||
|
// WEB-INF/lib 전체가 하나의 클래스로더를 공유하므로 어느 모듈의 클래스에서 조회하든 찾을 수 있다.
|
||||||
|
//
|
||||||
|
// elink-online-common/elink-online-core/... 는 별도 저장소를 참조하는 git submodule이라
|
||||||
|
// 루트(eapim-online)의 describe/dirty 만으로는 "어느 서브모듈이 바뀌었는지"를 알 수 없다
|
||||||
|
// (서브모듈 포인터가 커밋되고 나면 루트는 다시 clean 해져서 -dirty 흔적도 사라진다).
|
||||||
|
// 그래서 서브모듈 각각에 대해서도 describe를 실행해 module.<이름>=<결과> 형식으로 함께 기록한다.
|
||||||
|
def describeGit(File dir) {
|
||||||
|
try {
|
||||||
|
def proc = "git describe --tags --always --dirty".execute(null, dir)
|
||||||
|
// proc.text는 JVM/OS 기본 charset(Windows 환경에선 CP949 등)으로 stdout을 디코딩한다.
|
||||||
|
// git 태그명은 UTF-8 바이트이므로 기본 charset이 UTF-8이 아니면 여기서 한글이 깨진다.
|
||||||
|
// stream을 명시적으로 UTF-8로 읽어서 이 문제를 피한다.
|
||||||
|
def output = proc.inputStream.getText("UTF-8")
|
||||||
|
proc.waitFor()
|
||||||
|
return (proc.exitValue() == 0) ? output.trim() : "unknown"
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.warn("${dir} git describe 실행 불가, unknown 으로 대체: ${e.message}")
|
||||||
|
return "unknown"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task generateVersionInfo {
|
||||||
|
doLast {
|
||||||
|
def gitVersion = describeGit(projectDir)
|
||||||
|
|
||||||
|
def sb = new StringBuilder()
|
||||||
|
sb.append("version=${gitVersion}\n")
|
||||||
|
sb.append("buildTime=${new Date().format("yyyy-MM-dd HH:mm:ss")}\n")
|
||||||
|
subprojects.sort { it.name }.each { sub ->
|
||||||
|
if (file("${sub.projectDir}/.git").exists()) {
|
||||||
|
sb.append("module.${sub.name}=${describeGit(sub.projectDir)}\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def versionInfoFile = file("$projectDir/src/main/resources/version.info")
|
||||||
|
versionInfoFile.parentFile.mkdirs()
|
||||||
|
versionInfoFile.write(sb.toString(), "UTF-8")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
processResources.dependsOn generateVersionInfo
|
||||||
|
|
||||||
eclipse {
|
eclipse {
|
||||||
wtp {
|
wtp {
|
||||||
component {
|
component {
|
||||||
|
|||||||
+1
-1
Submodule elink-online-common updated: a923ff3f9f...9e1f7391a0
+1
-1
Submodule elink-online-core updated: 2929fc753f...f5a653ca6a
+1
-1
Submodule elink-online-transformer updated: a1d822c2d7...f9e6522b8f
+3
-12
@@ -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,17 +30,8 @@ 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");
|
||||||
JsonNode padding = rootNode.get("padding");
|
JsonNode padding = rootNode.get("padding");
|
||||||
|
|||||||
+3
-15
@@ -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,20 +33,8 @@ 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;
|
||||||
JsonNode hsmKeyAlias = rootNode.get("hsmKeyAlias");
|
JsonNode hsmKeyAlias = rootNode.get("hsmKeyAlias");
|
||||||
|
|||||||
@@ -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,17 +32,8 @@ 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");
|
||||||
JsonNode contextKey = rootNode.get("contextKey");
|
JsonNode contextKey = rootNode.get("contextKey");
|
||||||
|
|||||||
@@ -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