빌드 환경 설정 및 kjb-safedb 연동 조정

- build.gradle: nexus 저장소 및 의존성 설정 정리
This commit is contained in:
curry772
2026-03-11 10:17:42 +09:00
parent ceabf19a77
commit 980fb37b1a
2 changed files with 74 additions and 64 deletions
+10 -1
View File
@@ -14,6 +14,15 @@ idea {
def nexusUrl = "https://nexus.eactive.synology.me:8090" def nexusUrl = "https://nexus.eactive.synology.me:8090"
allprojects {
repositories {
maven {
url "${nexusUrl}/repository/maven-public/"
allowInsecureProtocol = true
}
}
}
def springVersion = "5.3.27" def springVersion = "5.3.27"
//def quartzVersion = "2.2.1" //def quartzVersion = "2.2.1"
def queryDslVersion = "5.0.0" def queryDslVersion = "5.0.0"
@@ -72,7 +81,7 @@ tasks.withType(JavaCompile) {
} }
dependencies { dependencies {
api project(':kjb-safedb') // api project(':kjb-safedb')
api "com.querydsl:querydsl-jpa:${queryDslVersion}" api "com.querydsl:querydsl-jpa:${queryDslVersion}"
api "com.querydsl:querydsl-apt:${queryDslVersion}" api "com.querydsl:querydsl-apt:${queryDslVersion}"
@@ -1,8 +1,8 @@
package kjb.safedb; package kjb.safedb;
import com.eactive.ext.kjb.safedb.KjbSafedbWrapper; //import com.eactive.ext.kjb.safedb.KjbSafedbWrapper;
import com.eactive.ext.kjb.safedb.SafeDBColumns; //import com.eactive.ext.kjb.safedb.SafeDBColumns;
import com.eactive.ext.kjb.safedb.Utils; //import com.eactive.ext.kjb.safedb.Utils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -25,26 +25,26 @@ public class KjbNotRnnoJpaAttributeConverter implements AttributeConverter<Strin
public String convertToDatabaseColumn(String attribute) { public String convertToDatabaseColumn(String attribute) {
// log.debug("DB 암호화 #1 - {} / {}", attribute, SafeDBColumns.NOT_RNNO); // log.debug("DB 암호화 #1 - {} / {}", attribute, SafeDBColumns.NOT_RNNO);
String originalAttribute = attribute; // String originalAttribute = attribute;
if (StringUtils.isNotEmpty(attribute)) { // if (StringUtils.isNotEmpty(attribute)) {
KjbSafedbWrapper wrapper = KjbSafedbWrapper.getInstance(); // KjbSafedbWrapper wrapper = KjbSafedbWrapper.getInstance();
attribute = wrapper.encryptNotRnnoString(attribute); // attribute = wrapper.encryptNotRnnoString(attribute);
//
if (log.isDebugEnabled()) { // if (log.isDebugEnabled()) {
// originalAttribute 홀수 글자 마스킹 // // originalAttribute 홀수 글자 마스킹
StringBuilder sb = new StringBuilder(); // StringBuilder sb = new StringBuilder();
for (int i = 0; i < originalAttribute.length(); i++) { // for (int i = 0; i < originalAttribute.length(); i++) {
if (i % 2 == 0) { // if (i % 2 == 0) {
sb.append(originalAttribute.charAt(i)); // sb.append(originalAttribute.charAt(i));
} else { // } else {
sb.append("*"); // sb.append("*");
} // }
} // }
//
originalAttribute = sb.toString(); // originalAttribute = sb.toString();
log.debug("DB 암호화 #2 : {} -> {}", originalAttribute, attribute); // log.debug("DB 암호화 #2 : {} -> {}", originalAttribute, attribute);
} // }
} // }
return attribute; return attribute;
} }
@@ -59,23 +59,23 @@ public class KjbNotRnnoJpaAttributeConverter implements AttributeConverter<Strin
public String convertToEntityAttribute(String dbData) { public String convertToEntityAttribute(String dbData) {
// log.debug("DB 복호화 #1 - {} / {}", dbData, SafeDBColumns.NOT_RNNO); // log.debug("DB 복호화 #1 - {} / {}", dbData, SafeDBColumns.NOT_RNNO);
String dbDataOriginal = dbData; // String dbDataOriginal = dbData;
if (StringUtils.isNotEmpty(dbData)) { // if (StringUtils.isNotEmpty(dbData)) {
if (this.isEncrypted(dbData)) { // if (this.isEncrypted(dbData)) {
KjbSafedbWrapper safeDBWrapper = KjbSafedbWrapper.getInstance(); // KjbSafedbWrapper safeDBWrapper = KjbSafedbWrapper.getInstance();
try { // try {
dbData = safeDBWrapper.decryptNotRnno(dbData); // dbData = safeDBWrapper.decryptNotRnno(dbData);
} catch (Exception e) { // } catch (Exception e) {
// 복호화 실패시 원본 반환 // // 복호화 실패시 원본 반환
String logData = dbData.length() <= 3 ? dbData : dbData.substring(0, 3) + "..."; // String logData = dbData.length() <= 3 ? dbData : dbData.substring(0, 3) + "...";
log.warn("DB 복호화 실패: 복호화하지 않고 원본 반환. dbData={} (Length : {})", logData, dbData.length()); // log.warn("DB 복호화 실패: 복호화하지 않고 원본 반환. dbData={} (Length : {})", logData, dbData.length());
needFixLogger.warn("DB 복호화 실패: 복호화하지 않고 원본 반환. dbData={} (Length : {})", logData, dbData.length(), e); // needFixLogger.warn("DB 복호화 실패: 복호화하지 않고 원본 반환. dbData={} (Length : {})", logData, dbData.length(), e);
return dbData; // return dbData;
} // }
} else { // } else {
log.debug("DB 복호화 경고: Base64 형식이 아님. 복호화하지 않고 원본 반환. dbData={}", dbData); // log.debug("DB 복호화 경고: Base64 형식이 아님. 복호화하지 않고 원본 반환. dbData={}", dbData);
} // }
} // }
// log.debug("DB 복호화 #2 : {} -> {}", dbDataOriginal, dbData); // log.debug("DB 복호화 #2 : {} -> {}", dbDataOriginal, dbData);
@@ -88,28 +88,29 @@ public class KjbNotRnnoJpaAttributeConverter implements AttributeConverter<Strin
* @return * @return
*/ */
private boolean isEncrypted(String data) { private boolean isEncrypted(String data) {
if (StringUtils.isEmpty(data)) { // if (StringUtils.isEmpty(data)) {
return false; // return false;
} // }
//
// 숫자, - 로만 구성된 경우 암호화 되지 않은 걸로 판단 (ex: 연락처) // // 숫자, - 로만 구성된 경우 암호화 되지 않은 걸로 판단 (ex: 연락처)
if (data.matches("^[0-9-]+$")) { // if (data.matches("^[0-9-]+$")) {
return false; // return false;
} // }
//
data = data.trim(); // data = data.trim();
//
// Base64 형식 체크 // // Base64 형식 체크
if (!Utils.isBase64(data)) { // if (!Utils.isBase64(data)) {
return false; // return false;
} // }
//
// Base64 길이 체크 (4의 배수) // // Base64 길이 체크 (4의 배수)
if (data.length() % 4 != 0) { // if (data.length() % 4 != 0) {
return false; // return false;
} // }
//
//
return true; // return true;
return false;
} }
} }