Commit Graph

361 Commits

Author SHA1 Message Date
curry772 07569e62da HTTP도 REST 처럼 simulator 호출 기능, mock server(test master) 호출로 변경 2026-05-11 16:11:10 +09:00
curry772 e5638f22bb Outbound HeaderGroup 전체 전달 'ALL' 지원 2026-05-11 16:10:20 +09:00
curry772 e64319e7d2 Merge branch 'feature/inflow-control-improvement' into master 2026-05-08 10:51:21 +09:00
curry772 43548a90c4 fix: AbstractInflowControlManager Bandwidth.simple → classic+intervally 버킷 생성 버그 수정 및 테스트 추가
- makeBucketUsingInflowVO: 어댑터/인터페이스 단일 버킷 threshold 리필을 greedy → intervally 변경
- makeGroupBucket: 그룹 threshold 버킷 동일하게 수정
- DualInflowControlManagerMakeBucketTest: 버킷 생성 로직 직접 검증 테스트 추가
- InflowControlManagerTest: @BeforeEach reload + spike/burst 경계 케이스 테스트 추가
- SQL 픽스처: MIN 단위 TEST_ADAPTER/TEST_INTERFACE/test-group-quota 항목 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 10:21:57 +09:00
curry772 8900966d71 refactor: DualBucket/DualInflowControlManager 클라이언트 분리 및 Bandwidth 방식 변경
- DualBucket 인터페이스에서 클라이언트 메서드 분리 → ClientDualBucket 신규 인터페이스
- DualInflowControlManager 클라이언트 구현 분리 → ClientDualInflowControlManager
- DualInflowControlManager @Component 제거 (ClientDualInflowControlManager가 단일 빈)
- makeBucket: Bandwidth.simple → Bandwidth.classic + Refill.greedy/intervally 변경
  (threshold 버킷을 진짜 기간 쿼터로 동작하도록 수정)
- DualRequestProcessor → eapim-online custom 패키지로 이동 (삭제)
- ReloadInflowClientControlCommand / RemoveInflowClientControlCommand:
  instanceof 타입을 ClientDualInflowControlManager로 변경
- 단위 테스트: ClientDualInflowControlManagerMetricsTest 추가,
  DualInflowControlManagerMetricsTest 클라이언트 케이스 분리

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 18:02:34 +09:00
curry772 32a7723fa4 Merge branch 'feature/crypto-module' into master 2026-05-07 15:38:47 +09:00
curry772 580686886c feat: HTTP 어댑터 암복호화 필터 기반 클래스 추가 및 ReloadCryptoModuleCommand 개선
- CryptoFilter (abstract): BODY/FIELD scope 암복호화, buildRuntimeContext 추상화
  - String/byte[]/JSONObject 타입 message 처리 (toBodyString)
  - STATIC/DYNAMIC 키 모듈 공통 지원 (CryptoModuleManager가 내부 분기)
- ReloadCryptoModuleCommand: 로깅 추가, 성공 시 "success" 반환, 에러코드 정의

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 15:03:47 +09:00
curry772 bf1135f9ad feat: 암호화모듈 프레임워크 신규 구현
- CryptoModuleExtension 인터페이스: BC 프로바이더, AAD, 편의 메서드 오버로드 추가
- AESCryptoModuleExtension: CBC/GCM/ECB/FF1 지원, GCM 랜덤 nonce, AAD 처리
- ARIACryptoModuleExtension: ARIA 알고리즘 지원
- CryptoModuleConfigVO: JPA Entity 분리를 위한 Lombok VO
- CryptoModuleManager: VO 패턴 적용, FQCN 기반 전략 동적 로딩(Class.forName)
- CryptoModuleService: STATIC/DYNAMIC × AAD 조합 8가지 오버로드
- CryptoModuleConfigMapper: MapStruct Entity→VO 매퍼
- KeyDerivationStrategy 인터페이스 및 DerivedKey
- HsmContextXorKeyDerivationStrategy: HSM 마스터키 XOR 컨텍스트값 전략
- ReloadCryptoModuleCommand: 설정 런타임 재로드 커맨드
- build.gradle: BouncyCastle bcprov-jdk15on:1.70 의존성 추가
- 단위 테스트 전체 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 16:49:33 +09:00
curry772 8f70451477 Merge branch 'feature/inflow-control-improvement'
- AbstractInflowControlManager 상속 구조 리팩토링
- DualInflowControlManager DAO 이중 호출 제거 및 타겟 메트릭 추가
- ReloadInflowClientControlCommandTest / RemoveInflowClientControlCommandTest 수정
2026-04-30 10:16:52 +09:00
curry772 437961e7d5 test: ReloadInflowClientControlCommandTest / RemoveInflowClientControlCommandTest 수정
PropManager NPE 및 정적 캐시 미초기화로 인한 테스트 실패 수정.
InflowControlUtil.cachedInflowControlManager를 ReflectionTestUtils로
직접 주입/초기화하는 방식으로 변경.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 10:15:27 +09:00
curry772 496bdd1468 feat: DualInflowControlManager DAO 이중 호출 제거 및 타겟 메트릭 추가
- 베이스 맵 메서드 오버라이드(getAdapterAllKeys, getInterfaceAllKeys,
  getAdapterInflowThreashold, getInterfaceInflowThreashold,
  removeAdapter, removeInterface)로 DAO 이중 호출 제거
