Compare commits

..

4 Commits

Author SHA1 Message Date
curry772 8701f5d459 보안성심의 오픈소스 조치 2026-09-07 16:08:48 +09:00
curry772 eaf1416e13 JSONMessage 파서에 선행 0 숫자 허용 옵션 추가
비표준(N) 경로도 표준(K) 경로와 같은 입력에서 실패한다.
JSONMessage 는 ALLOW_UNESCAPED_CONTROL_CHARS 만 켜고 있어 제어문자는
통과했지만, 선행 0 은 별개 옵션이라 함께 거부됐다.

transformer 는 의존 방향(common -> transformer)상 JacksonUtil 을 참조할 수
없어 common 의 newNumberSafeMapper() 와 같은 설정을 직접 켠다.

주의: 이 옵션은 00001 을 숫자 1 로 만든다(선행 0 미보존).

Jackson 2.12.7 실측: 생성자와 동일한 4개 설정 조합에서 선행 0 파싱,
제어문자 옵션 유지, 두 옵션 동시 동작, 숫자 정밀도 왕복 모두 확인.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Phh6MSGvgHM3rPgGUU3dzR
2026-08-28 16:41:31 +09:00
curry772 c0c1544350 test: 전체 테스트 스위트 통과하도록 격리/기대값 수정 (115/115)
전체 스위트 실행 시 115개 중 28개가 실패하던 문제 처리.

1. 클래스별 JVM 격리 (25건)
   TransformEngine/LayoutManager/MessageFactory 는 ApplicationContextProvider
   기반의 JVM 전역 싱글턴이라, 한 JVM 에서 여러 테스트 클래스를 돌리면 마지막에
   뜬 스프링 컨텍스트가 앞선 컨텍스트를 덮어쓴다. 그 결과 뒤 클래스가 앞 클래스의
   레이아웃을 보게 되어 "cannot create message" 로 실패했다.
   (각 클래스는 단독 실행 시에는 모두 통과)
   → build.gradle test 태스크에 forkEvery = 1 추가.
     느려지는 부분은 maxParallelForks 로 상쇄 (7분 → 4분 28초).

2. GetTrinomialFunctionTest 기대값 정정 (2건)
   JEP addStandardConstants() 에는 true/false 가 없고 Parser 가 이를 Boolean 으로
   등록한다(Parser.addBooleanConstants). 테스트 setUp 도 Boolean 을 바인딩해 놓고
   결과를 Number 로 단언하고 있어 자기모순이었음 → Boolean 기대로 정정.

3. LayoutRepositoryTest 시드 ID 수정 (1건)
   시드 SQL 어디에도 없는 TST_TTST00000002_RES 를 조회하고 있었음
   → init_tseaitr07/08 에 존재하는 TST_TOSSTEST1_TGT 로 변경.

운영 코드 변경 없음 (build.gradle 테스트 설정 + 테스트 코드만).
2026-08-28 12:48:40 +09:00
curry772 d20ac6290b jackson-dataformat-xml 을 jackson-databind 2.12.7 로 치환
XmlMapper 사용처는 0건이지만 transformer 의 유일한 jackson 공급원이라 제거가 아닌
치환이 필요하다. compileOnly 라 컴파일은 2.13.1 / 런타임은 2.12.7 인 skew 가 있었고,
이 때문에 2.13 전용 API 가 컴파일만 통과했다
(JacksonUtil.setValue 의 ArrayNode.set(int, String) -> 런타임 NoSuchMethodError).
2026-08-28 09:26:50 +09:00
2 changed files with 24 additions and 4 deletions
+18 -4
View File
@@ -51,13 +51,28 @@ dependencies {
api 'commons-collections:commons-collections:3.2.2'
api 'org.apache.poi:poi-excelant:3.9'
// poi-excelant -> poi-ooxml -> dom4j:dom4j:1.6.1 (구 groupId) 전이 차단.
// 1.6.1 은 XXE(CVE-2020-10683) / XML 인젝션(CVE-2018-1000632) 대상이고,
// 소스의 org.dom4j 사용처(HttpClient*AdapterServiceRest 등의 SAXReader)는
// hibernate-envers 가 가져오는 org.dom4j:dom4j:2.1.3 과 패키지가 같아 그대로 동작한다.
// 두 jar 가 공존하면 WEB-INF/lib 로딩 순서에 따라 1.6.1 이 선택될 수 있으므로 제거한다.
api ('org.apache.poi:poi-excelant:3.9') {
exclude group: 'dom4j', module: 'dom4j'
}
api group: 'org.apache.commons', name: 'commons-pool2', version: '2.11.1'
api 'commons-codec:commons-codec:1.15'
//api group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: '2.13.1'
compileOnly group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: '2.13.1'
// jackson-dataformat-xml(2.13.1) 을 jackson-databind 로 치환 (2026-08-27)
//
// XmlMapper/JacksonXml* 사용처는 전 소스에 0건이지만, 이 아티팩트가 transformer 의
// 유일한 jackson 공급원이었다(전이로 jackson-core/databind 2.13.1 을 끌고 옴).
// 그런데 compileOnly 라 WAR 에는 안 들어가고, 런타임은 Ignite 가 끌고 오는 2.12.7 이다.
// 이 컴파일(2.13.1)/런타임(2.12.7) skew 때문에 2.13 전용 API 가 컴파일을 통과했고,
// 실제로 JacksonUtil.setValue() 가 ArrayNode.set(int, String)(2.13 신규)을 써서
// 배열 경로 setText() 시 NoSuchMethodError 가 나는 상태였다.
// 런타임에 실제 존재하는 버전을 명시해 컴파일/런타임을 일치시킨다.
api group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.12.7'
compileOnly group: 'xalan', name: 'xalan', version: '2.6.0'
@@ -78,7 +93,6 @@ dependencies {
//testImplementation files("libs/json-simple-1.1.1-custom-1.2.jar")
//testImplementation files("libs/jep-4.j18-md-1.0.jar")
testImplementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: '2.13.1'
testImplementation 'junit:junit:4.4'
}
@@ -50,6 +50,12 @@ public class JSONMessage extends Message {
factory = mapper.getFactory();
factory.configure(JsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS.mappedFeature(), true);
// 상대가 0 패딩된 코드값을 따옴표 없이(=JSON 숫자로) 보내면 표준 파서는
// "Invalid numeric value: Leading zeroes not allowed" 로 거부한다.
// 전문 자체를 못 읽는 것보다 받아들이는 쪽이 낫다고 판단해 허용한다.
// ⚠ 이 옵션은 00001 을 숫자 1 로 만든다(선행 0 미보존).
// 표준전문 경로(common JacksonUtil.newNumberSafeMapper)와 동일한 설정이다.
factory.configure(JsonReadFeature.ALLOW_LEADING_ZEROS_FOR_NUMBERS.mappedFeature(), true);
}
@Override