- super.reload*() 호출 제거
- 어댑터/인터페이스/클라이언트별 TargetMetrics 수집 추가
  (allowed, rejectedPerSecond, rejectedThreshold)
- 메트릭 조회/초기화 API 메서드 추가
- 단위테스트: DualInflowControlManagerBucketMethodsTest(18건),
  DualInflowControlManagerMetricsTest 확장

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 10:15:04 +09:00
curry772 2bfc3d0bde refactor: AbstractInflowControlManager 상속 구조 리팩토링 및 커맨드 클래스 타입 변경
InflowControlManager에서 공통 로직을 AbstractInflowControlManager로 분리하고,
커맨드 클래스들이 AbstractInflowControlManager 타입을 사용하도록 변경.
InflowControlUtil에 cachedInflowControlManager 정적 캐시 도입.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 10:14:31 +09:00
curry772 9589bc635a test: 클라이언트 유량제어 Command 단위 테스트 추가
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 15:15:11 +09:00
curry772 ca8be26583 feat: 클라이언트 유량제어 Command 추가 및 removeClient() 구현
- ReloadInflowClientControlCommand: 클라이언트 버킷 전체/개별 리로드
- RemoveInflowClientControlCommand: 클라이언트 버킷 제거
- DualInflowControlManager.removeClient(clientId) 메서드 추가
  (기존 removeAdapter/removeInterface와 동일한 패턴)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 14:59:15 +09:00
curry772 5641baff35 Merge branch 'feature/circuit-breaker-test' into master 2026-04-29 14:47:15 +09:00
curry772 f36f78d63c refactor: TypedCircuitBreakerManager 미사용 코드 정리
- urlCBConfigMap 선언 주석 처리 (URL 기반 CB 기능 미사용)
- AlarmStateManager 연동 코드 주석 처리 (AlarmEvent/AlarmCondition/CoreAlarmKey import 제거)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 14:47:01 +09:00
curry772 06f0d389a6 test: TypedCircuitBreakerManager 단위테스트 추가 및 idCBConfigMap 버그 수정
- TypedCircuitBreakerManagerTest 추가 (JUnit5/Mockito, DB/Spring 없이 동작)
- getCircuitBreaker 조회/fallback/비활성화/normalizeUseYn 검증 (1-1~1-5)
- apiId 별 CB 인스턴스 독립성 및 상태 격리 검증 (2-1~2-2)
- CLOSED/OPEN/HALF_OPEN 상태 전이 전체 검증 (3-1~3-6)
- reload(key) 설정 갱신/비활성화 제거, reload() 레지스트리 재생성 검증 (4-1~4-3)
- 생명주기 isStarted 검증 (5-1)
- init()에서 idCBConfigMap.remove를 put으로 수정 (reload(key) 동작 오류 버그 수정)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 13:32:44 +09:00
curry772 00735f6614 Merge branch 'feature/hsm-integration-jdk8' into master 2026-04-29 12:59:07 +09:00
curry772 a1a5a34874 feat: HSM 키 캐시 및 PropManager 연동 초기화, DB 설정 파싱 오류 수정
- HsmCryptoService: getPublicKey/getSecretKey ConcurrentHashMap 캐시 추가 (HSM 통신 최소화)
- HsmCryptoService: encryptAes/decryptAes Provider 파라미터 오버로드 추가 (non-extractable 키 지원)
- HsmCryptoService: PropertyChangeListener 구현, HSM.CACHE_RELOAD_YN=Y 시 clearKeyCache() 자동 호출
- HsmCryptoService: @PostConstruct NPE 수정 - PropManager.getInstance() → @Autowired 직접 주입
- HsmManager: DB PKCS11_CONFIG 리터럴 \n → 실제 줄바꿈 치환 (파싱 오류 수정)
- HsmManager: 기동 시 HSM 키 목록 로그 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 12:58:50 +09:00
curry772 acdb58049c feat: SafeNet HSM 연동 구현 (JDK 8 / SunPKCS11)
- HsmManager: SunPKCS11 Provider 초기화, Lifecycle 관리
  - JDK 8 / JDK 9+ 분기를 리플렉션으로 처리하는 createProvider() 추가
  - PropManager DB에서 PKCS11_CONFIG / PIN 읽어 초기화
- HsmCryptoService: RSA / AES 암복호화 서비스
  - encryptRsa: 공개키 기반 JVM 소프트웨어 암호화
  - decryptRsa: HSM 내부 복호화 (미초기화 시 HsmException 발생)
  - encryptAes / decryptAes: AES/CBC/PKCS5Padding
- HsmException: HSM 전용 커스텀 예외
- pkcs11-dev.cfg: SoftHSM2용 (slotListIndex = 0)
- pkcs11-prod.cfg: SafeNet ProtectServer 운영용 (slot = 0)
- HsmSoftHsm2IntegrationTest: 저수준 PKCS11 직접 테스트 (8개)
- HsmManagerServiceTest: HsmManager/HsmCryptoService 경유 테스트 (8개)
  Mockito + GenericApplicationContext로 DB 없이 실행 가능

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 20:52:14 +09:00
curry772 81f7898eb1 Merge branch 'feature/inflow-control-improvement' into master 2026-04-27 17:24:58 +09:00
curry772 d08c7efcdc refactor: DualRequestProcessor를 inbound.processor 패키지로 이동
유량제어 컴포넌트(inflow.dual)가 아닌 요청 처리기이므로
부모 클래스(RequestProcessor)와 동일 패키지로 이동.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 13:50:48 +09:00
curry772 a4c9a2f2bd feat: Dual 이중 버킷 유량제어 패키지 추가 (DJErp→Dual 리네임·이관)
- InflowType 열거형 추가 (ADAPTER/INTERFACE/CLIENT 타입 코드 캡슐화)
- InflowControlDAO: InflowType 기반 범용 메서드 추가, 기존 메서드 위임
- RequestProcessor: private→protected 전환, 클라이언트/어댑터/인터페이스
  유량제어 훅 메서드 5개 추가 (checkClientInflow 등)
- dual 패키지 신규 추가
  · DualCustomBucket: perSecond/threshold 이중 버킷, 차단 원인 구분
  · DualBucket: isAdapterPassDetail 등 차단 원인 반환 인터페이스
  · DualInflowControlManager: 그룹 메트릭 카운팅(TargetMetrics), 리로드 연동
  · DualRequestProcessor: 클라이언트 유량제어 + 상세 오류 메시지 훅 구현
- 단위 테스트 5종 추가 (DualCustomBucket, Manager, Metrics, RequestProcessor, Concurrency)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 09:40:27 +09:00
curry772 632550220d fix: Reload 동시성 수정 - volatile ConcurrentHashMap + 원자적 맵 교체
1. 맵 5개를 volatile + ConcurrentHashMap으로 변경
   - 비동기 읽기(isGroupPass 등) 중 HashMap 구조 변경으로 발생하던 race condition 제거

2. initAdapter/Interface/Group()에서 빌드-완성 후 원자적 교체 패턴 적용
   - 신규 맵을 완전히 구성한 뒤 this.field = newMap으로 한 번에 교체
   - 구→신 전환 중 불완전 상태가 외부에 노출되던 문제 제거

3. removeAdapter/Interface/Group()에 synchronized 추가
   - 락 없이 맵을 수정하던 메서드와 reload 사이의 race condition 방지

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 15:25:58 +09:00
curry772 d88dbe1eef feat: 리플렉션 제거 - InflowControlManager.getGroupBucket() public 메서드 추가
groupBucketList private 필드에 리플렉션 없이 접근할 수 있도록
getGroupBucket(String groupId) public 메서드 제공.

그룹 테이블 테스트 픽스처 SQL 추가 및 InflowControlManagerTest에
getGroupBucket() 동작 검증 테스트 케이스 2개 추가.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 15:21:00 +09:00
curry772 31b8a2b130 Merge branch 'feature/standard-message-djb' 2026-04-23 14:14:54 +09:00
curry772 d81aeeef67 chore: DJErp InterfaceID 설정 TODO 주석 추가
표준전문 InterfaceID에 SEND_RECV_DIVISION·IN_EX_DIVISION 포함 여부 결정 전까지
mapper.setInterfaceId() 호출을 주석 처리 및 TODO 표기.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 14:10:54 +09:00
curry772 5dae063fe5 fix: FLAT 직렬화 시 비활성 조건부 GROUP 블록 바이트 포함 버그 수정
toByteArray() / getBytesDataLength() GROUP 케이스에서
size==0 이면 refPath/refValue 유무와 무관하게 무조건 skip 하도록 변경.
(toJson() 동작과 일치)

기존 로직은 refPath 또는 refValue 가 없는 경우에만 skip 하여,
조건부 블록(EZDATA, MSG 등)이 비활성 상태(size=0, isHidden=false)일 때도
FLAT 바이트에 잘못 포함되는 문제가 있었음.
→ FlatReader 파싱 시 오프셋 불일치로 overflow 예외 또는 DATA 필드 오염 발생.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 10:34:22 +09:00
curry772 024b24af49 Merge branch 'master' into feature/standard-message-djb 2026-04-22 15:50:23 +09:00
curry772 6807e2b947 Merge branch 'feature/jejubank-oauth-bypass' 2026-04-22 15:49:37 +09:00
curry772 56fc66faa0 fix: 표준헤더 진행번호(SendTime) 처리 수정
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 15:40:49 +09:00
curry772 126f41624d Merge branch 'feature/standard-message-djb' into master 2026-04-21 16:00:25 +09:00
curry772 ae6ed9b262 fix: DJBank 표준전문 대응 프레임워크 수정
- BaseFCProcess.setGUID(): nextGuidSeq 자동 호출 비활성화
  (guid_prgs_no 증가는 Coordinator에서 처리)
- DefaultProcess: 오류 응답 시 nextGuidSeq 자동 호출 비활성화
- RequestProcessor: GUID 조합(guid+seq) 로직 비활성화,
  logger.error에 exception 객체 추가
- StandardMessageManager: config 기본 경로 ./resources/ → ./ 수정

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 15:48:20 +09:00
curry772 6f5af2ac69 fix: toJson 직렬화 시 빈 항목 제외 처리
itemPart가 비어있을 경우 구분자와 내용을 출력하지 않도록 수정.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 09:08:31 +09:00
curry772 6fd9caa7d4 오류응답 디폴트 형식(ERROR_MESSAGE_DEFAULT_FORMAT) 프러퍼티 설정 가능하도록 수정
- 프러퍼티 그룹 : MessageUtil
- 프러퍼티 : ERROR_MESSAGE_DEFAULT_FORMAT
2026-04-17 09:43:32 +09:00
curry772 68cf1dff16 Authorization 오류 메시지 출력 변경 - 실제 사용하는 토큰헤더이름사용하도록 변경 2026-04-17 09:42:13 +09:00
curry772 bebf5fa36d ApiConfig token.header.name 프러퍼티를 추가하여 token 헤더 프러퍼티 추가 2026-04-15 17:39:59 +09:00
curry772 dd9fc6fbdb BearerToken 간헐적 파싱 못하는 경우 발생에 대한 방어로직 2026-04-09 08:59:38 +09:00
curry772 71686fb387 RFC 2616 §13.5.1 (Hop-by-hop 헤더 목록) 오류 정정, Trailers -> Trailer 2026-04-08 14:38:34 +09:00
curry772 bc8b549a33 HTTP Header 로그 off 기능 - -Duse.http.header.log=y 옵션 추가시 로깅 2026-04-08 14:16:59 +09:00
curry772 56ac438265 fix: 비-mTLS https 연결 시 testMode에서 hostname 검증 우회 적용
TrustAllStrategy 사용 시에도 DefaultHostnameVerifier가 적용되어
외부 testmaster 인증서 hostname mismatch 오류 발생.
testMode(-Duse.test.trust=y)일 때 NoopHostnameVerifier 적용하여 해결.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 09:57:51 +09:00
curry772 791e362a74 feature: DJErp OAuth bypass 지원을 위한 공통 모듈 개선
- UnkownMessageLogUtils 추가: unknown 메시지 발생 시 DB 에러 로그 기록
- HttpAdapterServiceSupport: transactionId 추출을 try 블록 외부로 이동,
  예외 분기 처리(HttpStatusException/JwtAuthException/Exception) 및 UnkownMessageLogUtils 연동
- ApiAuthFilter: eaiSvcCd 강제 덮어쓰기 로직 주석처리 (STDMessage 조회값 우선 사용)
- MessageUtil: ERROR_MESSAGE_DEFAULT_FORMAT을 표준 OAuth2 에러 형식으로 변경

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 00:01:38 +09:00
curry772 ffb1c69855 feature: circuitBreaker 타입 처리 및 RESTProcess 개선 2026-04-03 17:40:10 +09:00
curry772 1f24dc24b5 Typed 서킷브레이커 추가 2026-03-30 15:57:26 +09:00
curry772 16386d20ff Block IP 필터 추가 2026-03-30 15:57:04 +09:00
curry772 e0b3611a0a api key, token 추출 parameter 방식 추가 2026-03-26 13:57:27 +09:00
curry772 2b061bfab6 http extra 로그 중복 오류 처리 retry 시 logseq+1 2026-03-26 13:56:31 +09:00
curry772 7c45e4225e Retry 기능 추가 2026-03-26 10:24:37 +09:00
curry772 31817b7ba2 reload 시 STDMsgInfoAddOnVO NullPointerException 수정 2026-03-18 14:54:07 +09:00
curry772 7aa230f156 AlarmStateManager @Component 주석 처리
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 10:24:14 +09:00