Compare commits
72 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 17871ee380 | |||
| e557cac258 | |||
| eff625288b | |||
| 99e1489569 | |||
| d4b5de95c0 | |||
| cd97c680a3 | |||
| 0f48e4be89 | |||
| 03ce94a0c4 | |||
| 1a8531e064 | |||
| 24103d47f9 | |||
| f7531412be | |||
| ddca2a8ea4 | |||
| 094336ebf1 | |||
| a310b671e2 | |||
| d9373b00f0 | |||
| 09bc3a65f5 | |||
| 1d81681e70 | |||
| d4bafa706c | |||
| 60f9f89d90 | |||
| 8ecfaf4945 | |||
| fa736a36ab | |||
| b7869ad6e6 | |||
| 982187298c | |||
| 8118dba74d | |||
| 97489d0361 | |||
| 924c00968c | |||
| 53c3b0ee7e | |||
| b2787882bf | |||
| aafa7ac351 | |||
| b7477e10a1 | |||
| 11f1dae1f3 | |||
| 59c379b22c | |||
| d275aa12c4 | |||
| c732f1e1b2 | |||
| 9e32502ee3 | |||
| 2d0ff2bf84 | |||
| 21940a3e18 | |||
| 2e517a1e08 | |||
| 10c5e51162 | |||
| 69e5126de6 | |||
| d044ebd157 | |||
| af40f0ba61 | |||
| d6b3a44d61 | |||
| e57f2fe72f | |||
| cecf6260a6 | |||
| 52707998d4 | |||
| 28017fd83c | |||
| e55b7a6bf2 | |||
| 1b6fed7701 | |||
| 033faa6714 | |||
| 758b3ebd7d | |||
| f07123904a | |||
| 2bc2a3d6e3 | |||
| b58893d098 | |||
| 80b072983f | |||
| a456ed9bb0 | |||
| 33c64972f8 | |||
| cff0199d2d | |||
| 2e920eec96 | |||
| 65a262849e | |||
| 7056306718 | |||
| 05e0599b26 | |||
| c223fa3124 | |||
| 78b1edff5a | |||
| b41a81bda3 | |||
| 1ea2c89776 | |||
| dfb37c18b9 | |||
| 5f5b23026f | |||
| 5c61fc3f24 | |||
| a7aa5bc98c | |||
| bf63701e68 | |||
| f26aae296a |
Binary file not shown.
@@ -113,3 +113,4 @@ diff
|
|||||||
*gf63*
|
*gf63*
|
||||||
*obsidian*
|
*obsidian*
|
||||||
design-backup
|
design-backup
|
||||||
|
/.envrc
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="PortalApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
|
||||||
|
<option name="ACTIVE_PROFILES" value="local_gf63" />
|
||||||
|
<option name="FRAME_DEACTIVATION_UPDATE_POLICY" value="UpdateClassesAndResources" />
|
||||||
|
<module name="eapim-portal.main" />
|
||||||
|
<option name="SPRING_BOOT_MAIN_CLASS" value="com.eactive.apim.portal.PortalApplication" />
|
||||||
|
<option name="VM_PARAMETERS" value="-Ddamo-manager.enabled=true -Dlogging.config=classpath:logback-local_gf63.xml" />
|
||||||
|
<method v="2">
|
||||||
|
<option name="Make" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="eapim-portal [clean compileJava]" type="GradleRunConfiguration" factoryName="Gradle" nameIsGenerated="true">
|
||||||
|
<ExternalSystemSettings>
|
||||||
|
<option name="executionName" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="externalSystemIdString" value="GRADLE" />
|
||||||
|
<option name="scriptParameters" value="--no-build-cache -x test" />
|
||||||
|
<option name="taskDescriptions">
|
||||||
|
<list />
|
||||||
|
</option>
|
||||||
|
<option name="taskNames">
|
||||||
|
<list>
|
||||||
|
<option value="clean" />
|
||||||
|
<option value="compileJava" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
<option name="vmOptions" />
|
||||||
|
</ExternalSystemSettings>
|
||||||
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<ExternalSystemDebugDisabled>false</ExternalSystemDebugDisabled>
|
||||||
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
|
<RunAsTest>false</RunAsTest>
|
||||||
|
<GradleProfilingDisabled>false</GradleProfilingDisabled>
|
||||||
|
<GradleCoverageDisabled>false</GradleCoverageDisabled>
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="eapim-admin" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local" APPLICATION_SERVER_NAME="Tomcat 9.0.122" ALTERNATIVE_JRE_ENABLED="true" ALTERNATIVE_JRE_PATH="17">
|
||||||
|
<option name="OPEN_IN_BROWSER" value="false" />
|
||||||
|
<option name="COMMON_VM_ARGUMENTS" value="-Deai.datasource.type=DEV -Dinst.Name=emsSvr-RinjaeGF63 -Deai.tableowner=EMSAPP -Deai.systemmode=D -Dfile.encoding=utf-8 -Dlogin.mode=db -DLOGBACK_LOG_LEVEL=DEBUG -Dlogback.configurationFile=classpath:logback-rinjae_gf63_linux.xml -Dhibernate.dialect=org.hibernate.dialect.Oracle12cDialect -Dorg.jboss.logging.provider=slf4j -Ddamo-manager.enabled=true -Xms512m -Xmx2048m" />
|
||||||
|
<option name="UPDATE_ON_FRAME_DEACTIVATION" value="true" />
|
||||||
|
<deployment>
|
||||||
|
<artifact name="Gradle : com.eactive : eapim-admin.war (exploded)">
|
||||||
|
<settings>
|
||||||
|
<option name="CONTEXT_PATH" value="/monitoring" />
|
||||||
|
</settings>
|
||||||
|
</artifact>
|
||||||
|
</deployment>
|
||||||
|
<server-settings>
|
||||||
|
<option name="BASE_DIRECTORY_NAME" value="45eaed49-b6b5-44cd-89e9-0aa5aa2f6574" />
|
||||||
|
<option name="HTTP_PORT" value="39120" />
|
||||||
|
<option name="JNDI_PORT" value="39125" />
|
||||||
|
<option name="PRESERVE_SESSIONS" value="true" />
|
||||||
|
</server-settings>
|
||||||
|
<predefined_log_file enabled="true" id="Tomcat" />
|
||||||
|
<predefined_log_file enabled="true" id="Tomcat Catalina" />
|
||||||
|
<predefined_log_file id="Tomcat Manager" />
|
||||||
|
<predefined_log_file id="Tomcat Host Manager" />
|
||||||
|
<predefined_log_file id="Tomcat Localhost Access" />
|
||||||
|
<RunnerSettings RunnerId="Debug">
|
||||||
|
<option name="DEBUG_PORT" value="41307" />
|
||||||
|
</RunnerSettings>
|
||||||
|
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Cover">
|
||||||
|
<option name="USE_ENV_VARIABLES" value="true" />
|
||||||
|
<STARTUP>
|
||||||
|
<option name="USE_DEFAULT" value="true" />
|
||||||
|
<option name="SCRIPT" value="" />
|
||||||
|
<option name="VM_PARAMETERS" value="" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
</STARTUP>
|
||||||
|
<SHUTDOWN>
|
||||||
|
<option name="USE_DEFAULT" value="true" />
|
||||||
|
<option name="SCRIPT" value="" />
|
||||||
|
<option name="VM_PARAMETERS" value="" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
</SHUTDOWN>
|
||||||
|
</ConfigurationWrapper>
|
||||||
|
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Debug">
|
||||||
|
<option name="USE_ENV_VARIABLES" value="true" />
|
||||||
|
<STARTUP>
|
||||||
|
<option name="USE_DEFAULT" value="true" />
|
||||||
|
<option name="SCRIPT" value="" />
|
||||||
|
<option name="VM_PARAMETERS" value="" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
</STARTUP>
|
||||||
|
<SHUTDOWN>
|
||||||
|
<option name="USE_DEFAULT" value="true" />
|
||||||
|
<option name="SCRIPT" value="" />
|
||||||
|
<option name="VM_PARAMETERS" value="" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
</SHUTDOWN>
|
||||||
|
</ConfigurationWrapper>
|
||||||
|
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Profile">
|
||||||
|
<option name="USE_ENV_VARIABLES" value="true" />
|
||||||
|
<STARTUP>
|
||||||
|
<option name="USE_DEFAULT" value="true" />
|
||||||
|
<option name="SCRIPT" value="" />
|
||||||
|
<option name="VM_PARAMETERS" value="" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
</STARTUP>
|
||||||
|
<SHUTDOWN>
|
||||||
|
<option name="USE_DEFAULT" value="true" />
|
||||||
|
<option name="SCRIPT" value="" />
|
||||||
|
<option name="VM_PARAMETERS" value="" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
</SHUTDOWN>
|
||||||
|
</ConfigurationWrapper>
|
||||||
|
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Run">
|
||||||
|
<option name="USE_ENV_VARIABLES" value="true" />
|
||||||
|
<STARTUP>
|
||||||
|
<option name="USE_DEFAULT" value="true" />
|
||||||
|
<option name="SCRIPT" value="" />
|
||||||
|
<option name="VM_PARAMETERS" value="" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
</STARTUP>
|
||||||
|
<SHUTDOWN>
|
||||||
|
<option name="USE_DEFAULT" value="true" />
|
||||||
|
<option name="SCRIPT" value="" />
|
||||||
|
<option name="VM_PARAMETERS" value="" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
</SHUTDOWN>
|
||||||
|
</ConfigurationWrapper>
|
||||||
|
<method v="2">
|
||||||
|
<option name="Make" enabled="true" />
|
||||||
|
<option name="BuildArtifacts" enabled="true">
|
||||||
|
<artifact name="Gradle : com.eactive : eapim-admin.war (exploded)" />
|
||||||
|
</option>
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## 프로젝트 개요
|
## 프로젝트 개요
|
||||||
|
|
||||||
**EAPIM Portal**은 광주은행을 위한 엔터프라이즈 API 포털 관리 시스템입니다. API 서비스 관리, 사용자 등록, API 키 발급, 문서화, 테스트 기능을 제공하는 웹 기반 플랫폼입니다.
|
**EAPIM Portal**은 제주은행을 위한 엔터프라이즈 API 포털 관리 시스템입니다. API 서비스 관리, 사용자 등록, API 키 발급, 문서화, 테스트 기능을 제공하는 웹 기반 플랫폼입니다.
|
||||||
|
|
||||||
**기술 스택:**
|
**기술 스택:**
|
||||||
- Spring Boot 2.7.18 with Spring MVC and Thymeleaf
|
- Spring Boot 2.7.18 with Spring MVC and Thymeleaf
|
||||||
@@ -25,50 +25,59 @@
|
|||||||
## Git 브랜치 전략
|
## Git 브랜치 전략
|
||||||
|
|
||||||
**저장소 정보:**
|
**저장소 정보:**
|
||||||
- 기본 저장소: `ssh://git@192.168.240.178:18081/eapim/eapim-portal.git`
|
- origin: `ssh://git@172.30.1.50:2222/djb-eapim/eapim-portal.git` (Gitea, 사내망)
|
||||||
- 대체 저장소: `https://git.eactive.synology.me:8090/kjb-eapim/eapim-portal.git`
|
- 이 저장소가 유일한 remote다. Jenkins 파이프라인도 같은 주소를 본다.
|
||||||
|
|
||||||
**브랜치:**
|
**브랜치:**
|
||||||
- **jenkins_with_weblogic**: Jenkins 빌드와 WebLogic 테스트를 위한 브랜치 (기본 개발 브랜치)
|
- **master**: 기본 개발 브랜치이자 배포 기준 브랜치
|
||||||
- Jenkins CI/CD 파이프라인 설정 포함
|
- 일상적인 개발 작업(기능 개발, 버그 수정)을 여기서 직접 수행한다
|
||||||
- WebLogic 배포 및 테스트 환경 설정
|
- Jenkins 4개 파이프라인(`Jenkinsfile.*`)이 모두 `origin/master` 를 체크아웃한다
|
||||||
- 일상적인 개발 작업은 이 브랜치에서 수행
|
- `Jenkinsfile.security` 는 pollSCM 으로 master 변경을 감지해 자동 실행된다
|
||||||
- 기능 개발, 버그 수정, 테스트 등 모든 개발 활동의 기본 브랜치
|
|
||||||
|
|
||||||
- **master**: 완벽히 동작하는 검증된 코드 저장소 (안정 브랜치)
|
- **feats/\***, **design\***, **develop**: 과거 작업 잔여 브랜치
|
||||||
- 프로덕션 배포 가능한 안정적인 코드만 포함
|
- 현재 활성 개발에 사용하지 않는다. 참고용으로만 남아 있다
|
||||||
- jenkins_with_weblogic 브랜치에서 충분히 테스트된 코드만 병합
|
|
||||||
- 직접 커밋 금지, Pull Request를 통한 병합만 허용
|
|
||||||
|
|
||||||
**브랜치 사용 가이드:**
|
> Jenkins/WebLogic 배포 설정은 master 의 `Jenkinsfile.deploy` 에 있다.
|
||||||
|
|
||||||
|
**작업 흐름:**
|
||||||
```bash
|
```bash
|
||||||
# 개발 시작 시 jenkins_with_weblogic 브랜치에서 작업
|
# master 에서 바로 작업
|
||||||
git checkout jenkins_with_weblogic
|
git checkout master
|
||||||
|
git pull origin master
|
||||||
|
|
||||||
# 기능 개발 후 커밋
|
# 커밋 후 푸시 → Jenkins security 파이프라인이 자동 트리거됨
|
||||||
git add .
|
git add .
|
||||||
git commit -m "기능 설명"
|
git commit -m "기능 설명"
|
||||||
|
git push origin master
|
||||||
# jenkins_with_weblogic 브랜치에 푸시
|
|
||||||
git push origin jenkins_with_weblogic
|
|
||||||
|
|
||||||
# 충분한 테스트 완료 후 master로 병합 (Pull Request 사용)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 빌드 명령어
|
## 빌드 명령어
|
||||||
|
|
||||||
### 애플리케이션 실행
|
### 애플리케이션 실행
|
||||||
- gradlew 사용 금지 - offline gradle 단독 실행
|
- Linux 개발 환경에서는 `gradlew` 대신 설치된 `gradle`(8.7)을 직접 쓴다. Jenkins 노드도 `/apps/opts/gradle-8.7` 의 `gradle` 을 쓴다.
|
||||||
- JDK/Gradle 환경 변수는 저장소 루트의 `.envrc`(direnv)로 자동 설정됨 (JAVA_HOME → Zulu JDK 8, GRADLE_USER_HOME → 격리 디렉터리)
|
- Windows/Eclipse 환경 기동 절차는 `BOOTRUN_SETUP_GUIDE.md` 참고 (거기서는 `gradlew.bat bootRun` 사용).
|
||||||
|
- JAVA_HOME(JDK 8)/GRADLE_HOME 은 **워크스페이스 루트(`djb-workspace/.envrc`)의 direnv** 로 설정한다.
|
||||||
|
저장소 안에는 `.envrc` 를 두지 않는다(`.gitignore` 의 `/.envrc`, 머신별 절대경로). 작성법은 `djb-docs/개발환경-준비-사항.md` §3.
|
||||||
|
- 의존성은 사내 Nexus(`https://nexus.eactive.synology.me:8090/repository/maven-public/`, `build.gradle` 의 유일한 저장소)에서 받는다.
|
||||||
|
`--offline` 은 `~/.gradle/caches` 가 채워진 뒤에만 동작한다.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# dev 프로파일로 실행 (기본값)
|
# bootRun 기본 프로파일은 build.gradle 의 bootProfile 기본값(local_rinjaemac).
|
||||||
|
# direnv 의 ORG_GRADLE_PROJECT_bootProfile 로 머신별 기본값을 덮어쓴다.
|
||||||
gradle bootRun
|
gradle bootRun
|
||||||
|
|
||||||
# 특정 프로파일로 실행
|
# 다른 프로파일로 기동 (--args 가 아니라 -PbootProfile)
|
||||||
gradle bootRun --args='--spring.profiles.active=stage'
|
gradle bootRun -PbootProfile=local_gf63
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> **로컬 기동(bootRun)은 local 전용 프로파일(`local_*`)로만 한다.** dev/stage/prod 는 서버(WAS) 배포용이라
|
||||||
|
> bootRun 으로 뜨지 않는 것이 **의도된 동작**이다 — JNDI 전용이고 로그 경로도 서버 경로(`/logs/prod/eapim`)다.
|
||||||
|
> dev 를 로컬에서 띄우려고 dev yml 에 JDBC 정보나 로컬 경로를 넣지 않는다.
|
||||||
|
|
||||||
|
> `bootRun` 의 프로파일은 `-PbootProfile` 로 넘긴다. `-Pprofile` 은 `ext.profile='local'`
|
||||||
|
> 이 이미 점유하고 있어 무시된다(`build.gradle` 의 주석 참고).
|
||||||
|
> Jenkins 빌드에서 쓰는 `-Pprofile=weblogic` 은 스프링 프로파일이 아니라 빌드용 플래그다.
|
||||||
|
|
||||||
### 빌드
|
### 빌드
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -82,6 +91,9 @@ gradle war
|
|||||||
|
|
||||||
# 클린 후 빌드
|
# 클린 후 빌드
|
||||||
gradle clean build
|
gradle clean build
|
||||||
|
|
||||||
|
# SBOM(xlsx) 생성 - Jenkins 빌드 파이프라인에서 사용
|
||||||
|
gradle sbomXlsx
|
||||||
```
|
```
|
||||||
|
|
||||||
### 테스트
|
### 테스트
|
||||||
@@ -90,7 +102,7 @@ gradle clean build
|
|||||||
# 모든 테스트 실행
|
# 모든 테스트 실행
|
||||||
gradle test
|
gradle test
|
||||||
|
|
||||||
# 커버리지와 함께 테스트 실행
|
# 로그 상세 출력
|
||||||
gradle test --info
|
gradle test --info
|
||||||
|
|
||||||
# 특정 테스트 클래스 실행
|
# 특정 테스트 클래스 실행
|
||||||
@@ -100,24 +112,44 @@ gradle test --tests "com.eactive.apim.portal.apps.user.AccountControllerTest"
|
|||||||
gradle test --tests "*Controller*"
|
gradle test --tests "*Controller*"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> **커버리지**: `test` 가 `finalizedBy jacocoTestReport` 로 `build/reports/jacoco/test/jacocoTestReport.xml` 을 만들고
|
||||||
|
> `sonar-project.properties` 의 `sonar.coverage.jacoco.xmlReportPaths` 가 이를 읽는다.
|
||||||
|
> `jacocoTestReport` 에서 클래스를 제외하지 말 것 — 리포트에서 빠진 클래스는 Sonar 의 Zero Coverage Sensor 가
|
||||||
|
> 0% 로 채운다. 커버리지 집계 제외는 `sonar.coverage.exclusions` 로 한다.
|
||||||
|
|
||||||
|
### CSS/SASS 빌드
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run sass:build # main.css (expanded)
|
||||||
|
npm run build # main.css + main.min.css
|
||||||
|
npm run sass:watch # 변경 감시
|
||||||
|
./sass-build.sh # sass CLI 직접 호출 (npm 없이)
|
||||||
|
```
|
||||||
|
|
||||||
### 개발
|
### 개발
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 현재 프로파일 확인
|
# 현재 프로파일 확인 (-Pprofile 로 넘긴 값)
|
||||||
gradle printProfile
|
gradle printProfile
|
||||||
|
|
||||||
# 소스 세트 설정 확인
|
# 소스 세트 설정 확인
|
||||||
gradle printSourceSets
|
gradle printSourceSets
|
||||||
|
```
|
||||||
|
|
||||||
# Docker 이미지 빌드
|
### Docker
|
||||||
./build_docker.sh
|
|
||||||
|
`build_docker.sh` 는 **없다**. `Dockerfile` 만 있으므로 직접 빌드한다.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gradle bootWar
|
||||||
|
docker build -t eapim-portal:latest .
|
||||||
```
|
```
|
||||||
|
|
||||||
## 아키텍처
|
## 아키텍처
|
||||||
|
|
||||||
### 멀티 모듈 구조
|
### 멀티 모듈 구조
|
||||||
|
|
||||||
이 프로젝트는 Gradle composite build를 통해 3개의 외부 모듈에 의존합니다:
|
이 프로젝트는 `settings.gradle` 의 멀티 프로젝트 구성으로 2개의 형제 디렉터리 모듈에 의존합니다:
|
||||||
|
|
||||||
1. **elink-online-core-jpa** (`../eapim-online/elink-online-core-jpa`)
|
1. **elink-online-core-jpa** (`../eapim-online/elink-online-core-jpa`)
|
||||||
- Gateway 데이터 모델 및 JPA 엔티티
|
- Gateway 데이터 모델 및 JPA 엔티티
|
||||||
@@ -129,37 +161,49 @@ gradle printSourceSets
|
|||||||
- 기본 리포지토리 구현, QueryDSL 지원
|
- 기본 리포지토리 구현, QueryDSL 지원
|
||||||
- 공통 예외 핸들러 및 보안 유틸리티
|
- 공통 예외 핸들러 및 보안 유틸리티
|
||||||
|
|
||||||
3. **kjb-safedb** (`../kjb-safedb`)
|
두 모듈은 Jenkins 파이프라인의 `Checkout dependencies` 스테이지가 같은 Gitea 서버에서
|
||||||
- 광주은행 SafeDB 암호화 라이브러리
|
자동으로 clone/reset 한다. 로컬에서도 `../eapim-online/elink-online-core-jpa` 와
|
||||||
- 데이터베이스 레벨 민감 데이터 암호화
|
`../elink-portal-common` 이 없으면 컴파일 자체가 되지 않는다.
|
||||||
- 암호화 컬럼(사용자 비밀번호, API 키 등)에 필수
|
|
||||||
|
|
||||||
### 패키지 구조
|
### 패키지 구조
|
||||||
|
|
||||||
코드는 기술 계층이 아닌 **기능 모듈**(수직 분할) 방식으로 구성됩니다:
|
코드는 기술 계층이 아닌 **기능 모듈**(수직 분할) 방식으로 구성됩니다:
|
||||||
|
|
||||||
```
|
```
|
||||||
com.eactive.apim.portal/
|
com.eactive.apim/
|
||||||
├── apps/ # 기능 모듈
|
├── portal/
|
||||||
│ ├── agreements/ # API 약관
|
│ ├── PortalApplication.java
|
||||||
│ ├── apis/ # API 카탈로그 & 문서
|
│ ├── apps/ # 기능 모듈
|
||||||
│ ├── apiservice/ # API 서비스 그룹핑
|
│ │ ├── HealthCheckController.java
|
||||||
│ ├── app/ # API 키 관리
|
│ │ ├── ReadinessController.java
|
||||||
│ ├── approval/ # 승인 워크플로우
|
│ │ ├── agreements/ # API 약관
|
||||||
│ ├── auth/ # 인증
|
│ │ ├── apis/ # API 카탈로그 & 문서
|
||||||
│ ├── community/ # FAQ, 공지사항, Q&A, 제휴문의
|
│ │ ├── apiservice/ # API 서비스 그룹핑
|
||||||
│ ├── dashboard/ # 통계 & 분석
|
│ │ ├── app/ # API 키 관리
|
||||||
│ ├── file/ # 파일 업로드/다운로드
|
│ │ ├── approval/ # 승인 워크플로우
|
||||||
│ ├── login/ # 로그인/로그아웃
|
│ │ ├── auth/ # 인증
|
||||||
│ ├── proxy/ # API 테스트용 Forward Proxy
|
│ │ ├── community/ # FAQ, 공지사항, Q&A, 제휴문의
|
||||||
│ ├── sample/ # 샘플 코드 생성
|
│ │ ├── dashboard/ # 대시보드
|
||||||
│ └── user/ # 사용자 관리
|
│ │ ├── file/ # 파일 업로드/다운로드
|
||||||
├── common/ # 공통 관심사
|
│ │ ├── login/ # 로그인/로그아웃
|
||||||
├── config/ # Spring 설정
|
│ │ ├── main/ # 메인 화면
|
||||||
└── gateway/ # Gateway DB 직접 접근
|
│ │ ├── sample/ # 샘플 코드 생성
|
||||||
└── data/ # Gateway 리포지토리
|
│ │ ├── session/ # 세션 관리 (filter/entity/repository 포함)
|
||||||
|
│ │ ├── statistics/ # API 통계
|
||||||
|
│ │ └── user/ # 사용자 관리
|
||||||
|
│ ├── common/ # 공통 관심사
|
||||||
|
│ ├── config/ # Spring 설정
|
||||||
|
│ ├── custom/ # 사이트별 커스터마이징 설정
|
||||||
|
│ ├── djb/ # 은행 특화 기능
|
||||||
|
│ │ ├── apistatus/ community/ footer/ guide/ menu/ notitest/
|
||||||
|
│ │ ├── swing/ testbed/ testcleanup/ webhook/
|
||||||
|
│ ├── spring/ # DatabaseSessionVerifier 등
|
||||||
|
│ └── tools/ # HibernateSqlGenerator, JpaErrorLoggingAspect
|
||||||
|
└── gateway/ # Gateway DB 직접 접근 (portal 의 하위가 아님)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> `apps/proxy/` 패키지는 **더 이상 없다**. 과거 문서의 Forward Proxy 모듈 설명은 무효다.
|
||||||
|
|
||||||
각 기능 모듈은 일반적으로 다음을 포함합니다:
|
각 기능 모듈은 일반적으로 다음을 포함합니다:
|
||||||
- `controller/` - Spring MVC 컨트롤러 (@Controller)
|
- `controller/` - Spring MVC 컨트롤러 (@Controller)
|
||||||
- `service/` - 비즈니스 로직 (@Service, @Transactional)
|
- `service/` - 비즈니스 로직 (@Service, @Transactional)
|
||||||
@@ -183,6 +227,13 @@ com.eactive.apim.portal/
|
|||||||
- Entities: `com.eactive.eai.data.entity.onl.*`
|
- Entities: `com.eactive.eai.data.entity.onl.*`
|
||||||
- 목적: API 명세, 서비스, 메시지
|
- 목적: API 명세, 서비스, 메시지
|
||||||
|
|
||||||
|
저장소의 프로파일(dev/stage/prod)은 **모두 JNDI 로 연결한다**. 직접 JDBC 는 개인 로컬 프로파일
|
||||||
|
(`application-local_*.yml`, 커밋 안 함)에서만 쓴다 — `PortalDatasourceConfiguration` 은 `jndi-name` 이 비었거나
|
||||||
|
lookup 이 실패하면 `jdbc-url` 로 직접 접속하고, 둘 다 없으면 `IllegalArgumentException` 으로 기동을 멈춘다.
|
||||||
|
|
||||||
|
- 개발 DB: `jdbc:oracle:thin:@//172.30.1.50:1598/DAPM` (djb-vm Podman Oracle), 계정 `EMSAPP` / `AGWAPP`
|
||||||
|
- **DB 비밀번호는 저장소에 커밋하지 않는다** (개인 로컬 프로파일은 gitignore 대상이어야 한다)
|
||||||
|
|
||||||
설정: `config/PortalDatasourceConfiguration.java`
|
설정: `config/PortalDatasourceConfiguration.java`
|
||||||
- 각 데이터베이스별 별도 EntityManager
|
- 각 데이터베이스별 별도 EntityManager
|
||||||
- **JTA/XA 미사용**. EntityManagerFactory 별 로컬 트랜잭션 (`config/PortalConfigTransaction.java`)
|
- **JTA/XA 미사용**. EntityManagerFactory 별 로컬 트랜잭션 (`config/PortalConfigTransaction.java`)
|
||||||
@@ -193,18 +244,43 @@ com.eactive.apim.portal/
|
|||||||
|
|
||||||
환경별 설정 파일: `src/main/resources/application-{profile}.yml`
|
환경별 설정 파일: `src/main/resources/application-{profile}.yml`
|
||||||
|
|
||||||
- **dev**: 개발 환경 (Oracle at 192.168.240.177:1599, DevTools 활성화, SQL 로깅)
|
프로파일은 용도에 따라 두 종류로 나뉜다.
|
||||||
- **stage**: 스테이징 환경 (JNDI 데이터소스, proxy to inter-dapiwas01)
|
|
||||||
- **prod**: 운영 환경 (JNDI 데이터소스, proxy to inter-apiwas00, 캐싱 활성화)
|
|
||||||
- **gf63**: 개인 개발 환경
|
|
||||||
- **kjb_rinjae**: 개인 개발 환경
|
|
||||||
|
|
||||||
주요 설정:
|
**서버 배포용** — 저장소에 커밋된 3개. 모두 JNDI 전용이며 WAS(WebLogic)에 배포해서만 동작한다.
|
||||||
- 세션 타임아웃: 15분
|
로컬 bootRun 대상이 아니다.
|
||||||
- 파일 업로드 최대: 8MB
|
|
||||||
- 비밀번호 만료: 90일
|
- **dev**: 개발서버 (DevTools 활성화, SQL 로깅)
|
||||||
- 인증 토큰 TTL: 5분 (300초)
|
- **stage**: 스테이징 서버 (JNDI 데이터소스, proxy to inter-dapiwas01)
|
||||||
- 사용자 승인 필수: true
|
- **prod**: 운영 서버 (JNDI 데이터소스, proxy to inter-apiwas00, 캐싱 활성화)
|
||||||
|
|
||||||
|
**로컬 전용** (`local_*`) — bootRun/IDE 기동용. 직접 JDBC 로 개발 DB 에 붙고, 로그도 로컬 경로에 남긴다.
|
||||||
|
|
||||||
|
- **샘플 (git 관리)**: `application-local_example.yml` + `logback-local_example.xml`.
|
||||||
|
비밀번호는 `CHANGE_ME`, 로그는 `${user.home}/eapim-logs/eapim-portal`. **실제 비밀번호를 넣지 않는다.**
|
||||||
|
샘플 구조(키·로컬용 설정)를 바꾸면 개인 프로파일에도 같이 반영하도록 안내한다.
|
||||||
|
- **개인 프로파일 (git 제외)**: 샘플을 `application-local_<이름>.yml` / `logback-local_<이름>.xml` 로 복사해
|
||||||
|
`on-profile`, `logging.config`, `password` 만 바꿔 쓴다. 현재 있는 개인 프로파일:
|
||||||
|
|
||||||
|
| 프로파일 | 파일 | 머신 |
|
||||||
|
|---|---|---|
|
||||||
|
| `local_gf63` | `application-local_gf63.yml`, `logback-local_gf63.xml` | Linux (GF63) |
|
||||||
|
| `local_rinjaemac` | `application-local_rinjaemac.yml` | macOS |
|
||||||
|
|
||||||
|
- `.gitignore` 의 개인 패턴(`*gf63*`, `*rinjae*`)으로 무시된다. **패턴은 개인별**이라 새 개인 프로파일은
|
||||||
|
자동으로 무시되지 않는다 — `git check-ignore -v <파일>` 로 확인하고, 안 걸리면 `.gitignore` 에 추가한다.
|
||||||
|
- 파일명은 반드시 `application-local` / `logback-local` 로 시작해야 한다. `build.gradle` 의 `localOnlyResources`
|
||||||
|
(`**/application-local*.yml`, `**/logback-local*.xml`)가 WAR 산출물에서 제외한다 — 샘플도 WAR 에 실리지 않는다.
|
||||||
|
- 만드는 절차는 `djb-docs/개발환경-준비-사항.md` §5.2.
|
||||||
|
- 기본값 `local_rinjaemac` 은 다른 머신에는 없으므로 `-PbootProfile` 또는 direnv 로 자기 프로파일을 지정한다.
|
||||||
|
|
||||||
|
주요 설정 (`application.yml`):
|
||||||
|
- 세션 타임아웃: **10분** (`server.servlet.session.timeout: 10m`, WebLogic 은 `weblogic.xml` 의 `timeout-secs 600`)
|
||||||
|
- 세션 쿠키명: `JSESSIONID_PORTAL`
|
||||||
|
- 파일 업로드 최대: **10MB** (`portal.file.max-size`)
|
||||||
|
- 비밀번호 만료: 90일 (`portal.password-expiration-days`)
|
||||||
|
- 인증 토큰 TTL: 5분 (`portal.auth-ttl: 300`), 재발송 제한 30초
|
||||||
|
- 사용자 승인 필수: `portal.user-approval: true`
|
||||||
|
- 내부 사용자 판별 도메인: `portal.internal-user.email-domains`
|
||||||
|
|
||||||
## 주요 기능 및 비즈니스 로직
|
## 주요 기능 및 비즈니스 로직
|
||||||
|
|
||||||
@@ -237,12 +313,14 @@ API 키는 승인 워크플로우와 함께 관리됩니다:
|
|||||||
|
|
||||||
엔티티: `Approval`, `Approver`, `ApprovalStatus` (WAITING, APPROVED, REJECTED)
|
엔티티: `Approval`, `Approver`, `ApprovalStatus` (WAITING, APPROVED, REJECTED)
|
||||||
|
|
||||||
### API 테스트 (`apps/proxy/`, `apps/sample/`)
|
### API 테스트 (`apps/apis/`)
|
||||||
|
|
||||||
- Gateway 서버로의 Forward Proxy
|
- API 테스터: `apps/apis/filter/ApiTesterFilter.java`
|
||||||
- 요청/응답 로깅이 있는 API 테스터
|
- Testbed 스펙 제공: `apps/apis/controller/TestbedSpecController.java`
|
||||||
- 여러 언어의 샘플 코드 생성
|
- 샘플 코드 템플릿: `application.yml` 의 `sample-code-path: classpath:/templates/sample_code`
|
||||||
- API 문서를 위한 Swagger UI 통합
|
|
||||||
|
> `apps/sample/` 은 샘플 코드 생성기가 아니라 **Thymeleaf/Security 데모 컨트롤러**
|
||||||
|
> (`ThymeleafDemoController`, `SecurityThymeleafDemoController` 등) 모음이다.
|
||||||
|
|
||||||
### 감사 추적 (Hibernate Envers)
|
### 감사 추적 (Hibernate Envers)
|
||||||
|
|
||||||
@@ -321,16 +399,22 @@ public interface UserMapper {
|
|||||||
보안 설정: `config/PortalConfigSecurity.java`
|
보안 설정: `config/PortalConfigSecurity.java`
|
||||||
- 커스텀 인증 관리자: `PortalAuthenticationManager`
|
- 커스텀 인증 관리자: `PortalAuthenticationManager`
|
||||||
- `changeSessionId()`를 통한 세션 고정 공격 방어
|
- `changeSessionId()`를 통한 세션 고정 공격 방어
|
||||||
- 쿠키 기반 토큰을 사용한 CSRF 방어
|
- CSRF: **`HttpSessionCsrfTokenRepository`(세션 저장)**, 헤더명 `X-XSRF-TOKEN` 고정
|
||||||
- Lucy 필터를 통한 XSS 방어
|
— 쿠키 기반(`CookieCsrfTokenRepository`)이 아니다. 토큰 수명은 세션 타임아웃과 같다
|
||||||
|
- XSS: Naver Lucy `XssEscapeServletFilter`
|
||||||
|
- 비밀번호 전송암호화(RSA-OAEP + AES-GCM): `common/security/passwordcrypto/`
|
||||||
|
— 필터 순서상 MultipartFilter 이후, Lucy XSS 필터 이전에 복호화된다
|
||||||
|
|
||||||
역할 계층:
|
역할 계층 (정의: `src/main/resources/roles.yml`, 부팅 시 `PTL_ROLE` / `PTL_ROLE_AUTHORITY` 에 미러 적재):
|
||||||
```
|
```
|
||||||
ROLE_USER → [ROLE_INQUIRY, ROLE_ACCOUNT]
|
ROLE_USER (개인사용자) → [ROLE_INQUIRY, ROLE_ACCOUNT]
|
||||||
ROLE_CORP_USER → [ROLE_INQUIRY, ROLE_APP, ROLE_ACCOUNT]
|
|
||||||
ROLE_CORP_MANAGER → [ROLE_API_KEY_REQUEST, ROLE_INQUIRY, ROLE_APP,
|
ROLE_CORP_USER (법인사용자) → [ROLE_API_KEY_REQUEST, ROLE_API_KEY_REQUEST_VIEW,
|
||||||
ROLE_ACCOUNT, ROLE_CORP_API, ROLE_DASHBOARD,
|
ROLE_INQUIRY, ROLE_APP, ROLE_ACCOUNT]
|
||||||
ROLE_USER_MANAGER]
|
|
||||||
|
ROLE_CORP_MANAGER (법인관리자) → [ROLE_API_KEY_REQUEST, ROLE_API_KEY_REQUEST_VIEW,
|
||||||
|
ROLE_WEBHOOK, ROLE_INQUIRY, ROLE_APP, ROLE_ACCOUNT,
|
||||||
|
ROLE_CORP_API, ROLE_DASHBOARD, ROLE_USER_MANAGER]
|
||||||
```
|
```
|
||||||
|
|
||||||
### 데이터베이스 쿼리
|
### 데이터베이스 쿼리
|
||||||
@@ -377,15 +461,18 @@ return queryFactory.selectFrom(user)
|
|||||||
|
|
||||||
### 로깅
|
### 로깅
|
||||||
|
|
||||||
`application.yml`의 로깅 설정:
|
로깅은 `application.yml` 의 `logging.file.path` 가 아니라 **logback 설정으로 제어**한다.
|
||||||
```yaml
|
|
||||||
logging:
|
- 설정 파일: `src/main/resources/logback-spring.xml` (그 외 `logback-debug.xml`)
|
||||||
file:
|
- 로컬용 `logback-local_*.xml` 은 로컬 yml 의 `logging.config` 로 지정한다 (샘플 `logback-local_example.xml` 만 커밋, WAR 제외)
|
||||||
path: /Log/App/eapim/
|
- `logback-spring.xml` 은 콘솔 출력이 기본 OFF 다 (`-DCONSOLE_LOG_ENABLED=true` 로 켬)
|
||||||
level:
|
- 로그 디렉터리: `portal.logging.log-path` yml 프로퍼티 + 인스턴스명
|
||||||
com.eactive.apim.portal: DEBUG
|
```xml
|
||||||
org.hibernate.SQL: DEBUG (개발 환경만)
|
<springProperty scope="context" name="profileLogPath" source="portal.logging.log-path"/>
|
||||||
```
|
<property name="LOG_PATH" value="${profileLogPath}/${inst.Name:-devSvr00}"/>
|
||||||
|
```
|
||||||
|
- `application.yml` 기본값: `portal.logging.log-path: /logs/prod/eapim`
|
||||||
|
- 산출 파일: `${LOG_PATH}/portal.log`, `${LOG_PATH}/hibernate.log` 등 (`backup/` 에 일자 롤링)
|
||||||
|
|
||||||
Lombok의 `@Slf4j`와 함께 SLF4J 사용:
|
Lombok의 `@Slf4j`와 함께 SLF4J 사용:
|
||||||
```java
|
```java
|
||||||
@@ -434,13 +521,6 @@ class UserControllerTest extends BaseWebTest {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### SafeDB 테스트
|
|
||||||
|
|
||||||
테스트에서는 기본적으로 SafeDB 암호화가 비활성화됩니다. 필요한 경우:
|
|
||||||
```bash
|
|
||||||
gradle test -Dsafedb=/path/to/safedb
|
|
||||||
```
|
|
||||||
|
|
||||||
## 중요 사항
|
## 중요 사항
|
||||||
|
|
||||||
### 한글 지원
|
### 한글 지원
|
||||||
@@ -451,15 +531,6 @@ gradle test -Dsafedb=/path/to/safedb
|
|||||||
- 한글 메시지 프로퍼티 (`messages_ko.properties`)
|
- 한글 메시지 프로퍼티 (`messages_ko.properties`)
|
||||||
- 한글 사용자 가이드 (`개발자포탈.md`)
|
- 한글 사용자 가이드 (`개발자포탈.md`)
|
||||||
|
|
||||||
### Forward Proxy 설정
|
|
||||||
|
|
||||||
API 테스트는 Gateway로의 Forward Proxy 사용:
|
|
||||||
- Dev: `http://localhost:10000`
|
|
||||||
- Stage: `http://inter-dapiwas01:10000`
|
|
||||||
- Prod: `http://inter-apiwas00:10000`
|
|
||||||
|
|
||||||
설정: `apps/proxy/service/ProxyService.java`
|
|
||||||
|
|
||||||
### 비밀번호 정책
|
### 비밀번호 정책
|
||||||
|
|
||||||
`PortalUserValidator`에서 적용:
|
`PortalUserValidator`에서 적용:
|
||||||
@@ -472,29 +543,62 @@ API 테스트는 Gateway로의 Forward Proxy 사용:
|
|||||||
### 세션 관리
|
### 세션 관리
|
||||||
|
|
||||||
- 사용자당 단일 세션 강제
|
- 사용자당 단일 세션 강제
|
||||||
- 세션 타임아웃: 15분
|
- 세션 타임아웃: **10분** (쿠키명 `JSESSIONID_PORTAL`)
|
||||||
- 로그인 시 세션 고정 공격 방어
|
- 로그인 시 `changeSessionId()` 로 세션 고정 공격 방어
|
||||||
- Redis/Ehcache를 통한 세션 클러스터링 (스테이징/운영)
|
- 세션 상태는 DB 에 보관하며 `apps/session/` (filter/entity/repository) 과
|
||||||
|
`spring/DatabaseSessionVerifier.java` 가 담당한다. **Redis 는 쓰지 않는다.**
|
||||||
|
|
||||||
### 파일 업로드 제한
|
### 파일 업로드 제한
|
||||||
|
|
||||||
- 최대 파일 크기: 8MB
|
`application.yml` 의 `portal.file` 로 제어하고 `config/PortalProperties.java` 가 바인딩한다:
|
||||||
- `FileService`에서 허용 확장자 설정
|
|
||||||
- 파일 저장 위치: `/Log/App/eapim/files/`
|
```yaml
|
||||||
- 업로드 시 XSS 스캐닝
|
portal:
|
||||||
|
file:
|
||||||
|
max-size: 10MB
|
||||||
|
allowed-extensions: pdf,doc,docx,xls,xlsx,ppt,pptx,hwp,gif,jpg,jpeg,png
|
||||||
|
```
|
||||||
|
|
||||||
|
- 적용 지점: `config/MultipartConfig.java` (`setMaxUploadSize` / `setMaxUploadSizePerFile`)
|
||||||
|
- 초과 시 메시지: `common/exception/PortalGlobalExceptionHandler.java`
|
||||||
|
- `PortalProperties` 의 코드 기본값은 `8MB` 이지만 yml 이 `10MB` 로 덮어쓴다
|
||||||
|
- 다운로드는 `apps/file/controller/FileDownloadController.java` 하나뿐이다
|
||||||
|
|
||||||
## 배포
|
## 배포
|
||||||
|
|
||||||
### 애플리케이션 서버 지원
|
### 애플리케이션 서버 지원
|
||||||
|
|
||||||
WAR 파일 호환 서버:
|
WAR 파일 호환 서버:
|
||||||
- **JEUS** (`jeus-web-dd.xml` 필요)
|
- **WebLogic** (`src/main/resources/weblogic.xml`) — 현재 실제 배포 대상
|
||||||
- **WebLogic** (`weblogic.xml` 필요)
|
- **JEUS** (`src/main/resources/jeus-web-dd.xml`)
|
||||||
- **Tomcat** (Spring Boot 내장)
|
- **Tomcat** (Spring Boot 내장)
|
||||||
|
|
||||||
|
실제 배포는 `Jenkinsfile.deploy` 가 수행한다: `djb-vm` 노드에서 WAR 를 빌드해 stash 하고,
|
||||||
|
`weblogic` 라벨 노드에서 WebLogic 정지 → WAR 교체 → 기동 → readiness 확인 순으로 진행한다.
|
||||||
|
|
||||||
|
### Jenkins 파이프라인
|
||||||
|
|
||||||
|
저장소 루트에 4개의 Jenkinsfile 이 있고 모두 `origin/master` 를 대상으로 한다:
|
||||||
|
|
||||||
|
| 파일 | 용도 |
|
||||||
|
|---|---|
|
||||||
|
| `Jenkinsfile.security` | OWASP Dependency-Check(SCA) + SonarQube(SAST). pollSCM 자동 트리거 |
|
||||||
|
| `Jenkinsfile.sonar` | SonarQube 정적 분석 전용 |
|
||||||
|
| `Jenkinsfile.test-build` | 테스트 + WAR 빌드 + SBOM |
|
||||||
|
| `Jenkinsfile.deploy` | 빌드 후 WebLogic 배포 |
|
||||||
|
|
||||||
|
빌드는 JDK 8(`/apps/opts/jdk8`), SonarScanner/Dependency-Check 실행은 JDK 17
|
||||||
|
(`/apps/opts/jdk17`)로 분리되어 있다. 스캐너 설정은 `sonar-project.properties` 와
|
||||||
|
`ci/` 디렉터리(`sonar-classpath.gradle`, `dependency-check-classpath.gradle`,
|
||||||
|
`dependency-check-suppressions.xml`)에 있다.
|
||||||
|
|
||||||
|
알려진 CI 이슈:
|
||||||
|
- **Dependency-Check NVD 갱신 실패**: Jenkins 에 `nvd-api-key` credential 이 없다.
|
||||||
|
폐쇄망/키 부재 시에는 `UPDATE_NVD=false` 로 실행해 캐시 DB 로만 검사한다.
|
||||||
|
|
||||||
### JNDI 설정 필수
|
### JNDI 설정 필수
|
||||||
|
|
||||||
스테이징/운영 환경에서 JNDI 리소스 설정:
|
dev 를 포함한 모든 WAS 배포 환경에 JNDI 리소스가 있어야 한다 (로컬 bootRun 은 개인 로컬 프로파일의 직접 JDBC 로 대체):
|
||||||
- `jdbc/dsOBP_EMS` → Portal 데이터베이스
|
- `jdbc/dsOBP_EMS` → Portal 데이터베이스
|
||||||
- `jdbc/dsOBP_AGW` → Gateway 데이터베이스
|
- `jdbc/dsOBP_AGW` → Gateway 데이터베이스
|
||||||
|
|
||||||
@@ -511,8 +615,8 @@ JAVA_OPTS="-Xmx2g -Xms1g -Dspring.profiles.active=prod"
|
|||||||
# WAR 빌드
|
# WAR 빌드
|
||||||
gradle bootWar
|
gradle bootWar
|
||||||
|
|
||||||
# Docker 이미지 빌드
|
# Docker 이미지 빌드 (build_docker.sh 는 없다)
|
||||||
./build_docker.sh
|
docker build -t eapim-portal:latest .
|
||||||
|
|
||||||
# 컨테이너 실행
|
# 컨테이너 실행
|
||||||
docker run -p 30200:30200 \
|
docker run -p 30200:30200 \
|
||||||
@@ -526,13 +630,15 @@ docker run -p 30200:30200 \
|
|||||||
다음 항목에 영향을 주는 변경 시:
|
다음 항목에 영향을 주는 변경 시:
|
||||||
- **Gateway API 명세**: `elink-online-core-jpa` 모듈 확인
|
- **Gateway API 명세**: `elink-online-core-jpa` 모듈 확인
|
||||||
- **공통 유틸리티**: `elink-portal-common` 모듈 확인
|
- **공통 유틸리티**: `elink-portal-common` 모듈 확인
|
||||||
- **암호화**: `kjb-safedb` 모듈 확인
|
|
||||||
- **Admin 포털**: `../eapim-admin/` 관련 프로젝트
|
- **Admin 포털**: `../eapim-admin/` 관련 프로젝트
|
||||||
- **Online 포털**: `../eapim-online/` 관련 프로젝트
|
- **Online 포털**: `../eapim-online/` 관련 프로젝트
|
||||||
|
|
||||||
## 추가 자료
|
## 추가 자료
|
||||||
|
|
||||||
- 사용자 가이드 (한글): `개발자포탈.md`
|
- 사용자 가이드 (한글): `개발자포탈.md`
|
||||||
- 빌드 스크립트: `build-gf63.sh`, `deploy_portal.sh`, `deploy_portal2.sh`
|
- 로컬 기동 가이드 (Windows/Eclipse): `BOOTRUN_SETUP_GUIDE.md`
|
||||||
- Docker: `Dockerfile`, `build_docker.sh`
|
- 개발환경 준비, OHS 정적리소스 설정: `djb-docs/`
|
||||||
- SQL 스크립트: `../kjb-eapim-sql/`
|
- 메뉴 관리 개발 가이드: `readme-docs/메뉴-관리-개발-가이드.md`
|
||||||
|
- SASS/프론트 빌드: `package.json`, `sass-build.sh`, `tools/forge-entry.js`
|
||||||
|
- Docker: `Dockerfile`
|
||||||
|
- CI 설정: `Jenkinsfile.*`, `sonar-project.properties`, `ci/`
|
||||||
|
|||||||
@@ -0,0 +1,444 @@
|
|||||||
|
# DESIGN.md — EAPIM Portal 디자인 시스템
|
||||||
|
|
||||||
|
제주은행(DJBank) ERP뱅킹 API 개발자 포털의 디자인 토큰·컴포넌트 규약.
|
||||||
|
|
||||||
|
> **출처**: 이 문서는 Figma Design Guide 원본이 아니라 **현재 코드베이스(`src/main/resources/static/sass/`, `templates/`)에서 역추출**한 실사용 기준이다.
|
||||||
|
> Figma 가이드와 불일치하는 지점은 §9 "알려진 불일치"에 정리했다. 원본 대조가 필요하면 Figma 파일을 Figma로 열고 MCP 경유로 토큰을 추출해 이 문서를 갱신한다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. 소스 구조 / 빌드
|
||||||
|
|
||||||
|
```
|
||||||
|
src/main/resources/static/
|
||||||
|
├── sass/ ← 스타일 단일 소스 (여기만 수정)
|
||||||
|
│ ├── abstracts/ _variables · _mixins · _color-functions
|
||||||
|
│ ├── base/ _reset · _typography · _animations · _djb-font · _utilities
|
||||||
|
│ ├── layout/ _header · _footer · _grid · _container
|
||||||
|
│ ├── components/ 버튼·뱃지·카드·폼·테이블·모달·… (26개)
|
||||||
|
│ ├── pages/ 페이지별 스타일 (24개)
|
||||||
|
│ ├── themes/ _dark (현재 비어 있음)
|
||||||
|
│ ├── vendors/ _overrides
|
||||||
|
│ └── main.scss 단일 엔트리포인트
|
||||||
|
├── css/main.css ← 컴파일 산출물 (직접 수정 금지)
|
||||||
|
├── font/ shinhan · spoqa-hans · noto-sans
|
||||||
|
├── img/ logo · icon · favicon · 페이지 이미지
|
||||||
|
└── js/ common.js · djb/* · lib/* · 벤더
|
||||||
|
```
|
||||||
|
|
||||||
|
컴파일:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sass src/main/resources/static/sass/main.scss src/main/resources/static/css/main.css
|
||||||
|
```
|
||||||
|
|
||||||
|
**규칙**
|
||||||
|
- `css/main.css`는 산출물이다. **직접 수정 금지**, 반드시 SASS를 고치고 재컴파일한다.
|
||||||
|
- Dart Sass `@use` 기반. 새 파샬은 `main.scss`의 해당 섹션(base → layout → components → pages → themes → utilities → vendors)에 `@use`로 등록한다. **utilities는 항상 뒤쪽**(`!important` 유틸이 컴포넌트를 이겨야 함).
|
||||||
|
- 파샬 상단은 항상 다음 3줄로 시작한다:
|
||||||
|
```scss
|
||||||
|
@use '../abstracts/variables' as *;
|
||||||
|
@use '../abstracts/color-functions' as *;
|
||||||
|
@use '../abstracts/mixins' as *;
|
||||||
|
```
|
||||||
|
- `darken()` / `lighten()`은 전역 함수가 아니라 `abstracts/_color-functions.scss`의 `color.scale` 래퍼다(Dart Sass 3.0 호환). 새 파샬에서 쓰려면 위 `@use`가 반드시 있어야 한다.
|
||||||
|
- 빌드 트리(`build/resources/...`)를 서빙 중인 서버가 있을 수 있다. 수정 전 어느 트리를 서빙하는지 확인하고, 필요 시 `src` → `build` 동기화한다.
|
||||||
|
- 템플릿/CSS/JS는 서버 프로파일에 따라 기동 시점 고정될 수 있다 → 반영 안 되면 재시작.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. 컬러
|
||||||
|
|
||||||
|
정의: `sass/abstracts/_variables.scss`
|
||||||
|
|
||||||
|
### 브랜드 / 주색
|
||||||
|
|
||||||
|
| 토큰 | 값 | 용도 |
|
||||||
|
|---|---|---|
|
||||||
|
| `$primary-color` | `#0049B4` | `$primary-blue`와 동일 값(중복 정의) |
|
||||||
|
| `$primary-blue` | `#0049b4` | 주 브랜드 블루. 링크·주버튼·포커스링·활성상태 |
|
||||||
|
| `$secondary-blue` | `#c3dfea` | 연한 블루. hover 보조·링크 hover |
|
||||||
|
| `$main-bg` | `#EDF9FE` | 페이지 배경 톤 |
|
||||||
|
|
||||||
|
### 액센트
|
||||||
|
|
||||||
|
| 토큰 | 값 | 의미 |
|
||||||
|
|---|---|---|
|
||||||
|
| `$accent-cyan` | `#00D4FF` | 강조 |
|
||||||
|
| `$accent-yellow` | `#FFD93D` | 경고 / 진행중(processing) / popular |
|
||||||
|
| `$accent-orange` | `#FF6B6B` | **에러·삭제·필수표시**(실질적 danger 컬러) |
|
||||||
|
| `$accent-green` | `#6BCF7F` | 성공·완료·신규 |
|
||||||
|
| `$accent-purple` | `#A78BFA` | beta 뱃지 |
|
||||||
|
|
||||||
|
### 중립
|
||||||
|
|
||||||
|
| 토큰 | 값 | 용도 |
|
||||||
|
|---|---|---|
|
||||||
|
| `$text-dark` | `#1A1A2E` | 본문 기본 |
|
||||||
|
| `$text-gray` | `#64748B` | 보조 텍스트·테이블 td |
|
||||||
|
| `$text-light` | `#94A3B8` | placeholder·비활성 |
|
||||||
|
| `$white` | `#FFFFFF` | |
|
||||||
|
| `$gray-bg` | `#F8FAFC` | 연한 배경·disabled |
|
||||||
|
| `$light-bg` | `#EFF6FF` | 블루 틴트 배경·테이블 thead·뱃지 배경 |
|
||||||
|
| `$border-gray` | `#E2E8F0` | 기본 보더 |
|
||||||
|
| `$black` `#000000` / `$gray-800` `#1F2937` / `$gray-900` `#111827` | | |
|
||||||
|
|
||||||
|
### 그림자
|
||||||
|
|
||||||
|
```scss
|
||||||
|
$shadow-sm: 0 2px 4px rgba(0,0,0,.05);
|
||||||
|
$shadow-md: 0 4px 12px rgba(75,155,255,.10);
|
||||||
|
$shadow-lg: 0 8px 24px rgba(75,155,255,.15);
|
||||||
|
$shadow-xl: 0 16px 40px rgba(75,155,255,.20);
|
||||||
|
```
|
||||||
|
md 이상은 **블루 틴트 그림자**다. 중립 그림자가 필요하면 `$shadow-sm`을 쓴다.
|
||||||
|
|
||||||
|
### 상태색 관용구
|
||||||
|
|
||||||
|
투명도 배경 + 원색 텍스트 패턴이 표준이다.
|
||||||
|
|
||||||
|
```scss
|
||||||
|
background: rgba($accent-green, 0.1);
|
||||||
|
color: $accent-green;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. 타이포그래피
|
||||||
|
|
||||||
|
### 폰트 패밀리
|
||||||
|
|
||||||
|
| 토큰 | 스택 | 용도 |
|
||||||
|
|---|---|---|
|
||||||
|
| `$font-family-heading` | `OneShinhan` → Spoqa Han Sans Neo → SpoqaHanSans → Noto Sans KR → system | **제목 전용** |
|
||||||
|
| `$font-family-primary` | `Spoqa Han Sans Neo` → SpoqaHanSans → Noto Sans KR → system | 본문 |
|
||||||
|
| `$font-family-mono` | `Fira Code`, Courier New, monospace | 코드·키값 |
|
||||||
|
|
||||||
|
`@font-face` 선언: `sass/base/_djb-font.scss`
|
||||||
|
- OneShinhan: 300 / 400 / 500(=Medium 재사용) / 700, `.woff`
|
||||||
|
- Spoqa Han Sans Neo: 400 / 700, woff2 → woff → ttf
|
||||||
|
- Noto Sans KR: Variable 100–900, **한글 서브셋 woff2(~1.1MB)**. 원본 9.9MB TTF는 전송 abort 문제로 제거됨. 재생성 절차는 `docs/font-subset.md`.
|
||||||
|
- 전부 `font-display: swap` + `local()` 우선.
|
||||||
|
|
||||||
|
### 제목 규칙
|
||||||
|
|
||||||
|
`base/_typography.scss`가 `h1~h6`, `.h1~.h6`에 더해 **`-title`/`__title`로 끝나는 클래스 전체**에 OneShinhan Medium을 자동 적용한다.
|
||||||
|
|
||||||
|
```scss
|
||||||
|
[class$="-title"], [class*="-title "],
|
||||||
|
[class$="__title"], [class*="__title "] { font-family: $font-family-heading; font-weight: 500; }
|
||||||
|
```
|
||||||
|
→ 새 제목 요소는 `.xxx-title` / `.xxx__title` 네이밍만 지켜도 제목 서체가 붙는다.
|
||||||
|
|
||||||
|
### 스케일
|
||||||
|
|
||||||
|
| 토큰 | px | | 토큰 | px |
|
||||||
|
|---|---|---|---|---|
|
||||||
|
| `$font-size-xs` | 12 | | `$font-size-xl` | 24 |
|
||||||
|
| `$font-size-sm` | 14 | | `$font-size-2xl` | 32 |
|
||||||
|
| `$font-size-base` | 16 | | `$font-size-3xl` | 40 |
|
||||||
|
| `$font-size-md` | 18 | | `$font-size-4xl` | 48 |
|
||||||
|
| `$font-size-lg` | 20 | | `$font-size-5xl` | 56 |
|
||||||
|
|
||||||
|
헤딩 매핑(반응형 축소 포함):
|
||||||
|
|
||||||
|
| 태그 | 기본 | ≤768px | ≤480px |
|
||||||
|
|---|---|---|---|
|
||||||
|
| h1 | 5xl (56) | 3xl (40) | 2xl (32) |
|
||||||
|
| h2 | 4xl (48) | 2xl (32) | xl (24) |
|
||||||
|
| h3 | 3xl (40) | xl (24) | — |
|
||||||
|
| h4 | 2xl (32) | — | — |
|
||||||
|
| h5 | xl (24) | — | — |
|
||||||
|
| h6 | lg (20) | — | — |
|
||||||
|
|
||||||
|
### 굵기 / 행간
|
||||||
|
|
||||||
|
```
|
||||||
|
400 regular · 500 medium · 600 semibold · 700 bold · 800 extrabold
|
||||||
|
line-height: tight 1.2 · normal 1.6 · loose 1.8
|
||||||
|
```
|
||||||
|
|
||||||
|
### 텍스트 유틸
|
||||||
|
|
||||||
|
`.text-primary|secondary|dark|gray|light|white`, `.text-left|center|right`,
|
||||||
|
`.font-regular|medium|semibold|bold|extrabold`, `.text-xs|sm|base|lg|xl`,
|
||||||
|
`.lead`(20px/1.8/gray), `.caption`(14px/gray), `.code`(mono/gray-bg/6px radius)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. 스페이싱 · 반경 · 레이아웃
|
||||||
|
|
||||||
|
### 스페이싱 (4px 배수 기반, 후반부 비선형)
|
||||||
|
|
||||||
|
| 토큰 | px | | 토큰 | px |
|
||||||
|
|---|---|---|---|---|
|
||||||
|
| xs | 4 | | 2xl | 40 |
|
||||||
|
| sm | 8 | | 3xl | 48 |
|
||||||
|
| md | 16 | | 4xl | 64 |
|
||||||
|
| lg | 24 | | 5xl | 80 |
|
||||||
|
| xl | 32 | | 6xl | 100 |
|
||||||
|
|
||||||
|
### 보더 반경
|
||||||
|
|
||||||
|
| 토큰 | 값 | 용도 |
|
||||||
|
|---|---|---|
|
||||||
|
| sm | 6px | 코드·복사버튼·작은 뱃지 |
|
||||||
|
| md | 8px | 입력·셀렉트·기본 액션버튼 |
|
||||||
|
| lg | 12px | `.btn` 기본·테이블·큰 입력 |
|
||||||
|
| xl | 16px | 아이콘 박스 |
|
||||||
|
| 2xl | 20px | **카드 기본** |
|
||||||
|
| full | 50px | pill 뱃지 |
|
||||||
|
| circle | 50% | 아바타·아이콘버튼·FAB |
|
||||||
|
|
||||||
|
### 레이아웃
|
||||||
|
|
||||||
|
```scss
|
||||||
|
$container-max-width: 1280px;
|
||||||
|
$header-height: 80px;
|
||||||
|
```
|
||||||
|
|
||||||
|
`.container` max 1280 / padding 0 20px(≤768px는 16px)
|
||||||
|
변형: `.container-fluid`(100%), `.container-narrow`(960px), `.container-wide`(1440px)
|
||||||
|
|
||||||
|
`.section` 상하 100px(≤768px 64px) · `.section-sm` 48px · `.section-lg` 150px
|
||||||
|
|
||||||
|
### 브레이크포인트 & respond-to
|
||||||
|
|
||||||
|
```scss
|
||||||
|
$breakpoint-xs: 480px; $breakpoint-sm: 768px; $breakpoint-md: 1024px;
|
||||||
|
$breakpoint-lg: 1280px; $breakpoint-xl: 1440px;
|
||||||
|
```
|
||||||
|
|
||||||
|
`@include respond-to($key)`:
|
||||||
|
|
||||||
|
| key | 쿼리 |
|
||||||
|
|---|---|
|
||||||
|
| `xs` / `sm` / `md` | `max-width` 480 / 768 / 1024 |
|
||||||
|
| `tablet` | `max-width: 1024px` (= md) |
|
||||||
|
| `mobile` | `max-width: 1280px` |
|
||||||
|
| `lg` / `xl` | **`min-width`** 1280 / 1440 |
|
||||||
|
|
||||||
|
⚠️ `lg`·`xl`만 min-width다. 모바일 대응은 `xs/sm/md/tablet/mobile`(max-width)을 쓴다.
|
||||||
|
|
||||||
|
### z-index
|
||||||
|
|
||||||
|
```
|
||||||
|
dropdown 100 · sticky 200 · fixed 300 · header 350
|
||||||
|
modal-backdrop 1040 · modal 1050
|
||||||
|
popover 600 · tooltip 700 · notification 800
|
||||||
|
```
|
||||||
|
⚠️ `.global-header`는 토큰이 아니라 **`z-index: 1000` 하드코딩**이다. 그래서 모달은 1040/1050으로 그 위에 올린다. `$z-index-header: 350`은 실사용과 어긋나므로 헤더 관련 작업 시 1000을 기준으로 판단한다. 드롭다운 일부는 1100, 특정 오버레이는 9999를 쓴다.
|
||||||
|
|
||||||
|
### 트랜지션
|
||||||
|
|
||||||
|
```scss
|
||||||
|
$transition-fast: all .15s ease;
|
||||||
|
$transition-base: all .3s ease; // 기본
|
||||||
|
$transition-slow: all .5s ease;
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. 믹스인 (`abstracts/_mixins.scss`)
|
||||||
|
|
||||||
|
| 믹스인 | 내용 |
|
||||||
|
|---|---|
|
||||||
|
| `respond-to($bp)` | 미디어쿼리 (§4) |
|
||||||
|
| `flex-center` / `flex-between` | flex 정렬 |
|
||||||
|
| `button-base` | inline-flex · gap 8 · padding 16/32 · radius 12 · 600 · 16px · hover `translateY(-3px)` |
|
||||||
|
| `card` | white · radius 20 · padding 32 · hover `$shadow-lg` |
|
||||||
|
| `gradient-text($g)` | background-clip: text |
|
||||||
|
| `text-truncate` | 1줄 말줄임 |
|
||||||
|
| `absolute-center` | top/left 50% + translate(-50%,-50%) |
|
||||||
|
| `backdrop-blur($n=10px)` | -webkit 프리픽스 포함 |
|
||||||
|
| `hover-lift` | hover `translateY(-8px)` + `$shadow-xl` |
|
||||||
|
| `glass-effect` | white 95% + blur 10 + 흰 보더 |
|
||||||
|
| `pattern-circle($size,$color)` | 장식 원 (opacity .1) |
|
||||||
|
| `animate-float/bounce/slide-in-down/slide-in-up/fade-in` | 애니메이션 바인딩 |
|
||||||
|
|
||||||
|
### 애니메이션 (`base/_animations.scss`)
|
||||||
|
|
||||||
|
`float · bounce · slideInDown · slideInUp · slideInLeft · slideInRight · fadeIn · fadeInScale · spin · pulse · shimmer · wave · popIn · popupFadeIn · ripple · gradientShift · drawLine · pulseLine`
|
||||||
|
|
||||||
|
⚠️ `float`·`pulse`는 파일 내 **중복 정의**(뒤 선언이 이김). 수정 시 두 곳 모두 확인.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. 컴포넌트
|
||||||
|
|
||||||
|
### 6.1 버튼 (`components/_buttons.scss`)
|
||||||
|
|
||||||
|
**기본 `.btn`** — `button-base` 기반, radius 12, hover `translateY(-3px)`
|
||||||
|
|
||||||
|
크기: `.btn-sm`(8/16, 14px) · `.btn-md`(16/24, 16px) · `.btn-lg`(16/32, 18px) · `.btn-xl`(24/40, 20px)
|
||||||
|
|
||||||
|
변형: `primary`(blue/white/shadow-md) · `secondary`(#E5E7EB / #5F666C) · `success`(green) · `danger`(orange) · `ghost`(투명+blue) · `outline`(투명+border 2px) · `accent` / `warm`(배경 미지정 — §9)
|
||||||
|
|
||||||
|
상태: `:disabled`/`.disabled` opacity .5 + pointer-events none · `.loading`(텍스트 투명 + spin 스피너)
|
||||||
|
|
||||||
|
형태: `.btn-icon`(44×44 원형, sm 32 / lg 56) · `.btn-block`(100%) · `.btn-group`
|
||||||
|
|
||||||
|
**액션 버튼 계열**(목록·상세 화면 표준) — padding 16/40, radius 8, 500
|
||||||
|
|
||||||
|
- `.action-btn-new` / `.action-btn-primary` — 주 액션
|
||||||
|
- `.action-btn-secondary` — 취소·목록 (white + border-gray, hover 시 blue)
|
||||||
|
- `.action-btn-edit` — primary-blue
|
||||||
|
- `.action-btn-delete` — accent-orange
|
||||||
|
- `.action-btn.btn-list / .btn-edit / .btn-delete` — 게시판 변형
|
||||||
|
|
||||||
|
**특수 버튼**
|
||||||
|
|
||||||
|
| 클래스 | 규격 |
|
||||||
|
|---|---|
|
||||||
|
| `.btn-input-action` | 입력 우측 부착. min-w 172 · h 60 · radius 12 · 20px/700. `.btn-change`/`.btn-auth` = `#a4d6ea` / `#A4D6EA`. ≤768px full-width·h 52 |
|
||||||
|
| `.btn-upload` | h 40 · `#3ba4ed`(hover `#2b94dd`) · radius 8 · 14px/600 |
|
||||||
|
| `.btn-action-primary` | CTA. `#2a69de` · 20px/700 · padding 16/48 · radius 10. `.md` 변형 14px/11·45 |
|
||||||
|
| `.btn-copy` | primary-blue 10% 배경 · 12px |
|
||||||
|
| `.btn-action` / `.btn-cancel` | 8/24 · radius 8 · 14px |
|
||||||
|
| `.btn-cta-primary` / `.btn-cta-secondary` | 짙은 배경 위 CTA (white 배경 / 흰 보더 고스트) |
|
||||||
|
| `.fab` | 60×60 고정 원형, 우하단, 라벨 툴팁 동반 |
|
||||||
|
|
||||||
|
### 6.2 뱃지 (`components/_badges.scss`)
|
||||||
|
|
||||||
|
`.status-badge` — inline-flex · padding 4/16 · radius full · 12px/600
|
||||||
|
|
||||||
|
상태 클래스(배경 = 원색 10%, 글자 = 원색):
|
||||||
|
|
||||||
|
| 클래스 | 색 |
|
||||||
|
|---|---|
|
||||||
|
| `.status-pending` / `.status-failed` | accent-orange |
|
||||||
|
| `.status-completed` / `.status-success` | accent-green |
|
||||||
|
| `.status-active` | primary-blue |
|
||||||
|
| `.status-inactive` | text-gray |
|
||||||
|
| `.status-processing` | accent-yellow(글자는 30% darken) |
|
||||||
|
|
||||||
|
변형: `.status-badge-header`(하단 여백 포함) · `.badge-sm`(10px) · `.badge-lg`(14px) · `.badge-outline`(currentColor 보더) · `.badge-icon`
|
||||||
|
`.notification-badge` — 카운트용 20×20 원형, `.badge-primary|success|warning|danger`
|
||||||
|
|
||||||
|
### 6.3 카드 (`components/_cards.scss`)
|
||||||
|
|
||||||
|
전부 `@include card`(white · radius 20 · padding 32 · hover shadow-lg) 기반.
|
||||||
|
|
||||||
|
- `.card` — 기본
|
||||||
|
- `.api-card` — 보더 2px, hover 시 primary-blue. 하위 `.api-badge`(`.new`/`.beta`) · `.api-icon`(60×60, radius 16) · `.api-name` · `.api-description` · `.api-features > .feature-tag` · `.api-link`. 변형 `.api-card-popular`(yellow) / `.api-card-new`(green)
|
||||||
|
- `.experience-card` — 중앙정렬, `.card-icon`(56×56) + `.card-metric`(`.metric-value` 24px/800 blue)
|
||||||
|
- `.feature-card` — 가로형, `.feature-icon`(48×48 radius 12) + `.feature-content`
|
||||||
|
- `.testimonial-card` — `::before` 큰 따옴표 장식, `.testimonial-author`(아바타 48 원형)
|
||||||
|
- `.pricing-card` — `.featured` 시 blue 2px + scale(1.05), `.pricing-badge`/`.pricing-header .price`/`.pricing-features`(✓·× 프리픽스)
|
||||||
|
|
||||||
|
### 6.4 폼 (`components/_forms.scss`)
|
||||||
|
|
||||||
|
**레거시 계열** — `.form-group`(label 14px/600 + `.required`(orange) + `.form-hint` + `.form-error`), `.form-control`(**보더 2px** · radius 8 · padding 12/16 · focus 시 blue + 3px 링 `rgba(primary,.1)`), `.is-valid`/`.is-invalid`, `.form-control-sm|lg`
|
||||||
|
`textarea.form-control` min-h 120 · `select.form-control` 커스텀 SVG 화살표(`#64748B`)
|
||||||
|
|
||||||
|
**DJB 계열**(신규 화면 표준) — `.djb-label` · `.djb-input` · `.djb-textarea` · `.form-label-wrapper`/`.form-label-text`/`.required-badge` · `.form-field-wrapper` · `.form-input` · `.form-select` · `.form-row` · `.section-divider`
|
||||||
|
|
||||||
|
**조합 위젯** — `.input-group`(+`.input-group-append`) · `.compound-input` · `.input-with-button` · `.auth-input-group` · `.char-counter-wrapper` · `.search-field` · `.file-upload-wrapper` · `.form-check` / `.form-switch` · `.form-actions`(`--between` `--no-border` `--compact` `--with-withdrawal`) / `.form-actions-center`
|
||||||
|
|
||||||
|
> 신규 폼은 **DJB 계열**을 쓴다. `.form-control` 계열은 기존 화면 유지용.
|
||||||
|
|
||||||
|
### 6.5 테이블 (`components/_tables.scss`)
|
||||||
|
|
||||||
|
- `.data-table` — white · radius 12 · shadow-sm. `thead` 배경 `$light-bg` + 하단 2px 보더, `th` 14px/600 dark, `td` 14px gray, `tr:hover` 시 `rgba(primary,.02)`. 래퍼 `.data-table-wrapper`가 `overflow-x: auto` 담당 → **가로 스크롤은 항상 래퍼에 건다**.
|
||||||
|
- `.notice-table` — 게시판형. `.table-header`가 grid(`80px 1fr 120px`).
|
||||||
|
- ≤768px에서 padding·font 한 단계 축소.
|
||||||
|
|
||||||
|
### 6.6 기타 컴포넌트
|
||||||
|
|
||||||
|
| 파일 | 내용 |
|
||||||
|
|---|---|
|
||||||
|
| `_alerts.scss` | `.alert` + `.alert-warning`(yellow/글자 `#B89900`) `.alert-error`(orange) `.alert-success`(green) `.alert-info`(blue). 공통 패턴: 배경 10% + 보더 30% |
|
||||||
|
| `_modals.scss` | 모달 (backdrop 1040 / modal 1050) |
|
||||||
|
| `_toast.scss` | 토스트. JS는 `js/djb/toast.js` |
|
||||||
|
| `_pagination.scss` · `_breadcrumb.scss` | 목록/내비 |
|
||||||
|
| `_accordion.scss` · `_navigation.scss` · `_partners.scss` · `_cta.scss` | 섹션 컴포넌트 |
|
||||||
|
| `_page-title-banner.scss` | `.page-title-banner` — 배경 `#E9F8FF` · h 110px(모바일 120) · `.title-image`(220px, 모바일 120) · h1 40px/700 letter-spacing -.5px |
|
||||||
|
| `_apikey-common.scss` · `_board-common.scss` | 도메인 공통 |
|
||||||
|
| `_password-popup.scss` · `_password-policy.scss` | 비밀번호 UI |
|
||||||
|
| `_session-timer.scss` · `_two-factor.scss` · `_header-auth.scss` | 인증/세션 |
|
||||||
|
| `_test-env-notice.scss` | 테스트 환경 배너 |
|
||||||
|
| `_djb-inquiry-comments.scss` | 문의 댓글 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. 레이아웃 / 템플릿
|
||||||
|
|
||||||
|
### 헤더 (`layout/_header.scss`)
|
||||||
|
|
||||||
|
`.global-header` — fixed · **h 80px** · **z-index 1000(하드코딩)**
|
||||||
|
`.header-content`(내부 flex) / `.header-left`(로고 h 32px) / `.header-center`(GNB) / `.header-right`(h 40px 유틸)
|
||||||
|
모바일: `clamp(44px, 11.73vw, 60px)`로 높이 가변. 햄버거 → 전체화면 오버레이(z-index 9999).
|
||||||
|
본문은 `.content-wrapper .main-content { padding-top: $header-height }`로 헤더 높이를 보정한다.
|
||||||
|
|
||||||
|
### 그리드 (`layout/_grid.scss`)
|
||||||
|
|
||||||
|
범용: `.grid` + `.grid-cols-1|2|3|4|5|6|12` · `.grid-auto`(minmax 280) `.grid-auto-sm`(200) `.grid-auto-lg`(350) · `.gap-0|sm|md|lg|xl` · `.grid-md-cols-*` `.grid-sm-cols-*` · `.col-span-1~6|full` · `.row-span-1~3`
|
||||||
|
|
||||||
|
도메인 그리드: `.api-grid` · `.experience-grid` · `.partners-grid` · `.feature-grid` · `.demo-wrapper` · `.footer-grid`(2fr 3fr) · `.pricing-grid` · `.testimonial-grid` · `.stats-grid` · `.two-column`(`.reverse` 지원) · `.three-column`
|
||||||
|
대부분 ≤1024px에서 1~2열, ≤768px에서 1열로 접힌다.
|
||||||
|
|
||||||
|
### Thymeleaf 레이아웃
|
||||||
|
|
||||||
|
```
|
||||||
|
templates/views/
|
||||||
|
├── layout/ djbank_base_layout · djbank_index_layout · djbank_title_layout
|
||||||
|
│ djbank_nohead_layout · base_layout · index_layout · side_menu_layout
|
||||||
|
├── fragment/djbank/ head · header_container · header_nav · menu
|
||||||
|
│ footer · service_sidebar · terms_agreements
|
||||||
|
├── fragment/ 검증 UI 조각 (email/phone/password/auth-number/…)
|
||||||
|
└── apps/ · djb/ · samples/ 페이지 본문
|
||||||
|
```
|
||||||
|
|
||||||
|
`fragment/djbank/head.html`의 CSS 로드 순서:
|
||||||
|
|
||||||
|
```
|
||||||
|
all.min.css → main.css → editor-content.css → slick.css → daterangepicker.css
|
||||||
|
→ codemirror(+monokai) → summernote-lite → jquery-ui
|
||||||
|
```
|
||||||
|
`main.css`가 벤더보다 앞이므로 **벤더 위젯 커스터마이즈는 `sass/vendors/_overrides.scss`** 에서 한다.
|
||||||
|
|
||||||
|
메타/전역: `<meta name="_csrf">` + `_csrf_header`(JS는 쿠키 대신 이 meta를 읽는다), `window.PORTAL_CONFIG`(파일 업로드 제한), `window.__PASSWORD_POLICY__`, `window.__PASSWORD_CRYPTO__`, `window.__CLIENT_GUARD__`.
|
||||||
|
|
||||||
|
### 정적 자산
|
||||||
|
|
||||||
|
- 로고: `img/logo/logo-djb.png` · `logo-jjb.png` · `logo-jjb-color.png` · `logo-jjb-white.png` · `logo_box.png` (어두운 배경에는 `-white`)
|
||||||
|
- 파비콘: `img/favicon/` (16·32·apple-touch 180)
|
||||||
|
- 아이콘: `img/icon/` PNG 세트(`icon_*`, `arrow_*`, `checkbox_on/off` …). 인라인 SVG·data URI도 혼용.
|
||||||
|
- JS: 공통 `js/common.js`, 커스텀은 `js/djb/*`(`toast.js` · `client-guard.js` · `api-status.js` · `inquiry-*.js` · `notitest.js`), 벤더는 `js/lib/`·`plugins/`.
|
||||||
|
- `djb/` 네임스페이스는 **커스텀 전용**. 공통 성격은 `common/` 또는 `js/` 루트에 둔다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. 작성 규칙 요약
|
||||||
|
|
||||||
|
1. **CSS 직접 수정 금지.** SASS만 고치고 컴파일한다.
|
||||||
|
2. **하드코딩 색 금지.** 토큰이 없으면 `_variables.scss`에 추가한다.
|
||||||
|
3. 간격·폰트·반경은 토큰 스케일에서 고른다. 임의 px는 컴포넌트 고유 규격(입력 높이 60, 아이콘 44 등)에 한정.
|
||||||
|
4. 제목 요소는 `-title` / `__title` 네이밍 → 헤딩 서체 자동 적용.
|
||||||
|
5. 새 파샬은 `main.scss`의 올바른 섹션에 `@use` 등록. 유틸은 마지막.
|
||||||
|
6. 가로로 넘치는 콘텐츠(테이블·코드)는 **래퍼에 `overflow-x: auto`**, body에 가로 스크롤을 만들지 않는다.
|
||||||
|
7. 반응형은 `@include respond-to('sm'|'md'|…)` 사용. 직접 `@media`는 기존 코드 관례(`@media (max-width: $breakpoint-sm)`)를 따르는 곳에서만.
|
||||||
|
8. 상태 표현은 `.status-badge` + `.status-*`, 메시지는 `.alert-*`를 재사용한다. 새 상태색을 만들지 않는다.
|
||||||
|
9. 신규 폼은 DJB 계열(`.djb-input` · `.form-field-wrapper` …), 신규 액션 버튼은 `.action-btn-*` 계열.
|
||||||
|
10. 메뉴 추가는 `menu.yml`(GNB) + `page.home` 트리(브레드크럼) 양쪽. 스타일만 고쳐선 메뉴가 안 나온다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 9. 알려진 불일치 / 부채
|
||||||
|
|
||||||
|
코드에서 실제로 확인된 항목. 손댈 때 함께 정리한다.
|
||||||
|
|
||||||
|
| # | 내용 |
|
||||||
|
|---|---|
|
||||||
|
| 1 | **`#2a69de`가 92회 하드코딩** — `$primary-blue`(`#0049b4`, 91회)와 병존하는 사실상 제2 브랜드 블루인데 토큰이 없다. Figma 원본과 대조해 어느 쪽이 정본인지 확정 후 토큰화 필요. |
|
||||||
|
| 2 | `$primary-color`와 `$primary-blue`가 같은 값 중복 정의. `$primary-blue`로 일원화 권장. |
|
||||||
|
| 3 | `.btn-accent` / `.btn-warm`, `.action-btn-new`, `.action-btn .btn-edit`, `.btn-action`, `.experience-card .card-icon`, `.feature-icon`, `.pricing-badge` 등에 **`background` 선언이 비어 있다**(그라디언트 제거 흔적). 흰 글자만 남아 사실상 보이지 않는 상태. |
|
||||||
|
| 4 | `$z-index-header: 350` vs `.global-header { z-index: 1000 }` 하드코딩 불일치. 드롭다운 1100, 모바일 오버레이 9999도 토큰 밖. |
|
||||||
|
| 5 | `_animations.scss`에 `float`·`pulse` **중복 @keyframes**. |
|
||||||
|
| 6 | `.btn-group { gap: -1px }` — 음수 gap은 무효. |
|
||||||
|
| 7 | `themes/_dark.scss`는 **빈 파일**. 다크 테마 미구현. |
|
||||||
|
| 8 | `main.scss`에서 `components/password-policy`를 **두 번 `@use`**. |
|
||||||
|
| 9 | `#a4d6ea` / `#A4D6EA`(대소문자만 다른 동일 색), `#dfdfdf`·`#dadada`·`#e5e7eb`·`#e3e8f0` 등 **회색 계열 난립**. 토큰 정리 대상. |
|
||||||
|
| 10 | `css/api-statistics.css`가 별도로 존재하나 템플릿에서 링크가 **주석 처리**됨. 통계 스타일은 현재 `main.css` 경유. 파일 정리 여부 확인 필요. |
|
||||||
|
| 11 | `#f4253c`(17회) — 에러 레드가 `$accent-orange`(`#FF6B6B`)와 별개로 쓰인다. danger 색 이원화. |
|
||||||
|
| 12 | 이 문서는 코드 역추출본이다. **Figma Design Guide와의 공식 대조는 미수행.** |
|
||||||
+2
-1
@@ -74,8 +74,9 @@ pipeline {
|
|||||||
set -eu
|
set -eu
|
||||||
cd build/libs
|
cd build/libs
|
||||||
sha256sum eapim-portal.war > eapim-portal.war.sha256
|
sha256sum eapim-portal.war > eapim-portal.war.sha256
|
||||||
|
sha256sum eapim-portal-static.zip > eapim-portal-static.zip.sha256
|
||||||
'''
|
'''
|
||||||
archiveArtifacts artifacts: 'build/libs/eapim-portal.war,build/libs/eapim-portal.war.sha256', fingerprint: true
|
archiveArtifacts artifacts: 'build/libs/eapim-portal.war,build/libs/eapim-portal.war.sha256,build/libs/eapim-portal-static.zip,build/libs/eapim-portal-static.zip.sha256', fingerprint: true
|
||||||
stash name: 'war', includes: 'build/libs/eapim-portal.war'
|
stash name: 'war', includes: 'build/libs/eapim-portal.war'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-3
@@ -43,8 +43,9 @@ pipeline {
|
|||||||
)
|
)
|
||||||
booleanParam(
|
booleanParam(
|
||||||
name: 'RUN_TESTS',
|
name: 'RUN_TESTS',
|
||||||
defaultValue: false,
|
defaultValue: true,
|
||||||
description: '단위 테스트를 함께 실행해 JUnit 결과를 Sonar 로 전송한다(분석 시간 증가).'
|
description: '단위 테스트 + JaCoCo 커버리지를 Sonar 로 전송한다(분석 시간 증가). ' +
|
||||||
|
'끄면 커버리지 리포트가 없어 Sonar 가 Coverage 를 0% 로 집계하고 Quality Gate 가 실패한다.'
|
||||||
)
|
)
|
||||||
booleanParam(
|
booleanParam(
|
||||||
name: 'UPDATE_NVD',
|
name: 'UPDATE_NVD',
|
||||||
@@ -166,14 +167,18 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// test 는 finalizedBy jacocoTestReport 로 커버리지 XML 까지 만든다(build.gradle).
|
||||||
|
// 이 스테이지를 건너뛰면 Sonar 가 커버리지 리포트를 못 받아 Coverage 0% 로 집계되고
|
||||||
|
// Quality Gate 의 "새 코드 커버리지" 조건에서 반드시 실패한다.
|
||||||
stage('Test') {
|
stage('Test') {
|
||||||
when { expression { return params.RUN_TESTS } }
|
when { expression { return params.RUN_TESTS } }
|
||||||
steps {
|
steps {
|
||||||
sh 'gradle test --no-daemon'
|
sh 'gradle test jacocoTestReport --no-daemon'
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
junit allowEmptyResults: true, testResults: 'build/test-results/test/*.xml'
|
junit allowEmptyResults: true, testResults: 'build/test-results/test/*.xml'
|
||||||
|
archiveArtifacts artifacts: 'build/reports/jacoco/test/**', allowEmptyArchive: true, fingerprint: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -419,6 +424,16 @@ pipeline {
|
|||||||
JUNIT_ARG="-Dsonar.junit.reportPaths=build/test-results/test"
|
JUNIT_ARG="-Dsonar.junit.reportPaths=build/test-results/test"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 커버리지. sonar.junit.reportPaths 는 테스트 성공/실패 개수일 뿐
|
||||||
|
# 커버리지가 아니다. JaCoCo XML 을 따로 넘겨야 Coverage 지표가 채워진다.
|
||||||
|
COVERAGE_ARG=""
|
||||||
|
JACOCO_XML=build/reports/jacoco/test/jacocoTestReport.xml
|
||||||
|
if [ -f "$JACOCO_XML" ]; then
|
||||||
|
COVERAGE_ARG="-Dsonar.coverage.jacoco.xmlReportPaths=$JACOCO_XML"
|
||||||
|
else
|
||||||
|
echo "WARN: $JACOCO_XML 없음 - Coverage 는 0% 로 집계된다(RUN_TESTS 를 켰는지 확인)."
|
||||||
|
fi
|
||||||
|
|
||||||
# SonarQube 에 Dependency-Check 플러그인이 설치돼 있으면 CVE 결과도 함께 올린다.
|
# SonarQube 에 Dependency-Check 플러그인이 설치돼 있으면 CVE 결과도 함께 올린다.
|
||||||
# 플러그인이 없으면 스캐너가 모르는 속성으로 무시한다(경고만).
|
# 플러그인이 없으면 스캐너가 모르는 속성으로 무시한다(경고만).
|
||||||
DC_ARG=""
|
DC_ARG=""
|
||||||
@@ -445,6 +460,7 @@ pipeline {
|
|||||||
-Dsonar.java.libraries="$LIBS" \
|
-Dsonar.java.libraries="$LIBS" \
|
||||||
-Dsonar.java.test.libraries="$TEST_LIBS" \
|
-Dsonar.java.test.libraries="$TEST_LIBS" \
|
||||||
$JUNIT_ARG \
|
$JUNIT_ARG \
|
||||||
|
$COVERAGE_ARG \
|
||||||
$DC_ARG
|
$DC_ARG
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-4
@@ -26,8 +26,9 @@ pipeline {
|
|||||||
parameters {
|
parameters {
|
||||||
booleanParam(
|
booleanParam(
|
||||||
name: 'RUN_TESTS',
|
name: 'RUN_TESTS',
|
||||||
defaultValue: false,
|
defaultValue: true,
|
||||||
description: '단위 테스트를 함께 실행해 JUnit 결과를 Sonar 로 전송한다(분석 시간 증가).'
|
description: '단위 테스트 + JaCoCo 커버리지를 Sonar 로 전송한다(분석 시간 증가). ' +
|
||||||
|
'끄면 커버리지 리포트가 없어 Sonar 가 Coverage 를 0% 로 집계하고 Quality Gate 가 실패한다.'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,14 +122,16 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// test 는 finalizedBy jacocoTestReport 로 커버리지 XML 까지 만든다(build.gradle).
|
||||||
stage('Test') {
|
stage('Test') {
|
||||||
when { expression { return params.RUN_TESTS } }
|
when { expression { return params.RUN_TESTS } }
|
||||||
steps {
|
steps {
|
||||||
sh 'gradle test --no-daemon'
|
sh 'gradle test jacocoTestReport --no-daemon'
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
junit allowEmptyResults: true, testResults: 'build/test-results/test/*.xml'
|
junit allowEmptyResults: true, testResults: 'build/test-results/test/*.xml'
|
||||||
|
archiveArtifacts artifacts: 'build/reports/jacoco/test/**', allowEmptyArchive: true, fingerprint: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -199,6 +202,15 @@ pipeline {
|
|||||||
JUNIT_ARG="-Dsonar.junit.reportPaths=build/test-results/test"
|
JUNIT_ARG="-Dsonar.junit.reportPaths=build/test-results/test"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 커버리지. JUNIT_ARG 는 테스트 성공/실패 개수일 뿐 커버리지가 아니다.
|
||||||
|
COVERAGE_ARG=""
|
||||||
|
JACOCO_XML=build/reports/jacoco/test/jacocoTestReport.xml
|
||||||
|
if [ -f "$JACOCO_XML" ]; then
|
||||||
|
COVERAGE_ARG="-Dsonar.coverage.jacoco.xmlReportPaths=$JACOCO_XML"
|
||||||
|
else
|
||||||
|
echo "WARN: $JACOCO_XML 없음 - Coverage 는 0% 로 집계된다(RUN_TESTS 를 켰는지 확인)."
|
||||||
|
fi
|
||||||
|
|
||||||
# Tools 에 등록된 스캐너가 없으면 PATH 에서 찾는다
|
# Tools 에 등록된 스캐너가 없으면 PATH 에서 찾는다
|
||||||
if [ -n "${SONAR_SCANNER_HOME:-}" ] && [ -x "$SONAR_SCANNER_HOME/bin/sonar-scanner" ]; then
|
if [ -n "${SONAR_SCANNER_HOME:-}" ] && [ -x "$SONAR_SCANNER_HOME/bin/sonar-scanner" ]; then
|
||||||
SCANNER="$SONAR_SCANNER_HOME/bin/sonar-scanner"
|
SCANNER="$SONAR_SCANNER_HOME/bin/sonar-scanner"
|
||||||
@@ -215,7 +227,8 @@ pipeline {
|
|||||||
-Dsonar.projectVersion="${BUILD_NUMBER}" \
|
-Dsonar.projectVersion="${BUILD_NUMBER}" \
|
||||||
-Dsonar.java.libraries="$LIBS" \
|
-Dsonar.java.libraries="$LIBS" \
|
||||||
-Dsonar.java.test.libraries="$TEST_LIBS" \
|
-Dsonar.java.test.libraries="$TEST_LIBS" \
|
||||||
$JUNIT_ARG
|
$JUNIT_ARG \
|
||||||
|
$COVERAGE_ARG
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,8 +96,9 @@ pipeline {
|
|||||||
sha256sum "$f" > "$f.sha256"
|
sha256sum "$f" > "$f.sha256"
|
||||||
md5sum "$f" > "$f.md5"
|
md5sum "$f" > "$f.md5"
|
||||||
done
|
done
|
||||||
|
sha256sum eapim-portal-static.zip > eapim-portal-static.zip.sha256
|
||||||
'''
|
'''
|
||||||
archiveArtifacts artifacts: 'build/libs/eapim-portal.war,build/libs/eapim-portal-boot.war,build/libs/eapim-portal.war.sha1,build/libs/eapim-portal.war.sha256,build/libs/eapim-portal.war.md5,build/libs/eapim-portal-boot.war.sha1,build/libs/eapim-portal-boot.war.sha256,build/libs/eapim-portal-boot.war.md5', fingerprint: true
|
archiveArtifacts artifacts: 'build/libs/eapim-portal.war,build/libs/eapim-portal-boot.war,build/libs/eapim-portal.war.sha1,build/libs/eapim-portal.war.sha256,build/libs/eapim-portal.war.md5,build/libs/eapim-portal-boot.war.sha1,build/libs/eapim-portal-boot.war.sha256,build/libs/eapim-portal-boot.war.md5,build/libs/eapim-portal-static.zip,build/libs/eapim-portal-static.zip.sha256', fingerprint: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,45 +1,73 @@
|
|||||||
# EAPIM Portal
|
# EAPIM Portal
|
||||||
|
|
||||||
광주은행 엔터프라이즈 API 포털 관리 시스템
|
제주은행(DJBank) 엔터프라이즈 API 포털 관리 시스템
|
||||||
|
|
||||||
|
## 프로젝트 개요
|
||||||
|
|
||||||
|
**EAPIM Portal**은 제주은행(DJBank)의 API 서비스를 관리하고, 사용자 등록, API 키 발급, 문서화, 테스트 기능을 제공하는 웹 기반 플랫폼입니다.
|
||||||
|
|
||||||
|
## 기술 스택
|
||||||
|
|
||||||
|
- Spring Boot 2.7.18 (Spring MVC + Thymeleaf)
|
||||||
|
- Java 8
|
||||||
|
- Gradle 8.7
|
||||||
|
- Oracle 19c (JNDI 이중 데이터소스)
|
||||||
|
- Spring Security
|
||||||
|
- JPA/Hibernate 5.6.15 with Envers
|
||||||
|
- MapStruct, Lombok
|
||||||
|
- Dart Sass (SCSS)
|
||||||
|
|
||||||
## 프로젝트 클론 (Git Clone)
|
## 프로젝트 클론 (Git Clone)
|
||||||
|
|
||||||
아래 스크립트를 복사하여 한 번에 실행하면 모든 프로젝트를 클론합니다:
|
모든 저장소는 사내 Gitea 에 있으며 **`master` 브랜치**를 기준으로 합니다.
|
||||||
|
|
||||||
|
- Git 베이스 URL: `ssh://git@172.30.1.50:2222/djb-eapim`
|
||||||
|
- Gitea 웹: `http://172.30.1.50:3000/djb-eapim`
|
||||||
|
|
||||||
|
### 클론 스크립트 (Linux / macOS / Git Bash)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 변수 설정 (환경에 맞게 수정하세요)
|
# 변수 설정 (환경에 맞게 수정하세요)
|
||||||
GIT_URL="ssh://git@192.168.240.178:18081/eapim"
|
GIT_BASE="ssh://git@172.30.1.50:2222/djb-eapim"
|
||||||
PROJECT_HOME="/c/eactive/workspaces/kjb-eapim-devPortal"
|
WORKSPACE_DIR="$HOME/djb-workspace" # 예: /c/eactive/workspaces/djb-workspace
|
||||||
DEFAULT_BRANCH="jenkins_with_weblogic"
|
|
||||||
|
|
||||||
# 프로젝트 홈 디렉토리 생성 및 이동
|
mkdir -p "$WORKSPACE_DIR" && cd "$WORKSPACE_DIR"
|
||||||
mkdir -p "$PROJECT_HOME"
|
|
||||||
cd "$PROJECT_HOME"
|
|
||||||
|
|
||||||
# 메인 프로젝트 클론
|
# 1. 메인 프로젝트
|
||||||
git clone -b "$DEFAULT_BRANCH" "$GIT_URL/kjb-eapim.git" kjb-eapim
|
git clone -b master "$GIT_BASE/eapim-portal.git" eapim-portal
|
||||||
|
|
||||||
# 의존 모듈 클론 (kjb-eapim 폴더와 동일 레벨)
|
# 2. 공통 모듈
|
||||||
mkdir -p eapim-online
|
git clone -b master "$GIT_BASE/elink-portal-common.git" elink-portal-common
|
||||||
git clone -b "$DEFAULT_BRANCH" "$GIT_URL/elink-online-core-jpa.git" eapim-online/elink-online-core-jpa
|
|
||||||
git clone -b "$DEFAULT_BRANCH" "$GIT_URL/elink-portal-common.git" elink-portal-common
|
|
||||||
git clone -b "$DEFAULT_BRANCH" "$GIT_URL/kjb-safedb.git" kjb-safedb
|
|
||||||
|
|
||||||
# 클론 후 폴더 구조 확인
|
# 3. eapim-online 과 하위 모듈
|
||||||
echo "=== 프로젝트 구조 ==="
|
# eapim-online/.gitmodules 는 구 서버(synology)를 가리키므로 `git submodule update` 를 쓰지 않고
|
||||||
ls -la "$PROJECT_HOME"
|
# Gitea 에서 각 모듈을 직접 클론한다. (빈 서브모듈 디렉터리에 그대로 클론된다)
|
||||||
|
git clone -b master "$GIT_BASE/eapim-online.git" eapim-online
|
||||||
|
for m in elink-online-core-jpa elink-online-core elink-online-common elink-online-emsclient elink-online-transformer; do
|
||||||
|
git clone -b master "$GIT_BASE/$m.git" "eapim-online/$m"
|
||||||
|
done
|
||||||
|
|
||||||
|
# (선택) Admin 포털
|
||||||
|
git clone -b master "$GIT_BASE/eapim-admin.git" eapim-admin
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> eapim-portal 빌드에 필요한 건 `elink-online-core-jpa` 와 `elink-portal-common` 두 개뿐입니다.
|
||||||
|
> 나머지 eapim-online 모듈 4개는 eapim-admin 빌드에 필요합니다.
|
||||||
|
|
||||||
### 클론 후 폴더 구조
|
### 클론 후 폴더 구조
|
||||||
|
|
||||||
```
|
```
|
||||||
$PROJECT_HOME/
|
djb-workspace/
|
||||||
├── kjb-eapim/ # 메인 프로젝트
|
├── .envrc # (선택) direnv 환경변수 — 아래 "초기 세팅" 참고
|
||||||
│ └── eapim-portal/ # 이 프로젝트 (Portal)
|
├── eapim-portal/ # 이 프로젝트 (Portal)
|
||||||
├── eapim-online/ # Gateway 데이터 모델
|
├── eapim-admin/ # (선택) Admin 포털
|
||||||
│ └── elink-online-core-jpa/ # JPA 엔티티 모듈
|
├── eapim-online/ # Online 프로젝트
|
||||||
├── elink-portal-common/ # 공통 유틸리티
|
│ ├── elink-online-core-jpa/ # Gateway JPA 엔티티 ← portal 필수
|
||||||
└── kjb-safedb/ # SafeDB 암호화 라이브러리
|
│ ├── elink-online-core/
|
||||||
|
│ ├── elink-online-common/
|
||||||
|
│ ├── elink-online-emsclient/
|
||||||
|
│ └── elink-online-transformer/
|
||||||
|
└── elink-portal-common/ # 포털 공통 유틸리티 ← portal 필수
|
||||||
```
|
```
|
||||||
|
|
||||||
### 의존 관계 (settings.gradle 참조)
|
### 의존 관계 (settings.gradle 참조)
|
||||||
@@ -47,270 +75,168 @@ $PROJECT_HOME/
|
|||||||
```
|
```
|
||||||
eapim-portal
|
eapim-portal
|
||||||
├── elink-online-core-jpa → ../eapim-online/elink-online-core-jpa
|
├── elink-online-core-jpa → ../eapim-online/elink-online-core-jpa
|
||||||
├── elink-portal-common → ../elink-portal-common
|
└── elink-portal-common → ../elink-portal-common
|
||||||
└── kjb-safedb → ../kjb-safedb
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 프로젝트 개요
|
두 디렉터리가 없으면 컴파일 자체가 되지 않습니다.
|
||||||
|
|
||||||
**EAPIM Portal**은 광주은행의 API 서비스를 관리하고, 사용자 등록, API 키 발급, 문서화, 테스트 기능을 제공하는 웹 기반 플랫폼입니다.
|
|
||||||
|
|
||||||
## 기술 스택
|
|
||||||
|
|
||||||
- Spring Boot 2.7.18
|
|
||||||
- Java 8
|
|
||||||
- Gradle 8.7
|
|
||||||
- Oracle 19c
|
|
||||||
- Spring Security
|
|
||||||
- JPA/Hibernate 5.6.15 with Envers
|
|
||||||
- MapStruct, Lombok
|
|
||||||
|
|
||||||
## 초기 세팅 가이드
|
## 초기 세팅 가이드
|
||||||
|
|
||||||
### 사전 요구사항
|
### 사전 요구사항
|
||||||
|
|
||||||
아래 도구 설치 및 검증 절차는 별도 문서로 분리되어 있습니다. 신규 개발자는 먼저 이 문서를 끝까지 진행하세요.
|
도구별 설치 절차는 별도 문서를 참고하세요.
|
||||||
|
|
||||||
📄 **[개발환경 준비 사항](djb-docs/개발환경-준비-사항.md)** — JDK 8 · Gradle 8.7 · Git · Oracle 19c · Node.js & SASS · direnv · IDE 설정
|
📄 **[개발환경 준비 사항](djb-docs/개발환경-준비-사항.md)** — JDK 8 · Gradle 8.7 · Git · Oracle 19c · Node.js & SASS · direnv · IDE 설정
|
||||||
|
|
||||||
요약:
|
| 도구 | 버전 | 비고 |
|
||||||
|
|---|---|---|
|
||||||
|
| JDK | 1.8 (Zulu 8 권장) | `build.gradle` 의 `sourceCompatibility = 1.8` |
|
||||||
|
| Gradle | 8.7 | 시스템에 설치한 gradle 사용 (Jenkins 노드와 동일) |
|
||||||
|
| Git | - | Gitea SSH 키 등록 필요 |
|
||||||
|
| Node.js | 18 LTS 이상 | SCSS 컴파일용 |
|
||||||
|
| direnv | 최신 (선택) | JAVA_HOME / GRADLE_HOME 자동 설정 |
|
||||||
|
|
||||||
- JDK 8 (Zulu 권장)
|
- **Gradle**: 시스템에 설치한 `gradle` 8.7 을 직접 사용합니다. Windows/Eclipse 환경의 기동 절차는
|
||||||
- Gradle 8.7 (gradlew 사용 금지)
|
[`BOOTRUN_SETUP_GUIDE.md`](BOOTRUN_SETUP_GUIDE.md) 를 따릅니다 (여기서는 `gradlew.bat bootRun` 사용).
|
||||||
- Git
|
- **의존성 저장소**: 사내 Nexus (`https://nexus.eactive.synology.me:8090/repository/maven-public/`) 에서 받습니다.
|
||||||
- Oracle 19c 접근 (개발: `192.168.240.177:1599`)
|
Nexus 에 접근할 수 있어야 하며, offline 빌드는 로컬 캐시가 채워진 뒤에만 가능합니다.
|
||||||
- Node.js 18 LTS 이상 (SCSS 컴파일용)
|
|
||||||
|
|
||||||
### Git Bash에서 초기 세팅
|
### 환경 변수 (direnv 권장)
|
||||||
|
|
||||||
|
시스템 기본 JDK 가 8 이 아니면 `JAVA_HOME` 을 반드시 8 로 맞춰야 합니다.
|
||||||
|
direnv 를 쓰면 워크스페이스 루트에 `.envrc` 하나로 하위 모든 프로젝트(eapim-portal, eapim-admin, eapim-online)에 적용됩니다.
|
||||||
|
머신별 절대경로가 들어가므로 **저장소 안이 아닌 워크스페이스 루트**에 둡니다.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# ====================================
|
# djb-workspace/.envrc (경로는 환경에 맞게 수정)
|
||||||
# 1. 변수 설정 (프로젝트 경로 및 브랜치)
|
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
|
||||||
# ====================================
|
export GRADLE_HOME=/opt/gradle-8.7
|
||||||
export WORKSPACE_DIR="/c/eactive/workspaces/kjb-eapim"
|
|
||||||
export PROJECT_BRANCH="jenkins_with_weblogic"
|
|
||||||
|
|
||||||
# Git Repository URL 설정
|
PATH_add "$JAVA_HOME/bin"
|
||||||
# 기본: ssh://git@192.168.240.178:18081/eapim
|
PATH_add "$GRADLE_HOME/bin"
|
||||||
# 대체: https://git.eactive.synology.me:8090/kjb-eapim
|
|
||||||
export GIT_REPO_BASE="ssh://git@192.168.240.178:18081/eapim"
|
|
||||||
# export GIT_REPO_BASE="https://git.eactive.synology.me:8090/kjb-eapim"
|
|
||||||
|
|
||||||
# Gradle 명령어 설정
|
|
||||||
export GRADLE_CMD="gradle"
|
|
||||||
|
|
||||||
# ====================================
|
|
||||||
# 2. 작업 디렉토리 생성
|
|
||||||
# ====================================
|
|
||||||
mkdir -p $WORKSPACE_DIR
|
|
||||||
cd $WORKSPACE_DIR
|
|
||||||
|
|
||||||
# ====================================
|
|
||||||
# 3. eapim-portal 프로젝트 클론
|
|
||||||
# ====================================
|
|
||||||
git clone ${GIT_REPO_BASE}/eapim-portal.git
|
|
||||||
cd eapim-portal
|
|
||||||
|
|
||||||
# 프로젝트 브랜치로 체크아웃
|
|
||||||
git checkout $PROJECT_BRANCH
|
|
||||||
|
|
||||||
# ====================================
|
|
||||||
# 4. eapim-online 프로젝트 클론 (elink-online-core-jpa 포함)
|
|
||||||
# ====================================
|
|
||||||
cd $WORKSPACE_DIR
|
|
||||||
git clone ${GIT_REPO_BASE}/eapim-online.git
|
|
||||||
cd eapim-online
|
|
||||||
git checkout $PROJECT_BRANCH
|
|
||||||
|
|
||||||
# ====================================
|
|
||||||
# 5. 의존 모듈 클론
|
|
||||||
# ====================================
|
|
||||||
cd $WORKSPACE_DIR
|
|
||||||
|
|
||||||
# elink-portal-common 클론
|
|
||||||
git clone ${GIT_REPO_BASE}/elink-portal-common.git
|
|
||||||
cd elink-portal-common
|
|
||||||
git checkout master # 또는 필요한 브랜치
|
|
||||||
|
|
||||||
# ====================================
|
|
||||||
# 6. 최종 폴더 구조 확인
|
|
||||||
# ====================================
|
|
||||||
# kjb-eapim/
|
|
||||||
# ├── eapim-portal/
|
|
||||||
# ├── eapim-online/
|
|
||||||
# │ └── elink-online-core-jpa/
|
|
||||||
# ├── elink-portal-common/
|
|
||||||
|
|
||||||
# ====================================
|
|
||||||
# 7. eapim-portal 프로젝트로 이동 및 디펜던시 다운로드
|
|
||||||
# ====================================
|
|
||||||
cd $WORKSPACE_DIR/eapim-portal
|
|
||||||
|
|
||||||
# Gradle 디펜던시 다운로드
|
|
||||||
$GRADLE_CMD dependencies
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Windows CMD에서 초기 세팅
|
```bash
|
||||||
|
# 셸 훅 등록 (최초 1회, zsh 기준 — bash 는 'direnv hook bash' / ~/.bashrc)
|
||||||
|
echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc
|
||||||
|
|
||||||
```cmd
|
# .envrc 허용
|
||||||
REM ====================================
|
cd ~/djb-workspace && direnv allow
|
||||||
REM 1. 변수 설정 (프로젝트 경로 및 브랜치)
|
|
||||||
REM ====================================
|
|
||||||
set WORKSPACE_DIR=C:\eactive\workspaces\kjb-eapim
|
|
||||||
set PROJECT_BRANCH=jenkins_with_weblogic
|
|
||||||
|
|
||||||
REM Git Repository URL 설정
|
# 확인
|
||||||
REM 기본: ssh://git@192.168.240.178:18081/eapim
|
cd eapim-portal && which gradle && java -version # Gradle 8.7 / 1.8.x
|
||||||
REM 대체: https://git.eactive.synology.me:8090/kjb-eapim
|
|
||||||
set GIT_REPO_BASE=ssh://git@192.168.240.178:18081/eapim
|
|
||||||
REM set GIT_REPO_BASE=https://git.eactive.synology.me:8090/kjb-eapim
|
|
||||||
|
|
||||||
REM Gradle 명령어 설정
|
|
||||||
set GRADLE_CMD=gradle
|
|
||||||
|
|
||||||
REM ====================================
|
|
||||||
REM 2. 작업 디렉토리 생성
|
|
||||||
REM ====================================
|
|
||||||
if not exist "%WORKSPACE_DIR%" mkdir "%WORKSPACE_DIR%"
|
|
||||||
cd /d "%WORKSPACE_DIR%"
|
|
||||||
|
|
||||||
REM ====================================
|
|
||||||
REM 3. eapim-portal 프로젝트 클론
|
|
||||||
REM ====================================
|
|
||||||
git clone %GIT_REPO_BASE%/eapim-portal.git
|
|
||||||
cd eapim-portal
|
|
||||||
|
|
||||||
REM 프로젝트 브랜치로 체크아웃
|
|
||||||
git checkout %PROJECT_BRANCH%
|
|
||||||
|
|
||||||
REM ====================================
|
|
||||||
REM 4. eapim-online 프로젝트 클론 (elink-online-core-jpa 포함)
|
|
||||||
REM ====================================
|
|
||||||
cd /d "%WORKSPACE_DIR%"
|
|
||||||
git clone %GIT_REPO_BASE%/eapim-online.git
|
|
||||||
cd eapim-online
|
|
||||||
git checkout %PROJECT_BRANCH%
|
|
||||||
|
|
||||||
REM ====================================
|
|
||||||
REM 5. 의존 모듈 클론
|
|
||||||
REM ====================================
|
|
||||||
cd /d "%WORKSPACE_DIR%"
|
|
||||||
|
|
||||||
REM elink-portal-common 클론
|
|
||||||
git clone %GIT_REPO_BASE%/elink-portal-common.git
|
|
||||||
cd elink-portal-common
|
|
||||||
git checkout master
|
|
||||||
|
|
||||||
REM ====================================
|
|
||||||
REM 6. 최종 폴더 구조 확인
|
|
||||||
REM ====================================
|
|
||||||
REM kjb-eapim\
|
|
||||||
REM ├── eapim-portal\
|
|
||||||
REM ├── eapim-online\
|
|
||||||
REM │ └── elink-online-core-jpa\
|
|
||||||
REM ├── elink-portal-common\
|
|
||||||
|
|
||||||
REM ====================================
|
|
||||||
REM 7. eapim-portal 프로젝트로 이동 및 디펜던시 다운로드
|
|
||||||
REM ====================================
|
|
||||||
cd /d "%WORKSPACE_DIR%\eapim-portal"
|
|
||||||
|
|
||||||
REM Gradle 디펜던시 다운로드
|
|
||||||
%GRADLE_CMD% dependencies
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 환경별 설정 파일
|
### 설정 프로파일
|
||||||
|
|
||||||
프로젝트 클론 후 필요한 환경 설정을 수정하세요:
|
프로파일은 용도에 따라 두 종류로 나뉩니다.
|
||||||
|
|
||||||
- `src/main/resources/application-dev.yml` - 개발 환경
|
**서버 배포용** — 저장소에 커밋된 3개. 모두 JNDI 전용이며 WAS(WebLogic)에 배포해서만 동작합니다.
|
||||||
- `src/main/resources/application-stage.yml` - 스테이징 환경
|
|
||||||
- `src/main/resources/application-prod.yml` - 운영 환경
|
|
||||||
- `src/main/resources/application-gf63.yml` - 개인 개발 환경
|
|
||||||
|
|
||||||
### 데이터베이스 설정
|
| 프로파일 | 파일 | 용도 |
|
||||||
|
|---|---|---|
|
||||||
|
| `dev` | `application-dev.yml` | 개발서버 (DevTools, SQL 로깅) |
|
||||||
|
| `stage` | `application-stage.yml` | 스테이징 서버 |
|
||||||
|
| `prod` | `application-prod.yml` | 운영 서버 (캐싱 활성화) |
|
||||||
|
|
||||||
개발 환경(dev)에서는 `application-dev.yml`에 데이터베이스 설정이 포함되어 있습니다.
|
**로컬 전용** (`local_*`) — `gradle bootRun`/IDE 기동용. git 관리되는 샘플 `local_example` 을 복사해
|
||||||
스테이징/운영 환경에서는 JNDI 데이터소스가 필요합니다:
|
각자 `application-local_<이름>.yml` 을 만들어 씁니다 (개인 파일은 커밋하지 않음, 아래 "데이터베이스" 참고).
|
||||||
|
|
||||||
- `jdbc/dsOBP_EMS` - Portal 데이터베이스
|
| 파일 | git | 용도 |
|
||||||
- `jdbc/dsOBP_AGW` - Gateway 데이터베이스
|
|---|---|---|
|
||||||
|
| `application-local_example.yml` / `logback-local_example.xml` | 관리 | 샘플 (비밀번호 `CHANGE_ME`) |
|
||||||
|
| `application-local_<이름>.yml` / `logback-local_<이름>.xml` | **제외** | 개인 프로파일 (실제 비밀번호) |
|
||||||
|
|
||||||
### 주의사항
|
> **로컬 기동은 local 전용 프로파일로만 합니다.** dev/stage/prod 는 서버 배포용이라 bootRun 으로 뜨지 않는 것이
|
||||||
|
> **의도된 동작**입니다 (JNDI 전용, 로그 경로도 서버 경로 `/logs/prod/eapim`).
|
||||||
|
> dev 를 로컬에서 띄우려고 `application-dev.yml` 에 JDBC 정보나 로컬 경로를 넣지 마세요.
|
||||||
|
|
||||||
- **gradlew 사용 금지**: 반드시 시스템에 설치된 gradle을 직접 사용하거나 환경에 맞는 스크립트를 사용하세요
|
> `bootRun` 의 기본 프로파일은 `build.gradle` 의 `bootProfile` 기본값(`local_rinjaemac`, 개인 파일)입니다.
|
||||||
- **Gradle 명령어 변수화**: 위의 `GRADLE_CMD` 변수를 설정하면 환경별로 다른 gradle 명령어 사용 가능
|
> 자기 프로파일은 `-PbootProfile=local_<이름>` 또는 direnv 의 `ORG_GRADLE_PROJECT_bootProfile` 로 지정하세요.
|
||||||
|
|
||||||
|
### 데이터베이스
|
||||||
|
|
||||||
|
서버 배포용 프로파일(dev/stage/prod)은 **모두 JNDI 로 데이터소스를 연결합니다.** 배포 대상 WAS 에 아래 JNDI 리소스가 있어야 합니다.
|
||||||
|
|
||||||
|
| JNDI | 스키마 | 용도 |
|
||||||
|
|---|---|---|
|
||||||
|
| `jdbc/dsOBP_EMS` | `EMSAPP` | Portal — 사용자, 조직, API 키, 승인 |
|
||||||
|
| `jdbc/dsOBP_AGW` | `AGWAPP` | Gateway — API 명세, 서비스 (조회 전용) |
|
||||||
|
|
||||||
|
두 DB 는 JTA/XA 없이 각각 독립 로컬 트랜잭션으로 동작합니다 (`config/PortalConfigTransaction.java`).
|
||||||
|
|
||||||
|
**로컬 기동 (bootRun)** — 내장 Tomcat 에는 JNDI 가 없으므로 local 전용 프로파일에서 `jndi-name` 을 비우고
|
||||||
|
개발 DB(`172.30.1.50:1598/DAPM`)에 직접 접속합니다. `PortalDatasourceConfiguration` 은 `jndi-name` 이 비어 있으면
|
||||||
|
`jdbc-url` 로 직접 접속합니다.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd src/main/resources
|
||||||
|
cp application-local_example.yml application-local_<이름>.yml
|
||||||
|
cp logback-local_example.xml logback-local_<이름>.xml
|
||||||
|
# 복사한 yml 에서 on-profile, logging.config 의 local_example → local_<이름>, password CHANGE_ME → 실제 값
|
||||||
|
```
|
||||||
|
|
||||||
|
자세한 절차는 [개발환경 준비 사항 § 5.2](djb-docs/개발환경-준비-사항.md#52-애플리케이션의-db-연결-방식) 를 참고하세요.
|
||||||
|
|
||||||
|
- 파일명은 반드시 `application-local` / `logback-local` 로 시작 — `build.gradle` 의 `localOnlyResources` 가 WAR 에서 제외합니다
|
||||||
|
- 샘플(`*_example`)에는 실제 비밀번호를 넣지 않습니다
|
||||||
|
- DB 비밀번호가 들어가므로 **커밋 금지** — `.gitignore` 는 개인별 패턴(`*rinjae*`, `*gf63*`)만 무시하니
|
||||||
|
`git check-ignore -v <파일>` 로 확인하세요
|
||||||
|
|
||||||
## 빌드 및 실행
|
## 빌드 및 실행
|
||||||
|
|
||||||
### Gradle 명령어 설정
|
|
||||||
|
|
||||||
**Git Bash:**
|
|
||||||
```bash
|
```bash
|
||||||
export GRADLE_CMD="gradle"
|
# 로컬 기동 (개인 로컬 프로파일 — -Pprofile 이 아니라 -PbootProfile)
|
||||||
```
|
gradle bootRun -PbootProfile=local_<이름>
|
||||||
|
# → http://localhost:39130
|
||||||
**Windows CMD:**
|
|
||||||
```cmd
|
|
||||||
set GRADLE_CMD=gradle
|
|
||||||
```
|
|
||||||
|
|
||||||
### 빌드 및 실행 명령어
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 개발 환경 실행
|
|
||||||
$GRADLE_CMD bootRun
|
|
||||||
# 또는: %GRADLE_CMD% bootRun (CMD)
|
|
||||||
|
|
||||||
# WAR 빌드
|
|
||||||
$GRADLE_CMD bootWar
|
|
||||||
|
|
||||||
# 테스트
|
|
||||||
$GRADLE_CMD test
|
|
||||||
|
|
||||||
# 컴파일만 수행
|
# 컴파일만 수행
|
||||||
$GRADLE_CMD classes
|
gradle classes
|
||||||
|
|
||||||
|
# 테스트
|
||||||
|
gradle test
|
||||||
|
gradle test --tests "com.eactive.apim.portal.apps.user.AccountControllerTest"
|
||||||
|
|
||||||
|
# 실행 가능 WAR → build/libs/eapim-portal-boot.war
|
||||||
|
gradle bootWar
|
||||||
|
|
||||||
|
# WAS 배포용 WAR (WebLogic/JEUS) → build/libs/eapim-portal.war
|
||||||
|
gradle war
|
||||||
|
|
||||||
# 전체 빌드
|
# 전체 빌드
|
||||||
$GRADLE_CMD clean build
|
gradle clean build
|
||||||
```
|
|
||||||
|
|
||||||
**주의**: gradlew 사용 금지 - offline gradle 단독 실행
|
# SBOM (xlsx)
|
||||||
|
gradle sbomXlsx
|
||||||
|
```
|
||||||
|
|
||||||
## 프로젝트 구조
|
## 프로젝트 구조
|
||||||
|
|
||||||
### 전체 프로젝트 구조
|
|
||||||
```
|
```
|
||||||
kjb-eapim/
|
src/main/java/com/eactive/apim/
|
||||||
├── eapim-portal/ # Portal 웹 애플리케이션 (현재 프로젝트)
|
├── portal/
|
||||||
├── eapim-online/ # Online 프로젝트
|
│ ├── apps/ # 기능 모듈 (user, app, approval, apis, community, dashboard, ...)
|
||||||
│ └── elink-online-core-jpa/ # Gateway 데이터 모델
|
│ ├── common/ # 공통 관심사 (예외, 보안, 비밀번호 전송암호화)
|
||||||
├── elink-portal-common/ # 공통 유틸리티
|
│ ├── config/ # Spring 설정 (Security, Datasource, Transaction)
|
||||||
|
│ ├── custom/ # 사이트별 커스터마이징
|
||||||
|
│ ├── djb/ # 제주은행 특화 기능 (apistatus, community, footer, guide, menu, webhook, ...)
|
||||||
|
│ ├── spring/ # DatabaseSessionVerifier 등
|
||||||
|
│ └── tools/ # HibernateSqlGenerator, JpaErrorLoggingAspect
|
||||||
|
└── gateway/ # Gateway DB 직접 접근 (portal 하위가 아님)
|
||||||
```
|
```
|
||||||
|
|
||||||
### eapim-portal 내부 구조
|
코드는 기술 계층이 아닌 **기능 모듈(수직 분할)** 방식이며, 각 모듈은 `controller/` · `service/` · `repository/` · `dto/` · `mapper/` 로 구성됩니다.
|
||||||
```
|
|
||||||
src/main/java/com/eactive/apim/portal/
|
|
||||||
├── apps/ # 기능 모듈 (user, app, approval, apis, etc.)
|
|
||||||
├── common/ # 공통 관심사
|
|
||||||
├── config/ # Spring 설정
|
|
||||||
└── gateway/ # Gateway DB 접근
|
|
||||||
```
|
|
||||||
|
|
||||||
## 외부 모듈
|
|
||||||
|
|
||||||
이 프로젝트는 다음 모듈에 의존합니다 (settings.gradle 참조):
|
|
||||||
- `eapim-online/elink-online-core-jpa`: Gateway 데이터 모델 (../eapim-online/elink-online-core-jpa)
|
|
||||||
- `elink-portal-common`: 공통 유틸리티 (../elink-portal-common)
|
|
||||||
|
|
||||||
## SASS / CSS 스타일 개발
|
## SASS / CSS 스타일 개발
|
||||||
|
|
||||||
### 개요
|
### 개요
|
||||||
|
|
||||||
이 프로젝트는 **Dart Sass**를 사용하여 CSS를 관리합니다.
|
이 프로젝트는 **Dart Sass**로 CSS를 관리합니다.
|
||||||
`src/main/resources/static/css/main.css`는 SASS에서 컴파일된 결과물이므로 **직접 수정하면 안 됩니다.**
|
`src/main/resources/static/css/main.css`는 SASS에서 컴파일된 결과물이므로 **직접 수정하면 안 됩니다.**
|
||||||
스타일 변경은 반드시 `src/main/resources/static/sass/` 하위 파일을 수정하세요.
|
스타일 변경은 반드시 `src/main/resources/static/sass/` 하위 파일을 수정하세요.
|
||||||
|
|
||||||
|
디자인 토큰·컴포넌트 규약은 📄 **[`DESIGN.md`](DESIGN.md)** 를 참고하세요.
|
||||||
|
|
||||||
### 설치
|
### 설치
|
||||||
|
|
||||||
Node.js 및 SASS 설치 절차는 [개발환경 준비 사항 § 6. Node.js & SASS 빌드 환경](djb-docs/개발환경-준비-사항.md#6-nodejs--sass-빌드-환경) 을 참고하세요.
|
Node.js 및 SASS 설치 절차는 [개발환경 준비 사항 § 6. Node.js & SASS 빌드 환경](djb-docs/개발환경-준비-사항.md#6-nodejs--sass-빌드-환경) 을 참고하세요.
|
||||||
@@ -355,7 +281,7 @@ src/main/resources/static/sass/
|
|||||||
│ ├── _reset.scss
|
│ ├── _reset.scss
|
||||||
│ ├── _typography.scss
|
│ ├── _typography.scss
|
||||||
│ ├── _animations.scss
|
│ ├── _animations.scss
|
||||||
│ ├── _kjb-font.scss # 광주은행 전용 폰트
|
│ ├── _djb-font.scss # 제주은행 전용 폰트
|
||||||
│ └── _utilities.scss # 유틸리티 클래스
|
│ └── _utilities.scss # 유틸리티 클래스
|
||||||
│
|
│
|
||||||
├── layout/ # 페이지 레이아웃 구조
|
├── layout/ # 페이지 레이아웃 구조
|
||||||
@@ -369,16 +295,15 @@ src/main/resources/static/sass/
|
|||||||
│ ├── _forms.scss
|
│ ├── _forms.scss
|
||||||
│ ├── _modals.scss # customPopup 모달 스타일
|
│ ├── _modals.scss # customPopup 모달 스타일
|
||||||
│ ├── _tables.scss
|
│ ├── _tables.scss
|
||||||
│ ├── _badges.scss
|
│ ├── _djb-inquiry-comments.scss
|
||||||
│ ├── _cards.scss
|
│ ├── _session-timer.scss
|
||||||
│ ├── _navigation.scss
|
|
||||||
│ ├── _pagination.scss
|
|
||||||
│ └── ...
|
│ └── ...
|
||||||
│
|
│
|
||||||
├── pages/ # 페이지별 스타일
|
├── pages/ # 페이지별 스타일
|
||||||
│ ├── _mypage.scss
|
│ ├── _mypage.scss
|
||||||
│ ├── _login.scss
|
│ ├── _login.scss
|
||||||
│ ├── _apikey-list.scss
|
│ ├── _apikey-list.scss
|
||||||
|
│ ├── _webhook.scss
|
||||||
│ └── ...
|
│ └── ...
|
||||||
│
|
│
|
||||||
├── themes/
|
├── themes/
|
||||||
@@ -424,7 +349,7 @@ touch src/main/resources/static/sass/pages/_new-page.scss
|
|||||||
```scss
|
```scss
|
||||||
// abstracts/_variables.scss 에 정의된 변수 사용
|
// abstracts/_variables.scss 에 정의된 변수 사용
|
||||||
.my-component {
|
.my-component {
|
||||||
color: $primary-blue; // #0049b4 (광주은행 블루)
|
color: $primary-blue; // #0049b4 (주 브랜드 블루)
|
||||||
background: $gray-bg; // #F8FAFC
|
background: $gray-bg; // #F8FAFC
|
||||||
border: 1px solid $border-gray; // #E2E8F0
|
border: 1px solid $border-gray; // #E2E8F0
|
||||||
box-shadow: $shadow-md;
|
box-shadow: $shadow-md;
|
||||||
@@ -435,7 +360,6 @@ touch src/main/resources/static/sass/pages/_new-page.scss
|
|||||||
### 컴파일 결과 확인
|
### 컴파일 결과 확인
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 컴파일 후 출력 파일 확인
|
|
||||||
ls -lh src/main/resources/static/css/main.css
|
ls -lh src/main/resources/static/css/main.css
|
||||||
ls -lh src/main/resources/static/css/main.min.css # minified
|
ls -lh src/main/resources/static/css/main.min.css # minified
|
||||||
```
|
```
|
||||||
@@ -446,82 +370,69 @@ ls -lh src/main/resources/static/css/main.min.css # minified
|
|||||||
- `style2.css` 는 레거시 파일(구 디자인 시스템)이며 `main.css` 와 **별도로 관리됨**
|
- `style2.css` 는 레거시 파일(구 디자인 시스템)이며 `main.css` 와 **별도로 관리됨**
|
||||||
- `@import` 대신 **`@use`** 사용 (Dart Sass 3.0 호환)
|
- `@import` 대신 **`@use`** 사용 (Dart Sass 3.0 호환)
|
||||||
- 파일명 앞에 언더스코어(`_`) 필수 — `_filename.scss` 형식이어야 단독 컴파일되지 않음
|
- 파일명 앞에 언더스코어(`_`) 필수 — `_filename.scss` 형식이어야 단독 컴파일되지 않음
|
||||||
|
- 신규 폼은 **DJB 계열 클래스**(`.djb-label`, `.djb-input` 등)를 사용 — 자세한 내용은 `DESIGN.md`
|
||||||
|
|
||||||
---
|
## 주요 기능
|
||||||
|
|
||||||
|
- 사용자 관리 (내부 사용자 / 기업 사용자, 가입 → 이메일 인증 → 관리자 승인)
|
||||||
|
- API 키 관리 및 승인 워크플로우
|
||||||
|
- API 카탈로그 · 문서 · 테스트베드
|
||||||
|
- 웹훅 구독 관리
|
||||||
|
- 커뮤니티 (FAQ, 공지사항, Q&A, 제휴문의)
|
||||||
|
- 감사 추적 (Hibernate Envers)
|
||||||
|
|
||||||
|
## 배포
|
||||||
|
|
||||||
|
### 지원 서버
|
||||||
|
|
||||||
|
- **WebLogic** (`src/main/resources/weblogic.xml`) — 현재 실제 배포 대상
|
||||||
|
- JEUS (`src/main/resources/jeus-web-dd.xml`)
|
||||||
|
- Tomcat (Spring Boot 내장)
|
||||||
|
|
||||||
|
### Jenkins 파이프라인
|
||||||
|
|
||||||
|
저장소 루트의 Jenkinsfile 4개가 모두 `origin/master` 를 대상으로 합니다.
|
||||||
|
`master` 에 push 하면 `Jenkinsfile.security` 가 pollSCM 으로 자동 실행됩니다.
|
||||||
|
|
||||||
|
| 파일 | 용도 |
|
||||||
|
|---|---|
|
||||||
|
| `Jenkinsfile.security` | OWASP Dependency-Check(SCA) + SonarQube(SAST), pollSCM 자동 트리거 |
|
||||||
|
| `Jenkinsfile.sonar` | SonarQube 정적 분석 전용 |
|
||||||
|
| `Jenkinsfile.test-build` | 테스트 + WAR 빌드 + SBOM |
|
||||||
|
| `Jenkinsfile.deploy` | WAR 빌드 후 WebLogic 배포 (정지 → WAR 교체 → 기동 → readiness 확인) |
|
||||||
|
|
||||||
|
파이프라인의 `Checkout dependencies` 스테이지가 `elink-portal-common`, `elink-online-core-jpa` 를 자동으로 clone/reset 합니다.
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gradle bootWar
|
||||||
|
docker build -t eapim-portal:latest .
|
||||||
|
```
|
||||||
|
|
||||||
## AI 코딩 어시스턴트 지침 파일
|
## AI 코딩 어시스턴트 지침 파일
|
||||||
|
|
||||||
이 프로젝트는 여러 AI 코딩 어시스턴트를 지원합니다. 각 도구는 다음 파일을 참조합니다:
|
|
||||||
|
|
||||||
### 지침 파일 위치
|
|
||||||
|
|
||||||
| AI 도구 | 지침 파일 경로 | 용도 |
|
| AI 도구 | 지침 파일 경로 | 용도 |
|
||||||
|---------|---------------|------|
|
|---------|---------------|------|
|
||||||
| **Claude Code** | `CLAUDE.md` | 마스터 지침 파일 (한글) |
|
| **Claude Code** | `CLAUDE.md` | 마스터 지침 파일 (한글) |
|
||||||
| **GitHub Copilot** | `.github/copilot-instructions.md` | Copilot용 지침 |
|
| **GitHub Copilot** | `.github/copilot-instructions.md` | Copilot용 지침 |
|
||||||
| **Cursor** | `.cursorrules` | Cursor용 간결한 규칙 |
|
| **Cursor** | `.cursorrules` | Cursor용 간결한 규칙 |
|
||||||
|
|
||||||
### 지침 파일 관리 방법
|
`CLAUDE.md` 가 마스터입니다. 수정 시 이 파일을 먼저 업데이트한 뒤 다른 파일에 반영하세요.
|
||||||
|
|
||||||
1. **마스터 파일**: `CLAUDE.md`
|
```bash
|
||||||
- 가장 상세한 프로젝트 지침을 포함
|
# copilot-instructions.md 는 8줄 머리말 + CLAUDE.md 본문 구조다 (머리말 보존)
|
||||||
- 한글로 작성되어 한국 개발팀이 이해하기 쉬움
|
{ head -8 .github/copilot-instructions.md; cat CLAUDE.md; } > /tmp/ci.md && mv /tmp/ci.md .github/copilot-instructions.md
|
||||||
- 수정 시 이 파일을 먼저 업데이트
|
# .cursorrules 는 간결한 버전이므로 필요 시 수동 업데이트
|
||||||
|
```
|
||||||
2. **동기화**:
|
|
||||||
```bash
|
|
||||||
# CLAUDE.md 수정 후 다른 파일들 동기화
|
|
||||||
cp CLAUDE.md .github/copilot-instructions.md
|
|
||||||
# .cursorrules는 간결한 버전이므로 필요시 수동 업데이트
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **새로운 AI 도구 지원 추가**:
|
|
||||||
- Windsurf: `.windsurfrules` 파일 생성
|
|
||||||
- 기타 도구: 해당 도구의 규칙 파일명 확인 후 생성
|
|
||||||
|
|
||||||
### 지침 파일에 포함된 내용
|
|
||||||
|
|
||||||
- 프로젝트 개요 및 기술 스택
|
|
||||||
- 빌드 명령어 및 개발 환경 설정
|
|
||||||
- 아키텍처 구조 (멀티 모듈, 이중 DB)
|
|
||||||
- 주요 기능 및 비즈니스 로직
|
|
||||||
- 개발 패턴 및 코딩 컨벤션
|
|
||||||
- 보안, 트랜잭션, 로깅 가이드
|
|
||||||
- 테스트 패턴
|
|
||||||
- 배포 방법
|
|
||||||
|
|
||||||
## 환경 설정
|
|
||||||
|
|
||||||
### 프로파일
|
|
||||||
|
|
||||||
- **dev**: 개발 환경
|
|
||||||
- **stage**: 스테이징 환경
|
|
||||||
- **prod**: 운영 환경
|
|
||||||
- **gf63**: 개인 개발 환경
|
|
||||||
- **kjb_rinjae**: 개인 개발 환경
|
|
||||||
|
|
||||||
### 데이터베이스
|
|
||||||
|
|
||||||
- **EMS Database**: Portal 사용자, 조직, API 키
|
|
||||||
- **Gateway Database**: API 명세, 서비스
|
|
||||||
|
|
||||||
## 주요 기능
|
|
||||||
|
|
||||||
- 사용자 관리 (내부/기업)
|
|
||||||
- API 키 관리 및 승인 워크플로우
|
|
||||||
- 감사 추적 (Hibernate Envers)
|
|
||||||
|
|
||||||
## 배포
|
|
||||||
|
|
||||||
### 지원 서버
|
|
||||||
- JEUS
|
|
||||||
- WebLogic
|
|
||||||
- Tomcat (내장)
|
|
||||||
|
|
||||||
## 문서
|
## 문서
|
||||||
|
|
||||||
- **개발환경 준비 사항**: [`djb-docs/개발환경-준비-사항.md`](djb-docs/개발환경-준비-사항.md) — JDK·Gradle·Node.js·SASS 설치 가이드
|
- **개발환경 준비 사항**: [`djb-docs/개발환경-준비-사항.md`](djb-docs/개발환경-준비-사항.md) — JDK·Gradle·Node.js·SASS 설치 가이드
|
||||||
|
- **로컬 기동 가이드 (Windows/Eclipse)**: [`BOOTRUN_SETUP_GUIDE.md`](BOOTRUN_SETUP_GUIDE.md)
|
||||||
|
- **OHS 정적 리소스 설정**: [`djb-docs/OHS-StaticResource-설정.md`](djb-docs/OHS-StaticResource-설정.md)
|
||||||
|
- **디자인 시스템**: [`DESIGN.md`](DESIGN.md) — 디자인 토큰·컴포넌트 규약·SASS 작성 규칙
|
||||||
- **메뉴 관리 개발 가이드**: [`readme-docs/메뉴-관리-개발-가이드.md`](readme-docs/메뉴-관리-개발-가이드.md) — menu.yml/roles.yml 스키마·시딩 규칙·캐시 리로드·admin 포탈메뉴관리 연동
|
- **메뉴 관리 개발 가이드**: [`readme-docs/메뉴-관리-개발-가이드.md`](readme-docs/메뉴-관리-개발-가이드.md) — menu.yml/roles.yml 스키마·시딩 규칙·캐시 리로드·admin 포탈메뉴관리 연동
|
||||||
- **프로젝트 상세 지침**: `CLAUDE.md` (한글)
|
- **프로젝트 상세 지침**: `CLAUDE.md` (한글)
|
||||||
- **사용자 가이드**: `개발자포탈.md` (한글)
|
- **사용자 가이드**: `개발자포탈.md` (한글)
|
||||||
- **빌드 스크립트**: `build-gf63.sh`, `deploy_portal.sh`
|
- **CI 설정**: `Jenkinsfile.*`, `sonar-project.properties`, `ci/`
|
||||||
|
|||||||
+124
-12
@@ -3,6 +3,7 @@ plugins {
|
|||||||
id 'war'
|
id 'war'
|
||||||
id 'eclipse'
|
id 'eclipse'
|
||||||
id 'idea'
|
id 'idea'
|
||||||
|
id 'jacoco'
|
||||||
id 'org.cyclonedx.bom' version '3.2.4'
|
id 'org.cyclonedx.bom' version '3.2.4'
|
||||||
id 'org.springframework.boot' version '2.7.18'
|
id 'org.springframework.boot' version '2.7.18'
|
||||||
id 'io.spring.dependency-management' version '1.1.3'
|
id 'io.spring.dependency-management' version '1.1.3'
|
||||||
@@ -83,7 +84,14 @@ dependencies {
|
|||||||
implementation group: 'com.fasterxml.woodstox', name: 'woodstox-core', version: '6.5.1'
|
implementation group: 'com.fasterxml.woodstox', name: 'woodstox-core', version: '6.5.1'
|
||||||
|
|
||||||
|
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
// Thymeleaf 3.1 코어가 #temporals 를 내장 제공 → java8time extras 를 함께 두면 표현식 객체가 중복 등록된다.
|
||||||
|
implementation('org.springframework.boot:spring-boot-starter-thymeleaf') {
|
||||||
|
exclude group: 'org.thymeleaf.extras', module: 'thymeleaf-extras-java8time'
|
||||||
|
}
|
||||||
|
// WW-5417 관련 public 필드 접근 권한 검사 누락 수정(OGNL #264/#265).
|
||||||
|
// 3.3.x EOL 계열의 단기 조치. 3.4.x는 Thymeleaf 3.1.5의 OgnlContext 생성자와 비호환.
|
||||||
|
// 일반 OGNL 경로도 ThymeleafExpressionCompatibilityTest로 검증한다(Spring EL만으로는 확인 불가).
|
||||||
|
implementation 'ognl:ognl:3.3.5'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||||
implementation('org.springframework.boot:spring-boot-starter-cache')
|
implementation('org.springframework.boot:spring-boot-starter-cache')
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||||
@@ -91,33 +99,51 @@ dependencies {
|
|||||||
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
|
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
|
||||||
|
|
||||||
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
||||||
implementation 'org.springframework:spring-expression:5.3.30'
|
// spring-expression 개별 pin 제거: 아래 ext 의 spring-framework.version 이 전 모듈을 일괄 관리한다.
|
||||||
|
// 개별 pin 이 남아 있으면 다른 spring-* 모듈보다 낮은 버전으로 고정되어 버전이 어긋난다.
|
||||||
|
|
||||||
implementation group: 'xalan', name: 'xalan', version: '2.7.3'
|
implementation group: 'xalan', name: 'xalan', version: '2.7.3'
|
||||||
|
|
||||||
implementation 'org.hibernate:hibernate-envers:5.6.15.Final'
|
implementation 'org.hibernate:hibernate-envers:5.6.15.Final'
|
||||||
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:3.0.0'
|
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:3.4.0' // 3.0.0 은 thymeleaf 3.0 전용
|
||||||
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
|
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
|
||||||
|
|
||||||
implementation 'com.github.ua-parser:uap-java:1.5.3'
|
// uap-java 제거: 소스 전체에 ua_parser 참조 0건이고, 1.5.3 은 snakeyaml 2.x 에서 삭제된
|
||||||
|
// SafeConstructor() no-arg 를 호출해 NoSuchMethodError 를 낸다. 되살릴 경우 1.6.1 이상.
|
||||||
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
|
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
|
||||||
implementation 'com.navercorp.lucy:lucy-xss-servlet:2.0.1'
|
implementation 'com.navercorp.lucy:lucy-xss-servlet:2.0.1'
|
||||||
|
// 관리자 작성 HTML(공지 본문 등) 화이트리스트 정제. lucy-xss 는 허용 외 태그를 escape 해 그대로 노출하므로
|
||||||
|
// 태그를 제거해야 하는 곳(API Status 공지 본문)은 jsoup Safelist 를 쓴다. 1.17.x 는 Java 8 지원.
|
||||||
|
implementation 'org.jsoup:jsoup:1.17.2'
|
||||||
implementation 'javax.servlet:javax.servlet-api:4.0.0'
|
implementation 'javax.servlet:javax.servlet-api:4.0.0'
|
||||||
implementation 'org.jasypt:jasypt:1.9.3'
|
implementation 'org.jasypt:jasypt:1.9.3'
|
||||||
implementation 'xerces:xercesImpl:2.12.2'
|
implementation 'xerces:xercesImpl:2.12.2'
|
||||||
|
|
||||||
implementation 'org.apache.commons:commons-lang3:3.12.0'
|
// weblogic.xml prefer-application-packages 가 com.fasterxml.jackson.* 를 앱 우선으로 강제한다
|
||||||
|
// (oracle_common jackson-databind 2.17.0 vs 앱 2.18.10 split-package 방지, WLog 실사용 확인).
|
||||||
|
// Thymeleaf StandardJavaScriptSerializer 가 ObjectMapper.findAndRegisterModules() 로
|
||||||
|
// jackson-module-jaxb-annotations 를 옵션 모듈로 자동탐색하는데, 이 모듈은 WebLogic 번들에만
|
||||||
|
// 있고 앱엔 없어 ServiceConfigurationError(Provider not found) 발생 → 앱에도 명시 추가해
|
||||||
|
// jackson 전체를 자체 완결시킨다(jackson-bom 2.18.10 로 버전 통일).
|
||||||
|
implementation 'com.fasterxml.jackson.module:jackson-module-jaxb-annotations'
|
||||||
|
|
||||||
|
// Uncontrolled recursion in ClassUtils.getClass(...) on very long inputs. 3.18.0+ 에서 수정.
|
||||||
|
implementation 'org.apache.commons:commons-lang3:3.20.0'
|
||||||
implementation 'org.apache.commons:commons-collections4:4.4'
|
implementation 'org.apache.commons:commons-collections4:4.4'
|
||||||
|
|
||||||
implementation 'commons-net:commons-net:3.9.0'
|
implementation 'commons-net:commons-net:3.9.0'
|
||||||
implementation('commons-beanutils:commons-beanutils:1.9.4') {
|
// CVE-2025-48734 (PropertyUtilsBean 이 enum 의 declaredClass 프로퍼티 노출 → ClassLoader 접근/RCE).
|
||||||
|
// 1.11.0 부터 SuppressPropertiesBeanIntrospector 가 기본 활성이라 declaredClass 접근이 차단된다.
|
||||||
|
// 이 앱의 호출부(PasswordMatchValidator / PasswordRuleValidator / AuthNumberValidator)는
|
||||||
|
// 어노테이션에 박힌 고정 프로퍼티명만 넘기므로 외부 입력 경로는 없지만 버전은 올려 둔다.
|
||||||
|
// 1.11.0 = Java 8 바이트코드(major 52), PropertyUtils.getProperty/getNestedProperty API 동일.
|
||||||
|
implementation('commons-beanutils:commons-beanutils:1.11.0') {
|
||||||
// exclude group: 'commons-collections', module: 'commons-collections'
|
// exclude group: 'commons-collections', module: 'commons-collections'
|
||||||
}
|
}
|
||||||
implementation 'org.mapstruct:mapstruct:1.5.5.Final'
|
implementation 'org.mapstruct:mapstruct:1.5.5.Final'
|
||||||
// WS-2026-0003 (jackson-core async parser DoS, CVSS 7.5) — 2.18.6 에서 수정. JDK8 호환.
|
// jackson 개별 pin 제거: 아래 ext 의 jackson-bom.version 이 전 모듈을 일괄 관리한다.
|
||||||
implementation 'com.fasterxml.jackson.core:jackson-core:2.18.6'
|
// 개별 pin 은 BOM 보다 우선하므로 남겨 두면 BOM 만 올렸을 때 core/annotations/databind 가
|
||||||
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.18.6'
|
// 옛 버전에 고정돼 버전이 어긋난다(실제로 그런 상태였다).
|
||||||
implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.6'
|
|
||||||
|
|
||||||
implementation group: 'org.apache.velocity', name: 'velocity-engine-core', version: '2.3'
|
implementation group: 'org.apache.velocity', name: 'velocity-engine-core', version: '2.3'
|
||||||
|
|
||||||
@@ -127,7 +153,10 @@ dependencies {
|
|||||||
implementation 'net.bytebuddy:byte-buddy:1.14.5'
|
implementation 'net.bytebuddy:byte-buddy:1.14.5'
|
||||||
|
|
||||||
// Commons FileUpload (WAS 독립적인 multipart 처리)
|
// Commons FileUpload (WAS 독립적인 multipart 처리)
|
||||||
implementation 'commons-fileupload:commons-fileupload:1.5'
|
// CVE-2025-48976 (멀티파트 파트 헤더 크기 제한 부재 → DoS). 1.6.0 에서 partHeaderSizeMax 도입.
|
||||||
|
// 주의: 1.6 부터 파트 헤더 총량 기본 상한이 10240 → 512 바이트로 줄었다(DEFAULT_PART_HEADER_SIZE_MAX).
|
||||||
|
// 한글 파일명은 UTF-8 로 3바이트/자라 Content-Disposition 이 길어질 수 있어 실측으로 여유를 확인했다.
|
||||||
|
implementation 'commons-fileupload:commons-fileupload:1.6.0'
|
||||||
implementation 'commons-io:commons-io:2.15.1'
|
implementation 'commons-io:commons-io:2.15.1'
|
||||||
|
|
||||||
|
|
||||||
@@ -145,6 +174,49 @@ ext {
|
|||||||
springMavenArtifactVersion = '5.3.30'
|
springMavenArtifactVersion = '5.3.30'
|
||||||
encoding = 'UTF-8'
|
encoding = 'UTF-8'
|
||||||
profile = 'local'
|
profile = 'local'
|
||||||
|
|
||||||
|
// 내장 Tomcat 버전 상향 (Spring Boot 2.7.18 기본값 9.0.83 → 9.0.120).
|
||||||
|
// Boot BOM 의 tomcat.version 프로퍼티를 덮어써서 tomcat-embed-core/-el/-websocket 이 함께 올라간다.
|
||||||
|
// 9.0.x 계열 유지 = Servlet 4.0 / javax.* 네임스페이스 그대로, JDK8 호환.
|
||||||
|
set('tomcat.version', '9.0.120')
|
||||||
|
|
||||||
|
// CVE-2022-1471 (snakeyaml Constructor 임의 타입 역직렬화 → RCE). Boot 2.7.18 BOM 기본값 1.30 → 2.6.
|
||||||
|
// 앱/프레임워크 실경로는 이미 SafeConstructor 계열(OriginTrackedYamlLoader, spring-beans
|
||||||
|
// FilteringConstructor, swagger-parser DeserializationUtils)이라 익스플로잇 경로는 없었으나
|
||||||
|
// SCA 는 버전으로 판정하므로 2.x 로 올린다. snakeyaml 2.6 = Java 8 바이트코드(major 52).
|
||||||
|
// 2.6 인 이유: swagger-core 2.2.52 / swagger-parser-v3 2.1.45 가 요구하는 버전이라 강등이 없다.
|
||||||
|
// 부수 효과: swagger-parser 가 호출하는 LoaderOptions.setCodePointLimit(1.32+ API) 도 해소.
|
||||||
|
set('snakeyaml.version', '2.6')
|
||||||
|
|
||||||
|
// jackson 전 모듈 버전 통일(Boot 2.7.18 BOM 기본 2.13.5). 2.18.x 는 JDK8 호환 라인이다.
|
||||||
|
// 이유 3가지
|
||||||
|
// 1) snakeyaml 2.x 는 ParserImpl(StreamReader) 를 제거했고 jackson-dataformat-yaml 은
|
||||||
|
// 2.15+ 부터 ParserImpl(StreamReader, LoaderOptions) 를 쓴다 — 위 snakeyaml 상향의 전제.
|
||||||
|
// 2) WS-2026-0003 (jackson-core async parser DoS, CVSS 7.5) — 2.18.6 에서 수정.
|
||||||
|
// 3) jackson-databind PolymorphicTypeValidator 우회(제네릭 타입 인자 미검증) — 2.18.8 에서 수정.
|
||||||
|
// 이 앱은 다형성 역직렬화(activateDefaultTyping/@JsonTypeInfo)를 쓰지 않아 노출 경로는 없다.
|
||||||
|
// 2.18.x 마지막 패치를 쓴다.
|
||||||
|
set('jackson-bom.version', '2.18.10')
|
||||||
|
|
||||||
|
// CVE-2026-41901: ≤3.1.4의 제한된 표현식 구문 검사 우회(SSTI)를 3.1.5에서 수정.
|
||||||
|
// Boot 의존성 관리로 core/spring5를 함께 맞추며 Java8 / Spring5 / javax.servlet을 유지한다.
|
||||||
|
// extras-springsecurity5 3.1.5 / layout-dialect 3.4.0은 유지.
|
||||||
|
// ThymeleafBootMvcCompatibilityTest가 Boot 2.7 자동 구성 엔진·ViewResolver의 초기화,
|
||||||
|
// MVC 폼·레이아웃·보안 표시를 검증한다. 실제 WAS 기동/재배포 검증은 별도 배포 조건이다.
|
||||||
|
// 주의: 3.1 은 #request/#session/#response/#servletContext 표현식 객체를 제거했다(IllegalArgumentException).
|
||||||
|
set('thymeleaf.version', '3.1.5.RELEASE')
|
||||||
|
set('thymeleaf-extras-springsecurity.version', '3.1.5.RELEASE')
|
||||||
|
|
||||||
|
// Spring Framework 5.3.x OSS 마지막 릴리스로 통일(Boot 2.7.18 BOM 기본 5.3.31, 일부 5.3.30 혼재였음).
|
||||||
|
// 5.3.32~5.3.39 구간 CVE 정리용. 5.3.x 는 OSS EOL 이라 이 위로는 상용(Enterprise) 빌드뿐이다.
|
||||||
|
// 남는 5.3.x 지적(CVE-2026-41855 JMS Jackson 역직렬화, CVE-2016-1000027 HttpInvoker)은
|
||||||
|
// 5.3 계열에 수정본이 없고 앱이 JMS/HttpInvoker 를 쓰지 않으므로 억제 항목으로 따로 관리한다.
|
||||||
|
set('spring-framework.version', '5.3.39')
|
||||||
|
|
||||||
|
// Spring Security 5.7.x OSS 마지막 릴리스(Boot 2.7.18 BOM 기본 5.7.11).
|
||||||
|
// CVE-2026-22732(응답 커밋 후 보안 헤더 미기록)는 수정본이 5.7.22/5.8.24 = Enterprise 전용이라
|
||||||
|
// OSS 로는 올릴 수 없다. 우회책(HeaderWriterFilter.shouldWriteHeadersEagerly=true)은 동작 변경이라 분리 검토.
|
||||||
|
set('spring-security.version', '5.7.14')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -222,12 +294,40 @@ test {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
enabled = true
|
enabled = true
|
||||||
|
|
||||||
|
// 테스트가 끝나면 커버리지 리포트를 자동 생성한다.
|
||||||
|
// SonarQube 는 리포트가 없으면 "미측정"이 아니라 0% 로 집계하므로(Zero Coverage Sensor)
|
||||||
|
// 리포트 생성이 빠지면 Quality Gate 의 "새 코드 커버리지" 조건에서 항상 실패한다.
|
||||||
|
finalizedBy jacocoTestReport
|
||||||
|
}
|
||||||
|
|
||||||
|
// JaCoCo 0.8.11 = Gradle 8.7 기본값. JDK 8 바이트코드 계측 지원.
|
||||||
|
jacoco {
|
||||||
|
toolVersion = '0.8.11'
|
||||||
|
}
|
||||||
|
|
||||||
|
jacocoTestReport {
|
||||||
|
dependsOn test
|
||||||
|
|
||||||
|
reports {
|
||||||
|
// Sonar 가 읽는 형식은 XML 뿐이다. HTML 은 사람이 볼 용도.
|
||||||
|
xml.required = true
|
||||||
|
html.required = true
|
||||||
|
csv.required = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 여기서 클래스를 제외하지 말 것.
|
||||||
|
// JaCoCo 리포트에서 빠진 클래스는 Sonar 에 "데이터 없음"으로 도달하고,
|
||||||
|
// Sonar 의 Zero Coverage Sensor 가 그 파일을 0% 로 채워 넣는다(= 오히려 악화).
|
||||||
|
// 커버리지 집계에서 빼고 싶은 파일은 sonar-project.properties 의
|
||||||
|
// sonar.coverage.exclusions 로 지정한다.
|
||||||
}
|
}
|
||||||
|
|
||||||
// 로컬 전용 설정 파일. 배포 산출물(WAR)에 실리면 Actuator/SBA 설정이 그대로 노출되어
|
// 로컬 전용 설정 파일. 배포 산출물(WAR)에 실리면 Actuator/SBA 설정이 그대로 노출되어
|
||||||
// 정보보호 점검에 불필요하게 걸린다. processResources 는 건드리지 않는다
|
// 정보보호 점검에 불필요하게 걸린다. processResources 는 건드리지 않는다
|
||||||
// (bootRun 이 build/resources/main 을 그대로 쓰므로 로컬 기동이 깨진다).
|
// (bootRun 이 build/resources/main 을 그대로 쓰므로 로컬 기동이 깨진다).
|
||||||
def localOnlyResources = ['**/application-local*.yml']
|
// logback-local*.xml: git 관리되는 샘플(logback-local_example.xml)이 WAR 에 실리지 않도록 함께 제외한다.
|
||||||
|
def localOnlyResources = ['**/application-local*.yml', '**/logback-local*.xml']
|
||||||
|
|
||||||
// 배포 산출물에서 로컬 전용 라이브러리를 걸러낸다. localOnlyLibPrefixes 는 파일 상단 정의.
|
// 배포 산출물에서 로컬 전용 라이브러리를 걸러낸다. localOnlyLibPrefixes 는 파일 상단 정의.
|
||||||
def excludeLocalOnlyLibs = { org.gradle.api.file.FileCollection cp ->
|
def excludeLocalOnlyLibs = { org.gradle.api.file.FileCollection cp ->
|
||||||
@@ -251,6 +351,18 @@ war {
|
|||||||
classpath = excludeLocalOnlyLibs(classpath)
|
classpath = excludeLocalOnlyLibs(classpath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 정적 리소스만 별도 zip (OHS 추가 배포용). war/bootWar 는 그대로 정적 리소스 포함 유지
|
||||||
|
// (WAS 단독 접속 인원 지원). sass/ 는 컴파일 소스이며 실제 서빙 경로에 없어 제외
|
||||||
|
// (PortalConfigWebDispatcherServlet#addResourceHandlers 기준).
|
||||||
|
task staticResourcesZip(type: Zip) {
|
||||||
|
archiveFileName = "eapim-portal-static.zip"
|
||||||
|
destinationDirectory = file("$buildDir/libs")
|
||||||
|
from('src/main/resources/static') {
|
||||||
|
exclude 'sass/**'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assemble.dependsOn staticResourcesZip
|
||||||
|
|
||||||
task printSourceSets {
|
task printSourceSets {
|
||||||
doLast {
|
doLast {
|
||||||
sourceSets.each { srcSet ->
|
sourceSets.each { srcSet ->
|
||||||
|
|||||||
@@ -28,4 +28,219 @@
|
|||||||
</suppress>
|
</suppress>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<!-- ================================================================================
|
||||||
|
Spring 계열 Critical 5건 (2026-08-18 리포트 기준).
|
||||||
|
|
||||||
|
공통 배경: Spring Framework 5.3.x / Spring Boot 2.7.x / Spring Security 5.7.x 는 모두 OSS EOL 이라
|
||||||
|
남은 수정본이 상용(Enterprise/Tanzu)뿐이다. JDK 8 유지 제약상 Boot 3 + Spring 6 이관 전까지는
|
||||||
|
버전 상향으로 못 없앤다. 아래는 "코드에 트리거 경로가 없음"을 근거로 한 억제이며 만료일을 둔다.
|
||||||
|
버전 범위를 5.3.x / 2.7.x / 5.7.x 로 고정해 두었으므로, 이관 후에는 억제가 자동으로 풀린다.
|
||||||
|
재검토 시 확인할 것: (1) 각 근거 grep 이 여전히 0건인지 (2) OSS 수정본이 나왔는지.
|
||||||
|
================================================================================ -->
|
||||||
|
|
||||||
|
<!-- 1. Spring Boot: Cassandra SSL 호스트명 미검증 -->
|
||||||
|
<suppress until="2027-02-28Z">
|
||||||
|
<notes><![CDATA[
|
||||||
|
CVE-2026-40974 는 Spring Boot 의 Cassandra SSL 자동설정이 SSL 번들의 호스트명 검증 설정을
|
||||||
|
드라이버에 전달하지 않는 문제다. 이 앱은 Cassandra 를 쓰지 않는다
|
||||||
|
(runtimeClasspath 에 cassandra/datastax 계열 jar 0건, spring-boot-starter-data-cassandra 미선언).
|
||||||
|
수정본 2.7.33 은 상용(Enterprise) 릴리스라 OSS 로는 올릴 수 없다.
|
||||||
|
devtools/actuator/spring-boot-admin jar 는 스캔 대상(runtimeClasspath)에는 있으나
|
||||||
|
배포 산출물에서는 build.gradle 의 localOnlyLibPrefixes 로 제외되어 WAR 에 실리지 않는다.
|
||||||
|
확인: Rinjae / 2026-08-18 / grep -ri cassandra 0건, WAR 내 devtools/actuator jar 0건.
|
||||||
|
]]></notes>
|
||||||
|
<packageUrl regex="true">^pkg:maven/org\.springframework\.boot/.*@2\.7\..*$</packageUrl>
|
||||||
|
<cve>CVE-2026-40974</cve>
|
||||||
|
</suppress>
|
||||||
|
|
||||||
|
<!-- 2. Thymeleaf SSTI 2건: starter jar 이름 기준 오탐 -->
|
||||||
|
<suppress>
|
||||||
|
<notes><![CDATA[
|
||||||
|
오탐. CVE-2026-40477 / CVE-2026-40478 은 thymeleaf 본체 3.1.3.RELEASE 이하의 표현식 샌드박스
|
||||||
|
우회 문제이고 3.1.4.RELEASE 에서 수정됐다. 이 프로젝트는 build.gradle 의 ext 에서
|
||||||
|
thymeleaf.version=3.1.5.RELEASE / thymeleaf-extras-springsecurity.version=3.1.5.RELEASE 로
|
||||||
|
올려 두었으므로 실제 실리는 jar 는 thymeleaf-3.1.5.RELEASE.jar 다.
|
||||||
|
Dependency-Check 가 spring-boot-starter-thymeleaf-2.7.18.jar(의존만 선언한 빈 starter)에
|
||||||
|
thymeleaf CPE 를 잘못 매칭한 결과다. thymeleaf 본체 jar 에 대한 탐지는 억제하지 않는다.
|
||||||
|
확인: Rinjae / 2026-08-18 / WAR 내 thymeleaf 본체 jar 가 수정본임을 확인.
|
||||||
|
재확인: Rinjae / 2026-09-15 / war classpath 실측 — thymeleaf-3.1.5.RELEASE.jar,
|
||||||
|
thymeleaf-spring5-3.1.5.RELEASE.jar, thymeleaf-extras-springsecurity5-3.1.5.RELEASE.jar.
|
||||||
|
(2026-08-18 주석의 3.1.4 표기는 이후 3.1.5 상향분이 반영되지 않은 것이라 함께 갱신함.)
|
||||||
|
]]></notes>
|
||||||
|
<packageUrl regex="true">^pkg:maven/org\.springframework\.boot/spring-boot-starter-thymeleaf@.*$</packageUrl>
|
||||||
|
<cve>CVE-2026-40477</cve>
|
||||||
|
<cve>CVE-2026-40478</cve>
|
||||||
|
</suppress>
|
||||||
|
|
||||||
|
<!-- 3. Spring Framework: JMS Jackson 역직렬화 -->
|
||||||
|
<suppress until="2027-02-28Z">
|
||||||
|
<notes><![CDATA[
|
||||||
|
CVE-2026-41855 는 org.springframework.jms.support.converter.MappingJackson2MessageConverter /
|
||||||
|
JacksonJsonMessageConverter 가 임의 클래스 인스턴스화를 허용하는 문제다(신뢰할 수 없는 JMS 환경 전제).
|
||||||
|
이 앱은 JMS 를 쓰지 않는다: runtimeClasspath 에 spring-jms 0건, 소스에 javax.jms /
|
||||||
|
JmsTemplate / MappingJackson2MessageConverter 참조 0건.
|
||||||
|
5.3.x 는 OSS 수정본이 없다(6.2.19 / 7.0.8 에서만 수정). 이미 5.3.x OSS 마지막인 5.3.39 로 올려 둔 상태다.
|
||||||
|
확인: Rinjae / 2026-08-18 / grep -rn "javax.jms|JmsTemplate|MappingJackson2MessageConverter" src 0건.
|
||||||
|
]]></notes>
|
||||||
|
<packageUrl regex="true">^pkg:maven/org\.springframework/spring-.*@5\.3\..*$</packageUrl>
|
||||||
|
<cve>CVE-2026-41855</cve>
|
||||||
|
</suppress>
|
||||||
|
|
||||||
|
<!-- 4. spring-web: HttpInvoker 역직렬화 -->
|
||||||
|
<suppress until="2027-02-28Z">
|
||||||
|
<notes><![CDATA[
|
||||||
|
CVE-2016-1000027 은 HttpInvokerServiceExporter 를 노출했을 때만 성립한다. 해당 클래스는
|
||||||
|
Spring 6.0 에서 제거됐고 5.3.x 에는 수정본이 없다(= 5.3.x 를 쓰는 한 계속 탐지된다).
|
||||||
|
이 앱은 HttpInvoker 계열을 쓰지 않는다: 소스에 HttpInvoker 참조 0건이고 외부 호출은
|
||||||
|
RestTemplate / HttpClient 기반이다.
|
||||||
|
근본 해결은 Spring 6(Boot 3, JDK 17) 이관. 이관 전까지 억제한다.
|
||||||
|
확인: Rinjae / 2026-08-18 / grep -rn HttpInvoker src 0건.
|
||||||
|
]]></notes>
|
||||||
|
<packageUrl regex="true">^pkg:maven/org\.springframework/spring-web@5\.3\..*$</packageUrl>
|
||||||
|
<cve>CVE-2016-1000027</cve>
|
||||||
|
</suppress>
|
||||||
|
|
||||||
|
<!-- 5. Spring Security: 응답 커밋 시 보안 헤더 미기록 -->
|
||||||
|
<suppress until="2027-02-28Z">
|
||||||
|
<notes><![CDATA[
|
||||||
|
CVE-2026-22732 는 응답이 커밋된 뒤 Spring Security 가 보안 헤더를 기록하지 못하는 문제다.
|
||||||
|
트리거는 Content-Length 를 setHeader / setIntHeader / addIntHeader 로 지정하는 경로다
|
||||||
|
(OnCommittedResponseWrapper 는 setContentLength / setContentLengthLong / addHeader 만 추적한다).
|
||||||
|
(1) 이 코드베이스에는 트리거가 없다: portal / elink-portal-common / elink-online-core-jpa 전체에
|
||||||
|
setIntHeader, addIntHeader, setHeader("Content-Length") 0건. 파일 다운로드는
|
||||||
|
response.setContentLength(int) 를 쓰며 실측상 보안 헤더가 정상 기록된다.
|
||||||
|
(2) 그럼에도 안전망으로 PortalConfigSecurity 에서
|
||||||
|
HeaderWriterFilter.setShouldWriteHeadersEagerly(true) 를 적용해(spring.io 권고 우회책)
|
||||||
|
요청 시작 시점에 헤더를 기록하도록 했다.
|
||||||
|
수정본 5.7.22 / 5.8.24 는 Enterprise 전용이라 OSS 로는 올릴 수 없다. 이미 5.7.x OSS 마지막인
|
||||||
|
5.7.14 로 올려 둔 상태다.
|
||||||
|
확인: Rinjae / 2026-08-18 / 동일 스택(Boot 2.7.18 + Security 5.7.14 + Tomcat 9.0.120) 프로브 앱 실측 —
|
||||||
|
우회책 미적용 시 setHeader/setIntHeader/addIntHeader 경로에서 헤더 누락 재현, 적용 후 정상 기록.
|
||||||
|
]]></notes>
|
||||||
|
<packageUrl regex="true">^pkg:maven/org\.springframework\.security/spring-security-.*@5\.7\..*$</packageUrl>
|
||||||
|
<cve>CVE-2026-22732</cve>
|
||||||
|
</suppress>
|
||||||
|
|
||||||
|
<!-- ================================================================================
|
||||||
|
Spring Boot High 4건 (2026-09-15 리포트 기준, spring-boot-2.7.18.jar 에 탐지됨).
|
||||||
|
|
||||||
|
공통 배경: 4건 모두 수정본이 2.7.33 이며 2.7.x 는 OSS EOL(마지막 OSS 릴리스 2.7.18)이라
|
||||||
|
상용(Enterprise/Tanzu) 구독 없이는 버전 상향으로 없앨 수 없다. 위 Critical 5건과 같은 제약이다.
|
||||||
|
아래는 "이 앱의 설정/배포 형태에 트리거 경로가 없음"을 근거로 한 억제이며 만료일을 둔다.
|
||||||
|
재검토 시 확인할 것: (1) 각 근거 grep 이 여전히 0건인지 (2) OSS 수정본이 나왔는지
|
||||||
|
(3) Boot 3 이관 여부.
|
||||||
|
================================================================================ -->
|
||||||
|
|
||||||
|
<!-- 6. Spring Boot: CloudFoundry Actuator 인증 우회 -->
|
||||||
|
<suppress until="2027-02-28Z">
|
||||||
|
<notes><![CDATA[
|
||||||
|
CVE-2026-22733 은 CloudFoundry Actuator 엔드포인트 경로(/cloudfoundryapplication) 아래에
|
||||||
|
인증이 필요한 애플리케이션 엔드포인트가 선언됐을 때 인증을 우회당하는 문제다.
|
||||||
|
취약 코드는 spring-boot-actuator-autoconfigure 의 cloudfoundry 패키지에 있고,
|
||||||
|
해당 자동설정은 CloudFoundry 런타임(VCAP_APPLICATION)에서만 활성화된다.
|
||||||
|
(1) 배포 산출물에 actuator 계열 jar 가 없다. build.gradle 의 localOnlyLibPrefixes 가
|
||||||
|
war/bootWar classpath 에서 devtools/actuator/micrometer/spring-boot-admin 을 제거한다.
|
||||||
|
(2) CloudFoundry 가 아니라 WebLogic 에 WAR 로 배포한다. CF 관련 설정/코드도 없다.
|
||||||
|
수정본 2.7.33 은 상용 릴리스라 OSS 로는 올릴 수 없다.
|
||||||
|
확인: Rinjae / 2026-09-15 / war·bootWar classpath 실측 — actuator/devtools/micrometer/SBA 0건
|
||||||
|
(spring-boot-2.7.18.jar 본체만 포함). 3개 모듈 전체 grep -rE "cloudfoundry|VCAP_" 0건.
|
||||||
|
]]></notes>
|
||||||
|
<packageUrl regex="true">^pkg:maven/org\.springframework\.boot/.*@2\.7\..*$</packageUrl>
|
||||||
|
<cve>CVE-2026-22733</cve>
|
||||||
|
</suppress>
|
||||||
|
|
||||||
|
<!-- 7. Spring Boot DevTools: remote secret 타이밍 공격 -->
|
||||||
|
<suppress until="2027-02-28Z">
|
||||||
|
<notes><![CDATA[
|
||||||
|
CVE-2026-40972 는 DevTools 원격 연결의 secret 비교가 상수시간이 아니어서 타이밍 공격으로
|
||||||
|
secret 을 알아내고 원격 클래스 업로드(RCE)까지 갈 수 있는 문제다.
|
||||||
|
(1) 서버측 원격 DevTools 는 spring.devtools.remote.secret 이 설정돼야만 활성화된다.
|
||||||
|
3개 모듈 전체에 해당 프로퍼티가 없다. yml 의 devtools 설정은 restart/livereload 뿐이고
|
||||||
|
restart 는 모든 프로파일에서 enabled: false 다.
|
||||||
|
(2) 배포 산출물에 devtools jar 자체가 없다. developmentOnly 로 선언돼 runtimeClasspath
|
||||||
|
(= Dependency-Check 스캔 대상)에는 올라오지만 war/bootWar 에서는 제외된다.
|
||||||
|
수정본 2.7.33 은 상용 릴리스라 OSS 로는 올릴 수 없다.
|
||||||
|
확인: Rinjae / 2026-09-15 / grep -rE "devtools\.remote|remote\.secret|RemoteSpringApplication" 0건,
|
||||||
|
war·bootWar classpath 에 spring-boot-devtools 0건(스캔 대상 libs 에는 1건 존재).
|
||||||
|
]]></notes>
|
||||||
|
<packageUrl regex="true">^pkg:maven/org\.springframework\.boot/.*@2\.7\..*$</packageUrl>
|
||||||
|
<cve>CVE-2026-40972</cve>
|
||||||
|
</suppress>
|
||||||
|
|
||||||
|
<!-- 8. Spring Boot: ApplicationTemp 디렉터리 선점 -->
|
||||||
|
<suppress until="2027-02-28Z">
|
||||||
|
<notes><![CDATA[
|
||||||
|
CVE-2026-40973 은 같은 호스트의 로컬 공격자가 ApplicationTemp 가 쓰는 임시 디렉터리를
|
||||||
|
선점했을 때 성립한다. 실제 피해(세션 탈취/가젯체인)는 server.servlet.session.persistent=true
|
||||||
|
로 세션을 파일에 영속화하고 그 상태가 재기동을 넘어 유지될 때의 이야기다.
|
||||||
|
(1) server.servlet.session.persistent 를 설정하지 않는다(기본 false). 3개 모듈 grep 0건.
|
||||||
|
(2) 이 포털의 세션 상태는 파일이 아니라 DB 에 보관한다(apps/session/, DatabaseSessionVerifier).
|
||||||
|
(3) 운영 배포는 WebLogic WAR 이라 세션 처리 주체가 내장 Tomcat 이 아니다.
|
||||||
|
spring-boot-2.7.18.jar 본체는 배포본에 실리므로 오탐이 아니라 "설정상 트리거 없음" 억제다.
|
||||||
|
수정본 2.7.33 은 상용 릴리스라 OSS 로는 올릴 수 없다.
|
||||||
|
확인: Rinjae / 2026-09-15 / grep -rE "session\.persistent|ApplicationTemp" 3개 모듈 0건.
|
||||||
|
]]></notes>
|
||||||
|
<packageUrl regex="true">^pkg:maven/org\.springframework\.boot/.*@2\.7\..*$</packageUrl>
|
||||||
|
<cve>CVE-2026-40973</cve>
|
||||||
|
</suppress>
|
||||||
|
|
||||||
|
<!-- 9. Spring Boot: ${random.value} 를 secret 으로 쓰면 예측 가능 -->
|
||||||
|
<suppress until="2027-02-28Z">
|
||||||
|
<notes><![CDATA[
|
||||||
|
CVE-2026-40975 는 프로퍼티 플레이스홀더 ${random.value} / ${random.int} / ${random.long} 이
|
||||||
|
암호학적으로 안전하지 않아 secret 용도로 쓰면 예측 가능하다는 문제다(${random.uuid} 는 무관).
|
||||||
|
이 프로젝트는 ${random.*} 플레이스홀더를 어디에서도 쓰지 않는다.
|
||||||
|
(참고: 인증토큰/임시비밀번호 등 실제 비밀값 생성은 애플리케이션 코드에서 처리하며
|
||||||
|
이 CVE 의 대상인 RandomValuePropertySource 와 무관하다.)
|
||||||
|
spring-boot-2.7.18.jar 본체는 배포본에 실리므로 "미사용" 근거의 억제다.
|
||||||
|
수정본 2.7.33 은 상용 릴리스라 OSS 로는 올릴 수 없다.
|
||||||
|
확인: Rinjae / 2026-09-15 / grep -rE "random\.value|random\.int|random\.long" 3개 모듈 0건.
|
||||||
|
]]></notes>
|
||||||
|
<packageUrl regex="true">^pkg:maven/org\.springframework\.boot/.*@2\.7\..*$</packageUrl>
|
||||||
|
<cve>CVE-2026-40975</cve>
|
||||||
|
</suppress>
|
||||||
|
|
||||||
|
<!-- 10. elink-common-data: 이더리움 토큰 CVE 오탐 (패키지명 'eai' 매칭) -->
|
||||||
|
<suppress>
|
||||||
|
<notes><![CDATA[
|
||||||
|
오탐. CVE-2019-15079 는 'EAI' 라는 이더리움 ERC-20 토큰의 스마트 컨트랙트(Solidity) 생성자에
|
||||||
|
오타가 있어 토큰을 무상 취득할 수 있는 문제다. CPE 가 cpe:2.3:a:eai_project:eai:*:* 이며
|
||||||
|
자바 라이브러리와는 아무 관련이 없다.
|
||||||
|
오탐이 난 이유: elink-common-data-4.5.5.jar 는 MANIFEST 에 Manifest-Version 한 줄뿐이고
|
||||||
|
pom.properties 도 없어서 Dependency-Check 가 벤더/제품을 판단할 근거가 없다. 그래서
|
||||||
|
유일한 패키지 경로인 com/eactive/eai/data 에서 제품명을 'eai' 로 추론해 위 CPE 에 매칭했다.
|
||||||
|
여기서 eai 는 사내 EAI(Enterprise Application Integration) 의 약어다.
|
||||||
|
버전을 고정하지 않은 이유: 원인이 패키지명이라 이 아티팩트의 버전을 올려도 같은 오탐이 재발한다.
|
||||||
|
확인: Rinjae / 2026-09-15 / jar 내부 실측 — 최상위 패키지 com/eactive/eai/data 단일,
|
||||||
|
.sol/ethereum/token 관련 파일 0건, 총 45개 항목. SHA-1 7e2b7168604d4fbd8c383a4cd7558e8581477a78
|
||||||
|
로 리포트 대상 jar 와 동일함을 확인. NVD 원문 CPE 대조 완료.
|
||||||
|
]]></notes>
|
||||||
|
<packageUrl regex="true">^pkg:maven/com\.eactive\.elink\.common/elink-common-data@.*$</packageUrl>
|
||||||
|
<cve>CVE-2019-15079</cve>
|
||||||
|
</suppress>
|
||||||
|
|
||||||
|
<!-- 11. spring-boot-admin-client: SBA 서버 SSTI 오탐 -->
|
||||||
|
<suppress>
|
||||||
|
<notes><![CDATA[
|
||||||
|
오탐. CVE-2023-38286 은 Thymeleaf 3.1.1.RELEASE 이하의 샌드박스 우회를 Spring Boot Admin
|
||||||
|
서버에서 SSTI/코드실행으로 엮을 수 있다는 내용이고, 성립 조건이 "MailNotifier 활성화 +
|
||||||
|
UI 를 통한 환경변수 쓰기 권한"이다. 세 가지 이유로 이 프로젝트에는 성립하지 않는다.
|
||||||
|
(1) 우리가 쓰는 건 서버가 아니라 client 다. spring-boot-admin-client-2.7.16.jar 안에는
|
||||||
|
de/codecentric/boot/admin/client/** 의 등록(registration)·설정 클래스뿐이고
|
||||||
|
MailNotifier / thymeleaf 템플릿 / html 리소스가 0건이다. 취약 코드가 있는
|
||||||
|
spring-boot-admin-server 는 의존성에 아예 없다.
|
||||||
|
(2) thymeleaf 를 3.1.5.RELEASE 로 올려 두어 취약 범위(3.1.1 이하)를 벗어난다. 위 2번 항목 참고.
|
||||||
|
(3) 배포 산출물에 SBA jar 자체가 없다. build.gradle 의 localOnlyLibPrefixes 가
|
||||||
|
war/bootWar classpath 에서 spring-boot-admin-* 을 제거한다(로컬 모니터링 전용).
|
||||||
|
NVD 의 CPE 는 cpe:2.3:a:codecentric:spring_boot_admin:* (versionEndIncluding 3.1.0) 이라
|
||||||
|
client/server 구분이 없어 2.7.16 도 범위에 들어온다. Dependency-Check 가 이 CPE 를
|
||||||
|
client 아티팩트에 그대로 매칭한 것이 오탐의 원인이다.
|
||||||
|
확인: Rinjae / 2026-09-15 / jar 내부 실측 — MailNotifier/thymeleaf/html 0건,
|
||||||
|
SHA-1 04c3df4a292fb879555f61db19e5bf0b7c8fc54b 로 리포트 대상과 동일.
|
||||||
|
war classpath 실측 — spring-boot-admin-* 0건, thymeleaf-3.1.5.RELEASE.jar 포함.
|
||||||
|
]]></notes>
|
||||||
|
<packageUrl regex="true">^pkg:maven/de\.codecentric/spring-boot-admin-.*@.*$</packageUrl>
|
||||||
|
<cve>CVE-2023-38286</cve>
|
||||||
|
</suppress>
|
||||||
|
|
||||||
</suppressions>
|
</suppressions>
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
## OHS Static Resource 설정 예시
|
||||||
|
|
||||||
|
```apacheconf
|
||||||
|
<VirtualHost *:443>
|
||||||
|
ServerName weblogic-djb.rinjae.kr
|
||||||
|
|
||||||
|
<IfModule ossl_module>
|
||||||
|
SSLEngine on
|
||||||
|
SSLVerifyClient None
|
||||||
|
SSLProtocol TLSv1.2 TLSv1.3
|
||||||
|
SSLHonorCipherOrder on
|
||||||
|
SSLCipherSuite TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
|
||||||
|
SSLWallet "${ORACLE_INSTANCE}/config/fmwconfig/components/${COMPONENT_TYPE}/instances/${COMPONENT_NAME}/keystores/default"
|
||||||
|
|
||||||
|
<FilesMatch "\.(cgi|shtml|phtml|php)$">
|
||||||
|
SSLOptions +StdEnvVars
|
||||||
|
</FilesMatch>
|
||||||
|
|
||||||
|
<Directory "${ORACLE_INSTANCE}/config/fmwconfig/components/${COMPONENT_TYPE}/instances/${COMPONENT_NAME}/cgi-bin">
|
||||||
|
SSLOptions +StdEnvVars
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
BrowserMatch "MSIE [2-5]" \
|
||||||
|
nokeepalive ssl-unclean-shutdown \
|
||||||
|
downgrade-1.0 force-response-1.0
|
||||||
|
|
||||||
|
<IfModule mod_headers.c>
|
||||||
|
Header always set Strict-Transport-Security "max-age=63072000; preload; includeSubDomains"
|
||||||
|
</IfModule>
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
Alias /css /apps/portal-static/css
|
||||||
|
Alias /js /apps/portal-static/js
|
||||||
|
Alias /img /apps/portal-static/img
|
||||||
|
Alias /images /apps/portal-static/images
|
||||||
|
Alias /webfonts /apps/portal-static/webfonts
|
||||||
|
Alias /font /apps/portal-static/font
|
||||||
|
Alias /html /apps/portal-static/html
|
||||||
|
Alias /plugins /apps/portal-static/plugins
|
||||||
|
Alias /favicon.png /apps/portal-static/favicon.png
|
||||||
|
|
||||||
|
<Directory "/apps/portal-static">
|
||||||
|
Require all granted
|
||||||
|
Options -Indexes
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
<LocationMatch "^/favicon\.png$|^/(css|js|img|images|webfonts|font|html|plugins)/">
|
||||||
|
Header set Cache-Control "no-cache"
|
||||||
|
</LocationMatch>
|
||||||
|
|
||||||
|
<IfModule weblogic_module>
|
||||||
|
<Location />
|
||||||
|
DirectoryIndex disabled
|
||||||
|
SetHandler weblogic-handler
|
||||||
|
WebLogicHost 172.30.1.100
|
||||||
|
WebLogicPort 39130
|
||||||
|
DynamicServerList OFF
|
||||||
|
ConnectTimeoutSecs 10
|
||||||
|
ConnectRetrySecs 2
|
||||||
|
WLProxySSL ON
|
||||||
|
</Location>
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
<Location /css>
|
||||||
|
SetHandler None
|
||||||
|
</Location>
|
||||||
|
<Location /js>
|
||||||
|
SetHandler None
|
||||||
|
</Location>
|
||||||
|
<Location /img>
|
||||||
|
SetHandler None
|
||||||
|
</Location>
|
||||||
|
<Location /images>
|
||||||
|
SetHandler None
|
||||||
|
</Location>
|
||||||
|
<Location /webfonts>
|
||||||
|
SetHandler None
|
||||||
|
</Location>
|
||||||
|
<Location /font>
|
||||||
|
SetHandler None
|
||||||
|
</Location>
|
||||||
|
<Location /html>
|
||||||
|
SetHandler None
|
||||||
|
</Location>
|
||||||
|
<Location /plugins>
|
||||||
|
SetHandler None
|
||||||
|
</Location>
|
||||||
|
<Location /favicon.png>
|
||||||
|
SetHandler None
|
||||||
|
</Location>
|
||||||
|
</VirtualHost>
|
||||||
|
```
|
||||||
@@ -0,0 +1,343 @@
|
|||||||
|
import argparse
|
||||||
|
from datetime import datetime
|
||||||
|
import http.cookiejar
|
||||||
|
from http.cookies import SimpleCookie
|
||||||
|
import json
|
||||||
|
import ssl
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
import unicodedata
|
||||||
|
import urllib.error
|
||||||
|
import urllib.parse
|
||||||
|
import urllib.request
|
||||||
|
|
||||||
|
|
||||||
|
DEFAULT_HOST = 'https://api.jejubank.co.kr'
|
||||||
|
COOKIE_NAME = 'JSESSIONID_PORTAL'
|
||||||
|
USER_AGENT = (
|
||||||
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) '
|
||||||
|
'AppleWebKit/537.36 (KHTML, like Gecko) '
|
||||||
|
'Chrome/140.0.0.0 Safari/537.36'
|
||||||
|
)
|
||||||
|
COLUMNS = (
|
||||||
|
('회', 3),
|
||||||
|
('대상', 4),
|
||||||
|
('결과', 10),
|
||||||
|
('쿠키', 8),
|
||||||
|
('CSRF', 8),
|
||||||
|
('HTTP', 4),
|
||||||
|
('요청 값', 10),
|
||||||
|
('요청 서버ID', 11),
|
||||||
|
('응답 값', 10),
|
||||||
|
('응답 서버ID', 11),
|
||||||
|
)
|
||||||
|
BORDER = '+' + '+'.join('-' * (width + 2) for _, width in COLUMNS) + '+'
|
||||||
|
|
||||||
|
|
||||||
|
class NoRedirectHandler(urllib.request.HTTPRedirectHandler):
|
||||||
|
def redirect_request(self, request, fp, code, message, headers, new_url):
|
||||||
|
# 두 서버 비교에서는 지정한 주소의 첫 응답만 검사한다.
|
||||||
|
# 공유 세션 쿠키를 리다이렉트 대상에 전달하지 않는다.
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def integer_between(minimum, maximum):
|
||||||
|
def parse(value):
|
||||||
|
try:
|
||||||
|
number = int(value)
|
||||||
|
except ValueError:
|
||||||
|
raise argparse.ArgumentTypeError(
|
||||||
|
f'{minimum}~{maximum} 사이의 정수를 입력하세요.'
|
||||||
|
)
|
||||||
|
if not minimum <= number <= maximum:
|
||||||
|
raise argparse.ArgumentTypeError(
|
||||||
|
f'{minimum}~{maximum} 사이의 정수를 입력하세요.'
|
||||||
|
)
|
||||||
|
return number
|
||||||
|
return parse
|
||||||
|
|
||||||
|
|
||||||
|
def host_address(value):
|
||||||
|
value = value.strip()
|
||||||
|
message = 'http://호스트[:포트] 또는 https://호스트[:포트] 형식으로 입력하세요.'
|
||||||
|
try:
|
||||||
|
parsed = urllib.parse.urlsplit(value)
|
||||||
|
parsed.port # 포트 형식과 범위도 검사한다.
|
||||||
|
except ValueError:
|
||||||
|
raise argparse.ArgumentTypeError(message)
|
||||||
|
if (parsed.scheme not in ('http', 'https') or not parsed.hostname
|
||||||
|
or parsed.path not in ('', '/') or parsed.query or parsed.fragment
|
||||||
|
or parsed.username is not None or parsed.password is not None
|
||||||
|
or any(char.isspace() for char in value)):
|
||||||
|
raise argparse.ArgumentTypeError(message)
|
||||||
|
return urllib.parse.urlunsplit((parsed.scheme, parsed.netloc, '', '', ''))
|
||||||
|
|
||||||
|
|
||||||
|
def parse_args(argv=None):
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
description='새 익명 세션으로 쿠키와 CSRF 토큰의 유지 여부를 표로 확인합니다.'
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'--host', type=host_address, default=DEFAULT_HOST,
|
||||||
|
metavar='주소', help=f'대상 호스트 주소 (기본값: {DEFAULT_HOST})',
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'--host2', type=host_address, metavar='주소',
|
||||||
|
help='두 번째 서버. A/B를 번갈아 요청 (리다이렉트 미추적)',
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'--cookie-mode', choices=('shared', 'separate'), default='shared',
|
||||||
|
help='shared: 직전 세션 쿠키 공유, separate: 서버 주소/포트별 저장소 분리 (기본값: shared)',
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'-n', '--count', type=integer_between(1, 100), default=10,
|
||||||
|
metavar='횟수', help='전체 요청 횟수: 1~100회 (기본값: 10회, 두 서버 모드도 합산)',
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'-d', '--delay', '--delay-ms', type=integer_between(0, 10000), default=50,
|
||||||
|
metavar='밀리초', help='요청 사이 대기시간: 0~10000ms (기본값: 50ms)',
|
||||||
|
)
|
||||||
|
tls_options = parser.add_mutually_exclusive_group()
|
||||||
|
tls_options.add_argument(
|
||||||
|
'--cacert', metavar='CA파일',
|
||||||
|
help='신뢰할 사설 CA 인증서 또는 인증서 묶음 파일 (PEM 형식)',
|
||||||
|
)
|
||||||
|
tls_options.add_argument(
|
||||||
|
'-k', '--insecure', action='store_true',
|
||||||
|
help='HTTPS 서버 인증서와 호스트명 검증 생략',
|
||||||
|
)
|
||||||
|
return parser.parse_args(argv)
|
||||||
|
|
||||||
|
|
||||||
|
def tls_context(args):
|
||||||
|
context = ssl.create_default_context()
|
||||||
|
if args.cacert:
|
||||||
|
context.load_verify_locations(cafile=args.cacert)
|
||||||
|
if args.insecure:
|
||||||
|
context.check_hostname = False
|
||||||
|
context.verify_mode = ssl.CERT_NONE
|
||||||
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
def cookie_from_headers(headers):
|
||||||
|
value = None
|
||||||
|
for header in headers:
|
||||||
|
parsed = SimpleCookie()
|
||||||
|
parsed.load(header)
|
||||||
|
if COOKIE_NAME in parsed:
|
||||||
|
value = parsed[COOKIE_NAME].value
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
|
def cookie_for_url(jar, url):
|
||||||
|
request = urllib.request.Request(url)
|
||||||
|
jar.add_cookie_header(request)
|
||||||
|
return cookie_from_headers([request.get_header('Cookie', '')])
|
||||||
|
|
||||||
|
|
||||||
|
def host_key(url):
|
||||||
|
parsed = urllib.parse.urlsplit(url)
|
||||||
|
port = parsed.port if parsed.port is not None else (443 if parsed.scheme == 'https' else 80)
|
||||||
|
return parsed.scheme, parsed.hostname, port
|
||||||
|
|
||||||
|
|
||||||
|
def carry_session_cookie(request, value):
|
||||||
|
# 현재 호스트에 해당하는 다른 쿠키는 유지하고 포털 세션 쿠키만 이어 보낸다.
|
||||||
|
cookies = SimpleCookie()
|
||||||
|
cookies.load(request.get_header('Cookie', ''))
|
||||||
|
cookies[COOKIE_NAME] = value
|
||||||
|
request.add_unredirected_header(
|
||||||
|
'Cookie', cookies.output(header='', sep='; ').strip()
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def server_id(cookie):
|
||||||
|
return cookie.split('!')[1] if cookie and '!' in cookie else '-'
|
||||||
|
|
||||||
|
|
||||||
|
def cell(value, width):
|
||||||
|
text = str(value)
|
||||||
|
# 한글은 보통 터미널에서 두 칸을 차지하므로 표시 폭을 기준으로 정렬한다.
|
||||||
|
display_width = sum(
|
||||||
|
0 if unicodedata.combining(char) else
|
||||||
|
2 if unicodedata.east_asian_width(char) in ('W', 'F') else 1
|
||||||
|
for char in text
|
||||||
|
)
|
||||||
|
return text + ' ' * max(0, width - display_width)
|
||||||
|
|
||||||
|
|
||||||
|
def print_row(values):
|
||||||
|
print('| ' + ' | '.join(
|
||||||
|
cell(value, width) for value, (_, width) in zip(values, COLUMNS)
|
||||||
|
) + ' |', flush=True)
|
||||||
|
|
||||||
|
|
||||||
|
def change_state(previous, current):
|
||||||
|
if previous is None:
|
||||||
|
return '최초'
|
||||||
|
return '유지' if previous == current else '!!변경!!'
|
||||||
|
|
||||||
|
|
||||||
|
def run_probe(args):
|
||||||
|
targets = [('A', args.host + '/api/session/csrf')]
|
||||||
|
if args.host2:
|
||||||
|
targets.append(('B', args.host2 + '/api/session/csrf'))
|
||||||
|
try:
|
||||||
|
context = tls_context(args)
|
||||||
|
except (OSError, ValueError) as error:
|
||||||
|
print(f'TLS 설정 실패: {error}', file=sys.stderr)
|
||||||
|
return 1
|
||||||
|
jar = http.cookiejar.CookieJar()
|
||||||
|
cookie_processor = urllib.request.HTTPCookieProcessor(jar)
|
||||||
|
handlers = [
|
||||||
|
urllib.request.HTTPSHandler(context=context),
|
||||||
|
cookie_processor,
|
||||||
|
]
|
||||||
|
if args.host2:
|
||||||
|
handlers.append(NoRedirectHandler())
|
||||||
|
client = urllib.request.build_opener(*handlers)
|
||||||
|
previous_cookie = None
|
||||||
|
previous_token = None
|
||||||
|
cookie_stores = {}
|
||||||
|
session_states = {}
|
||||||
|
totals = {'최초': 0, '유지': 0, '변경': 0}
|
||||||
|
completed = 0
|
||||||
|
failure = None
|
||||||
|
exit_code = 0
|
||||||
|
|
||||||
|
for target, url in targets:
|
||||||
|
print(f'대상 {target}: {url}')
|
||||||
|
if len(targets) == 2:
|
||||||
|
print('호출 순서: A -> B -> A -> B ... (클라이언트 1개, 전체 요청 횟수 기준)')
|
||||||
|
print('두 서버 비교에서는 3xx 리다이렉트를 따라가지 않습니다.')
|
||||||
|
if args.cookie_mode == 'separate':
|
||||||
|
print('쿠키 모드: separate | 서버 주소/포트별 저장소 및 변경 비교 기준 분리')
|
||||||
|
elif len(targets) == 2:
|
||||||
|
print(f'쿠키 모드: shared | 직전 {COOKIE_NAME}을 다음 서버로 전달')
|
||||||
|
if any(url.startswith('https://') for _, url in targets):
|
||||||
|
tls_mode = ('생략 (--insecure)' if args.insecure else
|
||||||
|
f'사설 CA 추가 ({args.cacert})' if args.cacert else '기본 CA 사용')
|
||||||
|
print(f'TLS 인증서 검증: {tls_mode}')
|
||||||
|
print(f'쿠키 키: {COOKIE_NAME} | 값: 앞 10자리 | 횟수: {args.count}회 | 딜레이: {args.delay}ms')
|
||||||
|
print(BORDER)
|
||||||
|
print_row([title for title, _ in COLUMNS])
|
||||||
|
print(BORDER, flush=True)
|
||||||
|
|
||||||
|
try:
|
||||||
|
for number in range(1, args.count + 1):
|
||||||
|
if number > 1 and args.delay:
|
||||||
|
time.sleep(args.delay / 1000)
|
||||||
|
|
||||||
|
target, url = targets[(number - 1) % len(targets)]
|
||||||
|
if args.cookie_mode == 'separate':
|
||||||
|
key = host_key(url)
|
||||||
|
if key not in cookie_stores:
|
||||||
|
cookie_stores[key] = http.cookiejar.CookieJar()
|
||||||
|
jar = cookie_stores[key]
|
||||||
|
# 순차 요청마다 같은 클라이언트의 쿠키 저장소만 교체한다.
|
||||||
|
cookie_processor.cookiejar = jar
|
||||||
|
previous_cookie, previous_token = session_states.get(key, (None, None))
|
||||||
|
request = urllib.request.Request(
|
||||||
|
url,
|
||||||
|
headers={
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'Cache-Control': 'no-cache',
|
||||||
|
'User-Agent': USER_AGENT,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
# 응답이 저장소를 갱신하기 전에 실제 전송할 쿠키를 기록한다.
|
||||||
|
jar.add_cookie_header(request)
|
||||||
|
if args.host2 and args.cookie_mode == 'shared' and previous_cookie is not None:
|
||||||
|
carry_session_cookie(request, previous_cookie)
|
||||||
|
request_cookie = cookie_from_headers([request.get_header('Cookie', '')])
|
||||||
|
response_cookie = None
|
||||||
|
status = '-'
|
||||||
|
try:
|
||||||
|
with client.open(request, timeout=10) as response:
|
||||||
|
status = response.status
|
||||||
|
response_url = response.geturl()
|
||||||
|
# 이번 응답의 Set-Cookie만 표시한다. 재발급이 없으면 '없음'.
|
||||||
|
response_cookie = cookie_from_headers(
|
||||||
|
response.headers.get_all('Set-Cookie') or []
|
||||||
|
)
|
||||||
|
data = json.load(response)
|
||||||
|
|
||||||
|
if args.host2 and args.cookie_mode == 'shared' and response_cookie is None:
|
||||||
|
# 다른 호스트에 직접 이어 보낸 쿠키는 저장소에 없을 수 있다.
|
||||||
|
# 재발급이 없으면 이번 요청에 실었던 세션을 계속 사용한다.
|
||||||
|
cookie = request_cookie
|
||||||
|
else:
|
||||||
|
cookie = cookie_for_url(jar, response_url)
|
||||||
|
token = data.get('token') if isinstance(data, dict) else None
|
||||||
|
if not cookie or not token:
|
||||||
|
raise ValueError('세션 쿠키 또는 CSRF 토큰 없음')
|
||||||
|
except urllib.error.HTTPError as error:
|
||||||
|
status = error.code
|
||||||
|
response_cookie = cookie_from_headers(
|
||||||
|
error.headers.get_all('Set-Cookie') or []
|
||||||
|
)
|
||||||
|
failure = f'{number}회: HTTP {status}'
|
||||||
|
error.close()
|
||||||
|
except Exception as error:
|
||||||
|
failure = f'{number}회: {error}'
|
||||||
|
|
||||||
|
if failure:
|
||||||
|
result, cookie_state, token_state = '!!실패!!', '-', '-'
|
||||||
|
exit_code = 1
|
||||||
|
else:
|
||||||
|
# 변경 판정은 앞 10자리가 아니라 전체 쿠키와 전체 토큰으로 비교한다.
|
||||||
|
cookie_state = change_state(previous_cookie, cookie)
|
||||||
|
token_state = change_state(previous_token, token)
|
||||||
|
if '!!변경!!' in (cookie_state, token_state):
|
||||||
|
outcome, result = '변경', '>>>변경<<<'
|
||||||
|
elif previous_cookie is None:
|
||||||
|
outcome, result = '최초', '[최초]'
|
||||||
|
else:
|
||||||
|
outcome, result = '유지', '[유지]'
|
||||||
|
totals[outcome] += 1
|
||||||
|
completed += 1
|
||||||
|
previous_cookie, previous_token = cookie, token
|
||||||
|
if args.cookie_mode == 'separate':
|
||||||
|
session_states[host_key(url)] = (cookie, token)
|
||||||
|
|
||||||
|
print_row((
|
||||||
|
number, target, result, cookie_state, token_state, status,
|
||||||
|
request_cookie[:10] if request_cookie else '없음',
|
||||||
|
server_id(request_cookie),
|
||||||
|
response_cookie[:10] if response_cookie else '없음',
|
||||||
|
server_id(response_cookie),
|
||||||
|
))
|
||||||
|
if failure:
|
||||||
|
break
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
failure = '사용자가 중단했습니다.'
|
||||||
|
exit_code = 130
|
||||||
|
|
||||||
|
print(BORDER)
|
||||||
|
print(f'정상 조회: {completed}/{args.count}회 | 최초: {totals["최초"]}회 | 유지: {totals["유지"]}회 | 변경: {totals["변경"]}회')
|
||||||
|
print('응답 값=없음: Set-Cookie 재발급 없음. 서버ID는 각 쿠키의 ! 뒤 식별값입니다.')
|
||||||
|
if failure:
|
||||||
|
print(f'실패/중단: {failure}')
|
||||||
|
return exit_code
|
||||||
|
|
||||||
|
|
||||||
|
def main(argv=None):
|
||||||
|
args = parse_args(argv)
|
||||||
|
started_counter = time.perf_counter()
|
||||||
|
started_at = datetime.now().astimezone()
|
||||||
|
print(f'시작 시각: {started_at.isoformat(sep=" ", timespec="milliseconds")}', flush=True)
|
||||||
|
try:
|
||||||
|
return run_probe(args)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print('실패/중단: 사용자가 중단했습니다.')
|
||||||
|
return 130
|
||||||
|
finally:
|
||||||
|
finished_at = datetime.now().astimezone()
|
||||||
|
# 시스템 시각 보정에 영향받지 않도록 경과 시간은 별도 시계로 측정한다.
|
||||||
|
elapsed = time.perf_counter() - started_counter
|
||||||
|
print(f'종료 시각: {finished_at.isoformat(sep=" ", timespec="milliseconds")}')
|
||||||
|
print(f'총 소요 시간: {elapsed:.3f}초 (요청 간 딜레이 포함)', flush=True)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.exit(main())
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<!--
|
||||||
|
editor-content.css 대응 프래그먼트: <!doctype>/<html>/<head>/<style> 없이 순수 태그(h1/h2/h3/p/ul/li/strong)만 사용.
|
||||||
|
admin Summernote 코드뷰에 그대로 붙여넣으면 됨. class/style 속성 없음 -> 붙여넣기(paste-cleaner)든
|
||||||
|
코드뷰 직접 입력이든 태그 정리 과정에서 잘려나갈 것이 없다.
|
||||||
|
-->
|
||||||
|
<h1>개인정보수집동의서</h1>
|
||||||
|
<p><strong>(주)제주은행 귀중</strong></p>
|
||||||
|
<p>귀 행과의 Open API Market 회원가입 거래와 관련하여 귀 행이 본인의 개인정보를 수집·이용하고자 하는 경우에는 「개인정보보호법」 등 관계 법령에 따라 본인의 동의가 필요합니다.</p>
|
||||||
|
<h2>개인정보</h2>
|
||||||
|
<ul>
|
||||||
|
<li><strong>일반 개인정보:</strong> 성명, 직장명, 부서명, 연락처(휴대폰 번호, 직장번호), 이메일주소, 아이디, 비밀번호</li>
|
||||||
|
</ul>
|
||||||
|
<p>□ 동의하지 않음 □ 동의함</p>
|
||||||
|
<p>※ 본 동의 이후 동일한 목적 또는 이용범위 내에서 개인정보의 정확성, 최신성을 유지하기 위해 제공하는 경우에는 별도의 추가 동의가 필요하지 않습니다.</p>
|
||||||
|
<p>※ 은행의 고의 또는 과실 등 귀책사유로 인한 개인정보 유출로 고객님에게 발생한 손해에 대해 관계 법령 등에 따라 보상받으실 수 있습니다.</p>
|
||||||
|
<h3>위 개인정보 수집·이용에 동의하십니까?</h3>
|
||||||
|
<p>제정일자: 2026. 99. 99. 개정</p>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
개인정보수집동의서
|
||||||
|
|
||||||
|
(주)제주은행 귀중
|
||||||
|
|
||||||
|
귀 행과의 Open API Market 회원가입 거래와 관련하여 귀 행이 본인의 개인정보를 수집·이용하고자 하는 경우에는 「개인정보보호법」 등 관계 법령에 따라 본인의 동의가 필요합니다.
|
||||||
|
|
||||||
|
개인정보
|
||||||
|
ㄴ 일반 개인정보
|
||||||
|
성명, 직장명, 부서명, 연락처(휴대폰 번호, 직장번호), 이메일주소, 아이디, 비밀번호
|
||||||
|
|
||||||
|
□ 동의하지 않음 □ 동의함
|
||||||
|
|
||||||
|
※ 본 동의 이후 동일한 목적 또는 이용범위 내에서 개인정보의 정확성, 최신성을 유지하기 위해 제공하는 경우에는 별도의 추가 동의가 필요하지 않습니다.
|
||||||
|
|
||||||
|
※ 은행의 고의 또는 과실 등 귀책사유로 인한 개인정보 유출로 고객님에게 발생한 손해에 대해 관계 법령 등에 따라 보상받으실 수 있습니다.
|
||||||
|
|
||||||
|
위 개인정보 수집·이용에 동의하십니까?
|
||||||
|
|
||||||
|
제정일자: 2026. 99. 99. 개정
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
<!--
|
||||||
|
editor-content.css 대응 프래그먼트: <!doctype>/<html>/<head>/<style> 없이 순수 태그(h2/h3/p)만 사용.
|
||||||
|
admin Summernote 코드뷰에 그대로 붙여넣으면 됨(붙여넣기 시 badTags 정리 대상 없음).
|
||||||
|
약관탭(.content-body.editor-content), 회원가입 동의창, admin .note-editable.editor-content 3곳 모두
|
||||||
|
이 파일 안에서는 정의하지 않는 h2/h3/p 스타일은 공용 editor-content.css 가 담당한다.
|
||||||
|
-->
|
||||||
|
<h2>제1장 총칙</h2>
|
||||||
|
<h3>제1조 (목적)</h3>
|
||||||
|
<p>본 약관은 (주)제주은행(이하 “은행”)이 제공하는 Open API 서비스를 이용함에 있어 “은행”과 Open API 서비스를 이용하는 자(이하 “이용기관”)간의 권리, 의무 및 책임 사항, 이용조건 및 절차 등 기본적인 사항을 명확히 규정함을 목적으로 합니다.</p>
|
||||||
|
<h3>제2조 (용어의 정의)</h3>
|
||||||
|
<p> ① 본 약관에서 사용하는 용어의 정의는 다음 각 호와 같습니다.</p>
|
||||||
|
<p> 1. “Open API”란 “은행”이 “이용기관”에게 제공하는 API(Application Programming Interface) 기능을 개방형 플랫폼 형태로 이용할 수 있도록 공개한 API</p>
|
||||||
|
<p> 2. “Open API 서비스”(이하 “서비스”)란 “은행”의 서비스 및 데이터를 표준화된 API 형태로 Open API 시스템을 통하여 “이용기관”에 제공하는 것</p>
|
||||||
|
<p> 3. “Open API 시스템”(이하 “시스템”)이란 “서비스”를 제공하기 위하여 “은행”에 설치한 중계시스템과 “이용기관”의 처리시스템을 통신회선으로 연결하여 “은행” 및 “이용기관” 상호간에 정보를 교환하는 시스템</p>
|
||||||
|
<p> 4. “Open API 포탈”(이하 “포털”)이란 “서비스”를 소개하고 가입 절차 및 이용 절차를 제공하며 “이용기관”이 가입 및 “서비스” 이용을 하기 위하여 “은행”이 제공하는 웹사이트</p>
|
||||||
|
<p> 5. “이용신청기관”이란 “은행”의 “서비스”를 이용하기 위하여 “서비스” 이용을 신청한 기관(법인, 개인사업자 및 임의단체 등)</p>
|
||||||
|
<p> 6. “이용기관”이란 본 약관에 동의하고 “서비스” 이용신청에 대한 “은행”의 승낙을 받은 후, “은행”이 제공하는 Open API를 이용하여 별도의 서비스 또는 프로그램을 개발, 테스트 및 제공하고자 하는 자</p>
|
||||||
|
<p> 7. “최종사용자”란 “은행”이 제공한 “서비스”를 결합하여 “이용기관”이 개발한 별도의 서비스 또는 프로그램을 이용하는 고객</p>
|
||||||
|
<p> 8. “제휴사”란 “은행”이 “이용기관”에게 “서비스”를 제공하기 위하여 “은행”과 계약을 체결하여 협력하는 제3자</p>
|
||||||
|
<h3>제3조 (서비스의 내용)</h3>
|
||||||
|
<p> ① 조회성 API 서비스(계좌 거래내역 조회, 예금주 실명 조회 등)</p>
|
||||||
|
<p> ② 거래성 API 서비스(환전, 이체 등)</p>
|
||||||
|
<p> ③ 기타 “은행” 또는 “제휴사”가 제공하는 API 형태의 “서비스”</p>
|
||||||
|
<h3>제4조 (약관의 효력 및 변경)</h3>
|
||||||
|
<p> ① 본 약관 내용의 효력은 “은행” 인터넷 홈페이지 또는 “포털” 등에 게시되거나 전자우편 등의 방법으로 “이용기관”에 통지됨으로써 발생합니다.</p>
|
||||||
|
<p> ② 본 약관의 변경은 전자금융거래 기본약관의 내용을 준용합니다.</p>
|
||||||
|
<h2>제2장 서비스 이용계약</h2>
|
||||||
|
<h3>제5조 (서비스 이용신청)</h3>
|
||||||
|
<p> ① 서비스 이용신청은 “이용신청기관”이 “포털”에서 “은행”이 정한 가입양식에 회원정보 기입 및 본 약관에 동의함으로써 이루어집니다.</p>
|
||||||
|
<p> ② 제1항을 완료한 “이용신청기관”은 이용 희망일 전일까지 “은행”이 요청하는 서류를 제출하여야 합니다.</p>
|
||||||
|
<h3>제6조 (서비스 이용신청 승인 및 거절)</h3>
|
||||||
|
<p> ① “은행”은 본 약관 제5조 제2항의 “이용신청기관”이 제출한 서류와 “서비스” 이용목적의 적정성을 검토한 후, “이용신청기관” 서비스 이용신청을 승낙 또는 거절할 수 있습니다.</p>
|
||||||
|
<p> ② “은행”은 “이용신청기관”이 다음 각 호의 어느 하나에 해당할 경우 이용신청에 대해 거절할 수 있습니다.</p>
|
||||||
|
<p> 1. 실명이 아니거나, 타인의 명의를 사용하여 신청한 경우</p>
|
||||||
|
<p> 2. 이용신청 내용을 허위로 기재하거나 허위서류를 첨부한 경우</p>
|
||||||
|
<p> 3. 이전에 “이용기관” 자격을 상실한 적이 있거나, 탈퇴, 이용중지 등이 있는 경우</p>
|
||||||
|
<p> 4. “이용신청기관”의 업태가 사행행위에 관련이 있거나 금융질서문란 위험이 있는 경우</p>
|
||||||
|
<p> 5. “이용신청기관”의 사업모델에 위법성이 있는 경우</p>
|
||||||
|
<p> 6. “이용신청기관”의 재무안정성이 위험한 경우</p>
|
||||||
|
<p> 7. “이용신청기관”의 전산망이나 정보처리시스템에 보안 취약점이 있거나, “이용신청기관”의 “최종사용자” 정보에 관한 기술적·물리적·관리적 보호조치가 미흡한 경우</p>
|
||||||
|
<p> 8. “은행”의 평판이나 “최종사용자”의 권리에 위험을 끼칠 가능성이 있는 경우</p>
|
||||||
|
<p> ③ “은행”은 이용신청에 대한 결과를 “이용신청자”에게 통보하여야 합니다.</p>
|
||||||
|
<h2>제3장 서비스의 이용</h2>
|
||||||
|
<h3>제7조 (서비스 이용개시)</h3>
|
||||||
|
<p>“은행”이 “이용신청기관”의 이용신청을 심사 후 승낙하게 되면 “이용기관”이 요청한 이용 희망일로부터 “서비스”를 개시합니다. 단, 이용 희망일은 “은행”과 협의하여 결정합니다.</p>
|
||||||
|
<h3>제8조 (서비스 이용시간)</h3>
|
||||||
|
<p> ① “서비스”의 이용시간은 연중무휴(24시간)로 하며 “서비스”별 이용시간을 정하여 운영할 수 있습니다. 단, 다음 각 호의 어느 하나에 해당하여 은행이 정상적인 “서비스”를 제공하기 어려운 경우에는 서비스의 전부 또는 일부가 제한 될 수 있습니다.</p>
|
||||||
|
<p> 1. 은행의 시스템을 점검하는 경우</p>
|
||||||
|
<p> 2. 은행의 정보통신 설비의 보수점검, 증설, 교체, 이전 등 시스템 관리 작업을 진행하는 경우</p>
|
||||||
|
<p> 3. 정전, 제반 설비의 장애 또는 이용량의 폭주 등이 발생하는 경우</p>
|
||||||
|
<p> 4. 천재지변, 전쟁, 폭동, 테러, 해킹, Ddos, 국가비상사태 등 불가항력적 사유가 발생하는 경우</p>
|
||||||
|
<p> 5. 시스템 오류 등 서비스 제공에 관한 기술상 문제가 발생하는 경우</p>
|
||||||
|
<p> ② 제1항의 사유로 서비스가 일시 중지되는 경우, “은행”은 사전에 이를 공지하여야 합니다. 단, 부득이한 경우 사후에 통보할 수 있습니다.</p>
|
||||||
|
<h3>제9조 (서비스 변경 및 중단)</h3>
|
||||||
|
<p> ① “은행”은 변경될 “서비스”의 내용 및 변경일자를 “이용기관”에게 통지하고 “서비스”를 변경하여 제공할 수 있습니다.</p>
|
||||||
|
<p> ② “은행”은 “이용기관”이 다음 각 호의 어느 하나에 해당할 경우 “서비스”의 전부 또는 일부를 중단할 수 있습니다.</p>
|
||||||
|
<p> 1. “서비스”용 정보통신설비의 보수·교체·고장, 통신두절 등으로 인해 부득이한 경우</p>
|
||||||
|
<p> 2. 정전, 모든 설비의 장애 또는 이용량의 폭주 등으로 정상적인 서비스 이용에 지장이 있는 경우</p>
|
||||||
|
<p> 3. “서비스” 종료 등과 같은 “은행”의 사정으로 “서비스”를 유지할 수 없는 경우</p>
|
||||||
|
<p> 4. 기타 천재지변, 국가비상사태 등 불가항력적 사유가 있는 경우</p>
|
||||||
|
<p> ③ “서비스”를 변경하거나 중단할 경우, “은행”은 그 사실을 사전에 “이용기관”에 통지하여야 합니다. 단, 사전에 통지할 수 없는 부득이한 사유가 있는 경우에는 사후에 그 사유와 함께 통지하여야 합니다. 또한 “포털”에 등록된 연락처가 부정확하거나 “이용기관” 측의 사유로 인하여 “은행”의 통보를 받지 못해 발생하는 손실에 대해서는 “은행”의 고의 또는 과실이 없는 경우 그 책임의 전부 또는 일부를 지지 않습니다.</p>
|
||||||
|
<p> ④ “은행”은 “서비스”의 변경 혹은 중단으로 발생하는 문제에 대해서는 “은행”의 고의 또는 과실이 없는 경우 그 책임의 전부 또는 일부를 지지 않습니다.</p>
|
||||||
|
<h3>제10조 (서비스 이용 제한)</h3>
|
||||||
|
<p> ① “은행”은 “이용기관”이 다음 각 호의 어느 하나에 해당할 경우 “이용기관”에 대한 “서비스” 이용을 개별 고지 후 제한할 수 있습니다.</p>
|
||||||
|
<p> 1. 감독당국으로부터 중지 권고가 있는 경우</p>
|
||||||
|
<p> 2. “이용기관”이 휴업 또는 폐업을 하는 경우</p>
|
||||||
|
<p> 3. 접근권한을 넘어서는 접속을 시도하거나 반복적인 접속을 시도하여 과부하 발생 등 시스템 운영의 안전성을 저해한다고 판단되는 행위가 확인된 경우</p>
|
||||||
|
<p> 4. “이용기관” 수수료 납부계좌에서 부족분이 3회 이상 발생할 경우</p>
|
||||||
|
<p> 5. “이용기관”에 본 약관 제6조 제2항 각 호의 사유가 발생한 경우 또는 “서비스” 신청 당시 “이용기관”에 본 약관 제6조 제2항 각 호의 사유가 있었음이 밝혀진 경우</p>
|
||||||
|
<p> 6. “시스템” 및 “포털”의 안정적인 운영을 위하여 필요하다고 인정되는 경우</p>
|
||||||
|
<p> ② “이용기관”이 제1항에 해당할 경우, “은행”은 “서비스” 이용을 제한할 수 있으며 이와 별도로 해당 “이용기관”에 소명자료 제출을 요구할 수 있습니다. “이용기관”은 통지받은 날로부터 15일 이내에 소명자료를 제출하여야 합니다. 단, “은행”은 “이용기관”의 소명자료가 정당하다고 판단하기 전까지 “이용기관”의 “서비스” 이용을 제한할 수 있습니다.</p>
|
||||||
|
<h3>제11조 (서비스 이용 해지)</h3>
|
||||||
|
<p> ① “은행”은 “이용기관”이 다음 각 호의 어느 하나에 해당할 경우 “이용기관”에 대한 “서비스” 이용을 개별 고지 후 해지할 수 있습니다.</p>
|
||||||
|
<p> 1. 감독당국으로부터 해지권고가 있는 경우</p>
|
||||||
|
<p> 2. 최근 12개월간 “시스템” 이용 실적이 없는 경우</p>
|
||||||
|
<p> 3. “이용기관” 수수료 납부계좌에서 부족분이 6회 이상 발생할 경우</p>
|
||||||
|
<p> 4. “이용기관”의 정상적인 운영이 불가능하다고 “은행”이 판단할 경우</p>
|
||||||
|
<p> ② “이용기관”이 제1항에 해당할 경우, “이용기관”에 소명자료 제출을 요구할 수 있습니다. “이용기관”은 통지받은 날로부터 15일 이내에 소명자료를 제출하여야 합니다.</p>
|
||||||
|
<p> ③ 해지일은 “은행”이 “시스템” 또는 “포털” 원장에 해지 등록한 날로 합니다.</p>
|
||||||
|
<h2>제4장 계약당사자의 의무 및 손해배상 등</h2>
|
||||||
|
<h3>제12조 (은행의 의무)</h3>
|
||||||
|
<p> ① “은행”은 본 약관에서 특별히 규정한 사유 외에는 “서비스”를 지속적·안정적으로 제공하여야 합니다.</p>
|
||||||
|
<p> ② “은행”은 “서비스” 제공과 관련하여 알게 된 “이용기관”의 정보를 업무 이외의 목적으로 사용할 수 없습니다. 단, 관계법령에 따른 수사상의 관계기관으로부터 요구 받은 경우나 정보통신 윤리위원회의 요청이 있는 경우 등 법률의 규정에 따른 적법한 절차에 의한 경우에는 그러하지 않습니다.</p>
|
||||||
|
<p> ③ “은행”이 제공하는 “서비스”로 인하여 “이용기관”에 손해가 발생한 경우 “서비스”를 제공하는 “은행”과 이용하는 “이용기관”이 상호협의에 의하여 해결합니다. 단, 그러한 손해가 “은행”의 고의나 과실에 기해 발생한 경우에 한하여 “은행”은 그 책임의 전부 또는 일부를 부담합니다.</p>
|
||||||
|
<p> ④ “은행”은 개인정보보호법, 신용정보의 이용 및 보호에 관한 법률, 금융실명거래 및 비밀보장에 관한 법률, 정보통신망 이용촉진 및 정보보호에 관한 법률, 통신비밀보호법 등 “서비스” 운영, 유지와 관련 있는 법규를 준수하여야 합니다.</p>
|
||||||
|
<h3>제13조 (약관 외 준칙)</h3>
|
||||||
|
<p> ① “이용기관”은 “포털”에서 “은행”이 정한 가입양식에 회원정보를 기입할 때, 사실에 근거하여 정확하게 기입하여야 합니다.</p>
|
||||||
|
<p> ② “이용기관”은 “은행”에 제공한 사항이 변경될 때, 즉시 “은행”에 변경 신청하여 변경사항을 최신의 정보로 수정해야 합니다. 수정하지 않은 정보로 인하여 발생하는 문제에 대한 책임은 “이용기관”에 있으며 “은행”은 이에 대해 아무런 책임을 지지 않습니다.</p>
|
||||||
|
<p> ③ “이용기관”은 “시스템”과 관련한 “서비스” 이용의 대가로 수수료를 납부하여야 합니다.</p>
|
||||||
|
<p> ④ “이용기관”은 “서비스”의 이용 권한, 기타 이용 계약상의 지위를 타인에게 양도, 증여할 수 없으며 게시물에 대한 저작권을 포함한 모든 권리 및 책임은 이를 게시한 “이용기관”에 있습니다.</p>
|
||||||
|
<p> ⑤ “이용기관”은 “서비스”의 안정적인 이용을 위해 전산시스템의 구축에 필요한 회선, 단말기 및 부대기기를 “이용기관”의 부담으로 설치하여야 하고, 보안상 안전하게 처리할 수 있는 전산시스템을 갖추어야 합니다.</p>
|
||||||
|
<p> ⑥ “이용기관”은 “은행”이나 “최종사용자”가 업무처리에 대하여 이의를 제기하거나 확인을 요청하면 이를 신속히 처리하여야 합니다.</p>
|
||||||
|
<p> ⑦ “이용기관”은 본 약관에서 정한 사항을 준수하여야 하며, “은행”이 “이용기관”의 약관 이행여부를 점검하고자 할 경우 적극 협조하여야 합니다.</p>
|
||||||
|
<p> ⑧ “이용기관”은 “포털”에서 제공하는 “서비스” 이용과 관련하여 다음 각 호의 행위를 하여서는 안 됩니다.</p>
|
||||||
|
<p> 1. 다른 “이용기관”의 아이디를 부정 사용하는 행위</p>
|
||||||
|
<p> 2. 범죄행위를 목적으로 하거나 기타 범죄행위와 관련된 행위</p>
|
||||||
|
<p> 3. 선량한 풍속, 기타 사회질서를 해하는 행위</p>
|
||||||
|
<p> 4. 타인의 명예를 훼손하거나 모욕하는 행위</p>
|
||||||
|
<p> 5. 타인의 지식재산권 등의 권리를 침해하는 행위</p>
|
||||||
|
<p> 6. 해킹행위 또는 컴퓨터 바이러스의 유포행위</p>
|
||||||
|
<p> 7. 타인의 의사에 반하여 광고성 정보 등 일정한 내용을 지속적으로 전송하는 행위</p>
|
||||||
|
<p> 8. 서비스의 안정적인 운영에 지장을 주거나 줄 우려가 있는 일체의 행위</p>
|
||||||
|
<p> ⑨ “이용기관”은 개인정보보호법, 신용정보의 이용 및 보호에 관한 법률, 금융실명거래 및 비밀보장에 관한 법률, 정보통신망 이용촉진 및 정보보호에 관한 법률, 통신비밀보호법 등 “서비스” 운영, 유지와 관련 있는 법규를 준수하여야 합니다.</p>
|
||||||
|
<h2>제5장 수수료</h2>
|
||||||
|
<h3>제14조 (수수료)</h3>
|
||||||
|
<p> ① “은행”은 “서비스” 제공의 대가로 “이용기관”에게 수수료를 부과합니다.</p>
|
||||||
|
<p> ② “은행”은 매월 1일~말일까지 발생하는 수수료를 익월 10일(공휴일인 경우에는 익영업일)에 “이용기관”에게 부과하며, “이용기관”이 등록한 수수료 납부계좌에서 예금청구서 및 통장에 의하지 아니하고 대체 출금하기로 합니다.</p>
|
||||||
|
<p> ③ “은행”은 “이용기관”이 해지 등의 사유로 “서비스” 이용이 불가한 경우, 이용불가 시점까지 발생한 미결제 수수료를 본 “서비스” 해지일에 예금청구서 및 통장에 의하지 아니하고 “이용기관”의 수수료 납부계좌에서 출금하고, 부족액이 발생할 시에 별도 청구합니다.</p>
|
||||||
|
<p> ④ “은행”은 제2항의 규정에도 불구하고 전산상의 이유 등으로 “이용기관”이 등록한 수수료 납부계좌에서 예금청구서 및 통장에 의하지 아니하고 대체 출금할 수 없는 경우, “이용기관”에 “은행”이 정하는 다른 방법으로 수수료 납부를 요청할 수 있습니다.</p>
|
||||||
|
<p> ⑤ “이용기관”에게 부과되는 수수료는 “은행”이 정하는 바에 따릅니다. 다만 “은행”이 사업적으로 필요하다고 판단되는 경우 서비스 이용에 따른 수수료를 감면할 수 있습니다.</p>
|
||||||
|
<p> ⑥ 수수료는 은행의 정책에 따라 변경될 수 있으며, 은행이 수수료를 변경할 경우 전자금융거래 기본약관의 내용을 준용합니다.</p>
|
||||||
|
<h2>제6장 보칙</h2>
|
||||||
|
<h3>제15조 (최종사용자에 대한 고지 의무)</h3>
|
||||||
|
<p> ① “이용기관”은 중요사항에 대해 “최종사용자”에게 통보하여야 합니다.</p>
|
||||||
|
<p> ② “이용기관”은 “서비스” 이용 관련사항을 변경한 경우에 “최종사용자”에게 사전에 통지하여야 합니다.</p>
|
||||||
|
<p> ③ “은행”은 “이용기관”이 “최종사용자”에게 고지할 필요가 있다고 판단되는 사항을 고지하도록 “이용기관”에게 요구할 수 있습니다.</p>
|
||||||
|
<p> ④ “이용기관”은 “시스템”과 관련하여 알게 된 “최종사용자” 정보가 제3자에게 유출되었을 경우 즉시 해당 “최종사용자” 및 “은행”에 통지하여 추가적인 피해가 없도록 조치하여야 합니다.</p>
|
||||||
|
<h3>제16조 (부정 접속 방지)</h3>
|
||||||
|
<p> ① “은행”은 부정접속을 방지하기 위하여 “이용기관”의 “포털” 접속용 패스워드 입력오류가 연속 5회를 초과할 경우 업무 이용을 중지시킵니다.</p>
|
||||||
|
<p> ② 제1항에 따라 업무 이용이 중지된 “이용기관”은 업무 이용을 위하여 “은행”에 해제 요청을 하여야 합니다.</p>
|
||||||
|
<h3>제17조 (전산처리 절차)</h3>
|
||||||
|
<p>전산처리명세의 송·수신 절차, 방법, 시간, 이체일 등 전산처리와 관련된 사항은 “포털”을 통해 별도 공시합니다.</p>
|
||||||
|
<h3>제18조 (보안관리)</h3>
|
||||||
|
<p> ① “이용기관”은 “은행”에서 제시하는 보안 기준을 준수하여야 하고, “은행”은 “이용기관”의 전산시스템에 대하여 각 호의 사항을 점검 요청할 수 있습니다.</p>
|
||||||
|
<p> 1. 개인정보 및 금융정보 암호화 운영현황</p>
|
||||||
|
<p> 2. 해킹 등에 대비한 정책사항</p>
|
||||||
|
<p> 3. 시스템 운영에 대한 정보보호 체계 등</p>
|
||||||
|
<p> ② “이용기관”은 “서비스” 이용과 관련하여 감독 당국에서 관련 자료 또는 감독을 요청하면 이에 대하여 적극적으로 협조하여야 합니다.</p>
|
||||||
|
<p> ③ “이용기관”의 “서비스” 이용에 대한 고객 정보 관리책임은 “이용기관”에게 있으며, “이용기관”의 전산시스템에 대한 해킹 또는 외부의 네트워크 공격 등 위험이 발생한 경우에는 즉시 “은행”에 이를 통지하고, 본 “서비스”의 이용을 중단하여야 합니다.</p>
|
||||||
|
<h3>제19조 (기밀유지)</h3>
|
||||||
|
<p> ① “은행”과 “이용기관”은 “서비스”와 관련되거나 상호정보교환 등 업무처리 과정에서 인지 또는 획득한 정보를 이 업무처리 이외의 목적으로 사용하거나 외부에 유출하여서는 안 됩니다.</p>
|
||||||
|
<p> ② 제1항에서 정한 의무를 위반하여 상대방 또는 제3자에게 손해가 발생한 경우, 귀책사유 있는 당사자는 상대방 또는 제3자에게 이로 인하여 발생한 손해의 일부 또는 전부를 배상하여야 합니다.</p>
|
||||||
|
<h3>제20조 (손해배상 및 면책)</h3>
|
||||||
|
<p> ① “은행”은 “이용기관”으로부터 접근매체의 분실이나 도난의 통지를 받은 후에 제3자가 그 접근매체를 사용하여 “이용기관”에게 손해가 발생한 경우 그 손해를 배상합니다.</p>
|
||||||
|
<p> ② “은행”은 다음 각 1호의 사고로 인하여 “이용기관”에게 손해가 발생한 경우 그 손해를 배상합니다.</p>
|
||||||
|
<p> 1. 접근매체의 위조나 변조로 발생한 사고</p>
|
||||||
|
<p> 2. 계약체결 또는 거래지시의 전자적 전송이나 처리과정에서 발생한 사고</p>
|
||||||
|
<p> 3. 전자금융거래를 위한 전자적 장치 또는 「정보통신망 이용촉진 및 정보보호 등에 관한 법률」 제2조 제1항 제1호에 따른 “은행”의 정보통신망에 침입하여 거짓이나 그 밖의 부정한 방법으로 획득한 접근매체의 이용으로 발생한 사고</p>
|
||||||
|
<p> ③ 제1항 및 제2항에 의하여 금전적 손해가 발생한 경우 해당 금액 및 이에 대한 1년 만기 정기예금 이율로 계산한 경과이자를 배상합니다. 다만, 손해액이 해당 금액과 1년 만기 정기예금 이율로 계산한 금액을 초과하는 경우에는 실손해액을 배상합니다.</p>
|
||||||
|
<p> ④ 제2항의 규정에도 불구하고 “은행”은 “이용기관”이 고의 또는 과실로 다음 각 호의 행위를 하여 “이용기관”에게 손해가 생기는 경우 “은행”의 고의 또는 과실이 없다면 “은행”은 그 책임의 전부 또는 일부를 지지 않습니다.</p>
|
||||||
|
<p> 1. “이용기관”이 접근매체를 제3자에게 대여하거나 사용을 위임한 경우 또는 양도나 담보의 목적으로 제공한 경우(「전자금융거래법」제18조에 따라 선불전자지급수단이나 전자화폐를 양도하거나 담보로 제공한 경우를 제외합니다.)</p>
|
||||||
|
<p> 2. 제3자가 권한 없이 “이용기관”의 접근매체를 이용하여 전자금융거래를 할 수 있음을 알았거나 쉽게 알 수 있었음에도 불구하고 “이용기관”이 자신의 접근매체를 누설 또는 노출하거나 방치한 경우</p>
|
||||||
|
<p> 3. “은행”이 접근매체를 통하여 “이용기관”의 신원, 권한 및 거래지시의 내용 등을 확인하는 것 외에 보안강화를 위하여 전자금융거래 시 사전에 요구하는 추가적인 보안조치를 “이용기관”이 정당한 사유 없이 거부하여 사고가 발생한 경우</p>
|
||||||
|
<p> 4. “이용기관”이 제3호에 따른 추가적인 보안조치에 사용되는 매체·수단 또는 정보에 대하여 다음 각 목의 어느 하나에 해당하는 행위를 하여 사고가 발생한 경우</p>
|
||||||
|
<p> 가. 누설·노출 또는 방치한 행위</p>
|
||||||
|
<p> 나. 제3자에게 대여하거나 그 사용을 위임한 행위 또는 양도나 담보의 목적으로 제공한 행위</p>
|
||||||
|
<p> 5. 법인(「중소기업기본법」제2조 제2항에 의한 소기업을 제외합니다.)인 “이용기관”에게 손해가 발생한 경우로 “은행”이 사고를 방지하기 위하여 보안절차를 수립하고 이를 철저히 준수하는 등 합리적으로 요구되는 충분한 주의의무를 다한 경우</p>
|
||||||
|
<h3>제21조 (이의제기 및 협조)</h3>
|
||||||
|
<p> ① “이용기관”은 전자금융거래의 처리에 관하여 이의가 있을 때에는 “은행”의 분쟁처리기구에 그 해결을 요구하거나 금융감독원 금융분쟁조정위원회, 한국소비자보호원 소비자분쟁조정위원회 등을 통하여 분쟁조정을 신청할 수 있습니다.</p>
|
||||||
|
<p> ② “이용기관”이 “은행”의 본점이나 영업점 또는 “은행”의 분쟁처리기구에 이의를 제기한 경우 “은행”은 15일 이내에 이에 대한 조사 또는 처리결과를 “이용기관”에게 알려야 합니다.</p>
|
||||||
|
<p> ③ “은행”은 손해배상 등 분쟁처리를 위한 분쟁처리책임자 및 담당자를 지정하고, 그 연락처를 관련 인터넷 홈페이지에 게시하여야 합니다.</p>
|
||||||
|
<p> ④ “이용기관”은 제20조 제2항에 정한 사고발생으로 인한 손해배상 등 분쟁처리와 관련한 “은행”의 사고조사 및 관계당국의 수사 또는 조사 절차에 협조하여야 합니다.</p>
|
||||||
|
<h3>제22조 (거래기록·자료의 제공)</h3>
|
||||||
|
<p> ① “은행”은 “이용기관”의 요청이 있을 경우 「금융실명거래 및 비밀보장에 관한 법률」 등 다른 법률에 저촉되지 않는 범위 내에서 “은행”이 보존·관리하고 있는 전자금융거래 관련 기록·자료를 “이용기관”에게 제공하여야 합니다.</p>
|
||||||
|
<p> ② “이용기관”이 제공 요청을 할 수 있는 거래기록·자료의 범위와 대상기간은 「전자금융거래법」 제22조 제1항 및 제2항에서 정한 기록 및 기간으로 합니다.</p>
|
||||||
|
<p> ③ “이용기관”이 서면(전자문서를 제외합니다. 이하 같습니다.) 형태의 거래기록·자료(이하 “거래명세서”라 합니다.)를 제공할 것을 “은행”에 요청하는 경우에는 본인이 서면으로 영업점에 신청하여야 하며, “은행”은 신청 가능 영업점의 주소 및 전화번호 등을 인터넷 등을 통하여 “이용기관”이 알 수 있도록 게시하여야 합니다.</p>
|
||||||
|
<p> ④ “은행”은 “이용기관”으로부터 제3항에 따른 거래명세서의 제공요청을 받은 경우 2주일 이내에 “이용기관”에게 거래명세서를 교부하여야 합니다.</p>
|
||||||
|
<p> ⑤ “은행”은 불가피한 사유로 인하여 거래기록·자료(거래명세서 포함)의 제공이 불가능한 경우에는 그 사유를 “이용기관”에게 즉시 통보하여야 하며, 해당 사유가 소멸한 경우 다음 각 호에 정한 기한 내에 “이용기관”에게 확인 및 제공하여야 합니다.</p>
|
||||||
|
<p> 1. 전자적 장치를 통한 제공의 경우에는 즉시</p>
|
||||||
|
<p> 2. 제3항에 따른 서면 제공 방식의 경우에는 2주일 이내에 거래명세서를 교부</p>
|
||||||
|
<h2>부칙</h2>
|
||||||
|
<p>본 약관은 2026. 99. 99.부터 시행합니다.</p>
|
||||||
@@ -0,0 +1,184 @@
|
|||||||
|
제1장 총칙
|
||||||
|
|
||||||
|
제1조 (목적)
|
||||||
|
본 약관은 (주)제주은행(이하 “은행”)이 제공하는 Open API 서비스를 이용함에 있어 “은행”과 Open API 서비스를 이용하는 자(이하 “이용기관”)간의 권리, 의무 및 책임 사항, 이용조건 및 절차 등 기본적인 사항을 명확히 규정함을 목적으로 합니다.
|
||||||
|
|
||||||
|
제2조 (용어의 정의)
|
||||||
|
① 본 약관에서 사용하는 용어의 정의는 다음 각 호와 같습니다.
|
||||||
|
1. “Open API”란 “은행”이 “이용기관”에게 제공하는 API(Application Programming Interface) 기능을 개방형 플랫폼 형태로 이용할 수 있도록 공개한 API
|
||||||
|
2. “Open API 서비스”(이하 “서비스”)란 “은행”의 서비스 및 데이터를 표준화된 API 형태로 Open API 시스템을 통하여 “이용기관”에 제공하는 것
|
||||||
|
3. “Open API 시스템”(이하 “시스템”)이란 “서비스”를 제공하기 위하여 “은행”에 설치한 중계시스템과 “이용기관”의 처리시스템을 통신회선으로 연결하여 “은행” 및 “이용기관” 상호간에 정보를 교환하는 시스템
|
||||||
|
4. “Open API 포탈”(이하 “포털”)이란 “서비스”를 소개하고 가입 절차 및 이용 절차를 제공하며 “이용기관”이 가입 및 “서비스” 이용을 하기 위하여 “은행”이 제공하는 웹사이트
|
||||||
|
5. “이용신청기관”이란 “은행”의 “서비스”를 이용하기 위하여 “서비스” 이용을 신청한 기관(법인, 개인사업자 및 임의단체 등)
|
||||||
|
6. “이용기관”이란 본 약관에 동의하고 “서비스” 이용신청에 대한 “은행”의 승낙을 받은 후, “은행”이 제공하는 Open API를 이용하여 별도의 서비스 또는 프로그램을 개발, 테스트 및 제공하고자 하는 자
|
||||||
|
7. “최종사용자”란 “은행”이 제공한 “서비스”를 결합하여 “이용기관”이 개발한 별도의 서비스 또는 프로그램을 이용하는 고객
|
||||||
|
8. “제휴사”란 “은행”이 “이용기관”에게 “서비스”를 제공하기 위하여 “은행”과 계약을 체결하여 협력하는 제3자
|
||||||
|
|
||||||
|
제3조 (서비스의 내용)
|
||||||
|
① 조회성 API 서비스(계좌 거래내역 조회, 예금주 실명 조회 등)
|
||||||
|
② 거래성 API 서비스(환전, 이체 등)
|
||||||
|
③ 기타 “은행” 또는 “제휴사”가 제공하는 API 형태의 “서비스”
|
||||||
|
|
||||||
|
제4조 (약관의 효력 및 변경)
|
||||||
|
① 본 약관 내용의 효력은 “은행” 인터넷 홈페이지 또는 “포털” 등에 게시되거나 전자우편 등의 방법으로 “이용기관”에 통지됨으로써 발생합니다.
|
||||||
|
② 본 약관의 변경은 전자금융거래 기본약관의 내용을 준용합니다.
|
||||||
|
|
||||||
|
제2장 서비스 이용계약
|
||||||
|
|
||||||
|
제5조 (서비스 이용신청)
|
||||||
|
① 서비스 이용신청은 “이용신청기관”이 “포털”에서 “은행”이 정한 가입양식에 회원정보 기입 및 본 약관에 동의함으로써 이루어집니다.
|
||||||
|
② 제1항을 완료한 “이용신청기관”은 이용 희망일 전일까지 “은행”이 요청하는 서류를 제출하여야 합니다.
|
||||||
|
|
||||||
|
제6조 (서비스 이용신청 승인 및 거절)
|
||||||
|
① “은행”은 본 약관 제5조 제2항의 “이용신청기관”이 제출한 서류와 “서비스” 이용목적의 적정성을 검토한 후, “이용신청기관” 서비스 이용신청을 승낙 또는 거절할 수 있습니다.
|
||||||
|
② “은행”은 “이용신청기관”이 다음 각 호의 어느 하나에 해당할 경우 이용신청에 대해 거절할 수 있습니다.
|
||||||
|
1. 실명이 아니거나, 타인의 명의를 사용하여 신청한 경우
|
||||||
|
2. 이용신청 내용을 허위로 기재하거나 허위서류를 첨부한 경우
|
||||||
|
3. 이전에 “이용기관” 자격을 상실한 적이 있거나, 탈퇴, 이용중지 등이 있는 경우
|
||||||
|
4. “이용신청기관”의 업태가 사행행위에 관련이 있거나 금융질서문란 위험이 있는 경우
|
||||||
|
5. “이용신청기관”의 사업모델에 위법성이 있는 경우
|
||||||
|
6. “이용신청기관”의 재무안정성이 위험한 경우
|
||||||
|
7. “이용신청기관”의 전산망이나 정보처리시스템에 보안 취약점이 있거나, “이용신청기관”의 “최종사용자” 정보에 관한 기술적·물리적·관리적 보호조치가 미흡한 경우
|
||||||
|
8. “은행”의 평판이나 “최종사용자”의 권리에 위험을 끼칠 가능성이 있는 경우
|
||||||
|
③ “은행”은 이용신청에 대한 결과를 “이용신청자”에게 통보하여야 합니다.
|
||||||
|
|
||||||
|
제3장 서비스의 이용
|
||||||
|
|
||||||
|
제7조 (서비스 이용개시)
|
||||||
|
“은행”이 “이용신청기관”의 이용신청을 심사 후 승낙하게 되면 “이용기관”이 요청한 이용 희망일로부터 “서비스”를 개시합니다. 단, 이용 희망일은 “은행”과 협의하여 결정합니다.
|
||||||
|
|
||||||
|
제8조 (서비스 이용시간)
|
||||||
|
① “서비스”의 이용시간은 연중무휴(24시간)로 하며 “서비스”별 이용시간을 정하여 운영할 수 있습니다. 단, 다음 각 호의 어느 하나에 해당하여 은행이 정상적인 “서비스”를 제공하기 어려운 경우에는 서비스의 전부 또는 일부가 제한 될 수 있습니다.
|
||||||
|
1. 은행의 시스템을 점검하는 경우
|
||||||
|
2. 은행의 정보통신 설비의 보수점검, 증설, 교체, 이전 등 시스템 관리 작업을 진행하는 경우
|
||||||
|
3. 정전, 제반 설비의 장애 또는 이용량의 폭주 등이 발생하는 경우
|
||||||
|
4. 천재지변, 전쟁, 폭동, 테러, 해킹, Ddos, 국가비상사태 등 불가항력적 사유가 발생하는 경우
|
||||||
|
5. 시스템 오류 등 서비스 제공에 관한 기술상 문제가 발생하는 경우
|
||||||
|
② 제1항의 사유로 서비스가 일시 중지되는 경우, “은행”은 사전에 이를 공지하여야 합니다. 단, 부득이한 경우 사후에 통보할 수 있습니다.
|
||||||
|
|
||||||
|
제9조 (서비스 변경 및 중단)
|
||||||
|
① “은행”은 변경될 “서비스”의 내용 및 변경일자를 “이용기관”에게 통지하고 “서비스”를 변경하여 제공할 수 있습니다.
|
||||||
|
② “은행”은 “이용기관”이 다음 각 호의 어느 하나에 해당할 경우 “서비스”의 전부 또는 일부를 중단할 수 있습니다.
|
||||||
|
1. “서비스”용 정보통신설비의 보수·교체·고장, 통신두절 등으로 인해 부득이한 경우
|
||||||
|
2. 정전, 모든 설비의 장애 또는 이용량의 폭주 등으로 정상적인 서비스 이용에 지장이 있는 경우
|
||||||
|
3. “서비스” 종료 등과 같은 “은행”의 사정으로 “서비스”를 유지할 수 없는 경우
|
||||||
|
4. 기타 천재지변, 국가비상사태 등 불가항력적 사유가 있는 경우
|
||||||
|
③ “서비스”를 변경하거나 중단할 경우, “은행”은 그 사실을 사전에 “이용기관”에 통지하여야 합니다. 단, 사전에 통지할 수 없는 부득이한 사유가 있는 경우에는 사후에 그 사유와 함께 통지하여야 합니다. 또한 “포털”에 등록된 연락처가 부정확하거나 “이용기관” 측의 사유로 인하여 “은행”의 통보를 받지 못해 발생하는 손실에 대해서는 “은행”의 고의 또는 과실이 없는 경우 그 책임의 전부 또는 일부를 지지 않습니다.
|
||||||
|
④ “은행”은 “서비스”의 변경 혹은 중단으로 발생하는 문제에 대해서는 “은행”의 고의 또는 과실이 없는 경우 그 책임의 전부 또는 일부를 지지 않습니다.
|
||||||
|
|
||||||
|
제10조 (서비스 이용 제한)
|
||||||
|
① “은행”은 “이용기관”이 다음 각 호의 어느 하나에 해당할 경우 “이용기관”에 대한 “서비스” 이용을 개별 고지 후 제한할 수 있습니다.
|
||||||
|
1. 감독당국으로부터 중지 권고가 있는 경우
|
||||||
|
2. “이용기관”이 휴업 또는 폐업을 하는 경우
|
||||||
|
3. 접근권한을 넘어서는 접속을 시도하거나 반복적인 접속을 시도하여 과부하 발생 등 시스템 운영의 안전성을 저해한다고 판단되는 행위가 확인된 경우
|
||||||
|
4. “이용기관” 수수료 납부계좌에서 부족분이 3회 이상 발생할 경우
|
||||||
|
5. “이용기관”에 본 약관 제6조 제2항 각 호의 사유가 발생한 경우 또는 “서비스” 신청 당시 “이용기관”에 본 약관 제6조 제2항 각 호의 사유가 있었음이 밝혀진 경우
|
||||||
|
6. “시스템” 및 “포털”의 안정적인 운영을 위하여 필요하다고 인정되는 경우
|
||||||
|
② “이용기관”이 제1항에 해당할 경우, “은행”은 “서비스” 이용을 제한할 수 있으며 이와 별도로 해당 “이용기관”에 소명자료 제출을 요구할 수 있습니다. “이용기관”은 통지받은 날로부터 15일 이내에 소명자료를 제출하여야 합니다. 단, “은행”은 “이용기관”의 소명자료가 정당하다고 판단하기 전까지 “이용기관”의 “서비스” 이용을 제한할 수 있습니다.
|
||||||
|
|
||||||
|
제11조 (서비스 이용 해지)
|
||||||
|
① “은행”은 “이용기관”이 다음 각 호의 어느 하나에 해당할 경우 “이용기관”에 대한 “서비스” 이용을 개별 고지 후 해지할 수 있습니다.
|
||||||
|
1. 감독당국으로부터 해지권고가 있는 경우
|
||||||
|
2. 최근 12개월간 “시스템” 이용 실적이 없는 경우
|
||||||
|
3. “이용기관” 수수료 납부계좌에서 부족분이 6회 이상 발생할 경우
|
||||||
|
4. “이용기관”의 정상적인 운영이 불가능하다고 “은행”이 판단할 경우
|
||||||
|
② “이용기관”이 제1항에 해당할 경우, “이용기관”에 소명자료 제출을 요구할 수 있습니다. “이용기관”은 통지받은 날로부터 15일 이내에 소명자료를 제출하여야 합니다.
|
||||||
|
③ 해지일은 “은행”이 “시스템” 또는 “포털” 원장에 해지 등록한 날로 합니다.
|
||||||
|
|
||||||
|
제4장 계약당사자의 의무 및 손해배상 등
|
||||||
|
|
||||||
|
제12조 (은행의 의무)
|
||||||
|
① “은행”은 본 약관에서 특별히 규정한 사유 외에는 “서비스”를 지속적·안정적으로 제공하여야 합니다.
|
||||||
|
② “은행”은 “서비스” 제공과 관련하여 알게 된 “이용기관”의 정보를 업무 이외의 목적으로 사용할 수 없습니다. 단, 관계법령에 따른 수사상의 관계기관으로부터 요구 받은 경우나 정보통신 윤리위원회의 요청이 있는 경우 등 법률의 규정에 따른 적법한 절차에 의한 경우에는 그러하지 않습니다.
|
||||||
|
③ “은행”이 제공하는 “서비스”로 인하여 “이용기관”에 손해가 발생한 경우 “서비스”를 제공하는 “은행”과 이용하는 “이용기관”이 상호협의에 의하여 해결합니다. 단, 그러한 손해가 “은행”의 고의나 과실에 기해 발생한 경우에 한하여 “은행”은 그 책임의 전부 또는 일부를 부담합니다.
|
||||||
|
④ “은행”은 개인정보보호법, 신용정보의 이용 및 보호에 관한 법률, 금융실명거래 및 비밀보장에 관한 법률, 정보통신망 이용촉진 및 정보보호에 관한 법률, 통신비밀보호법 등 “서비스” 운영, 유지와 관련 있는 법규를 준수하여야 합니다.
|
||||||
|
|
||||||
|
제13조 (약관 외 준칙)
|
||||||
|
① “이용기관”은 “포털”에서 “은행”이 정한 가입양식에 회원정보를 기입할 때, 사실에 근거하여 정확하게 기입하여야 합니다.
|
||||||
|
② “이용기관”은 “은행”에 제공한 사항이 변경될 때, 즉시 “은행”에 변경 신청하여 변경사항을 최신의 정보로 수정해야 합니다. 수정하지 않은 정보로 인하여 발생하는 문제에 대한 책임은 “이용기관”에 있으며 “은행”은 이에 대해 아무런 책임을 지지 않습니다.
|
||||||
|
③ “이용기관”은 “시스템”과 관련한 “서비스” 이용의 대가로 수수료를 납부하여야 합니다.
|
||||||
|
④ “이용기관”은 “서비스”의 이용 권한, 기타 이용 계약상의 지위를 타인에게 양도, 증여할 수 없으며 게시물에 대한 저작권을 포함한 모든 권리 및 책임은 이를 게시한 “이용기관”에 있습니다.
|
||||||
|
⑤ “이용기관”은 “서비스”의 안정적인 이용을 위해 전산시스템의 구축에 필요한 회선, 단말기 및 부대기기를 “이용기관”의 부담으로 설치하여야 하고, 보안상 안전하게 처리할 수 있는 전산시스템을 갖추어야 합니다.
|
||||||
|
⑥ “이용기관”은 “은행”이나 “최종사용자”가 업무처리에 대하여 이의를 제기하거나 확인을 요청하면 이를 신속히 처리하여야 합니다.
|
||||||
|
⑦ “이용기관”은 본 약관에서 정한 사항을 준수하여야 하며, “은행”이 “이용기관”의 약관 이행여부를 점검하고자 할 경우 적극 협조하여야 합니다.
|
||||||
|
⑧ “이용기관”은 “포털”에서 제공하는 “서비스” 이용과 관련하여 다음 각 호의 행위를 하여서는 안 됩니다.
|
||||||
|
1. 다른 “이용기관”의 아이디를 부정 사용하는 행위
|
||||||
|
2. 범죄행위를 목적으로 하거나 기타 범죄행위와 관련된 행위
|
||||||
|
3. 선량한 풍속, 기타 사회질서를 해하는 행위
|
||||||
|
4. 타인의 명예를 훼손하거나 모욕하는 행위
|
||||||
|
5. 타인의 지식재산권 등의 권리를 침해하는 행위
|
||||||
|
6. 해킹행위 또는 컴퓨터 바이러스의 유포행위
|
||||||
|
7. 타인의 의사에 반하여 광고성 정보 등 일정한 내용을 지속적으로 전송하는 행위
|
||||||
|
8. 서비스의 안정적인 운영에 지장을 주거나 줄 우려가 있는 일체의 행위
|
||||||
|
⑨ “이용기관”은 개인정보보호법, 신용정보의 이용 및 보호에 관한 법률, 금융실명거래 및 비밀보장에 관한 법률, 정보통신망 이용촉진 및 정보보호에 관한 법률, 통신비밀보호법 등 “서비스” 운영, 유지와 관련 있는 법규를 준수하여야 합니다.
|
||||||
|
|
||||||
|
제5장 수수료
|
||||||
|
|
||||||
|
제14조 (수수료)
|
||||||
|
① “은행”은 “서비스” 제공의 대가로 “이용기관”에게 수수료를 부과합니다.
|
||||||
|
② “은행”은 매월 1일~말일까지 발생하는 수수료를 익월 10일(공휴일인 경우에는 익영업일)에 “이용기관”에게 부과하며, “이용기관”이 등록한 수수료 납부계좌에서 예금청구서 및 통장에 의하지 아니하고 대체 출금하기로 합니다.
|
||||||
|
③ “은행”은 “이용기관”이 해지 등의 사유로 “서비스” 이용이 불가한 경우, 이용불가 시점까지 발생한 미결제 수수료를 본 “서비스” 해지일에 예금청구서 및 통장에 의하지 아니하고 “이용기관”의 수수료 납부계좌에서 출금하고, 부족액이 발생할 시에 별도 청구합니다.
|
||||||
|
④ “은행”은 제2항의 규정에도 불구하고 전산상의 이유 등으로 “이용기관”이 등록한 수수료 납부계좌에서 예금청구서 및 통장에 의하지 아니하고 대체 출금할 수 없는 경우, “이용기관”에 “은행”이 정하는 다른 방법으로 수수료 납부를 요청할 수 있습니다.
|
||||||
|
⑤ “이용기관”에게 부과되는 수수료는 “은행”이 정하는 바에 따릅니다. 다만 “은행”이 사업적으로 필요하다고 판단되는 경우 서비스 이용에 따른 수수료를 감면할 수 있습니다.
|
||||||
|
⑥ 수수료는 은행의 정책에 따라 변경될 수 있으며, 은행이 수수료를 변경할 경우 전자금융거래 기본약관의 내용을 준용합니다.
|
||||||
|
|
||||||
|
제6장 보칙
|
||||||
|
|
||||||
|
제15조 (최종사용자에 대한 고지 의무)
|
||||||
|
① “이용기관”은 중요사항에 대해 “최종사용자”에게 통보하여야 합니다.
|
||||||
|
② “이용기관”은 “서비스” 이용 관련사항을 변경한 경우에 “최종사용자”에게 사전에 통지하여야 합니다.
|
||||||
|
③ “은행”은 “이용기관”이 “최종사용자”에게 고지할 필요가 있다고 판단되는 사항을 고지하도록 “이용기관”에게 요구할 수 있습니다.
|
||||||
|
④ “이용기관”은 “시스템”과 관련하여 알게 된 “최종사용자” 정보가 제3자에게 유출되었을 경우 즉시 해당 “최종사용자” 및 “은행”에 통지하여 추가적인 피해가 없도록 조치하여야 합니다.
|
||||||
|
|
||||||
|
제16조 (부정 접속 방지)
|
||||||
|
① “은행”은 부정접속을 방지하기 위하여 “이용기관”의 “포털” 접속용 패스워드 입력오류가 연속 5회를 초과할 경우 업무 이용을 중지시킵니다.
|
||||||
|
② 제1항에 따라 업무 이용이 중지된 “이용기관”은 업무 이용을 위하여 “은행”에 해제 요청을 하여야 합니다.
|
||||||
|
|
||||||
|
제17조 (전산처리 절차)
|
||||||
|
전산처리명세의 송·수신 절차, 방법, 시간, 이체일 등 전산처리와 관련된 사항은 “포털”을 통해 별도 공시합니다.
|
||||||
|
|
||||||
|
제18조 (보안관리)
|
||||||
|
① “이용기관”은 “은행”에서 제시하는 보안 기준을 준수하여야 하고, “은행”은 “이용기관”의 전산시스템에 대하여 각 호의 사항을 점검 요청할 수 있습니다.
|
||||||
|
1. 개인정보 및 금융정보 암호화 운영현황
|
||||||
|
2. 해킹 등에 대비한 정책사항
|
||||||
|
3. 시스템 운영에 대한 정보보호 체계 등
|
||||||
|
② “이용기관”은 “서비스” 이용과 관련하여 감독 당국에서 관련 자료 또는 감독을 요청하면 이에 대하여 적극적으로 협조하여야 합니다.
|
||||||
|
③ “이용기관”의 “서비스” 이용에 대한 고객 정보 관리책임은 “이용기관”에게 있으며, “이용기관”의 전산시스템에 대한 해킹 또는 외부의 네트워크 공격 등 위험이 발생한 경우에는 즉시 “은행”에 이를 통지하고, 본 “서비스”의 이용을 중단하여야 합니다.
|
||||||
|
|
||||||
|
제19조 (기밀유지)
|
||||||
|
① “은행”과 “이용기관”은 “서비스”와 관련되거나 상호정보교환 등 업무처리 과정에서 인지 또는 획득한 정보를 이 업무처리 이외의 목적으로 사용하거나 외부에 유출하여서는 안 됩니다.
|
||||||
|
② 제1항에서 정한 의무를 위반하여 상대방 또는 제3자에게 손해가 발생한 경우, 귀책사유 있는 당사자는 상대방 또는 제3자에게 이로 인하여 발생한 손해의 일부 또는 전부를 배상하여야 합니다.
|
||||||
|
|
||||||
|
제20조 (손해배상 및 면책)
|
||||||
|
① “은행”은 “이용기관”으로부터 접근매체의 분실이나 도난의 통지를 받은 후에 제3자가 그 접근매체를 사용하여 “이용기관”에게 손해가 발생한 경우 그 손해를 배상합니다.
|
||||||
|
② “은행”은 다음 각 1호의 사고로 인하여 “이용기관”에게 손해가 발생한 경우 그 손해를 배상합니다.
|
||||||
|
1. 접근매체의 위조나 변조로 발생한 사고
|
||||||
|
2. 계약체결 또는 거래지시의 전자적 전송이나 처리과정에서 발생한 사고
|
||||||
|
3. 전자금융거래를 위한 전자적 장치 또는 「정보통신망 이용촉진 및 정보보호 등에 관한 법률」 제2조 제1항 제1호에 따른 “은행”의 정보통신망에 침입하여 거짓이나 그 밖의 부정한 방법으로 획득한 접근매체의 이용으로 발생한 사고
|
||||||
|
③ 제1항 및 제2항에 의하여 금전적 손해가 발생한 경우 해당 금액 및 이에 대한 1년 만기 정기예금 이율로 계산한 경과이자를 배상합니다. 다만, 손해액이 해당 금액과 1년 만기 정기예금 이율로 계산한 금액을 초과하는 경우에는 실손해액을 배상합니다.
|
||||||
|
④ 제2항의 규정에도 불구하고 “은행”은 “이용기관”이 고의 또는 과실로 다음 각 호의 행위를 하여 “이용기관”에게 손해가 생기는 경우 “은행”의 고의 또는 과실이 없다면 “은행”은 그 책임의 전부 또는 일부를 지지 않습니다.
|
||||||
|
1. “이용기관”이 접근매체를 제3자에게 대여하거나 사용을 위임한 경우 또는 양도나 담보의 목적으로 제공한 경우(「전자금융거래법」제18조에 따라 선불전자지급수단이나 전자화폐를 양도하거나 담보로 제공한 경우를 제외합니다.)
|
||||||
|
2. 제3자가 권한 없이 “이용기관”의 접근매체를 이용하여 전자금융거래를 할 수 있음을 알았거나 쉽게 알 수 있었음에도 불구하고 “이용기관”이 자신의 접근매체를 누설 또는 노출하거나 방치한 경우
|
||||||
|
3. “은행”이 접근매체를 통하여 “이용기관”의 신원, 권한 및 거래지시의 내용 등을 확인하는 것 외에 보안강화를 위하여 전자금융거래 시 사전에 요구하는 추가적인 보안조치를 “이용기관”이 정당한 사유 없이 거부하여 사고가 발생한 경우
|
||||||
|
4. “이용기관”이 제3호에 따른 추가적인 보안조치에 사용되는 매체·수단 또는 정보에 대하여 다음 각 목의 어느 하나에 해당하는 행위를 하여 사고가 발생한 경우
|
||||||
|
가. 누설·노출 또는 방치한 행위
|
||||||
|
나. 제3자에게 대여하거나 그 사용을 위임한 행위 또는 양도나 담보의 목적으로 제공한 행위
|
||||||
|
5. 법인(「중소기업기본법」제2조 제2항에 의한 소기업을 제외합니다.)인 “이용기관”에게 손해가 발생한 경우로 “은행”이 사고를 방지하기 위하여 보안절차를 수립하고 이를 철저히 준수하는 등 합리적으로 요구되는 충분한 주의의무를 다한 경우
|
||||||
|
|
||||||
|
제21조 (이의제기 및 협조)
|
||||||
|
① “이용기관”은 전자금융거래의 처리에 관하여 이의가 있을 때에는 “은행”의 분쟁처리기구에 그 해결을 요구하거나 금융감독원 금융분쟁조정위원회, 한국소비자보호원 소비자분쟁조정위원회 등을 통하여 분쟁조정을 신청할 수 있습니다.
|
||||||
|
② “이용기관”이 “은행”의 본점이나 영업점 또는 “은행”의 분쟁처리기구에 이의를 제기한 경우 “은행”은 15일 이내에 이에 대한 조사 또는 처리결과를 “이용기관”에게 알려야 합니다.
|
||||||
|
③ “은행”은 손해배상 등 분쟁처리를 위한 분쟁처리책임자 및 담당자를 지정하고, 그 연락처를 관련 인터넷 홈페이지에 게시하여야 합니다.
|
||||||
|
④ “이용기관”은 제20조 제2항에 정한 사고발생으로 인한 손해배상 등 분쟁처리와 관련한 “은행”의 사고조사 및 관계당국의 수사 또는 조사 절차에 협조하여야 합니다.
|
||||||
|
|
||||||
|
제22조 (거래기록·자료의 제공)
|
||||||
|
① “은행”은 “이용기관”의 요청이 있을 경우 「금융실명거래 및 비밀보장에 관한 법률」 등 다른 법률에 저촉되지 않는 범위 내에서 “은행”이 보존·관리하고 있는 전자금융거래 관련 기록·자료를 “이용기관”에게 제공하여야 합니다.
|
||||||
|
② “이용기관”이 제공 요청을 할 수 있는 거래기록·자료의 범위와 대상기간은 「전자금융거래법」 제22조 제1항 및 제2항에서 정한 기록 및 기간으로 합니다.
|
||||||
|
③ “이용기관”이 서면(전자문서를 제외합니다. 이하 같습니다.) 형태의 거래기록·자료(이하 “거래명세서”라 합니다.)를 제공할 것을 “은행”에 요청하는 경우에는 본인이 서면으로 영업점에 신청하여야 하며, “은행”은 신청 가능 영업점의 주소 및 전화번호 등을 인터넷 등을 통하여 “이용기관”이 알 수 있도록 게시하여야 합니다.
|
||||||
|
④ “은행”은 “이용기관”으로부터 제3항에 따른 거래명세서의 제공요청을 받은 경우 2주일 이내에 “이용기관”에게 거래명세서를 교부하여야 합니다.
|
||||||
|
⑤ “은행”은 불가피한 사유로 인하여 거래기록·자료(거래명세서 포함)의 제공이 불가능한 경우에는 그 사유를 “이용기관”에게 즉시 통보하여야 하며, 해당 사유가 소멸한 경우 다음 각 호에 정한 기한 내에 “이용기관”에게 확인 및 제공하여야 합니다.
|
||||||
|
1. 전자적 장치를 통한 제공의 경우에는 즉시
|
||||||
|
2. 제3항에 따른 서면 제공 방식의 경우에는 2주일 이내에 거래명세서를 교부
|
||||||
|
|
||||||
|
부칙
|
||||||
|
본 약관은 2026. 99. 99.부터 시행합니다.
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<!--
|
||||||
|
editor-content.css 대응 프래그먼트: <!doctype>/<html>/<head>/<style> 없이 순수 태그(h1/h2/h3/p/ul/li/strong)만 사용.
|
||||||
|
admin Summernote 코드뷰에 그대로 붙여넣으면 됨. class/style 속성 없음 -> 붙여넣기(paste-cleaner)든
|
||||||
|
코드뷰 직접 입력이든 태그 정리 과정에서 잘려나갈 것이 없다.
|
||||||
|
-->
|
||||||
|
<h1>알림수신동의서</h1>
|
||||||
|
<p><strong>(주)제주은행 귀중</strong></p>
|
||||||
|
<p>귀 행의 Open API 포털에서 이용기관(귀 행과 계약을 체결한 법인) 관리자가 개발자 초대를 위하여 입력한 휴대폰 번호로 초대 안내 문자메시지(알림)를 발송하고자 하는 경우에는 「개인정보보호법」 등 관계 법령에 따라 수신자 본인의 동의가 필요합니다.</p>
|
||||||
|
<h2>발송정보</h2>
|
||||||
|
<ul>
|
||||||
|
<li><strong>수집·이용 항목:</strong> 휴대폰 번호</li>
|
||||||
|
<li><strong>발송 목적:</strong> Open API 포털 개발자 초대 안내(초대 이용기관명, 초대자명, 인증번호, 가입 진행 링크 포함) 문자메시지 발송</li>
|
||||||
|
<li><strong>보유·이용 기간:</strong> 초대 유효기간(발송일로부터 7일) 경과 또는 초대 처리(가입 완료·취소) 시까지 보유 후 파기</li>
|
||||||
|
</ul>
|
||||||
|
<p>□ 동의하지 않음 □ 동의함</p>
|
||||||
|
<p>※ 이용기관 관리자는 본인이 입력한 휴대폰 번호의 실제 사용자로부터 위 알림 수신에 대한 동의를 사전에 받은 경우에 한하여 초대를 진행하여야 합니다.</p>
|
||||||
|
<p>※ 동의하지 않을 경우 초대 신청(등록)은 유지되나 초대 안내 문자메시지는 발송되지 않으며, 이 경우 이용기관 관리자로부터 별도의 방법으로 초대 안내를 받아야 합니다.</p>
|
||||||
|
<p>※ 수집된 휴대폰 번호는 문자메시지 발송 업무를 위탁받은 발송대행사에 위 목적 범위 내에서만 제공되며, 목적 외 용도로 이용되지 않습니다.</p>
|
||||||
|
<h3>위 알림 수신에 동의하십니까?</h3>
|
||||||
|
<p>제정일자: 2026. 99. 99. 제정</p>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
알림수신동의서
|
||||||
|
|
||||||
|
(주)제주은행 귀중
|
||||||
|
|
||||||
|
귀 행의 Open API 포털에서 이용기관(귀 행과 계약을 체결한 법인) 관리자가 개발자 초대를 위하여 입력한 휴대폰 번호로 초대 안내 문자메시지(알림)를 발송하고자 하는 경우에는 「개인정보보호법」 등 관계 법령에 따라 수신자 본인의 동의가 필요합니다.
|
||||||
|
|
||||||
|
발송정보
|
||||||
|
ㄴ 수집·이용 항목: 휴대폰 번호
|
||||||
|
ㄴ 발송 목적: Open API 포털 개발자 초대 안내(초대 이용기관명, 초대자명, 인증번호, 가입 진행 링크 포함) 문자메시지 발송
|
||||||
|
ㄴ 보유·이용 기간: 초대 유효기간(발송일로부터 7일) 경과 또는 초대 처리(가입 완료·취소) 시까지 보유 후 파기
|
||||||
|
|
||||||
|
□ 동의하지 않음 □ 동의함
|
||||||
|
|
||||||
|
※ 이용기관 관리자는 본인이 입력한 휴대폰 번호의 실제 사용자로부터 위 알림 수신에 대한 동의를 사전에 받은 경우에 한하여 초대를 진행하여야 합니다.
|
||||||
|
|
||||||
|
※ 동의하지 않을 경우 초대 신청(등록)은 유지되나 초대 안내 문자메시지는 발송되지 않으며, 이 경우 이용기관 관리자로부터 별도의 방법으로 초대 안내를 받아야 합니다.
|
||||||
|
|
||||||
|
※ 수집된 휴대폰 번호는 문자메시지 발송 업무를 위탁받은 발송대행사에 위 목적 범위 내에서만 제공되며, 목적 외 용도로 이용되지 않습니다.
|
||||||
|
|
||||||
|
위 알림 수신에 동의하십니까?
|
||||||
|
|
||||||
|
제정일자: 2026. 99. 99. 제정
|
||||||
+168
-27
@@ -1,21 +1,22 @@
|
|||||||
# 개발환경 준비 사항
|
# 개발환경 준비 사항
|
||||||
|
|
||||||
EAPIM Portal 개발에 필요한 도구와 런타임을 설치하고 검증하는 절차입니다.
|
EAPIM Portal(제주은행 DJBank) 개발에 필요한 도구와 런타임을 설치하고 검증하는 절차입니다.
|
||||||
처음 환경을 세팅하는 신규 개발자는 이 문서를 끝까지 따라 진행한 뒤 [README.md](../README.md)의 "초기 세팅 가이드" 단계를 이어서 수행하세요.
|
처음 환경을 세팅하는 신규 개발자는 이 문서를 끝까지 따라 진행한 뒤 [README.md](../README.md)의 "프로젝트 클론" / "초기 세팅 가이드" 단계를 이어서 수행하세요.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 0. 한눈에 보는 요구사항
|
## 0. 한눈에 보는 요구사항
|
||||||
|
|
||||||
| 구분 | 도구 | 권장 버전 | 비고 |
|
| 구분 | 도구 | 권장 버전 | 비고 |
|
||||||
|------|------|-----------|----------------------------------|
|
|------|------|-----------|------|
|
||||||
| 백엔드 | JDK | 1.8 (Zulu 8 권장) | `sourceCompatibility=1.8` |
|
| 백엔드 | JDK | 1.8 (Zulu 8 권장, Linux 는 OpenJDK 8) | `sourceCompatibility=1.8` |
|
||||||
| 빌드 | Gradle | 8.7 | gradlew 사용 금지 — 시스템 gradle 직접 사용 |
|
| 빌드 | Gradle | 8.7 | 시스템에 설치한 gradle 직접 사용 (Jenkins 노드와 동일) |
|
||||||
| 형상관리 | Git | 2.30 이상 | SSH 키 등록 권장 |
|
| 형상관리 | Git | 2.30 이상 | 사내 Gitea `172.30.1.50:2222` SSH 키 등록 필요 |
|
||||||
| DB | Oracle Client/접근 | 19c | 개발은 `192.168.240.177:1598` |
|
| 의존성 저장소 | Nexus | - | `https://nexus.eactive.synology.me:8090` 접근 필요 |
|
||||||
|
| DB | Oracle 19c | 19c | 개발 DB `172.30.1.50:1598/DAPM` (djb-vm) |
|
||||||
| 프론트엔드 빌드 | Node.js | 18 LTS 이상 | SCSS 컴파일 전용 |
|
| 프론트엔드 빌드 | Node.js | 18 LTS 이상 | SCSS 컴파일 전용 |
|
||||||
| 프론트엔드 빌드 | npm | Node.js 함께 설치 | `sass` 패키지 사용 |
|
| 프론트엔드 빌드 | npm | Node.js 함께 설치 | `sass` 패키지 사용 |
|
||||||
| (선택) 환경 변수 | direnv | 최신 | `.envrc` 자동 로드 |
|
| (권장) 환경 변수 | direnv | 최신 | 워크스페이스 루트 `.envrc` 자동 로드 |
|
||||||
| (선택) IDE | IntelliJ IDEA | 2023.x 이상 | Lombok / MapStruct 플러그인 |
|
| (선택) IDE | IntelliJ IDEA | 2023.x 이상 | Lombok / MapStruct 플러그인 |
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -32,6 +33,16 @@ brew install --cask zulu@8
|
|||||||
/usr/libexec/java_home -v 1.8
|
/usr/libexec/java_home -v 1.8
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Linux (Ubuntu)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install openjdk-8-jdk
|
||||||
|
# 설치 경로: /usr/lib/jvm/java-8-openjdk-amd64
|
||||||
|
```
|
||||||
|
|
||||||
|
> 시스템 기본 `java` 가 다른 버전(예: 21)으로 남아 있어도 됩니다. 프로젝트에서는 direnv 로
|
||||||
|
> `JAVA_HOME` 을 8 로 고정합니다 (§3). `update-alternatives` 로 시스템 기본값을 바꿀 필요는 없습니다.
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
1. [Azul Zulu JDK 8 다운로드](https://www.azul.com/downloads/?version=java-8-lts&package=jdk)
|
1. [Azul Zulu JDK 8 다운로드](https://www.azul.com/downloads/?version=java-8-lts&package=jdk)
|
||||||
@@ -51,9 +62,12 @@ echo %JAVA_HOME% # Windows
|
|||||||
|
|
||||||
## 2. Gradle 8.7 설치
|
## 2. Gradle 8.7 설치
|
||||||
|
|
||||||
이 프로젝트는 **gradlew 사용을 금지**합니다. 시스템에 설치된 gradle 8.7을 직접 사용합니다.
|
시스템에 설치한 gradle 8.7 을 직접 사용합니다. Jenkins 노드도 `/apps/opts/gradle-8.7` 의 `gradle` 을 씁니다.
|
||||||
|
|
||||||
### macOS (Homebrew + SDKMAN 권장)
|
> Windows/Eclipse 환경에서 bootRun 으로 기동하는 절차는 [`BOOTRUN_SETUP_GUIDE.md`](../BOOTRUN_SETUP_GUIDE.md) 를
|
||||||
|
> 따릅니다 (그 가이드는 `gradlew.bat bootRun` 을 사용합니다).
|
||||||
|
|
||||||
|
### macOS (SDKMAN 권장)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# SDKMAN 설치 (이미 있으면 생략)
|
# SDKMAN 설치 (이미 있으면 생략)
|
||||||
@@ -65,6 +79,24 @@ sdk install gradle 8.7
|
|||||||
sdk default gradle 8.7
|
sdk default gradle 8.7
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Linux (배포판 직접 설치)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
GRADLE_DIR=/work/eactive/djb-eapim/apps # 설치 위치는 환경에 맞게
|
||||||
|
|
||||||
|
cd /tmp
|
||||||
|
curl -LO https://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||||
|
curl -LO https://services.gradle.org/distributions/gradle-8.7-bin.zip.sha256
|
||||||
|
|
||||||
|
# 체크섬 검증 (OK 가 나와야 함)
|
||||||
|
echo "$(cat gradle-8.7-bin.zip.sha256) gradle-8.7-bin.zip" | sha256sum -c -
|
||||||
|
|
||||||
|
mkdir -p "$GRADLE_DIR" && unzip -q gradle-8.7-bin.zip -d "$GRADLE_DIR"
|
||||||
|
# → $GRADLE_DIR/gradle-8.7/bin/gradle
|
||||||
|
```
|
||||||
|
|
||||||
|
`PATH` 등록은 §3 의 direnv 에서 합니다.
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
1. [Gradle 8.7 Binary-only 다운로드](https://gradle.org/releases/)
|
1. [Gradle 8.7 Binary-only 다운로드](https://gradle.org/releases/)
|
||||||
@@ -80,12 +112,23 @@ gradle -v
|
|||||||
# JVM: 1.8.x
|
# JVM: 1.8.x
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 의존성 저장소 (Nexus)
|
||||||
|
|
||||||
|
`build.gradle` 에 선언된 저장소는 사내 Nexus 하나뿐입니다.
|
||||||
|
|
||||||
|
```
|
||||||
|
https://nexus.eactive.synology.me:8090/repository/maven-public/
|
||||||
|
```
|
||||||
|
|
||||||
|
플러그인(`org.cyclonedx.bom` 등)은 Gradle Plugin Portal 에서 받습니다. 최초 빌드는 두 곳 모두 접근 가능해야 하며,
|
||||||
|
`--offline` 은 로컬 캐시(`~/.gradle/caches`)가 채워진 뒤에만 동작합니다.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 3. (권장) direnv 사용
|
## 3. (권장) direnv 사용
|
||||||
|
|
||||||
저장소 루트의 `.envrc` 가 `JAVA_HOME`, `GRADLE_USER_HOME` 등을 자동 주입합니다.
|
`JAVA_HOME` · `GRADLE_HOME` · `PATH` 를 디렉터리 진입만으로 자동 설정합니다.
|
||||||
디렉터리 진입만으로 환경이 격리되므로 다른 프로젝트와 JDK가 섞이지 않습니다.
|
다른 프로젝트와 JDK 가 섞이지 않습니다.
|
||||||
|
|
||||||
### 설치
|
### 설치
|
||||||
|
|
||||||
@@ -93,6 +136,9 @@ gradle -v
|
|||||||
# macOS
|
# macOS
|
||||||
brew install direnv
|
brew install direnv
|
||||||
|
|
||||||
|
# Linux (Ubuntu)
|
||||||
|
sudo apt install direnv
|
||||||
|
|
||||||
# Windows (scoop)
|
# Windows (scoop)
|
||||||
scoop install direnv
|
scoop install direnv
|
||||||
```
|
```
|
||||||
@@ -107,11 +153,37 @@ echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc
|
|||||||
echo 'eval "$(direnv hook bash)"' >> ~/.bashrc
|
echo 'eval "$(direnv hook bash)"' >> ~/.bashrc
|
||||||
```
|
```
|
||||||
|
|
||||||
### 프로젝트에서 허용
|
등록 후 새 터미널을 열거나 `source ~/.zshrc` 를 실행합니다.
|
||||||
|
|
||||||
|
### .envrc 작성 — 워크스페이스 루트에 둔다
|
||||||
|
|
||||||
|
`.envrc` 는 **저장소 안이 아니라 워크스페이스 루트**(`djb-workspace/`)에 둡니다.
|
||||||
|
|
||||||
|
- 머신별 절대경로가 저장소에 커밋되지 않습니다 (eapim-portal 의 `.gitignore` 도 `/.envrc` 를 무시합니다)
|
||||||
|
- direnv 는 상위 디렉터리를 거슬러 올라가 `.envrc` 를 찾으므로 eapim-portal · eapim-admin · eapim-online 에 한 번에 적용됩니다
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd /path/to/eapim-portal
|
# djb-workspace/.envrc (경로는 환경에 맞게 수정)
|
||||||
|
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
|
||||||
|
export GRADLE_HOME=/work/eactive/djb-eapim/apps/gradle-8.7
|
||||||
|
|
||||||
|
PATH_add "$JAVA_HOME/bin"
|
||||||
|
PATH_add "$GRADLE_HOME/bin"
|
||||||
|
|
||||||
|
# gradle bootRun 기본 프로파일 (§5.2 의 개인 로컬 프로파일)
|
||||||
|
# ORG_GRADLE_PROJECT_<name> 환경변수는 gradle 이 -P<name> 으로 읽는다.
|
||||||
|
export ORG_GRADLE_PROJECT_bootProfile=local_<이름>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 허용 및 확인
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ~/djb-workspace
|
||||||
direnv allow
|
direnv allow
|
||||||
|
|
||||||
|
cd eapim-portal
|
||||||
|
which gradle # .../gradle-8.7/bin/gradle
|
||||||
|
java -version # 1.8.x
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -124,40 +196,106 @@ direnv allow
|
|||||||
brew install git
|
brew install git
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Linux (Ubuntu)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install git
|
||||||
|
```
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
[Git for Windows](https://git-scm.com/download/win) 설치. Git Bash가 함께 설치되어 README의 Bash 스니펫을 그대로 사용할 수 있습니다.
|
[Git for Windows](https://git-scm.com/download/win) 설치. Git Bash가 함께 설치되어 README의 Bash 스니펫을 그대로 사용할 수 있습니다.
|
||||||
|
|
||||||
### SSH 키 등록 (사내 Git 서버용)
|
### SSH 키 등록 (사내 Gitea)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ssh-keygen -t ed25519 -C "your.email@djbank.co.kr"
|
ssh-keygen -t ed25519 -C "your.email@example.com"
|
||||||
cat ~/.ssh/id_ed25519.pub
|
cat ~/.ssh/id_ed25519.pub
|
||||||
# 출력된 공개키를 사내 Git 서버(192.168.240.178:18081)에 등록
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
출력된 공개키를 Gitea(`http://172.30.1.50:3000`) → 우상단 프로필 → **설정 → SSH/GPG 키** 에 등록합니다.
|
||||||
|
|
||||||
### 검증
|
### 검증
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git --version
|
git --version
|
||||||
ssh -T git@192.168.240.178 -p 18081
|
ssh -T -p 2222 git@172.30.1.50
|
||||||
|
# Hi there, <계정>! You've successfully authenticated ... but Gitea does not provide shell access.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
위 메시지가 나오면 정상입니다 (셸 접근이 없다는 문구는 오류가 아닙니다).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 5. Oracle 19c 접근 정보
|
## 5. Oracle 19c 접근 정보
|
||||||
|
|
||||||
개발 환경에서는 별도 Oracle 설치 없이 사내 개발 DB에 접속합니다.
|
### 5.1 개발 DB
|
||||||
|
|
||||||
- **Host**: `192.168.240.177`
|
별도 Oracle 설치 없이 djb-vm 의 개발 DB(Podman 컨테이너)에 접속합니다.
|
||||||
- **Port**: `1599`
|
|
||||||
- **Schemas**: `EMSADM` (Portal), `AGWADM` (Gateway)
|
|
||||||
- 상세 계정/패스워드는 사내 비밀번호 관리자에게 문의
|
|
||||||
|
|
||||||
스테이징/운영은 JNDI를 통해 접근합니다 — `jdbc/dsOBP_EMS`, `jdbc/dsOBP_AGW`.
|
| 항목 | 값 |
|
||||||
|
|---|---|
|
||||||
|
| Host | `172.30.1.50` |
|
||||||
|
| Port | `1598` |
|
||||||
|
| Service Name | `DAPM` |
|
||||||
|
| JDBC URL | `jdbc:oracle:thin:@//172.30.1.50:1598/DAPM` |
|
||||||
|
| Schema / 계정 | `EMSAPP` (Portal), `AGWAPP` (Gateway) |
|
||||||
|
|
||||||
|
계정 비밀번호는 담당자에게 문의하세요. **비밀번호를 저장소에 커밋하지 마세요.**
|
||||||
|
|
||||||
DB 클라이언트 도구는 자유 선택 (DBeaver, DataGrip, SQL Developer 등).
|
DB 클라이언트 도구는 자유 선택 (DBeaver, DataGrip, SQL Developer 등).
|
||||||
|
|
||||||
|
### 5.2 애플리케이션의 DB 연결 방식
|
||||||
|
|
||||||
|
서버 배포용 프로파일(`dev` · `stage` · `prod`)은 **모두 JNDI** 로 연결하며 WAS 에 배포해서만 동작합니다.
|
||||||
|
|
||||||
|
| JNDI | 스키마 | 용도 |
|
||||||
|
|---|---|---|
|
||||||
|
| `jdbc/dsOBP_EMS` | `EMSAPP` | Portal |
|
||||||
|
| `jdbc/dsOBP_AGW` | `AGWAPP` | Gateway (조회 전용) |
|
||||||
|
|
||||||
|
로컬 기동(`gradle bootRun`, 내장 Tomcat)은 **local 전용 프로파일**(`local_*`)로만 합니다.
|
||||||
|
dev 가 로컬에서 뜨지 않는 것은 의도된 동작입니다 — `application-dev.yml` 을 로컬용으로 고치지 마세요.
|
||||||
|
내장 Tomcat 에는 JNDI 가 없으므로 local 프로파일은 `jndi-name` 을 비우고 직접 JDBC 로 접속합니다
|
||||||
|
(`PortalDatasourceConfiguration` 은 `jndi-name` 이 비어 있으면 `jdbc-url` 로 직접 접속).
|
||||||
|
|
||||||
|
#### 샘플에서 개인 프로파일 만들기
|
||||||
|
|
||||||
|
git 으로 관리되는 샘플 `application-local_example.yml` / `logback-local_example.xml` 을 복사해서 씁니다.
|
||||||
|
샘플에는 DB 접속정보(비밀번호 제외)와 로컬용 설정(캐시 비활성화, 콘솔 로그, SQL 로그 분리)이 들어 있습니다.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd src/main/resources
|
||||||
|
cp application-local_example.yml application-local_<이름>.yml
|
||||||
|
cp logback-local_example.xml logback-local_<이름>.xml
|
||||||
|
```
|
||||||
|
|
||||||
|
복사한 yml 에서 세 군데를 고칩니다.
|
||||||
|
|
||||||
|
| 위치 | 샘플 값 | 변경 |
|
||||||
|
|---|---|---|
|
||||||
|
| `spring.config.activate.on-profile` | `local_example` | `local_<이름>` |
|
||||||
|
| `logging.config` | `classpath:logback-local_example.xml` | `classpath:logback-local_<이름>.xml` |
|
||||||
|
| `ems/gateway.datasource.password` | `CHANGE_ME` | 실제 비밀번호 (담당자 문의) |
|
||||||
|
|
||||||
|
로그는 기본으로 `~/eapim-logs/eapim-portal` 에 남습니다. 바꾸려면 yml 의 `portal.logging.log-path` 와
|
||||||
|
logback 의 `LOG_PATH` 를 함께 고칩니다.
|
||||||
|
|
||||||
|
기동:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gradle bootRun -PbootProfile=local_<이름> # → http://localhost:39130
|
||||||
|
# direnv 에 ORG_GRADLE_PROJECT_bootProfile 을 넣었다면 그냥 gradle bootRun
|
||||||
|
```
|
||||||
|
|
||||||
|
주의사항:
|
||||||
|
|
||||||
|
- **샘플 파일(`*_example`)에는 실제 비밀번호를 넣지 마세요** — git 으로 관리되는 파일입니다.
|
||||||
|
- **개인 파일의 gitignore 확인 필수** — `.gitignore` 는 `*rinjae*`, `*gf63*` 처럼 **개인별 패턴만** 무시합니다.
|
||||||
|
`git check-ignore -v application-local_<이름>.yml` 로 확인하고, 안 걸리면 `.gitignore` 에 본인 패턴을 추가하세요.
|
||||||
|
- 파일명은 반드시 `application-local` / `logback-local` 로 시작해야 합니다.
|
||||||
|
`build.gradle` 의 `localOnlyResources` 가 이 패턴을 **WAR 산출물에서 제외**합니다.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 6. Node.js & SASS 빌드 환경
|
## 6. Node.js & SASS 빌드 환경
|
||||||
@@ -237,6 +375,7 @@ ls -lh src/main/resources/static/css/main.min.css
|
|||||||
- SCSS 파일은 `src/main/resources/static/sass/` 하위에서만 작성
|
- SCSS 파일은 `src/main/resources/static/sass/` 하위에서만 작성
|
||||||
- 새 파일 추가 시 파일명 앞에 언더스코어(`_`) 필수 (`_filename.scss`)
|
- 새 파일 추가 시 파일명 앞에 언더스코어(`_`) 필수 (`_filename.scss`)
|
||||||
- `@import` 대신 `@use` 사용 (Dart Sass 3.0 호환)
|
- `@import` 대신 `@use` 사용 (Dart Sass 3.0 호환)
|
||||||
|
- 디자인 토큰·컴포넌트 규약은 [`DESIGN.md`](../DESIGN.md) 참고
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -246,7 +385,7 @@ ls -lh src/main/resources/static/css/main.min.css
|
|||||||
|
|
||||||
1. **Lombok 플러그인** 설치 → `Settings → Plugins → Lombok`
|
1. **Lombok 플러그인** 설치 → `Settings → Plugins → Lombok`
|
||||||
2. **Annotation Processing 활성화** → `Settings → Build → Compiler → Annotation Processors → Enable annotation processing`
|
2. **Annotation Processing 활성화** → `Settings → Build → Compiler → Annotation Processors → Enable annotation processing`
|
||||||
3. **Gradle JVM** 설정 → `Settings → Build → Build Tools → Gradle → Gradle JVM` 을 JDK 1.8 (Zulu) 로 지정
|
3. **Gradle JVM** 설정 → `Settings → Build → Build Tools → Gradle → Gradle JVM` 을 JDK 1.8 로 지정
|
||||||
4. **MapStruct** 는 별도 플러그인 불필요 (annotation processor 만 활성화되어 있으면 됨)
|
4. **MapStruct** 는 별도 플러그인 불필요 (annotation processor 만 활성화되어 있으면 됨)
|
||||||
|
|
||||||
### VS Code
|
### VS Code
|
||||||
@@ -265,9 +404,11 @@ ls -lh src/main/resources/static/css/main.min.css
|
|||||||
java -version # 1.8.x
|
java -version # 1.8.x
|
||||||
gradle -v # 8.7 / JVM 1.8
|
gradle -v # 8.7 / JVM 1.8
|
||||||
git --version
|
git --version
|
||||||
|
ssh -T -p 2222 git@172.30.1.50 # "successfully authenticated"
|
||||||
node -v # v18 이상
|
node -v # v18 이상
|
||||||
npm -v
|
npm -v
|
||||||
direnv version # (선택)
|
direnv version # (권장)
|
||||||
```
|
```
|
||||||
|
|
||||||
이후 [README.md](../README.md) 의 "초기 세팅 가이드" 로 이동해 프로젝트 클론과 의존 모듈 설치를 진행하세요.
|
이후 [README.md](../README.md) 의 "프로젝트 클론" 으로 이동해 저장소와 의존 모듈을 받고,
|
||||||
|
`gradle classes` 로 컴파일이 되는지 확인하세요.
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
// ./gradlew -I gradle/thymeleaf-verification.init.gradle :thymeleafCompatibilityDependencies
|
||||||
|
// Read-only dependency resolution; does not override versions or the normal build.
|
||||||
|
gradle.projectsEvaluated {
|
||||||
|
def portal = gradle.rootProject
|
||||||
|
portal.tasks.register('thymeleafCompatibilityDependencies') {
|
||||||
|
doLast {
|
||||||
|
def output = new File(portal.buildDir, 'reports/thymeleaf-compatibility')
|
||||||
|
output.mkdirs()
|
||||||
|
['runtimeClasspath', 'testRuntimeClasspath'].each { name ->
|
||||||
|
def artifacts = portal.configurations.getByName(name).resolvedConfiguration.resolvedArtifacts
|
||||||
|
def rows = artifacts.findAll {
|
||||||
|
it.id.componentIdentifier instanceof org.gradle.api.artifacts.component.ModuleComponentIdentifier
|
||||||
|
}.collect {
|
||||||
|
"${it.moduleVersion.id.group}:${it.name}\t${it.moduleVersion.id.version}\t${it.file.name}"
|
||||||
|
}.sort()
|
||||||
|
new File(output, "${name}.tsv").text = rows.join('\n') + '\n'
|
||||||
|
}
|
||||||
|
println "Dependency evidence: ${output}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Compare resolved dependency TSVs and inspect both WARs; exits nonzero on regression."""
|
||||||
|
import argparse
|
||||||
|
import hashlib
|
||||||
|
import io
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
import re
|
||||||
|
import zipfile
|
||||||
|
|
||||||
|
|
||||||
|
EXPECTED_CHANGES = {
|
||||||
|
"org.thymeleaf:thymeleaf": ("3.1.4.RELEASE", "3.1.5.RELEASE"),
|
||||||
|
"org.thymeleaf:thymeleaf-spring5": ("3.1.4.RELEASE", "3.1.5.RELEASE"),
|
||||||
|
"ognl:ognl": ("3.3.4", "3.3.5"),
|
||||||
|
}
|
||||||
|
EXPECTED_CLASSES = {
|
||||||
|
"org/thymeleaf/TemplateEngine.class": "thymeleaf-3.1.5.RELEASE.jar",
|
||||||
|
"org/thymeleaf/spring5/SpringTemplateEngine.class": "thymeleaf-spring5-3.1.5.RELEASE.jar",
|
||||||
|
"ognl/Ognl.class": "ognl-3.3.5.jar",
|
||||||
|
}
|
||||||
|
LOCAL_PREFIXES = (
|
||||||
|
"spring-boot-devtools", "spring-boot-starter-actuator", "spring-boot-actuator",
|
||||||
|
"micrometer-", "spring-boot-admin-", "tomcat-embed-websocket-",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def require(condition, message):
|
||||||
|
if not condition:
|
||||||
|
raise ValueError(message)
|
||||||
|
|
||||||
|
|
||||||
|
def dependencies(path):
|
||||||
|
result = {}
|
||||||
|
for line in path.read_text().splitlines():
|
||||||
|
module, version, filename = line.split("\t")
|
||||||
|
entries = result.setdefault(module, [])
|
||||||
|
require((version, filename) not in entries, "Duplicate artifact: " + filename)
|
||||||
|
require(not entries or entries[0][0] == version, "Multiple versions: " + module)
|
||||||
|
entries.append((version, filename))
|
||||||
|
for entries in result.values():
|
||||||
|
entries.sort()
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def compare(before, after):
|
||||||
|
old, new = dependencies(before), dependencies(after)
|
||||||
|
require(old.keys() == new.keys(), "Added/removed external modules: " + str(old.keys() ^ new.keys()))
|
||||||
|
changed = {key: (old[key][0][0], new[key][0][0]) for key in old if old[key] != new[key]}
|
||||||
|
require(changed == EXPECTED_CHANGES, "Unexpected dependency changes: " + str(changed))
|
||||||
|
return {"external_modules": len(new), "changes": changed}
|
||||||
|
|
||||||
|
|
||||||
|
def inspect_war(path):
|
||||||
|
owners = {name: [] for name in EXPECTED_CLASSES}
|
||||||
|
with zipfile.ZipFile(path) as war:
|
||||||
|
names = war.namelist()
|
||||||
|
require(len(names) == len(set(names)), "Duplicate ZIP entries: " + str(path))
|
||||||
|
jars = sorted(name for name in names if name.endswith(".jar"))
|
||||||
|
basenames = [Path(name).name for name in jars]
|
||||||
|
require(len(basenames) == len(set(basenames)), "Duplicate JAR names: " + str(path))
|
||||||
|
require(not any(Path(name).name.startswith("application-local") and name.endswith(".yml")
|
||||||
|
for name in names), "Local profile packaged: " + str(path))
|
||||||
|
for name in jars:
|
||||||
|
basename = Path(name).name
|
||||||
|
require(not basename.startswith(LOCAL_PREFIXES), "Excluded library packaged: " + name)
|
||||||
|
require(not re.match(r"spring-[\w-]+-6\.", basename), "Spring 6 packaged: " + name)
|
||||||
|
with zipfile.ZipFile(io.BytesIO(war.read(name))) as jar:
|
||||||
|
classes = set(jar.namelist())
|
||||||
|
require(not any(c.startswith("jakarta/servlet/") for c in classes),
|
||||||
|
"Jakarta Servlet classes packaged: " + name)
|
||||||
|
for target in owners:
|
||||||
|
if target in classes:
|
||||||
|
owners[target].append(name)
|
||||||
|
# Java 8 compatibility of each upgraded library's entry class.
|
||||||
|
require(int.from_bytes(jar.read(target)[6:8], "big") <= 52,
|
||||||
|
"Java >8 class: " + name + "!" + target)
|
||||||
|
for target, expected in EXPECTED_CLASSES.items():
|
||||||
|
require(owners[target] == ["WEB-INF/lib/" + expected],
|
||||||
|
"Wrong/duplicate class provider: " + target + " " + str(owners[target]))
|
||||||
|
for pattern, expected in [
|
||||||
|
(r"thymeleaf-\d", "thymeleaf-3.1.5.RELEASE.jar"),
|
||||||
|
(r"thymeleaf-spring\d-", "thymeleaf-spring5-3.1.5.RELEASE.jar"),
|
||||||
|
(r"ognl-", "ognl-3.3.5.jar"),
|
||||||
|
]:
|
||||||
|
require([n for n in basenames if re.match(pattern, n)] == [expected],
|
||||||
|
"Wrong/duplicate library version for " + expected)
|
||||||
|
return {"file": path.name, "sha256": hashlib.sha256(path.read_bytes()).hexdigest(),
|
||||||
|
"jar_count": len(jars), "class_providers": owners, "jars": jars}
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
|
parser.add_argument("--baseline", type=Path, required=True, help="Directory of baseline dependency TSVs")
|
||||||
|
parser.add_argument("--current", type=Path, required=True, help="Directory of current dependency TSVs")
|
||||||
|
parser.add_argument("--war", type=Path, action="append", required=True)
|
||||||
|
parser.add_argument("--output", type=Path, required=True)
|
||||||
|
args = parser.parse_args()
|
||||||
|
require(len(args.war) == 2 and len(set(args.war)) == 2, "Provide the standard WAR and bootWar")
|
||||||
|
result = {
|
||||||
|
"dependencies": {name: compare(args.baseline / (name + ".tsv"), args.current / (name + ".tsv"))
|
||||||
|
for name in ["runtimeClasspath", "testRuntimeClasspath"]},
|
||||||
|
"wars": [inspect_war(path) for path in args.war],
|
||||||
|
}
|
||||||
|
args.output.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
args.output.write_text(json.dumps(result, indent=2, ensure_ascii=False) + "\n")
|
||||||
|
print("PASS: dependency changes limited to three modules; both WARs verified")
|
||||||
|
for war in result["wars"]:
|
||||||
|
print(war["file"], war["sha256"])
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
Generated
+542
@@ -9,9 +9,454 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@playwright/test": "1.63.0",
|
||||||
|
"esbuild": "^0.25.0",
|
||||||
|
"node-forge": "^1.3.1",
|
||||||
"sass": "^1.69.5"
|
"sass": "^1.69.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@esbuild/aix-ppc64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==",
|
||||||
|
"cpu": [
|
||||||
|
"ppc64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"aix"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/android-arm": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==",
|
||||||
|
"cpu": [
|
||||||
|
"arm"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"android"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/android-arm64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"android"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/android-x64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"android"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/darwin-arm64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/darwin-x64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/freebsd-arm64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"freebsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/freebsd-x64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"freebsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-arm": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==",
|
||||||
|
"cpu": [
|
||||||
|
"arm"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-arm64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-ia32": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==",
|
||||||
|
"cpu": [
|
||||||
|
"ia32"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-loong64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==",
|
||||||
|
"cpu": [
|
||||||
|
"loong64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-mips64el": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==",
|
||||||
|
"cpu": [
|
||||||
|
"mips64el"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-ppc64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==",
|
||||||
|
"cpu": [
|
||||||
|
"ppc64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-riscv64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==",
|
||||||
|
"cpu": [
|
||||||
|
"riscv64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-s390x": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==",
|
||||||
|
"cpu": [
|
||||||
|
"s390x"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-x64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/netbsd-arm64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"netbsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/netbsd-x64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"netbsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/openbsd-arm64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"openbsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/openbsd-x64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"openbsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/openharmony-arm64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"openharmony"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/sunos-x64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"sunos"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/win32-arm64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/win32-ia32": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==",
|
||||||
|
"cpu": [
|
||||||
|
"ia32"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/win32-x64": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@parcel/watcher": {
|
"node_modules/@parcel/watcher": {
|
||||||
"version": "2.5.6",
|
"version": "2.5.6",
|
||||||
"resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.6.tgz",
|
"resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.6.tgz",
|
||||||
@@ -322,6 +767,22 @@
|
|||||||
"url": "https://opencollective.com/parcel"
|
"url": "https://opencollective.com/parcel"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@playwright/test": {
|
||||||
|
"version": "1.63.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.63.0.tgz",
|
||||||
|
"integrity": "sha512-oxMK4vllB9RK5NQ2l1pq1IfOf2AvnEuj/vYGDj0H2nMtmtZpKtCwt/l00GEO6xjGfpBNAvjovvYdCm50dRQkpQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"playwright": "1.63.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"playwright": "cli.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/chokidar": {
|
"node_modules/chokidar": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz",
|
||||||
@@ -349,6 +810,48 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/esbuild": {
|
||||||
|
"version": "0.25.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz",
|
||||||
|
"integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==",
|
||||||
|
"dev": true,
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"bin": {
|
||||||
|
"esbuild": "bin/esbuild"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@esbuild/aix-ppc64": "0.25.12",
|
||||||
|
"@esbuild/android-arm": "0.25.12",
|
||||||
|
"@esbuild/android-arm64": "0.25.12",
|
||||||
|
"@esbuild/android-x64": "0.25.12",
|
||||||
|
"@esbuild/darwin-arm64": "0.25.12",
|
||||||
|
"@esbuild/darwin-x64": "0.25.12",
|
||||||
|
"@esbuild/freebsd-arm64": "0.25.12",
|
||||||
|
"@esbuild/freebsd-x64": "0.25.12",
|
||||||
|
"@esbuild/linux-arm": "0.25.12",
|
||||||
|
"@esbuild/linux-arm64": "0.25.12",
|
||||||
|
"@esbuild/linux-ia32": "0.25.12",
|
||||||
|
"@esbuild/linux-loong64": "0.25.12",
|
||||||
|
"@esbuild/linux-mips64el": "0.25.12",
|
||||||
|
"@esbuild/linux-ppc64": "0.25.12",
|
||||||
|
"@esbuild/linux-riscv64": "0.25.12",
|
||||||
|
"@esbuild/linux-s390x": "0.25.12",
|
||||||
|
"@esbuild/linux-x64": "0.25.12",
|
||||||
|
"@esbuild/netbsd-arm64": "0.25.12",
|
||||||
|
"@esbuild/netbsd-x64": "0.25.12",
|
||||||
|
"@esbuild/openbsd-arm64": "0.25.12",
|
||||||
|
"@esbuild/openbsd-x64": "0.25.12",
|
||||||
|
"@esbuild/openharmony-arm64": "0.25.12",
|
||||||
|
"@esbuild/sunos-x64": "0.25.12",
|
||||||
|
"@esbuild/win32-arm64": "0.25.12",
|
||||||
|
"@esbuild/win32-ia32": "0.25.12",
|
||||||
|
"@esbuild/win32-x64": "0.25.12"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/immutable": {
|
"node_modules/immutable": {
|
||||||
"version": "5.1.5",
|
"version": "5.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.5.tgz",
|
||||||
@@ -389,6 +892,16 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
"node_modules/node-forge": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.4.0.tgz",
|
||||||
|
"integrity": "sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "(BSD-3-Clause OR GPL-2.0)",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6.13.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/picomatch": {
|
"node_modules/picomatch": {
|
||||||
"version": "4.0.4",
|
"version": "4.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
|
||||||
@@ -403,6 +916,35 @@
|
|||||||
"url": "https://github.com/sponsors/jonschlinkert"
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/playwright": {
|
||||||
|
"version": "1.63.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.63.0.tgz",
|
||||||
|
"integrity": "sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"playwright-core": "1.63.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"playwright": "cli.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/playwright-core": {
|
||||||
|
"version": "1.63.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.63.0.tgz",
|
||||||
|
"integrity": "sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"bin": {
|
||||||
|
"playwright-core": "cli.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/readdirp": {
|
"node_modules/readdirp": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz",
|
||||||
|
|||||||
+7
-2
@@ -1,15 +1,20 @@
|
|||||||
{
|
{
|
||||||
"name": "eapim-portal",
|
"name": "eapim-portal",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "SASS build system for EAPIM Portal",
|
"description": "SASS build system + forge custom bundle for EAPIM Portal",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"test:moment": "playwright test --config=src/test/js/playwright.config.js",
|
||||||
"sass:build": "sass src/main/resources/static/sass/main.scss:src/main/resources/static/css/main.css --style=expanded",
|
"sass:build": "sass src/main/resources/static/sass/main.scss:src/main/resources/static/css/main.css --style=expanded",
|
||||||
"sass:build:minified": "sass src/main/resources/static/sass/main.scss:src/main/resources/static/css/main.min.css --style=compressed",
|
"sass:build:minified": "sass src/main/resources/static/sass/main.scss:src/main/resources/static/css/main.min.css --style=compressed",
|
||||||
"sass:watch": "sass --watch src/main/resources/static/sass/main.scss:src/main/resources/static/css/main.css --style=expanded",
|
"sass:watch": "sass --watch src/main/resources/static/sass/main.scss:src/main/resources/static/css/main.css --style=expanded",
|
||||||
"build": "npm run sass:build && npm run sass:build:minified",
|
"build": "npm run sass:build && npm run sass:build:minified",
|
||||||
"dev": "npm run sass:watch"
|
"dev": "npm run sass:watch",
|
||||||
|
"forge:build": "esbuild tools/forge-entry.js --bundle --minify --format=iife --global-name=forge --target=es5 --outfile=src/main/resources/static/js/lib/forge-crypto.min.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@playwright/test": "1.63.0",
|
||||||
|
"esbuild": "^0.25.0",
|
||||||
|
"node-forge": "^1.3.1",
|
||||||
"sass": "^1.69.5"
|
"sass": "^1.69.5"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
|
|||||||
@@ -27,6 +27,23 @@ sonar.java.source=8
|
|||||||
sonar.java.binaries=build/classes/java/main
|
sonar.java.binaries=build/classes/java/main
|
||||||
sonar.java.test.binaries=build/classes/java/test
|
sonar.java.test.binaries=build/classes/java/test
|
||||||
|
|
||||||
|
# --- 커버리지 --------------------------------------------------------------
|
||||||
|
# JaCoCo XML 경로. build.gradle 의 test 가 finalizedBy jacocoTestReport 로 생성한다.
|
||||||
|
# 이 값이 없으면 Sonar 는 커버리지를 "미측정"이 아니라 0% 로 집계한다(Zero Coverage Sensor).
|
||||||
|
# Jenkins 는 파일 존재 여부를 확인한 뒤 -D 로 한 번 더 덮어쓴다.
|
||||||
|
sonar.coverage.jacoco.xmlReportPaths=build/reports/jacoco/test/jacocoTestReport.xml
|
||||||
|
|
||||||
|
# 커버리지 집계에서 빼는 대상.
|
||||||
|
# 주의: JaCoCo 쪽에서 클래스를 빼면 Sonar 가 0% 로 채우므로, 제외는 반드시 여기서 한다.
|
||||||
|
# 실행 로직이 없어 테스트 대상이 아닌 것들만 최소로 지정한다.
|
||||||
|
sonar.coverage.exclusions=\
|
||||||
|
**/PortalApplication.java,\
|
||||||
|
**/config/**,\
|
||||||
|
**/dto/**,\
|
||||||
|
**/*Dto.java,\
|
||||||
|
**/entity/**,\
|
||||||
|
**/mapper/**
|
||||||
|
|
||||||
# --- 제외 대상 -------------------------------------------------------------
|
# --- 제외 대상 -------------------------------------------------------------
|
||||||
# 서드파티 번들/컴파일 산출물/바이너리. 분석해도 우리가 고칠 수 없는 코드는 뺀다.
|
# 서드파티 번들/컴파일 산출물/바이너리. 분석해도 우리가 고칠 수 없는 코드는 뺀다.
|
||||||
sonar.exclusions=\
|
sonar.exclusions=\
|
||||||
|
|||||||
+6
@@ -22,4 +22,10 @@ public interface GwAuthClientRepository extends JpaRepository<GwAuthClient, Stri
|
|||||||
*/
|
*/
|
||||||
@Query("SELECT c.clientId FROM GwAuthClient c WHERE c.orgId = :orgId")
|
@Query("SELECT c.clientId FROM GwAuthClient c WHERE c.orgId = :orgId")
|
||||||
List<String> findClientIdsByOrgId(@Param("orgId") String orgId);
|
List<String> findClientIdsByOrgId(@Param("orgId") String orgId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 다건 org 소속 CLIENTID 목록 (인덱스 페이지 전체 통계 집계용).
|
||||||
|
*/
|
||||||
|
@Query("SELECT c.clientId FROM GwAuthClient c WHERE c.orgId IN :orgIds")
|
||||||
|
List<String> findClientIdsByOrgIdIn(@Param("orgIds") List<String> orgIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,19 +5,36 @@ import java.sql.SQLException;
|
|||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import org.jboss.logging.Logger;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.thymeleaf.spring5.SpringTemplateEngine;
|
||||||
|
|
||||||
|
import com.google.common.util.concurrent.Futures;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Readiness probe.
|
* Readiness probe.
|
||||||
*
|
*
|
||||||
* <p>Distinct from {@link HealthCheckController} (liveness — servlet alive?).
|
* <p>Distinct from {@link HealthCheckController} (liveness — servlet alive?).
|
||||||
* This endpoint validates both EMS and Gateway datasources via JDBC
|
* This endpoint validates both EMS and Gateway datasources via JDBC
|
||||||
* {@code Connection.isValid(timeout)} to confirm the app is ready to serve
|
* {@code Connection.isValid(timeout)}, plus three libraries that WebLogic's
|
||||||
* requests that depend on the database.
|
* oracle_common bundles at a different version from this app (see weblogic.xml
|
||||||
|
* {@code prefer-application-packages}): Thymeleaf's {@link SpringTemplateEngine}
|
||||||
|
* (jackson), jboss-logging, and Guava.
|
||||||
|
*
|
||||||
|
* <p>These exist because this controller bypasses view resolution entirely
|
||||||
|
* (plain {@code @RestController} JSON) — a classpath split between the app's
|
||||||
|
* copy and WebLogic's bundled copy of a preferred package can throw
|
||||||
|
* {@link LinkageError}/{@link java.util.ServiceConfigurationError} only on the
|
||||||
|
* real code paths that touch it, while this probe kept reporting 200. That
|
||||||
|
* already happened once for jackson (Thymeleaf's dialect/module discovery
|
||||||
|
* failed on every real page while /health/ready stayed green) — jboss-logging
|
||||||
|
* and Guava carry the same risk (confirmed version mismatch against
|
||||||
|
* oracle_common, not yet observed failing in production) so they get the same
|
||||||
|
* kind of forced-touch check here.
|
||||||
*
|
*
|
||||||
* <p>HTTP 200 + JSON when all checks pass.
|
* <p>HTTP 200 + JSON when all checks pass.
|
||||||
* <p>HTTP 503 + JSON when any check fails — body still includes the per-component
|
* <p>HTTP 503 + JSON when any check fails — body still includes the per-component
|
||||||
@@ -30,24 +47,34 @@ public class ReadinessController {
|
|||||||
|
|
||||||
private final DataSource portalDataSource;
|
private final DataSource portalDataSource;
|
||||||
private final DataSource gatewayDataSource;
|
private final DataSource gatewayDataSource;
|
||||||
|
private final SpringTemplateEngine templateEngine;
|
||||||
|
|
||||||
public ReadinessController(
|
public ReadinessController(
|
||||||
@Qualifier("portalDataSource") DataSource portalDataSource,
|
@Qualifier("portalDataSource") DataSource portalDataSource,
|
||||||
@Qualifier("gatewayDataSource") DataSource gatewayDataSource) {
|
@Qualifier("gatewayDataSource") DataSource gatewayDataSource,
|
||||||
|
SpringTemplateEngine templateEngine) {
|
||||||
this.portalDataSource = portalDataSource;
|
this.portalDataSource = portalDataSource;
|
||||||
this.gatewayDataSource = gatewayDataSource;
|
this.gatewayDataSource = gatewayDataSource;
|
||||||
|
this.templateEngine = templateEngine;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(value = "/health/ready", produces = MediaType.APPLICATION_JSON_VALUE)
|
@GetMapping(value = "/health/ready", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public ResponseEntity<String> ready() {
|
public ResponseEntity<String> ready() {
|
||||||
String ems = check(portalDataSource);
|
String ems = check(portalDataSource);
|
||||||
String gw = check(gatewayDataSource);
|
String gw = check(gatewayDataSource);
|
||||||
boolean ok = "UP".equals(ems) && "UP".equals(gw);
|
String view = checkTemplateEngine();
|
||||||
|
String logging = checkJbossLogging();
|
||||||
|
String guava = checkGuava();
|
||||||
|
boolean ok = "UP".equals(ems) && "UP".equals(gw) && "UP".equals(view)
|
||||||
|
&& "UP".equals(logging) && "UP".equals(guava);
|
||||||
|
|
||||||
String body = "{"
|
String body = "{"
|
||||||
+ "\"status\":\"" + (ok ? "UP" : "DOWN") + "\","
|
+ "\"status\":\"" + (ok ? "UP" : "DOWN") + "\","
|
||||||
+ "\"ems\":\"" + ems + "\","
|
+ "\"ems\":\"" + ems + "\","
|
||||||
+ "\"gateway\":\""+ gw + "\""
|
+ "\"gateway\":\"" + gw + "\","
|
||||||
|
+ "\"view\":\"" + view + "\","
|
||||||
|
+ "\"logging\":\"" + logging + "\","
|
||||||
|
+ "\"guava\":\"" + guava + "\""
|
||||||
+ "}";
|
+ "}";
|
||||||
|
|
||||||
return ResponseEntity.status(ok ? 200 : 503)
|
return ResponseEntity.status(ok ? 200 : 503)
|
||||||
@@ -55,6 +82,49 @@ public class ReadinessController {
|
|||||||
.body(body);
|
.body(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** {@code getConfiguration()} lazily runs Thymeleaf's dialect/module init on first call
|
||||||
|
* and caches it — so this is cheap once healthy, and reproduces the exact failure path
|
||||||
|
* a real page render would hit. Catches {@link Throwable}: init failures here have
|
||||||
|
* surfaced as {@link Error} (ServiceConfigurationError), not just Exception. */
|
||||||
|
private String checkTemplateEngine() {
|
||||||
|
try {
|
||||||
|
templateEngine.getConfiguration();
|
||||||
|
return "UP";
|
||||||
|
} catch (Throwable t) {
|
||||||
|
return down(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Forces jboss-logging's {@code Logger} + its bound provider (LogManager/JBoss/JUL
|
||||||
|
* discovery) to load and actually run a log-level check, not just resolve the class. */
|
||||||
|
private static String checkJbossLogging() {
|
||||||
|
try {
|
||||||
|
Logger log = Logger.getLogger(ReadinessController.class);
|
||||||
|
log.isDebugEnabled();
|
||||||
|
return "UP";
|
||||||
|
} catch (Throwable t) {
|
||||||
|
return down(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** {@code Futures.immediateFuture} touches Guava's {@code util.concurrent} machinery
|
||||||
|
* (AbstractFuture/InternalFutureFailureAccess) — the part backed by the separate
|
||||||
|
* {@code failureaccess} jar, which is exactly where an app/WebLogic version mismatch
|
||||||
|
* would split across classloaders. */
|
||||||
|
private static String checkGuava() {
|
||||||
|
try {
|
||||||
|
Futures.immediateFuture(Boolean.TRUE).isDone();
|
||||||
|
return "UP";
|
||||||
|
} catch (Throwable t) {
|
||||||
|
return down(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String down(Throwable t) {
|
||||||
|
String msg = t.getMessage() == null ? t.getClass().getSimpleName() : t.getMessage();
|
||||||
|
return "DOWN:" + msg.replace('"', '\'').replace('\n', ' ').replace('\r', ' ');
|
||||||
|
}
|
||||||
|
|
||||||
private static String check(DataSource ds) {
|
private static String check(DataSource ds) {
|
||||||
if (ds == null) return "DOWN:NO_DATASOURCE";
|
if (ds == null) return "DOWN:NO_DATASOURCE";
|
||||||
try (Connection c = ds.getConnection()) {
|
try (Connection c = ds.getConnection()) {
|
||||||
|
|||||||
+70
-23
@@ -1,10 +1,16 @@
|
|||||||
package com.eactive.apim.portal.apps.agreements.controller;
|
package com.eactive.apim.portal.apps.agreements.controller;
|
||||||
|
|
||||||
import com.eactive.apim.portal.agreements.entity.AgreementType;
|
import com.eactive.apim.portal.agreements.entity.AgreementType;
|
||||||
|
import com.eactive.apim.portal.agreements.service.AgreementTypeConfigService;
|
||||||
|
import com.eactive.apim.portal.apps.agreements.dto.AgreementTabDTO;
|
||||||
import com.eactive.apim.portal.apps.agreements.dto.AgreementsDTO;
|
import com.eactive.apim.portal.apps.agreements.dto.AgreementsDTO;
|
||||||
import com.eactive.apim.portal.apps.agreements.service.AgreementsFacade;
|
import com.eactive.apim.portal.apps.agreements.service.AgreementsFacade;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.EnumMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
@@ -21,38 +27,56 @@ public class AgreementsController {
|
|||||||
public static final String PRIVACY_POLICY_EXTERNAL_URL =
|
public static final String PRIVACY_POLICY_EXTERNAL_URL =
|
||||||
"https://www.jejubank.co.kr/hmpg/csct/secuCenr/ptctPlcy/procsPlcy/ctnt.do";
|
"https://www.jejubank.co.kr/hmpg/csct/secuCenr/ptctPlcy/procsPlcy/ctnt.do";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 약관 종류별 {@code tab} 파라미터 값. 기존 북마크/외부 링크 호환을 위해 슬러그를 유지한다.
|
||||||
|
* (초대 팝업 등에서 {@code tab=notification} 으로 직접 링크한다)
|
||||||
|
*/
|
||||||
|
private static final Map<AgreementType, String> TAB_SLUGS = new EnumMap<>(AgreementType.class);
|
||||||
|
|
||||||
|
static {
|
||||||
|
TAB_SLUGS.put(AgreementType.TERMS_OF_USE, "terms");
|
||||||
|
TAB_SLUGS.put(AgreementType.PRIVACY_POLICY, "privacy");
|
||||||
|
TAB_SLUGS.put(AgreementType.PRIVACY_COLLECT, "privacy-collect");
|
||||||
|
TAB_SLUGS.put(AgreementType.PRIVACY_COLLECT_IND, "privacy-collect-ind");
|
||||||
|
TAB_SLUGS.put(AgreementType.PRIVACY_COLLECT_ORG, "privacy-collect-org");
|
||||||
|
TAB_SLUGS.put(AgreementType.NOTIFICATION_CONSENT, "notification");
|
||||||
|
}
|
||||||
|
|
||||||
private final AgreementsFacade agreementsFacade;
|
private final AgreementsFacade agreementsFacade;
|
||||||
|
private final AgreementTypeConfigService agreementTypeConfigService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public AgreementsController(AgreementsFacade agreementsFacade) {
|
public AgreementsController(AgreementsFacade agreementsFacade,
|
||||||
|
AgreementTypeConfigService agreementTypeConfigService) {
|
||||||
this.agreementsFacade = agreementsFacade;
|
this.agreementsFacade = agreementsFacade;
|
||||||
|
this.agreementTypeConfigService = agreementTypeConfigService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/terms")
|
@GetMapping("/terms")
|
||||||
public String showTerms(@RequestParam(required = false) String tab,
|
public String showTerms(@RequestParam(required = false) String tab,
|
||||||
@RequestParam(required = false) String publishedOn,
|
@RequestParam(required = false) String publishedOn,
|
||||||
Model model) {
|
Model model) {
|
||||||
String currentTab = tab != null ? tab : "terms";
|
|
||||||
|
|
||||||
// 구 개인정보처리방침 탭(tab=privacy)은 외부 링크로 이동했으므로 외부 URL로 리다이렉트(북마크 호환)
|
// 구 개인정보처리방침 탭(tab=privacy)은 외부 링크로 이동했으므로 외부 URL로 리다이렉트(북마크 호환)
|
||||||
if ("privacy".equals(currentTab)) {
|
if ("privacy".equals(tab)) {
|
||||||
return "redirect:" + PRIVACY_POLICY_EXTERNAL_URL;
|
return "redirect:" + PRIVACY_POLICY_EXTERNAL_URL;
|
||||||
}
|
}
|
||||||
|
|
||||||
AgreementType type;
|
// 노출 대상과 순서는 관리 콘솔의 '약관 종류 관리'에서 설정한다
|
||||||
switch (currentTab) {
|
List<AgreementType> displayTypes = agreementTypeConfigService.getDisplayTypes();
|
||||||
case "privacy-collect":
|
|
||||||
// 개인정보수집동의서 = PRIVACY_COLLECT (신설항목)
|
// 요청한 탭이 노출 대상이 아니면(미배치/사용안함) 첫 번째 탭으로 보정한다
|
||||||
type = AgreementType.PRIVACY_COLLECT;
|
AgreementType type = resolveType(tab, displayTypes);
|
||||||
break;
|
|
||||||
case "notification":
|
if (type == null) {
|
||||||
type = AgreementType.NOTIFICATION_CONSENT;
|
// 노출할 약관 종류가 하나도 없는 경우 — 빈 화면으로 방어
|
||||||
break;
|
model.addAttribute("termsTabs", Collections.<AgreementTabDTO>emptyList());
|
||||||
case "terms":
|
model.addAttribute("agreementsList", Collections.<AgreementsDTO>emptyList());
|
||||||
default:
|
model.addAttribute("selectedAgreement", null);
|
||||||
currentTab = "terms";
|
model.addAttribute("selectedDate", publishedOn);
|
||||||
type = AgreementType.TERMS_OF_USE;
|
model.addAttribute("agreementTitle", "약관");
|
||||||
break;
|
model.addAttribute("agreementType", null);
|
||||||
|
model.addAttribute("currentTab", null);
|
||||||
|
return TERMS_AGREEMENTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<AgreementsDTO> agreementsList = agreementsFacade.getAgreementsList(String.valueOf(type));
|
List<AgreementsDTO> agreementsList = agreementsFacade.getAgreementsList(String.valueOf(type));
|
||||||
@@ -68,17 +92,40 @@ public class AgreementsController {
|
|||||||
model.addAttribute("selectedAgreement", selectedAgreement);
|
model.addAttribute("selectedAgreement", selectedAgreement);
|
||||||
model.addAttribute("selectedDate", publishedOn);
|
model.addAttribute("selectedDate", publishedOn);
|
||||||
|
|
||||||
model.addAttribute("isTermsOfUse", type == AgreementType.TERMS_OF_USE);
|
model.addAttribute("termsTabs", buildTabs(displayTypes, type));
|
||||||
model.addAttribute("isPrivacyCollect", type == AgreementType.PRIVACY_COLLECT);
|
|
||||||
model.addAttribute("isNotification", type == AgreementType.NOTIFICATION_CONSENT);
|
|
||||||
model.addAttribute("agreementTitle", type.getDescription());
|
model.addAttribute("agreementTitle", type.getDescription());
|
||||||
model.addAttribute("agreementType", type.getCode());
|
model.addAttribute("agreementType", type.getCode());
|
||||||
|
model.addAttribute("currentTab", TAB_SLUGS.get(type));
|
||||||
model.addAttribute("currentTab", currentTab);
|
|
||||||
|
|
||||||
return TERMS_AGREEMENTS;
|
return TERMS_AGREEMENTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 요청한 탭 슬러그를 노출 대상 약관 종류로 해석한다. 없거나 노출 대상이 아니면 첫 번째 탭. */
|
||||||
|
private AgreementType resolveType(String tab, List<AgreementType> displayTypes) {
|
||||||
|
if (displayTypes.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (tab != null && !tab.isEmpty()) {
|
||||||
|
for (AgreementType displayType : displayTypes) {
|
||||||
|
if (tab.equals(TAB_SLUGS.get(displayType))) {
|
||||||
|
return displayType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return displayTypes.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<AgreementTabDTO> buildTabs(List<AgreementType> displayTypes, AgreementType currentType) {
|
||||||
|
List<AgreementTabDTO> tabs = new ArrayList<>();
|
||||||
|
for (AgreementType displayType : displayTypes) {
|
||||||
|
tabs.add(new AgreementTabDTO(
|
||||||
|
TAB_SLUGS.get(displayType),
|
||||||
|
displayType.getDescription(),
|
||||||
|
displayType == currentType));
|
||||||
|
}
|
||||||
|
return tabs;
|
||||||
|
}
|
||||||
|
|
||||||
private AgreementsDTO findAgreementByDate(List<AgreementsDTO> agreements, String publishedOn) {
|
private AgreementsDTO findAgreementByDate(List<AgreementsDTO> agreements, String publishedOn) {
|
||||||
return agreements.stream()
|
return agreements.stream()
|
||||||
.filter(a -> publishedOn.equals(
|
.filter(a -> publishedOn.equals(
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.eactive.apim.portal.apps.agreements.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 약관 페이지({@code /agreements/terms})의 탭 하나.
|
||||||
|
*
|
||||||
|
* <p>노출 대상과 순서는 관리 콘솔의 '약관 종류 관리'에서 설정한 값
|
||||||
|
* ({@code PTL_PROPERTY Portal/portal.terms.display-types})을 따른다.
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class AgreementTabDTO {
|
||||||
|
|
||||||
|
/** URL 파라미터 {@code tab} 값 (북마크 호환을 위해 기존 슬러그를 유지한다) */
|
||||||
|
private final String tab;
|
||||||
|
|
||||||
|
/** 탭에 표시할 약관명 */
|
||||||
|
private final String title;
|
||||||
|
|
||||||
|
/** 현재 선택된 탭인지 여부 */
|
||||||
|
private final boolean active;
|
||||||
|
}
|
||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
package com.eactive.apim.portal.apps.agreements.service;
|
||||||
|
|
||||||
|
import com.eactive.apim.portal.agreements.entity.AgreementType;
|
||||||
|
import com.eactive.apim.portal.agreements.service.AgreementTypeConfigService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 약관 동의 폼({@code apps/register/userAgreementContent :: agreementContent})에 필요한 모델 속성을 채운다.
|
||||||
|
*
|
||||||
|
* <p>관리 콘솔의 '약관 종류 관리'에서 사용하지 않도록 설정한 약관 종류는 동의 항목 자체를 노출하지 않는다
|
||||||
|
* ({@code show*} 플래그가 {@code false} 이고 내용도 {@code null}).
|
||||||
|
*
|
||||||
|
* @see AgreementTypeConfigService
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class AgreementFormModelSupport {
|
||||||
|
|
||||||
|
private final AgreementsFacade agreementsFacade;
|
||||||
|
private final AgreementTypeConfigService agreementTypeConfigService;
|
||||||
|
|
||||||
|
/** 이용약관 / 개인정보수집동의서 / 알림 수신 동의서 모델 속성을 사용 여부에 맞춰 채운다. */
|
||||||
|
public void applyAgreements(Model model) {
|
||||||
|
applyAgreeAllMode(model);
|
||||||
|
|
||||||
|
Set<AgreementType> enabledTypes = agreementTypeConfigService.getEnabledTypes();
|
||||||
|
|
||||||
|
applyAgreement(model, enabledTypes, AgreementType.TERMS_OF_USE, "termsOfUse", "showTermsOfUse");
|
||||||
|
applyAgreement(model, enabledTypes, AgreementType.PRIVACY_COLLECT, "privacyCollect", "showPrivacyCollect");
|
||||||
|
applyAgreement(model, enabledTypes, AgreementType.NOTIFICATION_CONSENT, "notificationConsent",
|
||||||
|
"showNotificationConsent");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* '전체 동의' 허용 여부만 모델에 담는다.
|
||||||
|
*
|
||||||
|
* <p>동의 항목 구성은 그대로 두고 동의 방식만 설정에 맞추면 되는 화면(법인 전환 등)에서 쓴다.
|
||||||
|
* {@code false} 면 '전체 동의' 체크박스를 숨기고 항목별로 끝까지 읽어야 동의할 수 있다.
|
||||||
|
*/
|
||||||
|
public void applyAgreeAllMode(Model model) {
|
||||||
|
model.addAttribute("agreeAllEnabled", agreementTypeConfigService.isAgreeAllEnabled());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void applyAgreement(Model model, Set<AgreementType> enabledTypes, AgreementType type,
|
||||||
|
String contentAttribute, String flagAttribute) {
|
||||||
|
boolean enabled = enabledTypes.contains(type);
|
||||||
|
model.addAttribute(flagAttribute, enabled);
|
||||||
|
model.addAttribute(contentAttribute, enabled ? agreementsFacade.getAgreement(type.getCode()) : null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.eactive.apim.portal.apps.apis.controller;
|
|||||||
|
|
||||||
|
|
||||||
import com.eactive.apim.portal.apps.apis.dto.ApiSpecInfoDto;
|
import com.eactive.apim.portal.apps.apis.dto.ApiSpecInfoDto;
|
||||||
|
import com.eactive.apim.portal.apps.apis.service.ApiListProperties;
|
||||||
import com.eactive.apim.portal.apps.apis.service.ApiSearchFacade;
|
import com.eactive.apim.portal.apps.apis.service.ApiSearchFacade;
|
||||||
import com.eactive.apim.portal.apps.apis.service.ApiService;
|
import com.eactive.apim.portal.apps.apis.service.ApiService;
|
||||||
import com.eactive.apim.portal.apps.apiservice.dto.ApiGroupSearch;
|
import com.eactive.apim.portal.apps.apiservice.dto.ApiGroupSearch;
|
||||||
@@ -17,6 +18,7 @@ import java.util.Optional;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.PageImpl;
|
import org.springframework.data.domain.PageImpl;
|
||||||
|
import org.springframework.data.domain.PageRequest;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.web.PageableDefault;
|
import org.springframework.data.web.PageableDefault;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
@@ -37,6 +39,7 @@ public class ApiController {
|
|||||||
private final ApiServiceService apiServiceService;
|
private final ApiServiceService apiServiceService;
|
||||||
private final ApiSearchFacade apiSearchFacade;
|
private final ApiSearchFacade apiSearchFacade;
|
||||||
private final ApiStatusCatalogService apiStatusCatalogService;
|
private final ApiStatusCatalogService apiStatusCatalogService;
|
||||||
|
private final ApiListProperties apiListProperties;
|
||||||
private static final String DEFAULT_TOKEN_API_ID = "default-token-api-spec";
|
private static final String DEFAULT_TOKEN_API_ID = "default-token-api-spec";
|
||||||
private static final String DEFAULT_TOKEN_API_NAME = "인증";
|
private static final String DEFAULT_TOKEN_API_NAME = "인증";
|
||||||
|
|
||||||
@@ -88,7 +91,8 @@ public class ApiController {
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<ApiSpecInfoDto> allApis = (List<ApiSpecInfoDto>) searchResult.get("apis");
|
List<ApiSpecInfoDto> allApis = (List<ApiSpecInfoDto>) searchResult.get("apis");
|
||||||
Page<ApiSpecInfoDto> apiPage = slicePage(allApis, pageable);
|
Pageable listPageable = PageRequest.of(pageable.getPageNumber(), apiListProperties.getPageSize(), pageable.getSort());
|
||||||
|
Page<ApiSpecInfoDto> apiPage = slicePage(allApis, listPageable);
|
||||||
|
|
||||||
model.addAttribute("search", search);
|
model.addAttribute("search", search);
|
||||||
model.addAttribute("services", searchResult.get("services"));
|
model.addAttribute("services", searchResult.get("services"));
|
||||||
@@ -109,8 +113,8 @@ public class ApiController {
|
|||||||
*/
|
*/
|
||||||
private Page<ApiSpecInfoDto> slicePage(List<ApiSpecInfoDto> apis, Pageable pageable) {
|
private Page<ApiSpecInfoDto> slicePage(List<ApiSpecInfoDto> apis, Pageable pageable) {
|
||||||
int total = apis == null ? 0 : apis.size();
|
int total = apis == null ? 0 : apis.size();
|
||||||
int fromIndex = Math.min(pageable.getPageNumber() * pageable.getPageSize(), total);
|
int fromIndex = (int) Math.min(pageable.getOffset(), total);
|
||||||
int toIndex = Math.min(fromIndex + pageable.getPageSize(), total);
|
int toIndex = (int) Math.min((long) fromIndex + pageable.getPageSize(), total);
|
||||||
List<ApiSpecInfoDto> content = total == 0 ? new ArrayList<>() : apis.subList(fromIndex, toIndex);
|
List<ApiSpecInfoDto> content = total == 0 ? new ArrayList<>() : apis.subList(fromIndex, toIndex);
|
||||||
|
|
||||||
return new PageImpl<>(content, pageable, total);
|
return new PageImpl<>(content, pageable, total);
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.eactive.apim.portal.apps.apis.service;
|
||||||
|
|
||||||
|
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API 카탈로그 캐시({@link ApiSearchFacadeImpl#loadAllApiData()}) 설정.
|
||||||
|
*
|
||||||
|
* <p>TTL 은 PTL_PROPERTY({@code Portal} / {@code apis.catalog.cache-ttl-seconds})로 조절하며,
|
||||||
|
* 최초 접근 시 기본값(120초)으로 row 가 자동 생성된다. {@code 0} 이면 캐시를 쓰지 않는다.</p>
|
||||||
|
*
|
||||||
|
* <p>카탈로그 조회는 readOnly 트랜잭션 안(예: API Status 조회 서비스)에서도 호출되므로,
|
||||||
|
* 최초 row 생성(INSERT)이 묻히지 않도록 별도 트랜잭션({@code REQUIRES_NEW})에서 읽는다.</p>
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ApiCatalogCacheSettings {
|
||||||
|
|
||||||
|
public static final String PROPERTY_GROUP = "Portal";
|
||||||
|
|
||||||
|
public static final String KEY_TTL_SECONDS = "apis.catalog.cache-ttl-seconds";
|
||||||
|
|
||||||
|
static final int DEFAULT_TTL_SECONDS = 120;
|
||||||
|
|
||||||
|
private static final int MAX_TTL_SECONDS = 3600;
|
||||||
|
|
||||||
|
private final PortalPropertyService portalPropertyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 캐시 TTL(초). 0~3600 으로 clamp 하며, 값이 비었거나 이상하면 기본 120초.
|
||||||
|
*/
|
||||||
|
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||||
|
public int getTtlSeconds() {
|
||||||
|
try {
|
||||||
|
String value = portalPropertyService.getOrCreateProperty(
|
||||||
|
PROPERTY_GROUP, KEY_TTL_SECONDS, String.valueOf(DEFAULT_TTL_SECONDS),
|
||||||
|
"API 카탈로그(API 그룹·스펙 목록) 메모리 캐시 시간(초). OPEN API 목록·상세, API Status 에 적용. 0 = 캐시 안 함 (0~3600)");
|
||||||
|
int seconds = Integer.parseInt(StringUtils.trimToEmpty(value));
|
||||||
|
return Math.max(0, Math.min(MAX_TTL_SECONDS, seconds));
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("API 카탈로그 캐시 TTL 프로퍼티 해석 실패 - 기본값 {}초 사용", DEFAULT_TTL_SECONDS, e);
|
||||||
|
return DEFAULT_TTL_SECONDS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.eactive.apim.portal.apps.apis.service;
|
||||||
|
|
||||||
|
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/** OPEN API 목록 및 앱/Webhook 신청·수정 API 선택 목록의 공통 페이지 크기. */
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ApiListProperties {
|
||||||
|
|
||||||
|
private static final String PAGE_SIZE_PROPERTY = "api.list.page-size";
|
||||||
|
private static final int DEFAULT_PAGE_SIZE = 15;
|
||||||
|
|
||||||
|
private final PortalPropertyService portalPropertyService;
|
||||||
|
|
||||||
|
/** PTL_PROPERTY(Portal / api.list.page-size)를 조회하고, 없으면 기본값으로 생성한다. */
|
||||||
|
public int getPageSize() {
|
||||||
|
String value = portalPropertyService.getOrCreateProperty(
|
||||||
|
"Portal", PAGE_SIZE_PROPERTY, String.valueOf(DEFAULT_PAGE_SIZE),
|
||||||
|
"API 목록 및 앱/Webhook 신청·수정 API 선택 목록의 페이지당 노출 개수 (양의 정수, 기본 15)");
|
||||||
|
try {
|
||||||
|
int size = Integer.parseInt(value == null ? "" : value.trim());
|
||||||
|
if (size > 0) {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException ignored) {
|
||||||
|
// 비어 있거나 정수가 아닌 설정은 기본값을 사용한다.
|
||||||
|
}
|
||||||
|
log.warn("{} 값이 올바르지 않음('{}') - 기본값 {} 사용", PAGE_SIZE_PROPERTY, value, DEFAULT_PAGE_SIZE);
|
||||||
|
return DEFAULT_PAGE_SIZE;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import com.eactive.apim.portal.apps.apiservice.dto.ApiServiceDTO;
|
|||||||
import com.eactive.apim.portal.apps.apiservice.service.ApiServiceService;
|
import com.eactive.apim.portal.apps.apiservice.service.ApiServiceService;
|
||||||
import com.eactive.apim.portal.apps.auth.service.ApiPermissionFilter;
|
import com.eactive.apim.portal.apps.auth.service.ApiPermissionFilter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
@@ -21,14 +22,60 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class ApiSearchFacadeImpl implements ApiSearchFacade {
|
public class ApiSearchFacadeImpl implements ApiSearchFacade {
|
||||||
|
|
||||||
private final ApiService apiService;
|
private final ApiService apiService;
|
||||||
private final ApiServiceService apiServiceService;
|
private final ApiServiceService apiServiceService;
|
||||||
|
private final ApiCatalogCacheSettings cacheSettings;
|
||||||
|
|
||||||
|
/** 카탈로그 캐시. 사용자와 무관한 원본만 담고, 권한 필터는 {@link #searchApis} 가 요청마다 적용한다 */
|
||||||
|
private volatile CachedApiData cachedApiData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API 그룹 + 스펙 전체(카탈로그). TTL({@link ApiCatalogCacheSettings}) 동안 메모리에 캐시한다.
|
||||||
|
*
|
||||||
|
* <p>OPEN API 목록·상세와 API Status 가 요청마다 이 조회를 반복하므로(그룹 N+1 포함) 캐시로 묶는다.
|
||||||
|
* 관리자 화면에서 API 그룹·스펙을 바꾸면 최대 TTL 만큼 늦게 반영된다.</p>
|
||||||
|
*
|
||||||
|
* <p>반환 객체는 여러 요청이 공유하므로 호출자는 수정하지 않는다.</p>
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public ApiSearchData loadAllApiData() {
|
public ApiSearchData loadAllApiData() {
|
||||||
|
CachedApiData current = cachedApiData;
|
||||||
|
if (current != null && current.isFresh(nowMillis())) {
|
||||||
|
return current.getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
// TTL 은 캐시가 만료됐을 때만 읽는다 (프로퍼티 변경은 다음 갱신부터 반영)
|
||||||
|
int ttlSeconds = cacheSettings.getTtlSeconds();
|
||||||
|
if (ttlSeconds <= 0) {
|
||||||
|
cachedApiData = null;
|
||||||
|
return queryAllApiData();
|
||||||
|
}
|
||||||
|
|
||||||
|
synchronized (this) {
|
||||||
|
current = cachedApiData;
|
||||||
|
if (current != null && current.isFresh(nowMillis())) {
|
||||||
|
return current.getData();
|
||||||
|
}
|
||||||
|
long startedAt = nowMillis();
|
||||||
|
ApiSearchData data = queryAllApiData();
|
||||||
|
cachedApiData = new CachedApiData(data, nowMillis() + ttlSeconds * 1000L);
|
||||||
|
log.debug("API 카탈로그 캐시 갱신 - 그룹 {}개, API {}개, {}ms (TTL {}초)",
|
||||||
|
data.getAllServices().size(), data.getApiSpecsById().size(),
|
||||||
|
nowMillis() - startedAt, ttlSeconds);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
long nowMillis() {
|
||||||
|
return System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
private ApiSearchData queryAllApiData() {
|
||||||
|
|
||||||
List<ApiServiceDTO> allServices = apiServiceService.searchApiGroups(new ApiGroupSearch());
|
List<ApiServiceDTO> allServices = apiServiceService.searchApiGroups(new ApiGroupSearch());
|
||||||
|
|
||||||
@@ -57,7 +104,20 @@ public class ApiSearchFacadeImpl implements ApiSearchFacade {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return new ApiSearchData(allServices, apiSpecsById, servicesByApiId);
|
// 소속 그룹 정보는 캐시에 담기 전에 채운다. 캐시된 객체를 요청마다 고치지 않기 위함.
|
||||||
|
// mainIcon(CLOB, base64)은 카드 수만큼 복제하지 않는다. 렌더링은
|
||||||
|
// apiGroupId 기준 /api-services/{id}/icon 스트리밍 엔드포인트를 사용한다.
|
||||||
|
apiSpecsById.values().forEach(api -> {
|
||||||
|
ApiServiceDTO service = servicesByApiId.get(api.getApiId());
|
||||||
|
if (service != null) {
|
||||||
|
api.setApiGroupId(service.getId());
|
||||||
|
api.setApiGroupName(service.getGroupName());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return new ApiSearchData(Collections.unmodifiableList(allServices),
|
||||||
|
Collections.unmodifiableMap(apiSpecsById),
|
||||||
|
Collections.unmodifiableMap(servicesByApiId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -112,16 +172,6 @@ public class ApiSearchFacadeImpl implements ApiSearchFacade {
|
|||||||
.map(ApiSpecInfoDto::getApiId)
|
.map(ApiSpecInfoDto::getApiId)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
filteredApis.forEach(api -> {
|
|
||||||
ApiServiceDTO service = apiData.getServicesByApiId().get(api.getApiId());
|
|
||||||
if (service != null) {
|
|
||||||
// mainIcon(CLOB, base64)은 카드 수만큼 복제하지 않는다. 렌더링은
|
|
||||||
// apiGroupId 기준 /api-services/{id}/icon 스트리밍 엔드포인트를 사용한다.
|
|
||||||
api.setApiGroupId(service.getId());
|
|
||||||
api.setApiGroupName(service.getGroupName());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
List<ApiServiceDTO> servicesToReturn = apiData.getAllServices().stream()
|
List<ApiServiceDTO> servicesToReturn = apiData.getAllServices().stream()
|
||||||
.map(service -> {
|
.map(service -> {
|
||||||
ApiServiceDTO filteredService = new ApiServiceDTO();
|
ApiServiceDTO filteredService = new ApiServiceDTO();
|
||||||
@@ -209,4 +259,23 @@ public class ApiSearchFacadeImpl implements ApiSearchFacade {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 카탈로그 캐시 항목 (불변) */
|
||||||
|
private static final class CachedApiData {
|
||||||
|
|
||||||
|
private final ApiSearchData data;
|
||||||
|
private final long expiresAtMillis;
|
||||||
|
|
||||||
|
private CachedApiData(ApiSearchData data, long expiresAtMillis) {
|
||||||
|
this.data = data;
|
||||||
|
this.expiresAtMillis = expiresAtMillis;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ApiSearchData getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isFresh(long nowMillis) {
|
||||||
|
return nowMillis < expiresAtMillis;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.commons.lang3.Strings;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@@ -155,10 +156,10 @@ public class ApiSpecService {
|
|||||||
updateReferences(pathItem, apiId);
|
updateReferences(pathItem, apiId);
|
||||||
|
|
||||||
String tmpFullPath = StringUtils.isNotEmpty(basePath)
|
String tmpFullPath = StringUtils.isNotEmpty(basePath)
|
||||||
? StringUtils.join(basePath, "/", StringUtils.removeStart(path, "/"))
|
? StringUtils.join(basePath, "/", Strings.CS.removeStart(path, "/"))
|
||||||
: path;
|
: path;
|
||||||
|
|
||||||
final String fullPath = StringUtils.replacePattern(tmpFullPath, "//+", "/");
|
final String fullPath = tmpFullPath.replaceAll("//+", "/");
|
||||||
|
|
||||||
// HTTP 메소드별로 중복 체크
|
// HTTP 메소드별로 중복 체크
|
||||||
pathItem.readOperationsMap().forEach((httpMethod, operation) -> {
|
pathItem.readOperationsMap().forEach((httpMethod, operation) -> {
|
||||||
@@ -294,7 +295,7 @@ public class ApiSpecService {
|
|||||||
return StringUtils.EMPTY;
|
return StringUtils.EMPTY;
|
||||||
}
|
}
|
||||||
Server server = api.getServers().get(0);
|
Server server = api.getServers().get(0);
|
||||||
return StringUtils.removeEnd(server.getUrl(), "/");
|
return Strings.CS.removeEnd(server.getUrl(), "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void mergeComponents(OpenAPI currentAPI, String apiId, String apiName, Map<String, Object> mergedComponents, ObjectMapper objectMapper) {
|
private void mergeComponents(OpenAPI currentAPI, String apiId, String apiName, Map<String, Object> mergedComponents, ObjectMapper objectMapper) {
|
||||||
|
|||||||
@@ -1,18 +1,28 @@
|
|||||||
package com.eactive.apim.portal.apps.app.service;
|
package com.eactive.apim.portal.apps.app.service;
|
||||||
|
|
||||||
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.client.RestClientException;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 관리자(admin) 포털의 내부 API를 호출하는 클라이언트.
|
* 관리자(admin) 포털의 내부 API를 호출하는 클라이언트.
|
||||||
*
|
*
|
||||||
* <p>GW 인증서버(TSEAIAU01) 제어는 포털이 직접 하지 않고, broadcast 인프라를 갖춘 admin 에 위임한다.
|
* <p>GW 인증서버(TSEAIAU01) 제어는 포털이 직접 하지 않고, broadcast 인프라를 갖춘 admin 에 위임한다.
|
||||||
* admin base URL 은 {@code PTL_PROPERTY} (group={@code Portal}, name={@code djb.admin.base-url}) 에서 조회한다.</p>
|
* admin base URL 은 {@code PTL_PROPERTY} (group={@code Portal}, name={@code admin.base-url}) 에서 조회한다.</p>
|
||||||
|
*
|
||||||
|
* <p><b>다중 base URL / failover</b> — 프로퍼티 값에 콤마({@code ,}) 또는 개행으로 여러 admin 주소를 넣을 수 있다.
|
||||||
|
* 호출은 <b>기재된 순서대로</b> 시도하며, 통신 오류(연결 실패/타임아웃/HTTP 오류)면 다음 주소로 넘어간다.
|
||||||
|
* 모두 실패하면 마지막 오류를 던진다. 반면 admin 이 정상 응답하면서 {@code success=false} 를 준 것은
|
||||||
|
* 업무 처리 실패이므로 <b>failover 하지 않고</b> 즉시 실패시킨다(다른 노드도 같은 결과이며 중복 처리 위험).</p>
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@@ -22,6 +32,8 @@ public class AdminGatewayClient {
|
|||||||
private static final String PROP_GROUP = "Portal";
|
private static final String PROP_GROUP = "Portal";
|
||||||
private static final String PROP_ADMIN_BASE_URL = "admin.base-url";
|
private static final String PROP_ADMIN_BASE_URL = "admin.base-url";
|
||||||
private static final String DEFAULT_ADMIN_BASE_URL = "http://localhost:39120";
|
private static final String DEFAULT_ADMIN_BASE_URL = "http://localhost:39120";
|
||||||
|
private static final String PROP_ADMIN_BASE_URL_DESC =
|
||||||
|
"admin(관리자포털) 내부 API base URL. 콤마(,) 또는 줄바꿈으로 여러 개 지정 시 앞에서부터 failover";
|
||||||
private static final String CLIENT_BLOCK_PATH = "/onl/admin/authserver/clientBlock.json?clientId={clientId}";
|
private static final String CLIENT_BLOCK_PATH = "/onl/admin/authserver/clientBlock.json?clientId={clientId}";
|
||||||
|
|
||||||
private final RestTemplate restTemplate;
|
private final RestTemplate restTemplate;
|
||||||
@@ -30,26 +42,79 @@ public class AdminGatewayClient {
|
|||||||
/**
|
/**
|
||||||
* clientId 의 GW 인증 클라이언트 차단(appstatus=0) + GW 캐시 리로드를 admin 에 요청한다.
|
* clientId 의 GW 인증 클라이언트 차단(appstatus=0) + GW 캐시 리로드를 admin 에 요청한다.
|
||||||
*
|
*
|
||||||
|
* <p>base URL 이 여러 개면 앞에서부터 순서대로 시도한다(failover).</p>
|
||||||
|
*
|
||||||
* @param clientId 차단할 클라이언트 ID
|
* @param clientId 차단할 클라이언트 ID
|
||||||
* @throws RuntimeException admin 미응답/네트워크 오류 또는 admin 처리 실패 시 (호출측에서 처리)
|
* @throws RuntimeException admin 미응답/네트워크 오류(전 노드 실패) 또는 admin 처리 실패 시 (호출측에서 처리)
|
||||||
*/
|
*/
|
||||||
public void blockClient(String clientId) {
|
public void blockClient(String clientId) {
|
||||||
String baseUrl = portalPropertyService.getOrCreateProperty(
|
List<String> baseUrls = resolveBaseUrls();
|
||||||
PROP_GROUP, PROP_ADMIN_BASE_URL, DEFAULT_ADMIN_BASE_URL, "admin(관리자포털) 내부 API base URL");
|
|
||||||
|
|
||||||
String url = stripTrailingSlashes(baseUrl) + CLIENT_BLOCK_PATH;
|
RestClientException lastError = null;
|
||||||
|
for (int i = 0; i < baseUrls.size(); i++) {
|
||||||
|
String baseUrl = baseUrls.get(i);
|
||||||
|
String url = baseUrl + CLIENT_BLOCK_PATH;
|
||||||
|
|
||||||
// 네트워크/HTTP 오류는 RestTemplate 이 예외로 던진다.
|
ResponseEntity<Map> response;
|
||||||
ResponseEntity<Map> response = restTemplate.postForEntity(url, null, Map.class, clientId);
|
try {
|
||||||
|
response = restTemplate.postForEntity(url, null, Map.class, clientId);
|
||||||
|
} catch (RestClientException e) {
|
||||||
|
// 통신 계층 실패 — 다음 admin 주소로 failover
|
||||||
|
lastError = e;
|
||||||
|
log.warn("admin clientBlock 호출 실패({}/{}) - baseUrl={}, clientId={}, cause={}",
|
||||||
|
i + 1, baseUrls.size(), baseUrl, clientId, e.toString());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 여기까지 왔으면 admin 이 응답한 것 — 업무 실패는 failover 대상이 아니다.
|
||||||
Map<?, ?> body = response.getBody();
|
Map<?, ?> body = response.getBody();
|
||||||
boolean success = body != null && Boolean.TRUE.equals(body.get("success"));
|
boolean success = body != null && Boolean.TRUE.equals(body.get("success"));
|
||||||
if (!success) {
|
if (!success) {
|
||||||
String msg = body != null ? String.valueOf(body.get("msg")) : "응답 본문 없음";
|
String msg = body != null ? String.valueOf(body.get("msg")) : "응답 본문 없음";
|
||||||
throw new IllegalStateException("admin clientBlock 처리 실패 - clientId=" + clientId + ", msg=" + msg);
|
throw new IllegalStateException(
|
||||||
|
"admin clientBlock 처리 실패 - baseUrl=" + baseUrl + ", clientId=" + clientId + ", msg=" + msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("admin GW 차단/리로드 위임 성공 - clientId={}", clientId);
|
log.info("admin GW 차단/리로드 위임 성공 - baseUrl={}, clientId={}", baseUrl, clientId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new IllegalStateException(
|
||||||
|
"admin clientBlock 호출 실패 - 모든 admin 주소 응답 없음 (" + baseUrls + "), clientId=" + clientId, lastError);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 프로퍼티의 admin base URL 목록을 순서대로 반환한다.
|
||||||
|
*
|
||||||
|
* <p>구분자는 콤마({@code ,})와 개행({@code \r\n})이며, 공백 항목과 중복은 제거하고 순서는 보존한다.
|
||||||
|
* 값이 비어 있거나 유효 항목이 없으면 기본값 하나만 반환한다.</p>
|
||||||
|
*/
|
||||||
|
private List<String> resolveBaseUrls() {
|
||||||
|
String raw = portalPropertyService.getOrCreateProperty(
|
||||||
|
PROP_GROUP, PROP_ADMIN_BASE_URL, DEFAULT_ADMIN_BASE_URL, PROP_ADMIN_BASE_URL_DESC);
|
||||||
|
|
||||||
|
List<String> urls = parseBaseUrls(raw);
|
||||||
|
if (urls.isEmpty()) {
|
||||||
|
log.warn("admin.base-url 프로퍼티가 비어 있어 기본값 사용 - {}", DEFAULT_ADMIN_BASE_URL);
|
||||||
|
return parseBaseUrls(DEFAULT_ADMIN_BASE_URL);
|
||||||
|
}
|
||||||
|
return urls;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 콤마/개행으로 구분된 base URL 문자열을 정규화된 목록으로 파싱한다.
|
||||||
|
*/
|
||||||
|
static List<String> parseBaseUrls(String raw) {
|
||||||
|
Set<String> ordered = new LinkedHashSet<>();
|
||||||
|
if (raw != null) {
|
||||||
|
for (String token : raw.split("[,\\r\\n]")) {
|
||||||
|
String url = stripTrailingSlashes(token.trim());
|
||||||
|
if (!url.isEmpty()) {
|
||||||
|
ordered.add(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new ArrayList<>(ordered);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -41,7 +41,13 @@ public class ApprovalService {
|
|||||||
approval.setApprovalType(ApprovalType.APP);
|
approval.setApprovalType(ApprovalType.APP);
|
||||||
approval.setTargetId(request.getId());
|
approval.setTargetId(request.getId());
|
||||||
approval.setRequester(SecurityUtil.getPortalAuthenticatedUser());
|
approval.setRequester(SecurityUtil.getPortalAuthenticatedUser());
|
||||||
approval.setApprovalSubject("[" + request.getOrg().getOrgName() + "] " + request.getType().getDescription() + " 승인");
|
// 동일 법인의 신규/변경/해지 요청이 관리자 목록에서 같은 제목으로 보이면 대상 식별이 불가능하다.
|
||||||
|
// 클라이언트 이름을 제목에 포함해 운영자와 E2E 모두 정확한 승인 건을 검색할 수 있게 한다.
|
||||||
|
String clientName = request.getClientName();
|
||||||
|
String clientNamePart = clientName == null || clientName.trim().isEmpty()
|
||||||
|
? "" : " [" + clientName.trim() + "]";
|
||||||
|
approval.setApprovalSubject("[" + request.getOrg().getOrgName() + "]" + clientNamePart
|
||||||
|
+ " " + request.getType().getDescription() + " 승인");
|
||||||
|
|
||||||
for (PortalApprovalLineUser user : optLine.get().getPortalApprovalLineUsers()) {
|
for (PortalApprovalLineUser user : optLine.get().getPortalApprovalLineUsers()) {
|
||||||
this.addApprover(approval, user.getUser(), user.getApprovalOrder());
|
this.addApprover(approval, user.getUser(), user.getApprovalOrder());
|
||||||
|
|||||||
@@ -64,33 +64,36 @@ public class ApiPermissionFilter {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean checkServicePermissions(ApiServiceDTO spec, boolean isAuthenticated,
|
/**
|
||||||
|
* org 축과 role 축은 각자 독립적으로 선택적 제한이다(비어있으면 그 축은 통과) — 둘을 AND로 합친다.
|
||||||
|
* (과거 OR 합성은 한쪽 축이 비어있으면 그 축이 무조건 true가 되어 다른 쪽 제한을 무력화시키는
|
||||||
|
* 결함이 있었다 — 예: displayOrg 만 설정하고 displayRoleCode 를 비워두면 roleMatch 가 로그인
|
||||||
|
* 여부만으로 true 가 되어 조직 제한이 사실상 적용되지 않았다.)
|
||||||
|
*/
|
||||||
|
static boolean checkServicePermissions(ApiServiceDTO spec, boolean isAuthenticated,
|
||||||
String org, String roleCode) {
|
String org, String roleCode) {
|
||||||
if (!isAuthenticated) {
|
if (!isAuthenticated) {
|
||||||
return (spec.getDisplayOrg() == null || spec.getDisplayOrg().isEmpty()) && (spec.getDisplayRoleCode() == null || spec.getDisplayRoleCode().isEmpty());
|
return (spec.getDisplayOrg() == null || spec.getDisplayOrg().isEmpty()) && (spec.getDisplayRoleCode() == null || spec.getDisplayRoleCode().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean orgMatch = org != null && (spec.getDisplayOrg() == null ||
|
boolean orgOk = spec.getDisplayOrg() == null || spec.getDisplayOrg().isEmpty()
|
||||||
spec.getDisplayOrg().isEmpty() ||
|
|| (org != null && spec.getDisplayOrg().contains(org));
|
||||||
spec.getDisplayOrg().contains(org));
|
boolean roleOk = spec.getDisplayRoleCode() == null || spec.getDisplayRoleCode().isEmpty()
|
||||||
boolean roleMatch = roleCode != null && (spec.getDisplayRoleCode() == null ||
|
|| (roleCode != null && spec.getDisplayRoleCode().contains(roleCode));
|
||||||
spec.getDisplayRoleCode().isEmpty() ||
|
return orgOk && roleOk;
|
||||||
spec.getDisplayRoleCode().contains(roleCode));
|
|
||||||
return orgMatch || roleMatch;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean checkApiPermissions(ApiSpecInfoDto spec, boolean isAuthenticated,
|
/** {@link #checkServicePermissions} 와 동일 규칙(중복 유지 — 대상 DTO 타입만 다름). */
|
||||||
|
static boolean checkApiPermissions(ApiSpecInfoDto spec, boolean isAuthenticated,
|
||||||
String org, String roleCode) {
|
String org, String roleCode) {
|
||||||
if (!isAuthenticated) {
|
if (!isAuthenticated) {
|
||||||
return (spec.getDisplayOrg() == null || spec.getDisplayOrg().isEmpty()) && (spec.getDisplayRoleCode() == null || spec.getDisplayRoleCode().isEmpty());
|
return (spec.getDisplayOrg() == null || spec.getDisplayOrg().isEmpty()) && (spec.getDisplayRoleCode() == null || spec.getDisplayRoleCode().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean orgMatch = org != null && (spec.getDisplayOrg() == null ||
|
boolean orgOk = spec.getDisplayOrg() == null || spec.getDisplayOrg().isEmpty()
|
||||||
spec.getDisplayOrg().isEmpty() ||
|
|| (org != null && spec.getDisplayOrg().contains(org));
|
||||||
spec.getDisplayOrg().contains(org));
|
boolean roleOk = spec.getDisplayRoleCode() == null || spec.getDisplayRoleCode().isEmpty()
|
||||||
boolean roleMatch = roleCode != null && (spec.getDisplayRoleCode() == null ||
|
|| (roleCode != null && spec.getDisplayRoleCode().contains(roleCode));
|
||||||
spec.getDisplayRoleCode().isEmpty() ||
|
return orgOk && roleOk;
|
||||||
spec.getDisplayRoleCode().contains(roleCode));
|
|
||||||
return orgMatch || roleMatch;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@@ -104,9 +105,15 @@ public class AuthNumberServiceImpl implements AuthNumberService {
|
|||||||
private void validateResendTime(String recipientKey) {
|
private void validateResendTime(String recipientKey) {
|
||||||
storage.getAuthNumber(recipientKey).ifPresent(existingAuth -> {
|
storage.getAuthNumber(recipientKey).ifPresent(existingAuth -> {
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
if (existingAuth.getExpiresAt().minusSeconds(authNumberExpirationTime)
|
LocalDateTime resendAvailableAt = existingAuth.getExpiresAt()
|
||||||
.plusSeconds(resendLimitSeconds).isAfter(now)) {
|
.minusSeconds(authNumberExpirationTime)
|
||||||
throw new AuthNumberException("잠시 후에 다시 시도해 주세요.");
|
.plusSeconds(resendLimitSeconds);
|
||||||
|
if (resendAvailableAt.isAfter(now)) {
|
||||||
|
long remainingMillis = Duration.between(now, resendAvailableAt).toMillis();
|
||||||
|
long remainingSeconds = Math.max(1L, (remainingMillis + 999L) / 1000L);
|
||||||
|
throw new AuthNumberException(
|
||||||
|
String.format("인증번호 재발송 제한이 적용 중입니다. %d초 후 다시 시도해 주세요.",
|
||||||
|
remainingSeconds));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-3
@@ -1,6 +1,8 @@
|
|||||||
package com.eactive.apim.portal.apps.auth.twofactor;
|
package com.eactive.apim.portal.apps.auth.twofactor;
|
||||||
|
|
||||||
import com.eactive.apim.portal.apps.user.facade.UserFacade;
|
import com.eactive.apim.portal.apps.user.facade.UserFacade;
|
||||||
|
import com.eactive.apim.portal.common.security.PasswordConfirmFailureTracker;
|
||||||
|
import com.eactive.apim.portal.common.security.PasswordConfirmFailureTracker.Outcome;
|
||||||
import com.eactive.apim.portal.common.util.SecurityUtil;
|
import com.eactive.apim.portal.common.util.SecurityUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.security.access.annotation.Secured;
|
import org.springframework.security.access.annotation.Secured;
|
||||||
@@ -11,6 +13,8 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,6 +34,7 @@ public class StepUpPasswordController {
|
|||||||
|
|
||||||
private final UserFacade userFacade;
|
private final UserFacade userFacade;
|
||||||
private final TwoFactorService twoFactorService;
|
private final TwoFactorService twoFactorService;
|
||||||
|
private final PasswordConfirmFailureTracker passwordConfirmFailureTracker;
|
||||||
|
|
||||||
@GetMapping("/password")
|
@GetMapping("/password")
|
||||||
public String page(@RequestParam(required = false) String returnUrl, Model model) {
|
public String page(@RequestParam(required = false) String returnUrl, Model model) {
|
||||||
@@ -44,7 +49,8 @@ public class StepUpPasswordController {
|
|||||||
@PostMapping("/password")
|
@PostMapping("/password")
|
||||||
public String verify(@RequestParam String currentPassword,
|
public String verify(@RequestParam String currentPassword,
|
||||||
@RequestParam(required = false) String returnUrl,
|
@RequestParam(required = false) String returnUrl,
|
||||||
HttpSession session, Model model) {
|
HttpSession session, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
Model model) {
|
||||||
String path = pathOf(returnUrl);
|
String path = pathOf(returnUrl);
|
||||||
if (!StepUpProtectedPaths.isPasswordGated(path)) {
|
if (!StepUpProtectedPaths.isPasswordGated(path)) {
|
||||||
return "redirect:/";
|
return "redirect:/";
|
||||||
@@ -52,12 +58,21 @@ public class StepUpPasswordController {
|
|||||||
|
|
||||||
String loginId = SecurityUtil.getCurrentLoginId();
|
String loginId = SecurityUtil.getCurrentLoginId();
|
||||||
if (userFacade.verifyCurrentPassword(loginId, currentPassword)) {
|
if (userFacade.verifyCurrentPassword(loginId, currentPassword)) {
|
||||||
// 확인 성공 → 해당 경로 통과권 발급 후 원경로(화이트리스트 경로)로만 복귀
|
// 확인 성공 → 실패 카운트 초기화, 해당 경로 통과권 발급 후 원경로(화이트리스트 경로)로만 복귀
|
||||||
|
passwordConfirmFailureTracker.reset(session);
|
||||||
twoFactorService.grantStepUpPass(session, path);
|
twoFactorService.grantStepUpPass(session, path);
|
||||||
return "redirect:" + path;
|
return "redirect:" + path;
|
||||||
}
|
}
|
||||||
|
|
||||||
model.addAttribute("error", "현재 비밀번호가 일치하지 않습니다.");
|
// 연속 실패 카운트 증가. 임계치 초과 시 정책(로그아웃/계정 차단)에 따라 조치한다(무차별 대입 방어).
|
||||||
|
Outcome outcome = passwordConfirmFailureTracker.recordFailure(session, request, response);
|
||||||
|
if (outcome.isForcedLogout()) {
|
||||||
|
return outcome.isAccountLocked()
|
||||||
|
? "redirect:/login?pwFailExceeded=1&locked=1"
|
||||||
|
: "redirect:/login?pwFailExceeded=1";
|
||||||
|
}
|
||||||
|
|
||||||
|
model.addAttribute("error", outcome.getMessage());
|
||||||
model.addAttribute("returnUrl", path);
|
model.addAttribute("returnUrl", path);
|
||||||
return "apps/auth/stepupPassword";
|
return "apps/auth/stepupPassword";
|
||||||
}
|
}
|
||||||
|
|||||||
+32
-1
@@ -2,6 +2,8 @@ package com.eactive.apim.portal.apps.community.partnership.controller;
|
|||||||
|
|
||||||
import com.eactive.apim.portal.apps.community.partnership.dto.PartnershipApplicationDTO;
|
import com.eactive.apim.portal.apps.community.partnership.dto.PartnershipApplicationDTO;
|
||||||
import com.eactive.apim.portal.apps.community.partnership.service.PartnershipApplicationFacade;
|
import com.eactive.apim.portal.apps.community.partnership.service.PartnershipApplicationFacade;
|
||||||
|
import com.eactive.apim.portal.common.security.WriteRateLimitService;
|
||||||
|
import com.eactive.apim.portal.common.security.WriteRateLimitService.WriteTarget;
|
||||||
import com.eactive.apim.portal.common.util.SecurityUtil;
|
import com.eactive.apim.portal.common.util.SecurityUtil;
|
||||||
import com.eactive.apim.portal.common.util.UserTypeUtil;
|
import com.eactive.apim.portal.common.util.UserTypeUtil;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -20,10 +22,13 @@ import javax.validation.Valid;
|
|||||||
public class PartnershipApplicationController {
|
public class PartnershipApplicationController {
|
||||||
|
|
||||||
private final PartnershipApplicationFacade partnershipApplicationFacade;
|
private final PartnershipApplicationFacade partnershipApplicationFacade;
|
||||||
|
private final WriteRateLimitService writeRateLimitService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public PartnershipApplicationController(PartnershipApplicationFacade partnershipApplicationFacade){
|
public PartnershipApplicationController(PartnershipApplicationFacade partnershipApplicationFacade,
|
||||||
|
WriteRateLimitService writeRateLimitService){
|
||||||
this.partnershipApplicationFacade = partnershipApplicationFacade;
|
this.partnershipApplicationFacade = partnershipApplicationFacade;
|
||||||
|
this.writeRateLimitService = writeRateLimitService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -52,6 +57,13 @@ public class PartnershipApplicationController {
|
|||||||
return "apps/community/mainPartnershipForm";
|
return "apps/community/mainPartnershipForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 무제한 작성 차단 — 폼 전송이라 예외 대신 flash 메시지로 되돌린다.
|
||||||
|
if (writeRateLimitService.isExceeded(WriteTarget.PARTNERSHIP)) {
|
||||||
|
redirectAttributes.addFlashAttribute("error",
|
||||||
|
writeRateLimitService.exceededMessage(WriteTarget.PARTNERSHIP));
|
||||||
|
return "redirect:/partnership";
|
||||||
|
}
|
||||||
|
|
||||||
partnershipApplicationFacade.createPartnershipApplication(partnershipApplicationDTO);
|
partnershipApplicationFacade.createPartnershipApplication(partnershipApplicationDTO);
|
||||||
|
|
||||||
// 성공 메시지 추가
|
// 성공 메시지 추가
|
||||||
@@ -61,4 +73,23 @@ public class PartnershipApplicationController {
|
|||||||
return "redirect:/partnership";
|
return "redirect:/partnership";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 본인이 작성한 피드백/개선요청 1건 삭제.
|
||||||
|
* 목록(최근 3건)의 삭제 버튼이 항목별 form 을 POST 한다 — 등록과 동일하게 폼 전송 + flash 메시지 방식.
|
||||||
|
*/
|
||||||
|
@PostMapping("/{id}/delete")
|
||||||
|
public String deleteMyPartnershipApplication(@PathVariable String id, RedirectAttributes redirectAttributes) {
|
||||||
|
if (!SecurityUtil.isAuthenticated()) {
|
||||||
|
return "redirect:/login?reason=auth&redirect=/partnership";
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
partnershipApplicationFacade.deleteMyApplication(id);
|
||||||
|
redirectAttributes.addFlashAttribute("success", "피드백/개선요청이 삭제되었습니다.");
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
redirectAttributes.addFlashAttribute("error", e.getMessage());
|
||||||
|
}
|
||||||
|
return "redirect:/partnership";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+20
@@ -3,6 +3,8 @@ package com.eactive.apim.portal.apps.community.partnership.repository;
|
|||||||
import com.eactive.apim.portal.partnershipapplication.entity.PartnershipApplication;
|
import com.eactive.apim.portal.partnershipapplication.entity.PartnershipApplication;
|
||||||
import com.eactive.eai.rms.data.EMSDataSource;
|
import com.eactive.eai.rms.data.EMSDataSource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
@@ -18,7 +20,25 @@ public interface PartnershipApplicationRepository extends JpaRepository<Partners
|
|||||||
*/
|
*/
|
||||||
List<PartnershipApplication> findTop3ByCreatedByOrderByCreatedDateDesc(String createdBy);
|
List<PartnershipApplication> findTop3ByCreatedByOrderByCreatedDateDesc(String createdBy);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 작성 빈도 제한 판정용 — 특정 작성자의 최근 글을 최신순으로 조회한다(Pageable 로 건수 제한).
|
||||||
|
* 등가 조회가 가능한 이유는 위와 동일하다.
|
||||||
|
*/
|
||||||
|
List<PartnershipApplication> findByCreatedByOrderByCreatedDateDesc(String createdBy, Pageable pageable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 본인 글 삭제용 단건 조회. id 만으로 찾지 않고 createdBy 를 함께 걸어
|
||||||
|
* 남의 글 id 를 넣어도 조회되지 않게 한다(소유자 검증을 쿼리 단계에서 강제).
|
||||||
|
*/
|
||||||
|
Optional<PartnershipApplication> findByIdAndCreatedBy(String id, String createdBy);
|
||||||
|
|
||||||
/** createdBy = PortalUser.id (평문 등가 조회 가능한 이유는 위와 동일). */
|
/** createdBy = PortalUser.id (평문 등가 조회 가능한 이유는 위와 동일). */
|
||||||
@Transactional
|
@Transactional
|
||||||
long deleteByCreatedBy(String createdBy);
|
long deleteByCreatedBy(String createdBy);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test-cleanup 전용 — 특정 작성자의 글 중 제목이 지정 접두사로 시작하는 것만 조회한다.
|
||||||
|
* (bizSubject 는 암호화 컬럼이 아니라 LIKE 조회가 가능하다.)
|
||||||
|
*/
|
||||||
|
List<PartnershipApplication> findAllByCreatedByAndBizSubjectStartingWith(String createdBy, String bizSubjectPrefix);
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -13,4 +13,10 @@ public interface PartnershipApplicationFacade {
|
|||||||
* 현재 로그인 사용자가 작성한 최근 3건을 조회한다. 미인증이면 빈 목록.
|
* 현재 로그인 사용자가 작성한 최근 3건을 조회한다. 미인증이면 빈 목록.
|
||||||
*/
|
*/
|
||||||
List<PartnershipApplicationSummaryDTO> getMyRecentApplications();
|
List<PartnershipApplicationSummaryDTO> getMyRecentApplications();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 현재 로그인 사용자가 작성한 글 1건을 삭제한다(첨부파일 포함).
|
||||||
|
* 본인 글이 아니거나 이미 삭제된 경우 {@link IllegalArgumentException}.
|
||||||
|
*/
|
||||||
|
void deleteMyApplication(String id);
|
||||||
}
|
}
|
||||||
|
|||||||
+20
@@ -20,6 +20,7 @@ import java.util.Collections;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -74,4 +75,23 @@ public class PartnershipApplicationFacadeImpl implements PartnershipApplicationF
|
|||||||
List<PartnershipApplication> recent = partnershipApplicationService.findRecentByCreatedBy(user.getId());
|
List<PartnershipApplication> recent = partnershipApplicationService.findRecentByCreatedBy(user.getId());
|
||||||
return partnershipApplicationMapper.toSummaryDtoList(recent);
|
return partnershipApplicationMapper.toSummaryDtoList(recent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteMyApplication(String id) {
|
||||||
|
PortalAuthenticatedUser user = SecurityUtil.getPortalAuthenticatedUser();
|
||||||
|
if (user == null) {
|
||||||
|
throw new IllegalArgumentException("로그인이 필요합니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// id 만으로 조회하지 않고 createdBy 를 함께 걸어 타인 글 삭제를 원천 차단한다.
|
||||||
|
PartnershipApplication target = partnershipApplicationService
|
||||||
|
.findOwnedByCreatedBy(id, user.getId())
|
||||||
|
.orElseThrow(() -> new IllegalArgumentException("삭제할 수 있는 피드백/개선요청이 아닙니다."));
|
||||||
|
|
||||||
|
// 첨부파일도 함께 정리한다(관리자 삭제 PortalPartnershipManService.delete 와 동일 처리).
|
||||||
|
if (StringUtils.isNotBlank(target.getFileId())) {
|
||||||
|
fileService.deleteFile(target.getFileId());
|
||||||
|
}
|
||||||
|
partnershipApplicationService.deletePartnershipApplication(target);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+13
@@ -3,6 +3,7 @@ package com.eactive.apim.portal.apps.community.partnership.service;
|
|||||||
import com.eactive.apim.portal.apps.community.partnership.repository.PartnershipApplicationRepository;
|
import com.eactive.apim.portal.apps.community.partnership.repository.PartnershipApplicationRepository;
|
||||||
import com.eactive.apim.portal.partnershipapplication.entity.PartnershipApplication;
|
import com.eactive.apim.portal.partnershipapplication.entity.PartnershipApplication;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -30,4 +31,16 @@ public class PartnershipApplicationService {
|
|||||||
public List<PartnershipApplication> findRecentByCreatedBy(String createdBy) {
|
public List<PartnershipApplication> findRecentByCreatedBy(String createdBy) {
|
||||||
return partnershipApplicationRepository.findTop3ByCreatedByOrderByCreatedDateDesc(createdBy);
|
return partnershipApplicationRepository.findTop3ByCreatedByOrderByCreatedDateDesc(createdBy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 작성자 본인 글 단건 조회. id 와 createdBy 를 함께 조건으로 걸어 타인 글은 조회되지 않는다.
|
||||||
|
*/
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public Optional<PartnershipApplication> findOwnedByCreatedBy(String id, String createdBy) {
|
||||||
|
return partnershipApplicationRepository.findByIdAndCreatedBy(id, createdBy);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deletePartnershipApplication(PartnershipApplication partnershipApplication) {
|
||||||
|
partnershipApplicationRepository.delete(partnershipApplication);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-1
@@ -3,6 +3,8 @@ package com.eactive.apim.portal.apps.community.qna.controller;
|
|||||||
import com.eactive.apim.portal.apps.community.qna.dto.InquiryDTO;
|
import com.eactive.apim.portal.apps.community.qna.dto.InquiryDTO;
|
||||||
import com.eactive.apim.portal.apps.community.qna.dto.InquirySearch;
|
import com.eactive.apim.portal.apps.community.qna.dto.InquirySearch;
|
||||||
import com.eactive.apim.portal.apps.community.qna.service.InquiryFacade;
|
import com.eactive.apim.portal.apps.community.qna.service.InquiryFacade;
|
||||||
|
import com.eactive.apim.portal.common.security.WriteRateLimitService;
|
||||||
|
import com.eactive.apim.portal.common.security.WriteRateLimitService.WriteTarget;
|
||||||
import com.eactive.apim.portal.common.user.PortalAuthenticatedUser;
|
import com.eactive.apim.portal.common.user.PortalAuthenticatedUser;
|
||||||
import com.eactive.apim.portal.common.util.SecurityUtil;
|
import com.eactive.apim.portal.common.util.SecurityUtil;
|
||||||
import com.eactive.apim.portal.common.util.UserTypeUtil;
|
import com.eactive.apim.portal.common.util.UserTypeUtil;
|
||||||
@@ -37,11 +39,14 @@ public class InquiryController {
|
|||||||
public static final String REDIRECT_INQUIRY = "redirect:/inquiry";
|
public static final String REDIRECT_INQUIRY = "redirect:/inquiry";
|
||||||
private final InquiryFacade inquiryFacade;
|
private final InquiryFacade inquiryFacade;
|
||||||
private final InquiryCommentFacade inquiryCommentFacade;
|
private final InquiryCommentFacade inquiryCommentFacade;
|
||||||
|
private final WriteRateLimitService writeRateLimitService;
|
||||||
|
|
||||||
public InquiryController(InquiryFacade inquiryFacade,
|
public InquiryController(InquiryFacade inquiryFacade,
|
||||||
InquiryCommentFacade inquiryCommentFacade) {
|
InquiryCommentFacade inquiryCommentFacade,
|
||||||
|
WriteRateLimitService writeRateLimitService) {
|
||||||
this.inquiryFacade = inquiryFacade;
|
this.inquiryFacade = inquiryFacade;
|
||||||
this.inquiryCommentFacade = inquiryCommentFacade;
|
this.inquiryCommentFacade = inquiryCommentFacade;
|
||||||
|
this.writeRateLimitService = writeRateLimitService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -133,6 +138,13 @@ public class InquiryController {
|
|||||||
return APPS_COMMUNITY_MAIN_INQUIRY_FORM;
|
return APPS_COMMUNITY_MAIN_INQUIRY_FORM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 무제한 작성 차단 — 폼 전송이라 예외 대신 flash 메시지로 되돌린다.
|
||||||
|
if (writeRateLimitService.isExceeded(WriteTarget.INQUIRY)) {
|
||||||
|
redirectAttributes.addFlashAttribute("error",
|
||||||
|
writeRateLimitService.exceededMessage(WriteTarget.INQUIRY));
|
||||||
|
return REDIRECT_INQUIRY;
|
||||||
|
}
|
||||||
|
|
||||||
inquiryFacade.createInquiry(inquiryDTO, image);
|
inquiryFacade.createInquiry(inquiryDTO, image);
|
||||||
|
|
||||||
redirectAttributes.addFlashAttribute("success", "Q&A 작성이 완료되었습니다.");
|
redirectAttributes.addFlashAttribute("success", "Q&A 작성이 완료되었습니다.");
|
||||||
|
|||||||
+11
@@ -3,7 +3,9 @@ package com.eactive.apim.portal.apps.community.qna.repository;
|
|||||||
import com.eactive.apim.portal.portaluser.entity.PortalUser;
|
import com.eactive.apim.portal.portaluser.entity.PortalUser;
|
||||||
import com.eactive.apim.portal.qna.entity.Inquiry;
|
import com.eactive.apim.portal.qna.entity.Inquiry;
|
||||||
import com.eactive.eai.rms.data.EMSDataSource;
|
import com.eactive.eai.rms.data.EMSDataSource;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
@@ -17,4 +19,13 @@ public interface InquiryRepository extends JpaRepository<Inquiry, String>, JpaSp
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
long deleteByInquirer_Id(String inquirerId);
|
long deleteByInquirer_Id(String inquirerId);
|
||||||
|
|
||||||
|
/** 4010 테스트 cleanup 전용 — 작성자 + 제목 접두사로 테스트 문의글만 좁혀 조회한다. */
|
||||||
|
List<Inquiry> findAllByInquirer_IdAndInquirySubjectStartingWith(String inquirerId, String subjectPrefix);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 작성 빈도 제한 판정용 — 특정 작성자의 최근 글을 최신순으로 조회한다(Pageable 로 건수 제한).
|
||||||
|
* createdBy 는 PersonalDataEncryptConverter 로 결정적 암호화되므로 평문 사용자 id 로 등가 조회가 가능하다.
|
||||||
|
*/
|
||||||
|
List<Inquiry> findByCreatedByOrderByCreatedDateDesc(String createdBy, Pageable pageable);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ import com.eactive.apim.portal.portaluser.repository.UserPasswordHistoryReposito
|
|||||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
import com.eactive.apim.portal.template.entity.MessageCode;
|
||||||
import com.eactive.apim.portal.template.entity.MessageRequest;
|
import com.eactive.apim.portal.template.entity.MessageRequest;
|
||||||
import com.eactive.apim.portal.template.repository.MessageRequestRepository;
|
import com.eactive.apim.portal.template.repository.MessageRequestRepository;
|
||||||
|
import com.eactive.apim.portal.user.entity.UserLog;
|
||||||
|
import com.eactive.apim.portal.user.repository.UserLogRepository;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -74,6 +76,7 @@ public class LoginFinalizer {
|
|||||||
private final PortalOrgRepository portalOrgRepository;
|
private final PortalOrgRepository portalOrgRepository;
|
||||||
private final UserSessionService userSessionService;
|
private final UserSessionService userSessionService;
|
||||||
private final PortalPropertyService portalPropertyService;
|
private final PortalPropertyService portalPropertyService;
|
||||||
|
private final UserLogRepository userLogRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 로그인 확정 후처리를 수행하고 최종 이동 URL 을 반환한다.
|
* 로그인 확정 후처리를 수행하고 최종 이동 URL 을 반환한다.
|
||||||
@@ -96,11 +99,19 @@ public class LoginFinalizer {
|
|||||||
// 기존 세션이 끊기는 건인지) 기록한다. 현재 세션 등록(registerSession)은 이 뒤에 일어나므로
|
// 기존 세션이 끊기는 건인지) 기록한다. 현재 세션 등록(registerSession)은 이 뒤에 일어나므로
|
||||||
// 여기서 조회되는 활성 세션은 항상 "다른 곳"의 세션이다.
|
// 여기서 조회되는 활성 세션은 항상 "다른 곳"의 세션이다.
|
||||||
boolean duplicate = userSessionService.getActiveSession(normalizedUsername).isPresent();
|
boolean duplicate = userSessionService.getActiveSession(normalizedUsername).isPresent();
|
||||||
|
// 화면 표시용 "직전 로그인" 조회 — 이번 로그인 기록(logSuccess) 삽입 전에 조회해야
|
||||||
|
// 방금 로그인이 아닌 그 이전 성공 로그인을 얻는다.
|
||||||
|
Optional<UserLog> previousLogin = userLogRepository
|
||||||
|
.findFirstByLoginIdAndSuccessOrderByLoginTimeDesc(rawUsername, true);
|
||||||
userLogService.logSuccess(rawUsername, ip, sessionId, loginType, request.getHeader("User-Agent"),
|
userLogService.logSuccess(rawUsername, ip, sessionId, loginType, request.getHeader("User-Agent"),
|
||||||
duplicate);
|
duplicate);
|
||||||
|
|
||||||
String contextPath = request.getContextPath();
|
String contextPath = request.getContextPath();
|
||||||
HttpSession session = request.getSession();
|
HttpSession session = request.getSession();
|
||||||
|
previousLogin.ifPresent(log -> {
|
||||||
|
session.setAttribute("previousLoginDate", log.getLoginTime());
|
||||||
|
session.setAttribute("previousLoginIp", log.getIp());
|
||||||
|
});
|
||||||
|
|
||||||
applyPostLoginState(user, session, rawUsername, contextPath);
|
applyPostLoginState(user, session, rawUsername, contextPath);
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import lombok.NoArgsConstructor;
|
|||||||
* 인덱스 페이지 하단 통계 DTO
|
* 인덱스 페이지 하단 통계 DTO
|
||||||
* - API 활용 기업: 법인으로 등록된 수의 합계 (정상 상태)
|
* - API 활용 기업: 법인으로 등록된 수의 합계 (정상 상태)
|
||||||
* - 서비스 이용 수: 전체 법인이 생성한 앱의 합계 (이용 가능 상태)
|
* - 서비스 이용 수: 전체 법인이 생성한 앱의 합계 (이용 가능 상태)
|
||||||
* - API 이용 건수: 전체 법인이 생성한 앱의 API 수의 합계 (이용 가능 상태)
|
* - API 이용 건수 (월누적): 전체 법인 소속 게이트웨이 클라이언트의 이번 달 1일~오늘 누적 API 호출 건수
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@@ -37,8 +37,8 @@ public class IndexStatisticsDTO {
|
|||||||
private int activeAppCount;
|
private int activeAppCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API 이용 건수
|
* API 이용 건수 (월누적)
|
||||||
* 정상 상태 법인이 생성한 이용 가능 앱에 연결된 API의 총 수
|
* 정상 상태 법인 소속 게이트웨이 클라이언트의 이번 달 1일~오늘 누적 API 호출 건수
|
||||||
*/
|
*/
|
||||||
private int totalApiCount;
|
private int totalApiCount;
|
||||||
}
|
}
|
||||||
|
|||||||
+41
-6
@@ -1,14 +1,20 @@
|
|||||||
package com.eactive.apim.portal.apps.main.service;
|
package com.eactive.apim.portal.apps.main.service;
|
||||||
|
|
||||||
import com.eactive.apim.portal.app.entity.Credential;
|
import com.eactive.apim.gateway.data.statistics.repository.ApiStatsDayRepository;
|
||||||
|
import com.eactive.apim.gateway.data.statistics.repository.ApiStatsHourRepository;
|
||||||
|
import com.eactive.apim.gateway.data.statistics.repository.GwAuthClientRepository;
|
||||||
import com.eactive.apim.portal.app.repository.CredentialRepository;
|
import com.eactive.apim.portal.app.repository.CredentialRepository;
|
||||||
import com.eactive.apim.portal.apps.main.dto.IndexStatisticsDTO;
|
import com.eactive.apim.portal.apps.main.dto.IndexStatisticsDTO;
|
||||||
|
import com.eactive.apim.portal.apps.statistics.dto.ApiStatisticsSummaryDto;
|
||||||
import com.eactive.apim.portal.apps.user.repository.PortalOrgRepository;
|
import com.eactive.apim.portal.apps.user.repository.PortalOrgRepository;
|
||||||
import com.eactive.apim.portal.portalorg.entity.PortalOrgEnums.ApprovalStatus;
|
import com.eactive.apim.portal.portalorg.entity.PortalOrgEnums.ApprovalStatus;
|
||||||
import com.eactive.apim.portal.portalorg.entity.PortalOrgEnums.OrgStatus;
|
import com.eactive.apim.portal.portalorg.entity.PortalOrgEnums.OrgStatus;
|
||||||
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -31,6 +37,9 @@ public class IndexStatisticsService {
|
|||||||
|
|
||||||
private final PortalOrgRepository portalOrgRepository;
|
private final PortalOrgRepository portalOrgRepository;
|
||||||
private final CredentialRepository credentialRepository;
|
private final CredentialRepository credentialRepository;
|
||||||
|
private final GwAuthClientRepository gwAuthClientRepository;
|
||||||
|
private final ApiStatsDayRepository apiStatsDayRepository;
|
||||||
|
private final ApiStatsHourRepository apiStatsHourRepository;
|
||||||
private final PortalPropertyService portalPropertyService;
|
private final PortalPropertyService portalPropertyService;
|
||||||
|
|
||||||
// 캐시된 통계 데이터
|
// 캐시된 통계 데이터
|
||||||
@@ -91,11 +100,13 @@ public class IndexStatisticsService {
|
|||||||
// 3. 서비스 이용 수: 정상 기관의 이용 가능 앱 수
|
// 3. 서비스 이용 수: 정상 기관의 이용 가능 앱 수
|
||||||
activeAppCount = (int) credentialRepository.countActiveAppsByOrgIds(activeOrgIds);
|
activeAppCount = (int) credentialRepository.countActiveAppsByOrgIds(activeOrgIds);
|
||||||
|
|
||||||
// 4. API 이용 건수: 정상 기관의 이용 가능 앱에 연결된 API 수
|
// 4. API 이용 건수 (월누적): 정상 기관 소속 게이트웨이 클라이언트의 이번 달 1일~오늘 누적 호출 건수
|
||||||
List<Credential> activeApps = credentialRepository.findActiveAppsByOrgIds(activeOrgIds);
|
List<String> clientIds = gwAuthClientRepository.findClientIdsByOrgIdIn(activeOrgIds).stream()
|
||||||
totalApiCount = activeApps.stream()
|
.filter(id -> id != null && !id.trim().isEmpty())
|
||||||
.mapToInt(credential -> credential.getApiList() != null ? credential.getApiList().size() : 0)
|
.collect(Collectors.toList());
|
||||||
.sum();
|
if (!clientIds.isEmpty()) {
|
||||||
|
totalApiCount = (int) getMonthlyApiCallCount(clientIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cachedStatistics = IndexStatisticsDTO.builder()
|
cachedStatistics = IndexStatisticsDTO.builder()
|
||||||
@@ -125,6 +136,30 @@ public class IndexStatisticsService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 게이트웨이 클라이언트들의 이번 달 1일~오늘 누적 API 호출 건수(TOTAL_CNT 합산).
|
||||||
|
* 어제까지는 API_STATS_DAY(일별 집계), 오늘은 아직 DAY 미집계이므로 API_STATS_HOUR로 합산한다.
|
||||||
|
* ({@link com.eactive.apim.portal.apps.statistics.service.ApiStatisticsService#combineDayAndToday}와 동일 패턴)
|
||||||
|
*/
|
||||||
|
private long getMonthlyApiCallCount(List<String> clientIds) {
|
||||||
|
LocalDate today = LocalDate.now();
|
||||||
|
LocalDate monthStart = today.withDayOfMonth(1);
|
||||||
|
LocalDate dayEnd = today.minusDays(1);
|
||||||
|
|
||||||
|
long total = 0L;
|
||||||
|
if (!monthStart.isAfter(dayEnd)) {
|
||||||
|
total += nz(apiStatsDayRepository.findSummary(clientIds, monthStart, dayEnd).getTotalCount());
|
||||||
|
}
|
||||||
|
ApiStatisticsSummaryDto todaySummary = apiStatsHourRepository.findSummary(
|
||||||
|
clientIds, today.atStartOfDay(), today.atTime(LocalTime.MAX));
|
||||||
|
total += nz(todaySummary.getTotalCount());
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static long nz(Long value) {
|
||||||
|
return value != null ? value : 0L;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PortalProperty에서 통계 노출 여부 조회
|
* PortalProperty에서 통계 노출 여부 조회
|
||||||
* 프로퍼티가 없으면 기본값 "Y"를 DB에 저장 후 반환
|
* 프로퍼티가 없으면 기본값 "Y"를 DB에 저장 후 반환
|
||||||
|
|||||||
+8
-3
@@ -52,9 +52,10 @@ public class ApiStatisticsController {
|
|||||||
model.addAttribute("appList", apiStatisticsService.getAppListByOrg(orgId));
|
model.addAttribute("appList", apiStatisticsService.getAppListByOrg(orgId));
|
||||||
|
|
||||||
// 기본 조회 (일별, 7일 전 ~ 오늘, 전체 앱)
|
// 기본 조회 (일별, 7일 전 ~ 오늘, 전체 앱)
|
||||||
|
LocalDate today = LocalDate.now();
|
||||||
ApiStatisticsSearchDto searchDto = new ApiStatisticsSearchDto();
|
ApiStatisticsSearchDto searchDto = new ApiStatisticsSearchDto();
|
||||||
searchDto.setStartDate(LocalDate.now().minusDays(7));
|
searchDto.setStartDate(today.minusDays(7));
|
||||||
searchDto.setEndDate(LocalDate.now());
|
searchDto.setEndDate(today);
|
||||||
searchDto.setClientId(null);
|
searchDto.setClientId(null);
|
||||||
|
|
||||||
ApiStatisticsResultDto result = apiStatisticsService.getStatistics(orgId, searchDto);
|
ApiStatisticsResultDto result = apiStatisticsService.getStatistics(orgId, searchDto);
|
||||||
@@ -62,6 +63,9 @@ public class ApiStatisticsController {
|
|||||||
model.addAttribute("details", result.getDetails());
|
model.addAttribute("details", result.getDetails());
|
||||||
model.addAttribute("periods", result.getPeriods());
|
model.addAttribute("periods", result.getPeriods());
|
||||||
model.addAttribute("searchDto", searchDto);
|
model.addAttribute("searchDto", searchDto);
|
||||||
|
// 브라우저 시간대/시계와 관계없이 서버와 동일한 조회 경계를 적용한다.
|
||||||
|
model.addAttribute("statsMinDate", today.minusYears(1).toString());
|
||||||
|
model.addAttribute("statsMaxDate", today.toString());
|
||||||
|
|
||||||
// 월별 선택 가능 월 + 집계 안내 문구 데이터
|
// 월별 선택 가능 월 + 집계 안내 문구 데이터
|
||||||
model.addAttribute("availableMonths", apiStatisticsService.getAvailableMonths(orgId));
|
model.addAttribute("availableMonths", apiStatisticsService.getAvailableMonths(orgId));
|
||||||
@@ -124,7 +128,8 @@ public class ApiStatisticsController {
|
|||||||
private String rangeErrorMessage(ApiStatisticsSearchDto searchDto) {
|
private String rangeErrorMessage(ApiStatisticsSearchDto searchDto) {
|
||||||
return searchDto.isMonthly()
|
return searchDto.isMonthly()
|
||||||
? "조회할 월이 올바르지 않습니다."
|
? "조회할 월이 올바르지 않습니다."
|
||||||
: "조회 기간은 최대 " + ApiStatisticsSearchDto.MAX_DATE_RANGE_DAYS + "일까지 가능합니다.";
|
: "조회 기간은 1년 전부터 오늘까지의 날짜 중 최대 " + ApiStatisticsSearchDto.MAX_DATE_RANGE_DAYS
|
||||||
|
+ "일(시작일·종료일 포함)로 선택해주세요.";
|
||||||
}
|
}
|
||||||
|
|
||||||
private PortalOrg getPortalOrg() {
|
private PortalOrg getPortalOrg() {
|
||||||
|
|||||||
+9
-4
@@ -15,7 +15,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||||||
public class ApiStatisticsSearchDto {
|
public class ApiStatisticsSearchDto {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 최대 조회 가능 일수 (일별 모드).
|
* 한 번에 조회 가능한 일수 (일별 모드, 시작일·종료일 포함).
|
||||||
*/
|
*/
|
||||||
public static final int MAX_DATE_RANGE_DAYS = 40;
|
public static final int MAX_DATE_RANGE_DAYS = 40;
|
||||||
|
|
||||||
@@ -59,17 +59,22 @@ public class ApiStatisticsSearchDto {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 날짜(일별) 범위가 유효한지 검증 (최대 40일).
|
* 1년 전부터 오늘까지의 날짜 중 최대 40일인지 검증 (양 끝 포함).
|
||||||
*/
|
*/
|
||||||
public boolean isValidDateRange() {
|
public boolean isValidDateRange() {
|
||||||
|
return isValidDateRange(LocalDate.now());
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isValidDateRange(LocalDate today) {
|
||||||
if (startDate == null || endDate == null) {
|
if (startDate == null || endDate == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (startDate.isAfter(endDate)) {
|
if (startDate.isAfter(endDate)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
long daysBetween = ChronoUnit.DAYS.between(startDate, endDate);
|
LocalDate earliestDate = today.minusYears(1);
|
||||||
return daysBetween <= MAX_DATE_RANGE_DAYS;
|
return !startDate.isBefore(earliestDate) && !endDate.isAfter(today)
|
||||||
|
&& ChronoUnit.DAYS.between(startDate, endDate) < MAX_DATE_RANGE_DAYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.eactive.apim.portal.apps.user.controller;
|
package com.eactive.apim.portal.apps.user.controller;
|
||||||
|
|
||||||
|
import com.eactive.apim.portal.apps.agreements.service.AgreementFormModelSupport;
|
||||||
import com.eactive.apim.portal.apps.agreements.service.AgreementsFacade;
|
import com.eactive.apim.portal.apps.agreements.service.AgreementsFacade;
|
||||||
import com.eactive.apim.portal.apps.auth.twofactor.StepUpProtectedPaths;
|
import com.eactive.apim.portal.apps.auth.twofactor.StepUpProtectedPaths;
|
||||||
import com.eactive.apim.portal.apps.auth.twofactor.TwoFactorProperties;
|
import com.eactive.apim.portal.apps.auth.twofactor.TwoFactorProperties;
|
||||||
@@ -9,6 +10,7 @@ import com.eactive.apim.portal.apps.session.service.UserSessionService;
|
|||||||
import com.eactive.apim.portal.apps.user.dto.*;
|
import com.eactive.apim.portal.apps.user.dto.*;
|
||||||
import com.eactive.apim.portal.apps.user.facade.OrgRegisterFacade;
|
import com.eactive.apim.portal.apps.user.facade.OrgRegisterFacade;
|
||||||
import com.eactive.apim.portal.apps.user.facade.UserFacade;
|
import com.eactive.apim.portal.apps.user.facade.UserFacade;
|
||||||
|
import com.eactive.apim.portal.common.security.PasswordConfirmFailureTracker;
|
||||||
import com.eactive.apim.portal.common.user.PortalAuthenticatedUser;
|
import com.eactive.apim.portal.common.user.PortalAuthenticatedUser;
|
||||||
import com.eactive.apim.portal.common.util.PhoneNumberUtil;
|
import com.eactive.apim.portal.common.util.PhoneNumberUtil;
|
||||||
import com.eactive.apim.portal.common.util.SecurityUtil;
|
import com.eactive.apim.portal.common.util.SecurityUtil;
|
||||||
@@ -50,11 +52,13 @@ public class AccountController {
|
|||||||
private final UserFacade userFacade;
|
private final UserFacade userFacade;
|
||||||
private final OrgRegisterFacade orgRegisterFacade;
|
private final OrgRegisterFacade orgRegisterFacade;
|
||||||
private final AgreementsFacade agreementsFacade;
|
private final AgreementsFacade agreementsFacade;
|
||||||
|
private final AgreementFormModelSupport agreementFormModelSupport;
|
||||||
private final com.eactive.apim.portal.apps.user.facade.AuthFacade authFacade;
|
private final com.eactive.apim.portal.apps.user.facade.AuthFacade authFacade;
|
||||||
private final UserInvitationRepository userInvitationRepository;
|
private final UserInvitationRepository userInvitationRepository;
|
||||||
private final UserSessionService userSessionService;
|
private final UserSessionService userSessionService;
|
||||||
private final TwoFactorService twoFactorService;
|
private final TwoFactorService twoFactorService;
|
||||||
private final TwoFactorProperties twoFactorProperties;
|
private final TwoFactorProperties twoFactorProperties;
|
||||||
|
private final PasswordConfirmFailureTracker passwordConfirmFailureTracker;
|
||||||
|
|
||||||
|
|
||||||
/** 비밀번호 변경 화면 라이브 체크: 입력 중인 비밀번호에 아이디/휴대전화가 포함되는지 (민감정보는 응답에 미포함) */
|
/** 비밀번호 변경 화면 라이브 체크: 입력 중인 비밀번호에 아이디/휴대전화가 포함되는지 (민감정보는 응답에 미포함) */
|
||||||
@@ -65,12 +69,18 @@ public class AccountController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/password/confirm")
|
@PostMapping("/password/confirm")
|
||||||
public ResponseEntity<ValidationResponse> confirmPassword(@RequestParam String inputPassword) {
|
public ResponseEntity<ValidationResponse> confirmPassword(@RequestParam String inputPassword,
|
||||||
|
HttpSession session, HttpServletRequest request, HttpServletResponse response) {
|
||||||
String currentLoginId = SecurityUtil.getCurrentLoginId();
|
String currentLoginId = SecurityUtil.getCurrentLoginId();
|
||||||
boolean isPasswordCorrect = userFacade.verifyCurrentPassword(currentLoginId, inputPassword);
|
if (userFacade.verifyCurrentPassword(currentLoginId, inputPassword)) {
|
||||||
|
passwordConfirmFailureTracker.reset(session);
|
||||||
|
return ResponseEntity.ok(new ValidationResponse(true, "비밀번호가 확인되었습니다."));
|
||||||
|
}
|
||||||
|
|
||||||
String message = isPasswordCorrect ? "비밀번호가 확인되었습니다." : "비밀번호가 일치하지 않습니다.";
|
// 무제한 시도 차단 — step-up 확인 페이지와 동일한 카운터/정책을 쓴다.
|
||||||
return ResponseEntity.ok(new ValidationResponse(isPasswordCorrect, message));
|
PasswordConfirmFailureTracker.Outcome outcome =
|
||||||
|
passwordConfirmFailureTracker.recordFailure(session, request, response);
|
||||||
|
return ResponseEntity.ok(new ValidationResponse(false, outcome.getMessage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/password/verify")
|
@GetMapping("/password/verify")
|
||||||
@@ -96,15 +106,29 @@ public class AccountController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/password/verify")
|
@PostMapping("/password/verify")
|
||||||
public String verifyCurrentPassword(@RequestParam String currentPassword, RedirectAttributes redirectAttributes, HttpSession session, Model model) {
|
public String verifyCurrentPassword(@RequestParam String currentPassword, RedirectAttributes redirectAttributes,
|
||||||
|
HttpSession session, HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||||
String currentLoginId = SecurityUtil.getCurrentLoginId();
|
String currentLoginId = SecurityUtil.getCurrentLoginId();
|
||||||
if (userFacade.verifyCurrentPassword(currentLoginId, currentPassword)) {
|
if (userFacade.verifyCurrentPassword(currentLoginId, currentPassword)) {
|
||||||
|
passwordConfirmFailureTracker.reset(session);
|
||||||
model.addAttribute("passwordChangeRequest", new PasswordChangeRequestDTO());
|
model.addAttribute("passwordChangeRequest", new PasswordChangeRequestDTO());
|
||||||
|
// GET /password/change 와 동일하게 2FA 필요 여부를 내려준다.
|
||||||
|
// 누락되면 폼 JS 가 제출 가로채기(비밀번호 규칙 게이트 + 2FA 팝업)를 등록하지 않아
|
||||||
|
// 서버가 통과권 없음으로 계속 되돌리고 비밀번호를 바꿀 수 없다.
|
||||||
|
model.addAttribute("twofaRequired", isPwChangeTwofaRequired(session));
|
||||||
return "apps/mypage/passwordChange";
|
return "apps/mypage/passwordChange";
|
||||||
} else {
|
|
||||||
redirectAttributes.addFlashAttribute("error", "현재 비밀번호가 일치하지 않습니다.");
|
|
||||||
return "redirect:/password/verify";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 무제한 시도 차단 — 임계 초과 시 정책(로그아웃/계정 차단)에 따라 조치한다.
|
||||||
|
PasswordConfirmFailureTracker.Outcome outcome =
|
||||||
|
passwordConfirmFailureTracker.recordFailure(session, request, response);
|
||||||
|
if (outcome.isForcedLogout()) {
|
||||||
|
return outcome.isAccountLocked()
|
||||||
|
? "redirect:/login?pwFailExceeded=1&locked=1"
|
||||||
|
: "redirect:/login?pwFailExceeded=1";
|
||||||
|
}
|
||||||
|
redirectAttributes.addFlashAttribute("error", outcome.getMessage());
|
||||||
|
return "redirect:/password/verify";
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/password/change")
|
@PostMapping("/password/change")
|
||||||
@@ -343,6 +367,8 @@ public class AccountController {
|
|||||||
model.addAttribute("termsOfUse", agreementsFacade.getAgreement("TERMS_OF_USE"));
|
model.addAttribute("termsOfUse", agreementsFacade.getAgreement("TERMS_OF_USE"));
|
||||||
model.addAttribute("privacyCollect", agreementsFacade.getAgreement("PRIVACY_COLLECT"));
|
model.addAttribute("privacyCollect", agreementsFacade.getAgreement("PRIVACY_COLLECT"));
|
||||||
model.addAttribute("registrationType", "corporate");
|
model.addAttribute("registrationType", "corporate");
|
||||||
|
// 동의 항목 구성은 이 화면 그대로 두고 '전체 동의' 허용 여부만 설정을 따른다
|
||||||
|
agreementFormModelSupport.applyAgreeAllMode(model);
|
||||||
return "apps/mypage/orgTransfer";
|
return "apps/mypage/orgTransfer";
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
+6
-8
@@ -1,6 +1,6 @@
|
|||||||
package com.eactive.apim.portal.apps.user.controller;
|
package com.eactive.apim.portal.apps.user.controller;
|
||||||
|
|
||||||
import com.eactive.apim.portal.apps.agreements.service.AgreementsFacade;
|
import com.eactive.apim.portal.apps.agreements.service.AgreementFormModelSupport;
|
||||||
import com.eactive.apim.portal.apps.user.dto.PortalOrgRegistrationDTO;
|
import com.eactive.apim.portal.apps.user.dto.PortalOrgRegistrationDTO;
|
||||||
import com.eactive.apim.portal.apps.user.dto.UserAgreementDTO;
|
import com.eactive.apim.portal.apps.user.dto.UserAgreementDTO;
|
||||||
import com.eactive.apim.portal.apps.user.dto.ValidationResponse;
|
import com.eactive.apim.portal.apps.user.dto.ValidationResponse;
|
||||||
@@ -21,7 +21,7 @@ public class OrgRegisterController {
|
|||||||
private static final String MAIN_ORG_REGISTER = "apps/register/orgUserRegister";
|
private static final String MAIN_ORG_REGISTER = "apps/register/orgUserRegister";
|
||||||
private static final String MAIN_REGISTER_RESULT = "apps/register/userRegisterResult";
|
private static final String MAIN_REGISTER_RESULT = "apps/register/userRegisterResult";
|
||||||
|
|
||||||
private final AgreementsFacade agreementsFacade;
|
private final AgreementFormModelSupport agreementFormModelSupport;
|
||||||
private final PortalProperties portalProperties;
|
private final PortalProperties portalProperties;
|
||||||
private final OrgRegisterFacade orgRegisterFacade;
|
private final OrgRegisterFacade orgRegisterFacade;
|
||||||
|
|
||||||
@@ -30,9 +30,8 @@ public class OrgRegisterController {
|
|||||||
model.addAttribute("registrationType", "corporate");
|
model.addAttribute("registrationType", "corporate");
|
||||||
model.addAttribute("authTtl", portalProperties.getAuthTtl());
|
model.addAttribute("authTtl", portalProperties.getAuthTtl());
|
||||||
model.addAttribute("portalOrg", new PortalOrgRegistrationDTO());
|
model.addAttribute("portalOrg", new PortalOrgRegistrationDTO());
|
||||||
model.addAttribute("termsOfUse", agreementsFacade.getAgreement("TERMS_OF_USE"));
|
// 사용하지 않도록 설정한 약관 종류는 동의 항목을 노출하지 않는다 (관리 콘솔 > 약관 종류 관리)
|
||||||
model.addAttribute("privacyCollect", agreementsFacade.getAgreement("PRIVACY_COLLECT"));
|
agreementFormModelSupport.applyAgreements(model);
|
||||||
model.addAttribute("notificationConsent", agreementsFacade.getAgreement("NOTIFICATION_CONSENT"));
|
|
||||||
return MAIN_ORG_REGISTER;
|
return MAIN_ORG_REGISTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,8 +104,7 @@ public class OrgRegisterController {
|
|||||||
model.addAttribute("registrationType", "corporate");
|
model.addAttribute("registrationType", "corporate");
|
||||||
model.addAttribute("portalOrg", orgDTO);
|
model.addAttribute("portalOrg", orgDTO);
|
||||||
model.addAttribute("error", errorMessage);
|
model.addAttribute("error", errorMessage);
|
||||||
model.addAttribute("termsOfUse", agreementsFacade.getAgreement("TERMS_OF_USE"));
|
// 사용하지 않도록 설정한 약관 종류는 동의 항목을 노출하지 않는다 (관리 콘솔 > 약관 종류 관리)
|
||||||
model.addAttribute("privacyCollect", agreementsFacade.getAgreement("PRIVACY_COLLECT"));
|
agreementFormModelSupport.applyAgreements(model);
|
||||||
model.addAttribute("notificationConsent", agreementsFacade.getAgreement("NOTIFICATION_CONSENT"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.eactive.apim.portal.apps.user.controller;
|
package com.eactive.apim.portal.apps.user.controller;
|
||||||
|
|
||||||
|
import com.eactive.apim.portal.agreements.entity.AgreementType;
|
||||||
|
import com.eactive.apim.portal.agreements.service.AgreementTypeConfigService;
|
||||||
import com.eactive.apim.portal.apps.user.dto.PortalUserDTO;
|
import com.eactive.apim.portal.apps.user.dto.PortalUserDTO;
|
||||||
import com.eactive.apim.portal.apps.user.facade.UserManFacade;
|
import com.eactive.apim.portal.apps.user.facade.UserManFacade;
|
||||||
import com.eactive.apim.portal.common.util.SecurityUtil;
|
import com.eactive.apim.portal.common.util.SecurityUtil;
|
||||||
@@ -24,6 +26,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
public class UserManController {
|
public class UserManController {
|
||||||
|
|
||||||
private final UserManFacade userManFacade;
|
private final UserManFacade userManFacade;
|
||||||
|
private final AgreementTypeConfigService agreementTypeConfigService;
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public String userList(@PageableDefault(sort = "createdDate", direction = Sort.Direction.DESC) Pageable pageable, Model model) {
|
public String userList(@PageableDefault(sort = "createdDate", direction = Sort.Direction.DESC) Pageable pageable, Model model) {
|
||||||
@@ -34,6 +37,10 @@ public class UserManController {
|
|||||||
model.addAttribute("pendingUsers", pendingUsers);
|
model.addAttribute("pendingUsers", pendingUsers);
|
||||||
model.addAttribute("page", users);
|
model.addAttribute("page", users);
|
||||||
model.addAttribute("currentUserId", SecurityUtil.getPortalAuthenticatedUser().getId());
|
model.addAttribute("currentUserId", SecurityUtil.getPortalAuthenticatedUser().getId());
|
||||||
|
// 초대/초대 취소 팝업의 알림 수신 동의 체크박스 노출 여부.
|
||||||
|
// 약관 페이지에 배치되어 있어야(= 사용 중이고 미배치가 아니어야) 동의서 링크를 안내할 수 있다.
|
||||||
|
model.addAttribute("notificationConsentAvailable",
|
||||||
|
agreementTypeConfigService.isDisplayed(AgreementType.NOTIFICATION_CONSENT));
|
||||||
return "apps/users/userList";
|
return "apps/users/userList";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-22
@@ -1,6 +1,6 @@
|
|||||||
package com.eactive.apim.portal.apps.user.controller;
|
package com.eactive.apim.portal.apps.user.controller;
|
||||||
|
|
||||||
import com.eactive.apim.portal.apps.agreements.service.AgreementsFacade;
|
import com.eactive.apim.portal.apps.agreements.service.AgreementFormModelSupport;
|
||||||
import com.eactive.apim.portal.apps.user.dto.PortalUserRegistrationDTO;
|
import com.eactive.apim.portal.apps.user.dto.PortalUserRegistrationDTO;
|
||||||
import com.eactive.apim.portal.apps.user.dto.UserAgreementDTO;
|
import com.eactive.apim.portal.apps.user.dto.UserAgreementDTO;
|
||||||
import com.eactive.apim.portal.apps.user.dto.ValidationResponse;
|
import com.eactive.apim.portal.apps.user.dto.ValidationResponse;
|
||||||
@@ -10,7 +10,6 @@ import com.eactive.apim.portal.apps.user.repository.PortalOrgRepository;
|
|||||||
import com.eactive.apim.portal.apps.user.service.PortalUserAuthService;
|
import com.eactive.apim.portal.apps.user.service.PortalUserAuthService;
|
||||||
import com.eactive.apim.portal.apps.user.service.PortalUserService;
|
import com.eactive.apim.portal.apps.user.service.PortalUserService;
|
||||||
import com.eactive.apim.portal.apps.user.validator.AgreementValidator;
|
import com.eactive.apim.portal.apps.user.validator.AgreementValidator;
|
||||||
import com.eactive.apim.portal.common.util.EncryptionUtil;
|
|
||||||
import com.eactive.apim.portal.common.util.PhoneNumberUtil;
|
import com.eactive.apim.portal.common.util.PhoneNumberUtil;
|
||||||
import com.eactive.apim.portal.common.util.SecurityUtil;
|
import com.eactive.apim.portal.common.util.SecurityUtil;
|
||||||
import com.eactive.apim.portal.config.PortalProperties;
|
import com.eactive.apim.portal.config.PortalProperties;
|
||||||
@@ -22,21 +21,15 @@ import com.eactive.apim.portal.portaluser.entity.PortalUser;
|
|||||||
import com.eactive.apim.portal.portaluser.entity.PortalUserEnums;
|
import com.eactive.apim.portal.portaluser.entity.PortalUserEnums;
|
||||||
import com.eactive.apim.portal.portaluser.repository.PortalUserRepository;
|
import com.eactive.apim.portal.portaluser.repository.PortalUserRepository;
|
||||||
|
|
||||||
import java.security.InvalidKeyException;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import javax.crypto.BadPaddingException;
|
|
||||||
import javax.crypto.IllegalBlockSizeException;
|
|
||||||
import javax.crypto.NoSuchPaddingException;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.xerces.impl.dv.util.Base64;
|
|
||||||
import org.springframework.security.access.annotation.Secured;
|
import org.springframework.security.access.annotation.Secured;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
@@ -61,10 +54,9 @@ public class UserRegisterController {
|
|||||||
private final AuthFacade authFacade;
|
private final AuthFacade authFacade;
|
||||||
private final PortalUserRepository portalUserRepository;
|
private final PortalUserRepository portalUserRepository;
|
||||||
private final PortalOrgRepository portalOrgRepository;
|
private final PortalOrgRepository portalOrgRepository;
|
||||||
private final AgreementsFacade agreementsFacade;
|
private final AgreementFormModelSupport agreementFormModelSupport;
|
||||||
private final PortalProperties portalProperties;
|
private final PortalProperties portalProperties;
|
||||||
private final UserInvitationRepository userInvitationRepository;
|
private final UserInvitationRepository userInvitationRepository;
|
||||||
private final EncryptionUtil encryptionUtil;
|
|
||||||
private final AgreementValidator agreementValidator;
|
private final AgreementValidator agreementValidator;
|
||||||
private final PortalUserAuthService portalUserAuthService;
|
private final PortalUserAuthService portalUserAuthService;
|
||||||
|
|
||||||
@@ -102,9 +94,8 @@ public class UserRegisterController {
|
|||||||
|
|
||||||
model.addAttribute("authTtl", portalProperties.getAuthTtl());
|
model.addAttribute("authTtl", portalProperties.getAuthTtl());
|
||||||
model.addAttribute("portalUser", new PortalUserRegistrationDTO());
|
model.addAttribute("portalUser", new PortalUserRegistrationDTO());
|
||||||
model.addAttribute("termsOfUse", agreementsFacade.getAgreement("TERMS_OF_USE"));
|
// 사용하지 않도록 설정한 약관 종류는 동의 항목을 노출하지 않는다 (관리 콘솔 > 약관 종류 관리)
|
||||||
model.addAttribute("privacyCollect", agreementsFacade.getAgreement("PRIVACY_COLLECT"));
|
agreementFormModelSupport.applyAgreements(model);
|
||||||
model.addAttribute("notificationConsent", agreementsFacade.getAgreement("NOTIFICATION_CONSENT"));
|
|
||||||
|
|
||||||
return MAIN_USER_REGISTER;
|
return MAIN_USER_REGISTER;
|
||||||
|
|
||||||
@@ -368,9 +359,8 @@ public class UserRegisterController {
|
|||||||
model.addAttribute("userName", SecurityUtil.getPortalAuthenticatedUser().getUsername());
|
model.addAttribute("userName", SecurityUtil.getPortalAuthenticatedUser().getUsername());
|
||||||
model.addAttribute("orgName", org.get().getOrgName());
|
model.addAttribute("orgName", org.get().getOrgName());
|
||||||
model.addAttribute("invitationCode", invitation.get().getToken());
|
model.addAttribute("invitationCode", invitation.get().getToken());
|
||||||
model.addAttribute("termsOfUse", agreementsFacade.getAgreement("TERMS_OF_USE"));
|
// 사용하지 않도록 설정한 약관 종류는 동의 항목을 노출하지 않는다 (관리 콘솔 > 약관 종류 관리)
|
||||||
model.addAttribute("privacyCollect", agreementsFacade.getAgreement("PRIVACY_COLLECT"));
|
agreementFormModelSupport.applyAgreements(model);
|
||||||
model.addAttribute("notificationConsent", agreementsFacade.getAgreement("NOTIFICATION_CONSENT"));
|
|
||||||
model.addAttribute("agreementTitle", "법인 회원 전환을 위한 약관 동의");
|
model.addAttribute("agreementTitle", "법인 회원 전환을 위한 약관 동의");
|
||||||
model.addAttribute("registrationType", "corporate");
|
model.addAttribute("registrationType", "corporate");
|
||||||
|
|
||||||
@@ -399,9 +389,8 @@ public class UserRegisterController {
|
|||||||
|
|
||||||
model.addAttribute("userName", SecurityUtil.getPortalAuthenticatedUser().getUsername());
|
model.addAttribute("userName", SecurityUtil.getPortalAuthenticatedUser().getUsername());
|
||||||
model.addAttribute("orgName", org.get().getOrgName());
|
model.addAttribute("orgName", org.get().getOrgName());
|
||||||
model.addAttribute("termsOfUse", agreementsFacade.getAgreement("TERMS_OF_USE"));
|
// 사용하지 않도록 설정한 약관 종류는 동의 항목을 노출하지 않는다 (관리 콘솔 > 약관 종류 관리)
|
||||||
model.addAttribute("privacyCollect", agreementsFacade.getAgreement("PRIVACY_COLLECT"));
|
agreementFormModelSupport.applyAgreements(model);
|
||||||
model.addAttribute("notificationConsent", agreementsFacade.getAgreement("NOTIFICATION_CONSENT"));
|
|
||||||
model.addAttribute("agreementTitle", "법인 회원 전환을 위한 약관 동의");
|
model.addAttribute("agreementTitle", "법인 회원 전환을 위한 약관 동의");
|
||||||
model.addAttribute("registrationType", "corporate");
|
model.addAttribute("registrationType", "corporate");
|
||||||
|
|
||||||
@@ -443,9 +432,8 @@ public class UserRegisterController {
|
|||||||
model.addAttribute("error", errorMessage);
|
model.addAttribute("error", errorMessage);
|
||||||
model.addAttribute("agreement", agreement);
|
model.addAttribute("agreement", agreement);
|
||||||
|
|
||||||
model.addAttribute("termsOfUse", agreementsFacade.getAgreement("TERMS_OF_USE"));
|
// 사용하지 않도록 설정한 약관 종류는 동의 항목을 노출하지 않는다 (관리 콘솔 > 약관 종류 관리)
|
||||||
model.addAttribute("privacyCollect", agreementsFacade.getAgreement("PRIVACY_COLLECT"));
|
agreementFormModelSupport.applyAgreements(model);
|
||||||
model.addAttribute("notificationConsent", agreementsFacade.getAgreement("NOTIFICATION_CONSENT"));
|
|
||||||
model.addAttribute("msgType", "sms");
|
model.addAttribute("msgType", "sms");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -35,8 +35,8 @@ public class UserRegisterRestController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/check_password_match")
|
@PostMapping("/check_password_match")
|
||||||
public ResponseEntity<ValidationResponse> checkPasswordMatch(@RequestParam String password, @RequestParam String password2) {
|
public ResponseEntity<ValidationResponse> checkPasswordMatch(@RequestParam String password, @RequestParam String confirmPassword) {
|
||||||
return ResponseEntity.ok(userRegisterFacade.checkPasswordMatch(password, password2));
|
return ResponseEntity.ok(userRegisterFacade.checkPasswordMatch(password, confirmPassword));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/register/confirm_password")
|
@PostMapping("/register/confirm_password")
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import org.hibernate.validator.constraints.NotEmpty;
|
|||||||
|
|
||||||
|
|
||||||
@AuthNumberMatch(recipient = "loginId", authField = "authNumber")
|
@AuthNumberMatch(recipient = "loginId", authField = "authNumber")
|
||||||
@PasswordMatch(input = "password", confirm = "password2")
|
@PasswordMatch(input = "password", confirm = "confirmPassword")
|
||||||
@Data
|
@Data
|
||||||
@PasswordRule(password = "password", loginId = "loginId", mobile = "mobileNumber")
|
@PasswordRule(password = "password", loginId = "loginId", mobile = "mobileNumber")
|
||||||
public class PortalUserRegistrationDTO {
|
public class PortalUserRegistrationDTO {
|
||||||
@@ -31,8 +31,6 @@ public class PortalUserRegistrationDTO {
|
|||||||
*/
|
*/
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
private String password2;
|
|
||||||
|
|
||||||
@CellPhone
|
@CellPhone
|
||||||
private String mobileNumber;
|
private String mobileNumber;
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ import com.eactive.apim.portal.apps.user.service.PortalOrgService;
|
|||||||
import com.eactive.apim.portal.apps.user.service.PortalUserService;
|
import com.eactive.apim.portal.apps.user.service.PortalUserService;
|
||||||
import com.eactive.apim.portal.apps.user.service.UserRegistrationValidationService;
|
import com.eactive.apim.portal.apps.user.service.UserRegistrationValidationService;
|
||||||
import com.eactive.apim.portal.apps.user.validator.AgreementValidator;
|
import com.eactive.apim.portal.apps.user.validator.AgreementValidator;
|
||||||
import com.eactive.apim.portal.common.exception.SystemException;
|
|
||||||
import com.eactive.apim.portal.common.util.EncryptionUtil;
|
|
||||||
import com.eactive.apim.portal.file.entity.FileInfo;
|
import com.eactive.apim.portal.file.entity.FileInfo;
|
||||||
import com.eactive.apim.portal.file.service.FileService;
|
import com.eactive.apim.portal.file.service.FileService;
|
||||||
import com.eactive.apim.portal.file.service.FileTypeContext;
|
import com.eactive.apim.portal.file.service.FileTypeContext;
|
||||||
@@ -20,26 +18,14 @@ import com.eactive.apim.portal.portalorg.entity.PortalOrg;
|
|||||||
import com.eactive.apim.portal.portaluser.entity.PortalUser;
|
import com.eactive.apim.portal.portaluser.entity.PortalUser;
|
||||||
import com.eactive.apim.portal.portaluser.entity.PortalUserEnums;
|
import com.eactive.apim.portal.portaluser.entity.PortalUserEnums;
|
||||||
import com.eactive.apim.portal.portaluser.repository.PortalUserRepository;
|
import com.eactive.apim.portal.portaluser.repository.PortalUserRepository;
|
||||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
|
||||||
import com.eactive.apim.portal.template.service.MessageHandlerService;
|
|
||||||
import com.eactive.apim.portal.template.service.MessageRecipient;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.xerces.impl.dv.util.Base64;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.crypto.BadPaddingException;
|
|
||||||
import javax.crypto.IllegalBlockSizeException;
|
|
||||||
import javax.crypto.NoSuchPaddingException;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.security.InvalidKeyException;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@@ -58,8 +44,6 @@ public class OrgRegisterFacadeImpl implements OrgRegisterFacade {
|
|||||||
private final PasswordEncoder passwordEncoder;
|
private final PasswordEncoder passwordEncoder;
|
||||||
private final AgreementValidator agreementValidator;
|
private final AgreementValidator agreementValidator;
|
||||||
private final ApprovalService approvalService;
|
private final ApprovalService approvalService;
|
||||||
private final MessageHandlerService messageHandlerService;
|
|
||||||
private final EncryptionUtil encryptionUtil;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -101,9 +85,6 @@ public class OrgRegisterFacadeImpl implements OrgRegisterFacade {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
FileInfo uploadedFile = handleFileUpload(orgDTO.getFiles());
|
FileInfo uploadedFile = handleFileUpload(orgDTO.getFiles());
|
||||||
if (uploadedFile == null) {
|
|
||||||
return new ValidationResponse(false, "첨부파일이 올바르지 않습니다.");
|
|
||||||
}
|
|
||||||
return registerNewCorporateUser(orgDTO, uploadedFile, emailVerified);
|
return registerNewCorporateUser(orgDTO, uploadedFile, emailVerified);
|
||||||
} catch (IllegalArgumentException | IOException e) {
|
} catch (IllegalArgumentException | IOException e) {
|
||||||
return new ValidationResponse(false, e.getMessage());
|
return new ValidationResponse(false, e.getMessage());
|
||||||
@@ -129,9 +110,6 @@ public class OrgRegisterFacadeImpl implements OrgRegisterFacade {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
FileInfo uploadedFile = handleFileUpload(orgDTO.getFiles());
|
FileInfo uploadedFile = handleFileUpload(orgDTO.getFiles());
|
||||||
if (uploadedFile == null) {
|
|
||||||
return new ValidationResponse(false, "첨부파일이 올바르지 않습니다.");
|
|
||||||
}
|
|
||||||
return convertExistingUserToCorporate(existingUser, orgDTO, uploadedFile);
|
return convertExistingUserToCorporate(existingUser, orgDTO, uploadedFile);
|
||||||
} catch (IllegalArgumentException | IOException e) {
|
} catch (IllegalArgumentException | IOException e) {
|
||||||
return new ValidationResponse(false, e.getMessage());
|
return new ValidationResponse(false, e.getMessage());
|
||||||
@@ -155,9 +133,6 @@ public class OrgRegisterFacadeImpl implements OrgRegisterFacade {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
FileInfo uploadedFile = handleFileUpload(orgDTO.getFiles());
|
FileInfo uploadedFile = handleFileUpload(orgDTO.getFiles());
|
||||||
if (uploadedFile == null) {
|
|
||||||
return new ValidationResponse(false, "첨부파일이 올바르지 않습니다.");
|
|
||||||
}
|
|
||||||
return convertExistingUserToCorporate(existingUser, orgDTO, uploadedFile);
|
return convertExistingUserToCorporate(existingUser, orgDTO, uploadedFile);
|
||||||
} catch (IllegalArgumentException | IOException e) {
|
} catch (IllegalArgumentException | IOException e) {
|
||||||
return new ValidationResponse(false, e.getMessage());
|
return new ValidationResponse(false, e.getMessage());
|
||||||
@@ -184,9 +159,6 @@ public class OrgRegisterFacadeImpl implements OrgRegisterFacade {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
FileInfo uploadedFile = handleFileUpload(orgDTO.getFiles());
|
FileInfo uploadedFile = handleFileUpload(orgDTO.getFiles());
|
||||||
if (uploadedFile == null) {
|
|
||||||
return new ValidationResponse(false, "첨부파일이 올바르지 않습니다.");
|
|
||||||
}
|
|
||||||
return registerNewCorporateUserWithExistingData(orgDTO, existingUser, newEmail, uploadedFile);
|
return registerNewCorporateUserWithExistingData(orgDTO, existingUser, newEmail, uploadedFile);
|
||||||
} catch (IllegalArgumentException | IOException e) {
|
} catch (IllegalArgumentException | IOException e) {
|
||||||
return new ValidationResponse(false, e.getMessage());
|
return new ValidationResponse(false, e.getMessage());
|
||||||
@@ -213,29 +185,10 @@ public class OrgRegisterFacadeImpl implements OrgRegisterFacade {
|
|||||||
agreementsFacade.saveUserAgreements(newUser.getId(), AgreementType.PRIVACY_COLLECT);
|
agreementsFacade.saveUserAgreements(newUser.getId(), AgreementType.PRIVACY_COLLECT);
|
||||||
|
|
||||||
approvalService.createUserApproval(newUser);
|
approvalService.createUserApproval(newUser);
|
||||||
// 11.28 - 회원 가입단계가 아닌 로그인 단계로 이메일 인증 이동
|
|
||||||
// sendActivationEmail(newUser);
|
|
||||||
|
|
||||||
return new ValidationResponse(true, "법인 사용자 등록 신청이 완료되었습니다.");
|
return new ValidationResponse(true, "법인 사용자 등록 신청이 완료되었습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendActivationEmail(PortalUser newUser) {
|
|
||||||
MessageRecipient recipient = new MessageRecipient();
|
|
||||||
recipient.setUsername(newUser.getUserName());
|
|
||||||
recipient.setUserId(newUser.getEmailAddr());
|
|
||||||
recipient.setPhone(newUser.getMobileNumber());
|
|
||||||
HashMap<String, Object> params = new HashMap<>();
|
|
||||||
String tokenValue = newUser.getCreatedDate().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + ":" + newUser.getId();
|
|
||||||
|
|
||||||
try {
|
|
||||||
String encToken = encryptionUtil.encrypt(tokenValue);
|
|
||||||
params.put("token", Base64.encode(encToken.getBytes(StandardCharsets.UTF_8)));
|
|
||||||
messageHandlerService.publishEvent(MessageCode.USER_VERIFICATION_EMAIL, recipient, params);
|
|
||||||
} catch (NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {
|
|
||||||
throw new SystemException("암호화 모듈 오류");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 기존 사용자를 법인 사용자로 전환하는 메서드
|
// 기존 사용자를 법인 사용자로 전환하는 메서드
|
||||||
private ValidationResponse convertExistingUserToCorporate(
|
private ValidationResponse convertExistingUserToCorporate(
|
||||||
PortalUser existingUser,
|
PortalUser existingUser,
|
||||||
@@ -300,9 +253,10 @@ public class OrgRegisterFacadeImpl implements OrgRegisterFacade {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 파일 업로드를 처리하는 메서드
|
// 파일 업로드를 처리하는 메서드
|
||||||
|
// 사업자등록증은 선택 첨부다. 첨부가 없으면(빈 파일 포함) null 을 반환하고 기관은 첨부 없이 등록된다.
|
||||||
private FileInfo handleFileUpload(List<MultipartFile> files) throws IOException {
|
private FileInfo handleFileUpload(List<MultipartFile> files) throws IOException {
|
||||||
if (!validationService.isFileUploaded(files)) {
|
if (!validationService.isFileUploaded(files)) {
|
||||||
throw new IllegalArgumentException("법인 등록을 위해 파일이 필요합니다.");
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileTypeContext.setFileType("certificate");
|
FileTypeContext.setFileType("certificate");
|
||||||
|
|||||||
@@ -140,11 +140,11 @@ public class UserFacadeImpl implements UserFacade {
|
|||||||
public void withdrawUser(String userId, String withdrawalReason) {
|
public void withdrawUser(String userId, String withdrawalReason) {
|
||||||
PortalUser user = portalUserService.findById(userId);
|
PortalUser user = portalUserService.findById(userId);
|
||||||
|
|
||||||
// 법인 관리자 탈퇴 제한
|
// 법인 관리자는 권한 이관 전 탈퇴할 수 없다.
|
||||||
if (user.getRoleCode() == PortalUserEnums.RoleCode.ROLE_CORP_MANAGER) {
|
if (user.getRoleCode() == PortalUserEnums.RoleCode.ROLE_CORP_MANAGER) {
|
||||||
if(portalUserService.checkOrgHasOtherUsers(user.getPortalOrg())){
|
throw new IllegalArgumentException(
|
||||||
throw new IllegalArgumentException("법인 관리자권한을 다른 개발자에게 위임하신 후 탈퇴가 가능합니다.");
|
"법인 관리자는 회원 탈퇴를 할 수 없습니다. "
|
||||||
}
|
+ "관리자 권한을 다른 사용자에게 이관하거나 담당자에게 연락해 주세요.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 약관 동의 정보 삭제
|
// 약관 동의 정보 삭제
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public interface UserRegisterFacade {
|
|||||||
|
|
||||||
ValidationResponse checkPassword(String password, String loginId, String mobileNumber);
|
ValidationResponse checkPassword(String password, String loginId, String mobileNumber);
|
||||||
|
|
||||||
ValidationResponse checkPasswordMatch(String password, String password2);
|
ValidationResponse checkPasswordMatch(String password, String confirmPassword);
|
||||||
|
|
||||||
ValidationResponse verifyPassword(String loginId, String confirmPassword);
|
ValidationResponse verifyPassword(String loginId, String confirmPassword);
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.eactive.apim.portal.apps.user.facade;
|
|||||||
|
|
||||||
import com.eactive.apim.portal.agreements.entity.AgreementType;
|
import com.eactive.apim.portal.agreements.entity.AgreementType;
|
||||||
import com.eactive.apim.portal.apps.agreements.service.AgreementsFacade;
|
import com.eactive.apim.portal.apps.agreements.service.AgreementsFacade;
|
||||||
import com.eactive.apim.portal.apps.auth.service.AuthNumberGenerator;
|
|
||||||
import com.eactive.apim.portal.apps.user.dto.PortalUserRegistrationDTO;
|
import com.eactive.apim.portal.apps.user.dto.PortalUserRegistrationDTO;
|
||||||
import com.eactive.apim.portal.apps.user.dto.UserAgreementDTO;
|
import com.eactive.apim.portal.apps.user.dto.UserAgreementDTO;
|
||||||
import com.eactive.apim.portal.apps.user.dto.ValidationResponse;
|
import com.eactive.apim.portal.apps.user.dto.ValidationResponse;
|
||||||
@@ -11,15 +10,11 @@ import com.eactive.apim.portal.apps.user.service.PortalUserService;
|
|||||||
import com.eactive.apim.portal.apps.user.service.UserRegistrationValidationService;
|
import com.eactive.apim.portal.apps.user.service.UserRegistrationValidationService;
|
||||||
import com.eactive.apim.portal.apps.user.validator.AgreementValidator;
|
import com.eactive.apim.portal.apps.user.validator.AgreementValidator;
|
||||||
import com.eactive.apim.portal.apps.user.validator.PasswordValidator;
|
import com.eactive.apim.portal.apps.user.validator.PasswordValidator;
|
||||||
import com.eactive.apim.portal.common.util.EncryptionUtil;
|
|
||||||
import com.eactive.apim.portal.invitation.entity.UserInvitation;
|
import com.eactive.apim.portal.invitation.entity.UserInvitation;
|
||||||
import com.eactive.apim.portal.invitation.entity.UserInvitationEnums;
|
import com.eactive.apim.portal.invitation.entity.UserInvitationEnums;
|
||||||
import com.eactive.apim.portal.invitation.repository.UserInvitationRepository;
|
import com.eactive.apim.portal.invitation.repository.UserInvitationRepository;
|
||||||
import com.eactive.apim.portal.portaluser.entity.PortalUser;
|
import com.eactive.apim.portal.portaluser.entity.PortalUser;
|
||||||
import com.eactive.apim.portal.portaluser.repository.PortalUserRepository;
|
import com.eactive.apim.portal.portaluser.repository.PortalUserRepository;
|
||||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
|
||||||
import com.eactive.apim.portal.template.service.MessageHandlerService;
|
|
||||||
import com.eactive.apim.portal.template.service.MessageRecipient;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -31,7 +26,6 @@ import org.springframework.validation.BindingResult;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@@ -49,9 +43,6 @@ public class UserRegisterFacadeImpl implements UserRegisterFacade {
|
|||||||
private final PasswordValidator passwordValidator;
|
private final PasswordValidator passwordValidator;
|
||||||
private final PasswordEncoder passwordEncoder;
|
private final PasswordEncoder passwordEncoder;
|
||||||
private final AgreementValidator agreementValidator;
|
private final AgreementValidator agreementValidator;
|
||||||
private final MessageHandlerService messageHandlerService;
|
|
||||||
private final EncryptionUtil encryptionUtil;
|
|
||||||
private final AuthNumberGenerator authNumberGenerator;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -94,8 +85,8 @@ public class UserRegisterFacadeImpl implements UserRegisterFacade {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ValidationResponse checkPasswordMatch(String password, String password2) {
|
public ValidationResponse checkPasswordMatch(String password, String confirmPassword) {
|
||||||
boolean isMatch = password.equals(password2);
|
boolean isMatch = password.equals(confirmPassword);
|
||||||
String message = isMatch ? "비밀번호가 일치합니다." : "비밀번호가 일치하지 않습니다.";
|
String message = isMatch ? "비밀번호가 일치합니다." : "비밀번호가 일치하지 않습니다.";
|
||||||
return new ValidationResponse(isMatch, message);
|
return new ValidationResponse(isMatch, message);
|
||||||
}
|
}
|
||||||
@@ -159,8 +150,6 @@ public class UserRegisterFacadeImpl implements UserRegisterFacade {
|
|||||||
}
|
}
|
||||||
|
|
||||||
agreementsFacade.saveUserAgreements(newUser.getId(), AgreementType.PRIVACY_COLLECT);
|
agreementsFacade.saveUserAgreements(newUser.getId(), AgreementType.PRIVACY_COLLECT);
|
||||||
// 11.13 - 회원 가입단계가 아닌 로그인 단계로 이메일 인증 이동
|
|
||||||
// sendEmailActivation(newUser);
|
|
||||||
return new ValidationResponse(true,"회원가입이 완료되었습니다.");
|
return new ValidationResponse(true,"회원가입이 완료되었습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,28 +218,6 @@ public class UserRegisterFacadeImpl implements UserRegisterFacade {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendEmailActivation(PortalUser registeredUser) {
|
|
||||||
MessageRecipient recipient = new MessageRecipient();
|
|
||||||
recipient.setUsername(registeredUser.getUserName());
|
|
||||||
recipient.setUserId(registeredUser.getEmailAddr());
|
|
||||||
recipient.setPhone(registeredUser.getMobileNumber());
|
|
||||||
|
|
||||||
// 25.10.01 - 이메일 링크 방식으로 접근 불가이기에 SMS 인증방식과 동일하게 대체
|
|
||||||
HashMap<String, Object> params = new HashMap<>();
|
|
||||||
String tokenValue = String.valueOf(authNumberGenerator.generateAuthNumber());
|
|
||||||
// String tokenValue = registeredUser.getCreatedDate().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + ":" + registeredUser.getId();
|
|
||||||
params.put("token", tokenValue);
|
|
||||||
messageHandlerService.publishEvent(MessageCode.USER_VERIFICATION_EMAIL, recipient, params);
|
|
||||||
|
|
||||||
// try {
|
|
||||||
// String encToken = encryptionUtil.encrypt(tokenValue);
|
|
||||||
// params.put("token", Base64.encode(encToken.getBytes(StandardCharsets.UTF_8)));
|
|
||||||
// messageHandlerService.publishEvent(UserEmailActivationEvent.KEY, recipient, params);
|
|
||||||
// } catch (NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {
|
|
||||||
// throw new SystemException("암호화 모듈 오류");
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public ValidationResponse processInvitation(String action, UserInvitation invitation) {
|
public ValidationResponse processInvitation(String action, UserInvitation invitation) {
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ public class PasswordService {
|
|||||||
.orElseThrow(() -> new IllegalArgumentException("해당 사용자를 찾을 수 없습니다."));
|
.orElseThrow(() -> new IllegalArgumentException("해당 사용자를 찾을 수 없습니다."));
|
||||||
|
|
||||||
validatePasswordUpdate(user, newPassword, confirmPassword);
|
validatePasswordUpdate(user, newPassword, confirmPassword);
|
||||||
checkPasswordHistory(user.getLoginId(), newPassword);
|
// PTL_USER_PASSWORD_HISTORY.USER_ID 에는 loginId가 아닌 PortalUser.id가 저장된다.
|
||||||
|
checkPasswordHistory(user.getId(), newPassword);
|
||||||
|
|
||||||
List<UserPasswordHistory> histories = passwordHistoryRepository.findRecentPasswordsByUserId(user.getId());
|
List<UserPasswordHistory> histories = passwordHistoryRepository.findRecentPasswordsByUserId(user.getId());
|
||||||
if(histories.isEmpty()) {
|
if(histories.isEmpty()) {
|
||||||
@@ -85,6 +86,17 @@ public class PasswordService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@link #updatePassword} 를 거치지 않고 비밀번호 해시를 직접 바꾸는 지점(예: 비밀번호 초기화로
|
||||||
|
* 임시 비밀번호 발급 — PortalUserAuthService.resetPassword)이 <b>덮어쓰기 직전</b>에 호출해,
|
||||||
|
* 지금 버려지는 비밀번호를 이력에 남긴다. 이걸 빼먹으면 재사용 금지(최근 5회) 검증이 그 비밀번호를
|
||||||
|
* 전혀 모른 채로 남아 있어, 초기화 이후 바로 예전 비밀번호로 되돌리는 게 허용되는 보안 허점이 된다.
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
public void recordExternalPasswordChange(String userId, String previousPasswordHash) {
|
||||||
|
savePasswordHistory(userId, previousPasswordHash);
|
||||||
|
}
|
||||||
|
|
||||||
private void checkPasswordHistory(String userId, String newPassword) {
|
private void checkPasswordHistory(String userId, String newPassword) {
|
||||||
List<UserPasswordHistory> passwordHistories = passwordHistoryRepository.findRecentPasswordsByUserId(userId);
|
List<UserPasswordHistory> passwordHistories = passwordHistoryRepository.findRecentPasswordsByUserId(userId);
|
||||||
|
|
||||||
@@ -115,26 +127,4 @@ public class PasswordService {
|
|||||||
|
|
||||||
passwordHistoryRepository.save(newHistory);
|
passwordHistoryRepository.save(newHistory);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isValidPassword(String password) {
|
|
||||||
if (password.length() < 8) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean hasLetter = false;
|
|
||||||
boolean hasDigit = false;
|
|
||||||
boolean hasSpecial = false;
|
|
||||||
|
|
||||||
for (char c : password.toCharArray()) {
|
|
||||||
if (Character.isLetter(c)) {
|
|
||||||
hasLetter = true;
|
|
||||||
} else if (Character.isDigit(c)) {
|
|
||||||
hasDigit = true;
|
|
||||||
} else if (!Character.isWhitespace(c)) {
|
|
||||||
hasSpecial = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return hasLetter && hasDigit && hasSpecial;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,10 +35,9 @@ public class PortalOrgService {
|
|||||||
// ID 수동 할당
|
// ID 수동 할당
|
||||||
newOrg.setId(java.util.UUID.randomUUID().toString());
|
newOrg.setId(java.util.UUID.randomUUID().toString());
|
||||||
|
|
||||||
// 파일 정보 설정
|
// 파일 정보 설정 (사업자등록증은 선택 첨부)
|
||||||
if (file != null) {
|
// 매퍼가 DTO 의 compRegFile(화면 표시용 파일명)을 복사하므로, 첨부가 없으면 명시적으로 비운다
|
||||||
newOrg.setCompRegFile(file.getFileId());
|
newOrg.setCompRegFile(file != null ? file.getFileId() : null);
|
||||||
}
|
|
||||||
|
|
||||||
// 초기 상태 설정
|
// 초기 상태 설정
|
||||||
setInitialOrgStatus(newOrg);
|
setInitialOrgStatus(newOrg);
|
||||||
|
|||||||
@@ -16,23 +16,14 @@ import com.eactive.apim.portal.portaluser.entity.PortalUserEnums;
|
|||||||
import com.eactive.apim.portal.portaluser.entity.PortalUserEnums.RoleCode;
|
import com.eactive.apim.portal.portaluser.entity.PortalUserEnums.RoleCode;
|
||||||
import com.eactive.apim.portal.portaluser.event.UserPasswordResetEvent;
|
import com.eactive.apim.portal.portaluser.event.UserPasswordResetEvent;
|
||||||
import com.eactive.apim.portal.portaluser.repository.PortalUserRepository;
|
import com.eactive.apim.portal.portaluser.repository.PortalUserRepository;
|
||||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
|
||||||
import com.eactive.apim.portal.template.entity.MessageRequest;
|
import com.eactive.apim.portal.template.entity.MessageRequest;
|
||||||
import com.eactive.apim.portal.template.repository.MessageRequestRepository;
|
import com.eactive.apim.portal.template.repository.MessageRequestRepository;
|
||||||
import com.eactive.apim.portal.template.service.MessageHandlerService;
|
import com.eactive.apim.portal.template.service.MessageHandlerService;
|
||||||
import com.eactive.apim.portal.template.service.MessageRecipient;
|
import com.eactive.apim.portal.template.service.MessageRecipient;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.security.InvalidKeyException;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.crypto.BadPaddingException;
|
|
||||||
import javax.crypto.IllegalBlockSizeException;
|
|
||||||
import javax.crypto.NoSuchPaddingException;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.xerces.impl.dv.util.Base64;
|
|
||||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
@@ -54,8 +45,8 @@ public class PortalUserAuthService implements UserDetailsService {
|
|||||||
private final PasswordEncoder passwordEncoder;
|
private final PasswordEncoder passwordEncoder;
|
||||||
private final MessageHandlerService messageHandlerService;
|
private final MessageHandlerService messageHandlerService;
|
||||||
private final MessageRequestRepository messageRequestRepository;
|
private final MessageRequestRepository messageRequestRepository;
|
||||||
private final EncryptionUtil encryptionUtil;
|
|
||||||
private final LoginFinalizer loginFinalizer;
|
private final LoginFinalizer loginFinalizer;
|
||||||
|
private final PasswordService passwordService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(noRollbackFor = UsernameNotFoundException.class)
|
@Transactional(noRollbackFor = UsernameNotFoundException.class)
|
||||||
@@ -66,7 +57,9 @@ public class PortalUserAuthService implements UserDetailsService {
|
|||||||
PortalUser portalUser = findByEmailAddr(normalizedUsername);
|
PortalUser portalUser = findByEmailAddr(normalizedUsername);
|
||||||
return buildAuthenticatedUser(portalUser);
|
return buildAuthenticatedUser(portalUser);
|
||||||
} catch (UserNotFoundException e) {
|
} catch (UserNotFoundException e) {
|
||||||
throw new UsernameNotFoundException("입력하신 사용자 정보가 올바르지 않습니다. 다시 확인해 주세요.");
|
// 계정 열거(user enumeration) 공격 방지: 비밀번호 불일치(BadCredentialsException, PortalAuthenticationManager)와
|
||||||
|
// 동일한 문구를 사용해 아이디 존재 여부가 노출되지 않도록 한다.
|
||||||
|
throw new UsernameNotFoundException("아이디 또는 비밀번호가 일치하지 않습니다.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,6 +155,10 @@ public class PortalUserAuthService implements UserDetailsService {
|
|||||||
.orElseThrow(() -> new UserNotFoundException("일치하는 사용자 정보를 찾을 수 없습니다."));
|
.orElseThrow(() -> new UserNotFoundException("일치하는 사용자 정보를 찾을 수 없습니다."));
|
||||||
|
|
||||||
String tempPassword = EncryptionUtil.generateNewPassword();
|
String tempPassword = EncryptionUtil.generateNewPassword();
|
||||||
|
// 지금 버려지는(임시 비밀번호로 교체되는) 비밀번호를 이력에 남긴다 — 안 남기면 재사용 금지
|
||||||
|
// (최근 5회) 검증이 이 비밀번호를 모른 채로 남아, 초기화 직후 바로 예전 비밀번호로 되돌리는
|
||||||
|
// 것이 허용되는 보안 허점이 생긴다.
|
||||||
|
passwordService.recordExternalPasswordChange(portalUser.getId(), portalUser.getPasswordHash());
|
||||||
portalUser.setPasswordHash(passwordEncoder.encode(tempPassword));
|
portalUser.setPasswordHash(passwordEncoder.encode(tempPassword));
|
||||||
// 임시 비밀번호 발급 → 변경일을 null 로 초기화해 로그인 시 강제 비밀번호 변경을 유도한다
|
// 임시 비밀번호 발급 → 변경일을 null 로 초기화해 로그인 시 강제 비밀번호 변경을 유도한다
|
||||||
// (LoginFinalizer.applyPostLoginState 의 passwordChangeDate == null 분기)
|
// (LoginFinalizer.applyPostLoginState 의 passwordChangeDate == null 분기)
|
||||||
|
|||||||
@@ -1,53 +1,23 @@
|
|||||||
package com.eactive.apim.portal.apps.user.validator;
|
package com.eactive.apim.portal.apps.user.validator;
|
||||||
|
|
||||||
|
import com.eactive.apim.portal.common.security.PasswordPolicyProperties;
|
||||||
import com.eactive.apim.portal.common.validator.PasswordRuleValidator;
|
import com.eactive.apim.portal.common.validator.PasswordRuleValidator;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 비밀번호 문자열 정책 검사 진입점. 규칙 자체는 정본인 {@link PasswordRuleValidator} 가 갖고,
|
||||||
|
* 여기서는 DB 토글({@link PasswordPolicyProperties})을 얹어 위임만 한다.
|
||||||
|
*/
|
||||||
@Component
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class PasswordValidator {
|
public class PasswordValidator {
|
||||||
|
|
||||||
public boolean isValidPassword(String password) {
|
private final PasswordPolicyProperties passwordPolicyProperties;
|
||||||
if (password == null || password.isEmpty()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String tmpPw = password.toUpperCase();
|
|
||||||
return isValidLengthAndCharacters(tmpPw) && !containsInvalidPatterns(tmpPw);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isValidPassword(String password, String loginId, String mobileNumber) {
|
public boolean isValidPassword(String password, String loginId, String mobileNumber) {
|
||||||
PasswordRuleValidator validator = new PasswordRuleValidator();
|
PasswordRuleValidator validator = new PasswordRuleValidator();
|
||||||
return validator.isValid(password, loginId, mobileNumber);
|
return validator.isValid(password, loginId, mobileNumber,
|
||||||
}
|
passwordPolicyProperties.isKeyboardSequenceBlocked());
|
||||||
|
|
||||||
private boolean isValidLengthAndCharacters(String password) {
|
|
||||||
final int MIN = 8;
|
|
||||||
final int MAX = 50;
|
|
||||||
final String REGEX = "^(?=.*\\d)(?=.*[a-zA-Z])(?=.*[\\W]).{" + MIN + "," + MAX + "}$";
|
|
||||||
return password.matches(REGEX);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean containsInvalidPatterns(String password) {
|
|
||||||
final String SAMEPT = "(\\w)\\1\\1";
|
|
||||||
final String BLANKPT = "(\\s)";
|
|
||||||
|
|
||||||
if (password.matches(BLANKPT) || password.matches(SAMEPT)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return containsContinuousCharacters(password);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean containsContinuousCharacters(String password) {
|
|
||||||
for (int i = 0; i < password.length() - 2; i++) {
|
|
||||||
if (isContinuous(password.charAt(i), password.charAt(i + 1), password.charAt(i + 2))) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isContinuous(char a, char b, char c) {
|
|
||||||
return (b - a == 1) && (c - b == 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,11 @@ import com.eactive.apim.portal.config.PortalProperties;
|
|||||||
import com.eactive.apim.portal.apps.auth.AuthNoticeProperties;
|
import com.eactive.apim.portal.apps.auth.AuthNoticeProperties;
|
||||||
import com.eactive.apim.portal.apps.session.service.UserSessionService;
|
import com.eactive.apim.portal.apps.session.service.UserSessionService;
|
||||||
import com.eactive.apim.portal.common.security.ClientGuardService;
|
import com.eactive.apim.portal.common.security.ClientGuardService;
|
||||||
|
import com.eactive.apim.portal.common.security.PasswordPolicyProperties;
|
||||||
import com.eactive.apim.portal.djb.footer.RelatedSite;
|
import com.eactive.apim.portal.djb.footer.RelatedSite;
|
||||||
import com.eactive.apim.portal.djb.footer.RelatedSiteService;
|
import com.eactive.apim.portal.djb.footer.RelatedSiteService;
|
||||||
import com.eactive.apim.portal.djb.guide.GuideProperty;
|
import com.eactive.apim.portal.djb.guide.GuideProperty;
|
||||||
|
import com.eactive.apim.portal.common.security.passwordcrypto.PasswordCryptoProperties;
|
||||||
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||||
|
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
@@ -32,6 +34,9 @@ public class GlobalControllerAdvice {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ClientGuardService clientGuardService;
|
private ClientGuardService clientGuardService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PasswordPolicyProperties passwordPolicyProperties;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PortalPropertyService portalPropertyService;
|
private PortalPropertyService portalPropertyService;
|
||||||
|
|
||||||
@@ -47,6 +52,9 @@ public class GlobalControllerAdvice {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private Environment environment;
|
private Environment environment;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PasswordCryptoProperties passwordCryptoProperties;
|
||||||
|
|
||||||
@ModelAttribute("breadcrumb")
|
@ModelAttribute("breadcrumb")
|
||||||
public List<Map> addBreadcrumbToModel(HttpServletRequest request) {
|
public List<Map> addBreadcrumbToModel(HttpServletRequest request) {
|
||||||
String currentPath = request.getRequestURI();
|
String currentPath = request.getRequestURI();
|
||||||
@@ -111,6 +119,35 @@ public class GlobalControllerAdvice {
|
|||||||
return clientGuardService.isDevtoolsGuardEnabled();
|
return clientGuardService.isDevtoolsGuardEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 비밀번호 정책 - 키보드 배열 연속 문자 차단 여부.
|
||||||
|
* PortalProperty(Portal/password.keyboard-sequence.block)에서 조회.
|
||||||
|
* head 의 window.__PASSWORD_POLICY__ 와 비밀번호 요구사항 체크리스트 노출에 함께 쓴다.
|
||||||
|
*/
|
||||||
|
@ModelAttribute("passwordKeyboardSequenceBlock")
|
||||||
|
public boolean passwordKeyboardSequenceBlock() {
|
||||||
|
return passwordPolicyProperties.isKeyboardSequenceBlocked();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 비밀번호 전송암호화 설정(yml {@code portal.security.password-encrypt.*}).
|
||||||
|
* head 의 {@code window.__PASSWORD_CRYPTO__} 로 내려가 password-crypto.js 가 읽는다.
|
||||||
|
*
|
||||||
|
* <ul>
|
||||||
|
* <li>{@code enabled} - 꺼져 있으면 화면은 아무것도 하지 않고 평문 전송한다.</li>
|
||||||
|
* <li>{@code policy} - 평문 비밀번호 처리 정책. 화면은 경고 팝업 노출 여부·문구를 여기서 정한다.</li>
|
||||||
|
* <li>{@code softwareFallback} - {@code crypto.subtle} 이 없을 때 forge 번들을 내려받아 쓸지.</li>
|
||||||
|
* </ul>
|
||||||
|
*/
|
||||||
|
@ModelAttribute("passwordCrypto")
|
||||||
|
public Map<String, Object> passwordCrypto() {
|
||||||
|
Map<String, Object> config = new java.util.LinkedHashMap<>();
|
||||||
|
config.put("enabled", passwordCryptoProperties.isEnabled());
|
||||||
|
config.put("policy", passwordCryptoProperties.getPlaintextPolicy().name());
|
||||||
|
config.put("softwareFallback", passwordCryptoProperties.isSoftwareFallback());
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 상단 헤더 좌측 노출용 활성 프로파일 배지. prod 프로파일이면 노출하지 않는다(null).
|
* 상단 헤더 좌측 노출용 활성 프로파일 배지. prod 프로파일이면 노출하지 않는다(null).
|
||||||
*/
|
*/
|
||||||
@@ -133,6 +170,61 @@ public class GlobalControllerAdvice {
|
|||||||
"Portal", "customer.center.contact", "1588-3388", "고객센터 연락처");
|
"Portal", "customer.center.contact", "1588-3388", "고객센터 연락처");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 메인 페이지 본문에 노출되는 브랜드명. PortalProperty(Portal/brand.name)에서 조회.
|
||||||
|
* 로고 이미지(alt 텍스트)는 별도이며 이 값의 영향을 받지 않는다.
|
||||||
|
*/
|
||||||
|
@ModelAttribute("brandName")
|
||||||
|
public String brandName() {
|
||||||
|
return portalPropertyService.getOrCreateProperty(
|
||||||
|
"Portal", "brand.name", "DJBank", "메인 페이지 브랜드명 표기");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* brandName 뒤에 바로 붙는 주격 조사(이/가). 받침 유무에 따라 관리자가 값을 바꿔도 문법이 깨지지 않도록 계산한다.
|
||||||
|
*/
|
||||||
|
@ModelAttribute("brandNameJosaGa")
|
||||||
|
public String brandNameJosaGa() {
|
||||||
|
return hasBatchim(brandName()) ? "이" : "가";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* brandName 뒤에 바로 붙는 보조사(은/는).
|
||||||
|
*/
|
||||||
|
@ModelAttribute("brandNameJosaEun")
|
||||||
|
public String brandNameJosaEun() {
|
||||||
|
return hasBatchim(brandName()) ? "은" : "는";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 헤더(GNB) 로고 이미지 경로. PortalProperty(Portal/brand.logo.header.path)에서 조회.
|
||||||
|
*/
|
||||||
|
@ModelAttribute("brandLogoHeaderPath")
|
||||||
|
public String brandLogoHeaderPath() {
|
||||||
|
return portalPropertyService.getOrCreateProperty(
|
||||||
|
"Portal", "brand.logo.header.path", "/img/logo/logo-djb.png", "헤더(GNB) 로고 이미지 경로");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 푸터 로고 이미지 경로. PortalProperty(Portal/brand.logo.footer.path)에서 조회.
|
||||||
|
*/
|
||||||
|
@ModelAttribute("brandLogoFooterPath")
|
||||||
|
public String brandLogoFooterPath() {
|
||||||
|
return portalPropertyService.getOrCreateProperty(
|
||||||
|
"Portal", "brand.logo.footer.path", "/img/logo/logo-jjb.png", "푸터 로고 이미지 경로");
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean hasBatchim(String word) {
|
||||||
|
if (word == null || word.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
char last = word.charAt(word.length() - 1);
|
||||||
|
if (last >= 0xAC00 && last <= 0xD7A3) {
|
||||||
|
return (last - 0xAC00) % 28 != 0;
|
||||||
|
}
|
||||||
|
return "AEIOUaeiou".indexOf(last) < 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 푸터 관련 사이트 셀렉트 라벨. PortalProperty(Portal/footer.related-sites.label)에서 조회.
|
* 푸터 관련 사이트 셀렉트 라벨. PortalProperty(Portal/footer.related-sites.label)에서 조회.
|
||||||
*/
|
*/
|
||||||
|
|||||||
+47
-14
@@ -1,8 +1,7 @@
|
|||||||
package com.eactive.apim.portal.common.exception;
|
package com.eactive.apim.portal.common.exception;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import com.eactive.apim.portal.apps.login.service.LoginFinalizer;
|
import com.eactive.apim.portal.apps.login.service.LoginFinalizer;
|
||||||
@@ -36,23 +35,27 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class PortalGlobalExceptionHandler {
|
public class PortalGlobalExceptionHandler {
|
||||||
|
|
||||||
|
private static final String REDIRECT_PREFIX = "redirect:";
|
||||||
|
private static final String REDIRECT_HOME = REDIRECT_PREFIX + "/";
|
||||||
|
private static final String REDIRECT_LOGIN_AUTH = REDIRECT_PREFIX + "/login?reason=auth";
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
private final PortalProperties portalProperties;
|
private final PortalProperties portalProperties;
|
||||||
private final Environment environment;
|
private final Environment environment;
|
||||||
|
|
||||||
@ExceptionHandler(value = NotFoundException.class)
|
@ExceptionHandler(value = NotFoundException.class)
|
||||||
public ModelAndView handleINotFoundException(HttpServletRequest request, NotFoundException ex) {
|
public ModelAndView handleINotFoundException(HttpServletRequest request, NotFoundException ex) {
|
||||||
return new ModelAndView("redirect:/");
|
return new ModelAndView(REDIRECT_HOME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler(value = MethodArgumentTypeMismatchException.class)
|
@ExceptionHandler(value = MethodArgumentTypeMismatchException.class)
|
||||||
public ModelAndView handleMethodArgumentTypeMismatchException(HttpServletRequest request, MethodArgumentTypeMismatchException ex) {
|
public ModelAndView handleMethodArgumentTypeMismatchException(HttpServletRequest request, MethodArgumentTypeMismatchException ex) {
|
||||||
return new ModelAndView("redirect:/");
|
return new ModelAndView(REDIRECT_HOME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler(value = UserNotLoginException.class)
|
@ExceptionHandler(value = UserNotLoginException.class)
|
||||||
public ModelAndView handleUserNotLoginException(HttpServletRequest request, UserNotLoginException ex) {
|
public ModelAndView handleUserNotLoginException(HttpServletRequest request, UserNotLoginException ex) {
|
||||||
return new ModelAndView("redirect:/login?reason=auth");
|
return new ModelAndView(REDIRECT_LOGIN_AUTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler(value = AccessDeniedException.class)
|
@ExceptionHandler(value = AccessDeniedException.class)
|
||||||
@@ -61,7 +64,7 @@ public class PortalGlobalExceptionHandler {
|
|||||||
if (!SecurityUtil.isAuthenticated()) {
|
if (!SecurityUtil.isAuthenticated()) {
|
||||||
// 원래 요청 페이지를 세션에 저장 → 로그인+2FA 완료 후 LoginFinalizer 가 복귀시킨다.
|
// 원래 요청 페이지를 세션에 저장 → 로그인+2FA 완료 후 LoginFinalizer 가 복귀시킨다.
|
||||||
savePostLoginRedirect(request);
|
savePostLoginRedirect(request);
|
||||||
return new ModelAndView("redirect:/login?reason=auth");
|
return new ModelAndView(REDIRECT_LOGIN_AUTH);
|
||||||
}
|
}
|
||||||
log.warn("접근 권한 없음: loginId={}, uri={}", StringMaskingUtil.maskLoginId(SecurityUtil.getCurrentLoginId()), request.getRequestURI());
|
log.warn("접근 권한 없음: loginId={}, uri={}", StringMaskingUtil.maskLoginId(SecurityUtil.getCurrentLoginId()), request.getRequestURI());
|
||||||
ModelAndView modelAndView = new ModelAndView("error");
|
ModelAndView modelAndView = new ModelAndView("error");
|
||||||
@@ -122,9 +125,40 @@ public class PortalGlobalExceptionHandler {
|
|||||||
|| path.startsWith("/favicon"));
|
|| path.startsWith("/favicon"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 리다이렉트/뷰 이름으로 허용할 문자. 스킴 구분자(:)·중괄호·달러를 막아
|
||||||
|
* 외부 URL 이나 Thymeleaf 표현식이 뷰 이름으로 흘러드는 것을 차단한다.
|
||||||
|
*/
|
||||||
|
private static final Pattern SAFE_REDIRECT_TARGET = Pattern.compile("[A-Za-z0-9._/?=&%-]+");
|
||||||
|
|
||||||
@ExceptionHandler(value = PortalRedirectException.class)
|
@ExceptionHandler(value = PortalRedirectException.class)
|
||||||
public ModelAndView handlePortalRedirectException(HttpServletRequest request, PortalRedirectException ex) {
|
public ModelAndView handlePortalRedirectException(HttpServletRequest request, PortalRedirectException ex) {
|
||||||
return new ModelAndView(ex.getMessage());
|
// PortalRedirectException 은 super(message) 를 호출하지 않으므로 getMessage() 는 항상 null 이다.
|
||||||
|
// 이전 구현은 그 null 을 뷰 이름으로 넘겨(= 뷰 미지정) 요청 URL 기준으로 뷰가 추론되게 만들었다.
|
||||||
|
// 실제 대상은 redirectPage 필드다.
|
||||||
|
String target = ex.getRedirectPage();
|
||||||
|
if (!isSafeRedirectTarget(target)) {
|
||||||
|
log.warn("허용되지 않은 리다이렉트 대상 - uri={}, target={}", request.getRequestURI(), target);
|
||||||
|
return new ModelAndView(REDIRECT_HOME);
|
||||||
|
}
|
||||||
|
return new ModelAndView(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 내부 경로/뷰 이름만 허용(외부 URL·프로토콜 상대 URL·표현식 문자 차단) */
|
||||||
|
private boolean isSafeRedirectTarget(String target) {
|
||||||
|
if (target == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
String path = target;
|
||||||
|
if (path.startsWith(REDIRECT_PREFIX)) {
|
||||||
|
path = path.substring(REDIRECT_PREFIX.length());
|
||||||
|
} else if (path.startsWith("forward:")) {
|
||||||
|
path = path.substring("forward:".length());
|
||||||
|
}
|
||||||
|
if (path.isEmpty() || path.startsWith("//")) { // //evil.example 형태의 외부 리다이렉트 차단
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return SAFE_REDIRECT_TARGET.matcher(path).matches();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler(value = {IllegalArgumentException.class})
|
@ExceptionHandler(value = {IllegalArgumentException.class})
|
||||||
@@ -140,7 +174,7 @@ public class PortalGlobalExceptionHandler {
|
|||||||
public ModelAndView handleHttpRequestMethodNotSupportedException(HttpServletRequest request, HttpRequestMethodNotSupportedException ex) {
|
public ModelAndView handleHttpRequestMethodNotSupportedException(HttpServletRequest request, HttpRequestMethodNotSupportedException ex) {
|
||||||
log.error(ex.getMessage());
|
log.error(ex.getMessage());
|
||||||
ModelAndView modelAndView = new ModelAndView();
|
ModelAndView modelAndView = new ModelAndView();
|
||||||
modelAndView.setViewName("redirect:/");
|
modelAndView.setViewName(REDIRECT_HOME);
|
||||||
return modelAndView;
|
return modelAndView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,10 +193,9 @@ public class PortalGlobalExceptionHandler {
|
|||||||
*/
|
*/
|
||||||
@ExceptionHandler(value = Exception.class)
|
@ExceptionHandler(value = Exception.class)
|
||||||
public ModelAndView handleException(HttpServletRequest request, Exception ex) {
|
public ModelAndView handleException(HttpServletRequest request, Exception ex) {
|
||||||
String requestParams = request.getParameterMap().entrySet()
|
// 비밀번호·시크릿·토큰 계열 파라미터는 값을 가린다. 전송암호화가 켜져 있어도
|
||||||
.stream()
|
// 이 시점의 파라미터는 이미 복호화된 평문이다.
|
||||||
.map(entry -> entry.getKey() + "=" + Arrays.toString(entry.getValue()))
|
String requestParams = StringMaskingUtil.maskParameterMap(request.getParameterMap());
|
||||||
.collect(Collectors.joining(", "));
|
|
||||||
|
|
||||||
log.error("Exception occurred - url={}, params={}", request.getRequestURL(), requestParams, ex);
|
log.error("Exception occurred - url={}, params={}", request.getRequestURL(), requestParams, ex);
|
||||||
|
|
||||||
@@ -184,7 +217,7 @@ public class PortalGlobalExceptionHandler {
|
|||||||
public ModelAndView handleInvalidFileException(HttpServletRequest request, RedirectAttributes redirectAttributes, InvalidFileException ex) {
|
public ModelAndView handleInvalidFileException(HttpServletRequest request, RedirectAttributes redirectAttributes, InvalidFileException ex) {
|
||||||
ModelAndView modelAndView = new ModelAndView();
|
ModelAndView modelAndView = new ModelAndView();
|
||||||
redirectAttributes.addFlashAttribute("error", ex.getMessage());
|
redirectAttributes.addFlashAttribute("error", ex.getMessage());
|
||||||
modelAndView.setViewName("redirect:" + request.getRequestURI());
|
modelAndView.setViewName(REDIRECT_PREFIX + request.getRequestURI());
|
||||||
return modelAndView;
|
return modelAndView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,7 +228,7 @@ public class PortalGlobalExceptionHandler {
|
|||||||
String errorMessage = "파일 크기가 허용된 최대 용량(" + maxSize + ")을 초과했습니다.";
|
String errorMessage = "파일 크기가 허용된 최대 용량(" + maxSize + ")을 초과했습니다.";
|
||||||
redirectAttributes.addFlashAttribute("error", errorMessage);
|
redirectAttributes.addFlashAttribute("error", errorMessage);
|
||||||
ModelAndView modelAndView = new ModelAndView();
|
ModelAndView modelAndView = new ModelAndView();
|
||||||
modelAndView.setViewName("redirect:" + request.getRequestURI());
|
modelAndView.setViewName(REDIRECT_PREFIX + request.getRequestURI());
|
||||||
return modelAndView;
|
return modelAndView;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package com.eactive.apim.portal.common.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 작성 요청이 허용 빈도를 초과했을 때 던진다(무제한 요청 차단).
|
||||||
|
*
|
||||||
|
* <p>JSON 응답 컨트롤러에서만 사용한다 — 폼 전송 컨트롤러는 예외 대신
|
||||||
|
* flash 메시지로 되돌려야 하므로 {@code isExceeded} 판정을 직접 쓴다.</p>
|
||||||
|
*/
|
||||||
|
public class TooManyWriteRequestsException extends RuntimeException {
|
||||||
|
|
||||||
|
public TooManyWriteRequestsException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.eactive.apim.portal.common.security;
|
||||||
|
|
||||||
|
import com.eactive.apim.portal.portaluser.entity.PortalUser;
|
||||||
|
import com.eactive.apim.portal.portaluser.repository.PortalUserRepository;
|
||||||
|
import com.eactive.apim.portal.template.entity.MessageCode;
|
||||||
|
import com.eactive.apim.portal.template.service.MessageHandlerService;
|
||||||
|
import com.eactive.apim.portal.template.service.MessageRecipient;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.groovy.util.Maps;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 계정 잠금 처리 단일 지점.
|
||||||
|
*
|
||||||
|
* <p>로그인 연속 실패(`PortalAuthenticationFailureHandler`)와 본인확인 연속 실패
|
||||||
|
* (`PasswordConfirmFailureTracker`)가 같은 방식으로 계정을 잠그도록 로직을 모았다.</p>
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class AccountLockService {
|
||||||
|
|
||||||
|
private final PortalUserRepository portalUserRepository;
|
||||||
|
private final MessageHandlerService messageHandlerService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 계정을 잠그고 잠금 알림을 발송한다. 이미 잠긴 계정이면 알림을 중복 발송하지 않는다.
|
||||||
|
*
|
||||||
|
* <p>호출자의 트랜잭션에 참여한다 — 로그인 실패 핸들러는 이미 자신만의
|
||||||
|
* {@code REQUIRES_NEW} 트랜잭션에서 실행되므로 별도 전파를 두면 같은 row 를 두 트랜잭션이
|
||||||
|
* 잠그게 된다.</p>
|
||||||
|
*
|
||||||
|
* @param reason 알림 문구에 실을 잠금 사유
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
public void lock(PortalUser user, String reason) {
|
||||||
|
if (user == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ("Y".equals(user.getAccountLockYn())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
user.setAccountLockYn("Y");
|
||||||
|
portalUserRepository.save(user);
|
||||||
|
messageHandlerService.publishEvent(MessageCode.USER_ACCOUNT_LOCKED,
|
||||||
|
MessageRecipient.of(user), Maps.of("reason", reason));
|
||||||
|
log.warn("계정 잠금 처리 userId={} reason={}", user.getId(), reason);
|
||||||
|
}
|
||||||
|
}
|
||||||
+75
@@ -0,0 +1,75 @@
|
|||||||
|
package com.eactive.apim.portal.common.security;
|
||||||
|
|
||||||
|
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 중요 페이지 진입용 비밀번호 재인증(본인확인)의 연속 실패 정책을 DB(PortalProperty)에서 조회한다.
|
||||||
|
*
|
||||||
|
* <ul>
|
||||||
|
* <li>{@code password.confirm.failure.limit} - 연속 실패 허용 횟수 (기본 {@value #DEFAULT_LIMIT})</li>
|
||||||
|
* <li>{@code password.confirm.failure.action} - 임계 초과 시 조치 ({@code LOGOUT} / {@code LOCK})</li>
|
||||||
|
* </ul>
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PasswordConfirmFailurePolicy {
|
||||||
|
|
||||||
|
private static final String GROUP = "Portal";
|
||||||
|
private static final String NAME_LIMIT = "password.confirm.failure.limit";
|
||||||
|
private static final String NAME_ACTION = "password.confirm.failure.action";
|
||||||
|
|
||||||
|
/** 프로퍼티 미존재/파싱 실패 시 기본 허용 횟수 */
|
||||||
|
public static final int DEFAULT_LIMIT = 5;
|
||||||
|
|
||||||
|
/** 임계 초과 시 조치 */
|
||||||
|
public enum Action {
|
||||||
|
/** 세션만 강제 종료 (기본) */
|
||||||
|
LOGOUT,
|
||||||
|
/** 계정을 잠근 뒤 세션도 종료 — 재로그인 자체가 차단된다 */
|
||||||
|
LOCK;
|
||||||
|
|
||||||
|
public static final Action DEFAULT = LOGOUT;
|
||||||
|
|
||||||
|
public static Action from(String raw) {
|
||||||
|
if (raw == null || raw.trim().isEmpty()) {
|
||||||
|
return DEFAULT;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return Action.valueOf(raw.trim().toUpperCase());
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
log.warn("{} 값이 유효하지 않음('{}') - 기본값 {} 사용", NAME_ACTION, raw, DEFAULT);
|
||||||
|
return DEFAULT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private final PortalPropertyService portalPropertyService;
|
||||||
|
|
||||||
|
/** 연속 실패가 이 값 이상이면 {@link #action()} 을 수행한다. */
|
||||||
|
public int limit() {
|
||||||
|
String raw = portalPropertyService.getOrCreateProperty(
|
||||||
|
GROUP, NAME_LIMIT, String.valueOf(DEFAULT_LIMIT),
|
||||||
|
"본인확인(비밀번호 재인증) 연속 실패 허용 횟수 (이 값 이상 실패 시 조치)");
|
||||||
|
try {
|
||||||
|
int parsed = Integer.parseInt(raw.trim());
|
||||||
|
if (parsed > 0) {
|
||||||
|
return parsed;
|
||||||
|
}
|
||||||
|
log.warn("{} 값이 0 이하({}) - 기본값 {} 사용", NAME_LIMIT, parsed, DEFAULT_LIMIT);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
log.warn("{} 값이 숫자가 아님('{}') - 기본값 {} 사용", NAME_LIMIT, raw, DEFAULT_LIMIT);
|
||||||
|
}
|
||||||
|
return DEFAULT_LIMIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 임계 초과 시 조치 */
|
||||||
|
public Action action() {
|
||||||
|
return Action.from(portalPropertyService.getOrCreateProperty(
|
||||||
|
GROUP, NAME_ACTION, Action.DEFAULT.name(),
|
||||||
|
"본인확인 연속 실패 임계 초과 시 조치 (LOGOUT=강제 로그아웃, LOCK=계정 차단 후 로그아웃)"));
|
||||||
|
}
|
||||||
|
}
|
||||||
+131
@@ -0,0 +1,131 @@
|
|||||||
|
package com.eactive.apim.portal.common.security;
|
||||||
|
|
||||||
|
import com.eactive.apim.portal.apps.session.service.UserSessionService;
|
||||||
|
import com.eactive.apim.portal.common.security.PasswordConfirmFailurePolicy.Action;
|
||||||
|
import com.eactive.apim.portal.common.user.PortalAuthenticatedUser;
|
||||||
|
import com.eactive.apim.portal.common.util.SecurityUtil;
|
||||||
|
import com.eactive.apim.portal.portaluser.entity.PortalUser;
|
||||||
|
import com.eactive.apim.portal.portaluser.repository.PortalUserRepository;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 중요 페이지 진입 시 비밀번호 재인증(본인확인)의 연속 실패를 추적하고 임계 초과 시 조치한다.
|
||||||
|
*
|
||||||
|
* <p>무차별 대입 방어. 카운터는 세션 attribute 로 유지하고, 임계 초과 시
|
||||||
|
* {@link PasswordConfirmFailurePolicy.Action} 에 따라 강제 로그아웃하거나 계정을 잠근다.
|
||||||
|
* step-up 확인 페이지·webhook·비밀번호 변경 진입이 모두 이 클래스를 쓴다.</p>
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PasswordConfirmFailureTracker {
|
||||||
|
|
||||||
|
/** 연속 실패 횟수 세션 attribute 키 */
|
||||||
|
public static final String ATTR_FAIL_COUNT = "STEPUP_PW_CONFIRM_FAIL_COUNT";
|
||||||
|
|
||||||
|
private final PasswordConfirmFailurePolicy policy;
|
||||||
|
private final UserSessionService userSessionService;
|
||||||
|
private final AccountLockService accountLockService;
|
||||||
|
private final PortalUserRepository portalUserRepository;
|
||||||
|
|
||||||
|
/** 실패 처리 결과 */
|
||||||
|
@Getter
|
||||||
|
public static class Outcome {
|
||||||
|
|
||||||
|
private final int failCount;
|
||||||
|
private final int limit;
|
||||||
|
private final boolean forcedLogout;
|
||||||
|
private final boolean accountLocked;
|
||||||
|
private final String message;
|
||||||
|
|
||||||
|
Outcome(int failCount, int limit, boolean forcedLogout, boolean accountLocked, String message) {
|
||||||
|
this.failCount = failCount;
|
||||||
|
this.limit = limit;
|
||||||
|
this.forcedLogout = forcedLogout;
|
||||||
|
this.accountLocked = accountLocked;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 확인 성공 시 카운터 초기화 */
|
||||||
|
public void reset(HttpSession session) {
|
||||||
|
if (session != null) {
|
||||||
|
session.removeAttribute(ATTR_FAIL_COUNT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 실패 1회를 기록하고, 임계에 도달했으면 정책에 따라 조치(로그아웃 또는 계정 잠금 후 로그아웃)한다.
|
||||||
|
* 조치가 수행되면 호출자는 로그인 화면으로 보내기만 하면 된다.
|
||||||
|
*/
|
||||||
|
public Outcome recordFailure(HttpSession session, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
int limit = policy.limit();
|
||||||
|
int failCount = increment(session);
|
||||||
|
|
||||||
|
if (failCount < limit) {
|
||||||
|
return new Outcome(failCount, limit, false, false,
|
||||||
|
policy.action() == Action.LOCK
|
||||||
|
? "현재 비밀번호가 일치하지 않습니다. 보안을 위해 반복 실패 시 계정 이용이 제한됩니다."
|
||||||
|
: "현재 비밀번호가 일치하지 않습니다. 보안을 위해 반복 실패 시 자동 로그아웃됩니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean locked = false;
|
||||||
|
if (policy.action() == Action.LOCK) {
|
||||||
|
locked = lockCurrentUser(limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
forceLogout(session, request, response);
|
||||||
|
log.warn("본인확인 비밀번호 반복 실패로 {} 처리", locked ? "계정 차단" : "강제 로그아웃");
|
||||||
|
|
||||||
|
return new Outcome(failCount, limit, true, locked,
|
||||||
|
locked
|
||||||
|
? "비밀번호 확인 반복 실패로 계정이 차단되었습니다. 관리자에게 문의해 주세요."
|
||||||
|
: "비밀번호 확인 반복 실패로 로그아웃되었습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
private int increment(HttpSession session) {
|
||||||
|
Integer count = (Integer) session.getAttribute(ATTR_FAIL_COUNT);
|
||||||
|
int next = (count == null ? 0 : count) + 1;
|
||||||
|
session.setAttribute(ATTR_FAIL_COUNT, next);
|
||||||
|
return next;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 현재 사용자를 잠근다. 로그인 실패 카운트도 임계치로 맞춰 두어야
|
||||||
|
* 세션을 새로 받아도 잠금 상태가 이어진다.
|
||||||
|
*/
|
||||||
|
private boolean lockCurrentUser(int limit) {
|
||||||
|
PortalAuthenticatedUser current = SecurityUtil.getPortalAuthenticatedUser();
|
||||||
|
if (current == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Optional<PortalUser> found = portalUserRepository.findById(current.getId());
|
||||||
|
if (!found.isPresent()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
PortalUser user = found.get();
|
||||||
|
if (user.getLoginFailureCount() == null || user.getLoginFailureCount() < limit) {
|
||||||
|
user.setLoginFailureCount(limit);
|
||||||
|
portalUserRepository.save(user);
|
||||||
|
}
|
||||||
|
accountLockService.lock(user, "본인확인 비밀번호 반복 실패로 인한 계정 차단");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void forceLogout(HttpSession session, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
// SecurityContextLogoutHandler 는 HTTP 세션만 무효화하므로 DB 세션 레코드를 먼저 정리한다.
|
||||||
|
userSessionService.removeSession(session.getId());
|
||||||
|
new SecurityContextLogoutHandler().logout(request, response,
|
||||||
|
SecurityContextHolder.getContext().getAuthentication());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.eactive.apim.portal.common.security;
|
||||||
|
|
||||||
|
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 비밀번호 문자열 정책 중 DB(PortalProperty)로 on/off 하는 항목을 조회한다.
|
||||||
|
*
|
||||||
|
* <p>group 은 기존 {@code Portal} 을 재사용하여 {@link PortalPropertyService#getOrCreateProperty}
|
||||||
|
* 의 자동 생성이 동작하도록 한다.</p>
|
||||||
|
*
|
||||||
|
* <ul>
|
||||||
|
* <li>{@code password.keyboard-sequence.block} - 키보드 배열 연속 문자(qwe/asd 등) 사용 금지</li>
|
||||||
|
* </ul>
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PasswordPolicyProperties {
|
||||||
|
|
||||||
|
private static final String GROUP = "Portal";
|
||||||
|
private static final String NAME_KEYBOARD_SEQUENCE = "password.keyboard-sequence.block";
|
||||||
|
|
||||||
|
/** 프로퍼티 미존재/파싱 실패 시 기본값 (차단) */
|
||||||
|
public static final boolean DEFAULT_KEYBOARD_SEQUENCE_BLOCK = true;
|
||||||
|
|
||||||
|
private final PortalPropertyService portalPropertyService;
|
||||||
|
|
||||||
|
/** 키보드 배열 연속 문자 3자리 이상 사용 금지 여부 */
|
||||||
|
public boolean isKeyboardSequenceBlocked() {
|
||||||
|
return Boolean.parseBoolean(
|
||||||
|
portalPropertyService.getOrCreateProperty(GROUP, NAME_KEYBOARD_SEQUENCE,
|
||||||
|
String.valueOf(DEFAULT_KEYBOARD_SEQUENCE_BLOCK),
|
||||||
|
"키보드 배열 연속 문자(qwe·asd 등) 3자리 이상 사용 금지 여부 (true/false)").trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
package com.eactive.apim.portal.common.security;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||||
|
import org.springframework.context.ApplicationListener;
|
||||||
|
import org.springframework.core.Ordered;
|
||||||
|
import org.springframework.core.annotation.Order;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 기동 시 보안 정책 PTL_PROPERTY 를 미리 생성한다.
|
||||||
|
*
|
||||||
|
* <p>PTL_PROPERTY 에는 (GROUP, NAME) 유니크 제약이 없어
|
||||||
|
* {@code getOrCreateProperty} 최초 조회가 동시 요청으로 경합하면 같은 키가 중복 INSERT 된다
|
||||||
|
* (중복 시 Hibernate 가 {@code More than one row with the given identifier} 로 실패한다).
|
||||||
|
* 특히 {@link PasswordPolicyProperties} 는 GlobalControllerAdvice 를 통해 <b>매 요청</b> 조회되므로
|
||||||
|
* 기동 직후 동시 접속에서 경합할 가능성이 높다.</p>
|
||||||
|
*
|
||||||
|
* <p>부팅 완료 시점에 단일 스레드로 한 번 조회해 두면 이후 요청은 항상 기존 행을 읽는다.
|
||||||
|
* {@code PortalPropertyDuplicateChecker} 보다 먼저 실행되도록 우선순위를 높인다.</p>
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Order(Ordered.HIGHEST_PRECEDENCE)
|
||||||
|
public class SecurityPolicyPropertySeeder implements ApplicationListener<ApplicationReadyEvent> {
|
||||||
|
|
||||||
|
private final PasswordPolicyProperties passwordPolicyProperties;
|
||||||
|
private final WriteRateLimitPolicy writeRateLimitPolicy;
|
||||||
|
private final PasswordConfirmFailurePolicy passwordConfirmFailurePolicy;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void onApplicationEvent(ApplicationReadyEvent event) {
|
||||||
|
try {
|
||||||
|
boolean keyboardSequenceBlock = passwordPolicyProperties.isKeyboardSequenceBlocked();
|
||||||
|
int writeLimit = writeRateLimitPolicy.perMinuteLimit();
|
||||||
|
int confirmLimit = passwordConfirmFailurePolicy.limit();
|
||||||
|
PasswordConfirmFailurePolicy.Action confirmAction = passwordConfirmFailurePolicy.action();
|
||||||
|
log.info("[보안 정책] keyboard-sequence.block={}, write.rate-limit.per-minute={}, "
|
||||||
|
+ "password.confirm.failure.limit={}, password.confirm.failure.action={}",
|
||||||
|
keyboardSequenceBlock, writeLimit, confirmLimit, confirmAction);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("[보안 정책] PTL_PROPERTY 사전 생성 실패 — 최초 요청 시 생성된다", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.eactive.apim.portal.common.security;
|
||||||
|
|
||||||
|
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 게시물·댓글·피드백 작성의 1분당 허용 건수를 DB(PortalProperty)에서 조회한다.
|
||||||
|
*
|
||||||
|
* <p>PTL_PROPERTY (group={@code Portal}, name={@code write.rate-limit.per-minute}) 값으로 제어한다.
|
||||||
|
* 허용 범위는 {@value #MIN_LIMIT}~{@value #MAX_LIMIT} 이며 벗어나거나 숫자가 아니면 기본값
|
||||||
|
* {@value #DEFAULT_LIMIT} 로 동작한다. {@code 0} 은 제한 없음을 뜻한다.</p>
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class WriteRateLimitPolicy {
|
||||||
|
|
||||||
|
private static final String GROUP = "Portal";
|
||||||
|
private static final String NAME = "write.rate-limit.per-minute";
|
||||||
|
|
||||||
|
/** 프로퍼티 미존재/파싱 실패 시 기본 허용 건수 */
|
||||||
|
public static final int DEFAULT_LIMIT = 1;
|
||||||
|
private static final int MIN_LIMIT = 0;
|
||||||
|
private static final int MAX_LIMIT = 10;
|
||||||
|
|
||||||
|
private final PortalPropertyService portalPropertyService;
|
||||||
|
|
||||||
|
/** 1분당 작성 허용 건수. 0 이면 제한하지 않는다. */
|
||||||
|
public int perMinuteLimit() {
|
||||||
|
String raw = portalPropertyService.getOrCreateProperty(
|
||||||
|
GROUP, NAME, String.valueOf(DEFAULT_LIMIT),
|
||||||
|
"1분당 게시물·댓글·피드백 작성 허용 건수 (" + MIN_LIMIT + "~" + MAX_LIMIT + ", 0=제한없음)");
|
||||||
|
try {
|
||||||
|
int parsed = Integer.parseInt(raw.trim());
|
||||||
|
if (parsed >= MIN_LIMIT && parsed <= MAX_LIMIT) {
|
||||||
|
return parsed;
|
||||||
|
}
|
||||||
|
log.warn("{} 값이 허용 범위({}~{}) 밖({}) - 기본값 {} 사용", NAME, MIN_LIMIT, MAX_LIMIT, parsed, DEFAULT_LIMIT);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
log.warn("{} 값이 숫자가 아님('{}') - 기본값 {} 사용", NAME, raw, DEFAULT_LIMIT);
|
||||||
|
}
|
||||||
|
return DEFAULT_LIMIT;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
package com.eactive.apim.portal.common.security;
|
||||||
|
|
||||||
|
import com.eactive.apim.portal.apps.community.partnership.repository.PartnershipApplicationRepository;
|
||||||
|
import com.eactive.apim.portal.apps.community.qna.repository.InquiryRepository;
|
||||||
|
import com.eactive.apim.portal.common.entity.Auditable;
|
||||||
|
import com.eactive.apim.portal.common.exception.TooManyWriteRequestsException;
|
||||||
|
import com.eactive.apim.portal.common.user.PortalAuthenticatedUser;
|
||||||
|
import com.eactive.apim.portal.common.util.SecurityUtil;
|
||||||
|
import com.eactive.apim.portal.djb.community.qna.comment.repository.InquiryCommentRepository;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.data.domain.PageRequest;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 작성 요청 빈도 제한(무제한 요청 차단).
|
||||||
|
*
|
||||||
|
* <p>카운터는 대상별로 독립이며 저장소는 DB 다 — 세션 재발급·다중 탭으로 우회할 수 없다.
|
||||||
|
* 허용 건수는 {@link WriteRateLimitPolicy} 가 PortalProperty 에서 읽는다.</p>
|
||||||
|
*
|
||||||
|
* <p>판정은 "최신 N건을 뽑아 N번째가 1분 이내인가" 로 한다. {@code createdDate} 는
|
||||||
|
* {@code LocalDateTimeToStringConverter} 로 문자열 저장되므로 쿼리에서 범위 비교하지 않고
|
||||||
|
* Java 에서 비교한다.</p>
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class WriteRateLimitService {
|
||||||
|
|
||||||
|
/** 빈도 판정 기준 구간 */
|
||||||
|
private static final Duration WINDOW = Duration.ofMinutes(1);
|
||||||
|
|
||||||
|
/** 빈도 제한 대상. 대상별로 카운터가 독립이다. */
|
||||||
|
public enum WriteTarget {
|
||||||
|
INQUIRY("Q&A 문의"),
|
||||||
|
INQUIRY_COMMENT("댓글"),
|
||||||
|
PARTNERSHIP("피드백/개선요청");
|
||||||
|
|
||||||
|
private final String label;
|
||||||
|
|
||||||
|
WriteTarget(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private final WriteRateLimitPolicy writeRateLimitPolicy;
|
||||||
|
private final InquiryRepository inquiryRepository;
|
||||||
|
private final InquiryCommentRepository inquiryCommentRepository;
|
||||||
|
private final PartnershipApplicationRepository partnershipApplicationRepository;
|
||||||
|
|
||||||
|
/** 현재 로그인 사용자 기준으로 허용 빈도를 넘었는지 */
|
||||||
|
public boolean isExceeded(WriteTarget target) {
|
||||||
|
return isExceeded(target, currentUserId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 허용 빈도를 넘었는지. userId 가 없으면(비인증) 판정하지 않는다. */
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public boolean isExceeded(WriteTarget target, String userId) {
|
||||||
|
int limit = writeRateLimitPolicy.perMinuteLimit();
|
||||||
|
if (limit <= 0 || userId == null || userId.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<? extends Auditable> recent = findRecent(target, userId, limit);
|
||||||
|
if (recent.size() < limit) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalDateTime oldestOfWindow = recent.get(limit - 1).getCreatedDate();
|
||||||
|
boolean exceeded = oldestOfWindow != null && oldestOfWindow.isAfter(LocalDateTime.now().minus(WINDOW));
|
||||||
|
if (exceeded) {
|
||||||
|
log.warn("작성 빈도 제한 초과 target={} limit={}/분", target, limit);
|
||||||
|
}
|
||||||
|
return exceeded;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 허용 빈도를 넘었으면 예외. JSON 응답 컨트롤러 전용. */
|
||||||
|
public void assertNotExceeded(WriteTarget target) {
|
||||||
|
if (isExceeded(target)) {
|
||||||
|
throw new TooManyWriteRequestsException(exceededMessage(target));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 사용자에게 보여줄 차단 안내 문구 */
|
||||||
|
public String exceededMessage(WriteTarget target) {
|
||||||
|
return target.getLabel() + " 작성은 1분에 " + writeRateLimitPolicy.perMinuteLimit()
|
||||||
|
+ "건까지 가능합니다. 잠시 후 다시 시도해 주세요.";
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 감사 필드 createdBy 와 동일한 식별자(PortalUser.id). 비인증이면 null. */
|
||||||
|
private static String currentUserId() {
|
||||||
|
PortalAuthenticatedUser user = SecurityUtil.getPortalAuthenticatedUser();
|
||||||
|
return user == null ? null : user.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<? extends Auditable> findRecent(WriteTarget target, String userId, int limit) {
|
||||||
|
PageRequest page = PageRequest.of(0, limit);
|
||||||
|
switch (target) {
|
||||||
|
case INQUIRY:
|
||||||
|
return inquiryRepository.findByCreatedByOrderByCreatedDateDesc(userId, page);
|
||||||
|
case INQUIRY_COMMENT:
|
||||||
|
return inquiryCommentRepository.findByCreatedByOrderByCreatedDateDesc(userId, page);
|
||||||
|
case PARTNERSHIP:
|
||||||
|
return partnershipApplicationRepository.findByCreatedByOrderByCreatedDateDesc(userId, page);
|
||||||
|
default:
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+90
@@ -0,0 +1,90 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
import org.springframework.util.MultiValueMap;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 멀티파트(파일 업로드 동반) 요청 전용 복호화 래퍼.
|
||||||
|
*
|
||||||
|
* <p><b>배경</b> — {@link DecryptingRequestWrapper} 는 {@code getParameter()} 호출 시
|
||||||
|
* {@code super.getParameter()} 위임 결과를 복호화하는 방식이다. 그런데 Spring 의
|
||||||
|
* {@link org.springframework.web.multipart.support.MultipartFilter} 가 만드는
|
||||||
|
* {@code MultipartHttpServletRequest} 는 자신이 직접 파싱한 폼 필드(파일이 아닌 text part) 값을
|
||||||
|
* {@code getParameter()} 에서 곧바로 반환하고 {@code super.getParameter()} 로 위임하지 않는다.
|
||||||
|
* 그 결과 {@code DecryptingRequestWrapper} 가 멀티파트 파싱 "이전"(안쪽)에 씌워지면, 멀티파트 안의
|
||||||
|
* 비밀번호 파라미터는 복호화되지 않은 봉투(ENC1) 문자열 그대로 컨트롤러까지 전달된다 — 법인가입처럼
|
||||||
|
* 파일 첨부(사업자등록증)와 비밀번호가 같은 폼에 있는 경우 재현된다.
|
||||||
|
*
|
||||||
|
* <p><b>해결</b> — {@link PasswordDecryptFilter} 를 MultipartFilter "이후"에 실행되도록 순서를
|
||||||
|
* 옮기면(그리고 Lucy XSS 필터보다는 여전히 앞서도록), 이 필터가 감싸는 대상이 이미
|
||||||
|
* {@code MultipartHttpServletRequest} 다. 이때는 이 클래스로 감싸 {@link MultipartHttpServletRequest}
|
||||||
|
* 인터페이스 자체를 구현하고 파일 관련 메서드는 원본 멀티파트 요청에 위임한다 — Spring 의
|
||||||
|
* {@code MultipartFile} 바인딩({@code WebUtils.getNativeRequest(request, MultipartHttpServletRequest.class)})이
|
||||||
|
* 이 래퍼를 그대로 인식하도록 하기 위함이다. 파라미터(텍스트 필드) 복호화 로직은 부모
|
||||||
|
* {@link DecryptingRequestWrapper} 그대로 재사용한다.
|
||||||
|
*/
|
||||||
|
public class DecryptingMultipartRequestWrapper extends DecryptingRequestWrapper
|
||||||
|
implements MultipartHttpServletRequest {
|
||||||
|
|
||||||
|
private final MultipartHttpServletRequest multipartRequest;
|
||||||
|
|
||||||
|
public DecryptingMultipartRequestWrapper(MultipartHttpServletRequest request,
|
||||||
|
PasswordEnvelopeCodec codec,
|
||||||
|
PasswordKeyStore keyStore,
|
||||||
|
PasswordCryptoProperties properties) {
|
||||||
|
super(request, codec, keyStore, properties);
|
||||||
|
this.multipartRequest = request;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Iterator<String> getFileNames() {
|
||||||
|
return multipartRequest.getFileNames();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MultipartFile getFile(String name) {
|
||||||
|
return multipartRequest.getFile(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MultipartFile> getFiles(String name) {
|
||||||
|
return multipartRequest.getFiles(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, MultipartFile> getFileMap() {
|
||||||
|
return multipartRequest.getFileMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MultiValueMap<String, MultipartFile> getMultiFileMap() {
|
||||||
|
return multipartRequest.getMultiFileMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getMultipartContentType(String paramOrFileName) {
|
||||||
|
return multipartRequest.getMultipartContentType(paramOrFileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpMethod getRequestMethod() {
|
||||||
|
return multipartRequest.getRequestMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpHeaders getRequestHeaders() {
|
||||||
|
return multipartRequest.getRequestHeaders();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpHeaders getMultipartHeaders(String paramOrFileName) {
|
||||||
|
return multipartRequest.getMultipartHeaders(paramOrFileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
+181
@@ -0,0 +1,181 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletRequestWrapper;
|
||||||
|
import java.security.PrivateKey;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 봉투(ENC1) 형식으로 들어온 파라미터 값을 평문으로 되돌리는 요청 래퍼.
|
||||||
|
*
|
||||||
|
* <p><b>지연 복호화가 필수다.</b> 생성자에서 {@code getParameterMap()} 을 부르면 컨테이너가 요청 본문을
|
||||||
|
* 파싱해버려, 본문을 직접 읽는 필터({@code ApiTesterFilter})가 이후 {@code getInputStream()} 을 못 쓴다.
|
||||||
|
* 따라서 값은 {@code getParameter*} 호출 시점에만 건드린다.</p>
|
||||||
|
*
|
||||||
|
* <p>Lucy XSS 필터({@code order = MIN_VALUE + 3})보다 <b>앞</b>({@code MIN_VALUE + 2})에서 이 래퍼가
|
||||||
|
* 씌워지므로, 복호화된 평문이 기존과 똑같이 XSS 이스케이프를 거친다. 순서가 뒤바뀌면 특수문자가 든
|
||||||
|
* 비밀번호의 이스케이프 여부가 달라져 기존 계정 로그인이 깨진다.</p>
|
||||||
|
*
|
||||||
|
* <p><b>멀티파트(파일 업로드) 요청 주의</b> — {@code getParameter()} 는 {@code super.getParameter()} 위임
|
||||||
|
* 결과를 복호화하는 방식이라, 이 래퍼가 감싸는 시점에 {@code super} 가 이미 멀티파트 파싱이 끝난
|
||||||
|
* {@code MultipartHttpServletRequest} 여야만 폼 필드(파일이 아닌 text part)를 볼 수 있다 — Spring 의
|
||||||
|
* 멀티파트 파라미터 맵은 자신이 파싱한 값을 곧바로 반환하고 감싸고 있는 원본 요청으로 위임하지 않기
|
||||||
|
* 때문이다. 그래서 {@link PasswordDecryptFilter} 는 MultipartFilter({@code order = MIN_VALUE + 1})
|
||||||
|
* "이후"에 실행되도록 등록돼 있고, 감싸는 대상이 {@code MultipartHttpServletRequest} 면 이 클래스 대신
|
||||||
|
* {@link DecryptingMultipartRequestWrapper}(이 클래스를 상속하며 멀티파트 인터페이스도 구현)를 쓴다.</p>
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class DecryptingRequestWrapper extends HttpServletRequestWrapper {
|
||||||
|
|
||||||
|
private final PasswordEnvelopeCodec codec;
|
||||||
|
private final PasswordKeyStore keyStore;
|
||||||
|
private final PasswordCryptoProperties properties;
|
||||||
|
|
||||||
|
/** 봉투 원문 → 평문. 같은 값이 여러 번 조회돼도 RSA 연산은 한 번만 한다. */
|
||||||
|
private final Map<String, String> decrypted = new HashMap<>();
|
||||||
|
|
||||||
|
/** 요청 처리 후 폐기할 keyId(1회용 키 모드). */
|
||||||
|
private final Set<String> usedKeyIds = new LinkedHashSet<>();
|
||||||
|
|
||||||
|
private Map<String, String[]> parameterMapCache;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 평문 비밀번호 경고를 요청당 한 번만 남기기 위한 표시.
|
||||||
|
* 파라미터는 컨트롤러·검증기에서 여러 번 조회되고, 같은 폼에 비밀번호 계열 필드가 둘 이상인
|
||||||
|
* 경우도 흔해서(비밀번호/비밀번호확인) 그대로 두면 한 번의 제출이 로그 여러 줄을 만든다.
|
||||||
|
*/
|
||||||
|
private boolean plaintextWarned;
|
||||||
|
|
||||||
|
public DecryptingRequestWrapper(HttpServletRequest request,
|
||||||
|
PasswordEnvelopeCodec codec,
|
||||||
|
PasswordKeyStore keyStore,
|
||||||
|
PasswordCryptoProperties properties) {
|
||||||
|
super(request);
|
||||||
|
this.codec = codec;
|
||||||
|
this.keyStore = keyStore;
|
||||||
|
this.properties = properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getParameter(String name) {
|
||||||
|
return convert(name, super.getParameter(name));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getParameterValues(String name) {
|
||||||
|
String[] values = super.getParameterValues(name);
|
||||||
|
if (values == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String[] converted = new String[values.length];
|
||||||
|
for (int i = 0; i < values.length; i++) {
|
||||||
|
converted[i] = convert(name, values[i]);
|
||||||
|
}
|
||||||
|
return converted;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String[]> getParameterMap() {
|
||||||
|
if (parameterMapCache == null) {
|
||||||
|
Map<String, String[]> source = super.getParameterMap();
|
||||||
|
Map<String, String[]> result = new HashMap<>(Math.max(16, source.size() * 2));
|
||||||
|
for (Map.Entry<String, String[]> entry : source.entrySet()) {
|
||||||
|
String name = entry.getKey();
|
||||||
|
String[] values = entry.getValue();
|
||||||
|
String[] converted = new String[values.length];
|
||||||
|
for (int i = 0; i < values.length; i++) {
|
||||||
|
converted[i] = convert(name, values[i]);
|
||||||
|
}
|
||||||
|
result.put(name, converted);
|
||||||
|
}
|
||||||
|
parameterMapCache = Collections.unmodifiableMap(result);
|
||||||
|
}
|
||||||
|
return parameterMapCache;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 요청 처리가 끝난 뒤 필터가 호출한다. 1회용 키를 폐기해 재전송을 막는다. */
|
||||||
|
void consumeUsedKeys() {
|
||||||
|
for (String keyId : usedKeyIds) {
|
||||||
|
keyStore.consume(keyId, (HttpServletRequest) getRequest());
|
||||||
|
}
|
||||||
|
usedKeyIds.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String convert(String name, String value) {
|
||||||
|
if (value == null || value.isEmpty()) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
if (!codec.isEnvelope(value)) {
|
||||||
|
return handlePlaintext(name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
String cached = decrypted.get(value);
|
||||||
|
if (cached != null) {
|
||||||
|
return cached;
|
||||||
|
}
|
||||||
|
|
||||||
|
String keyId = codec.keyIdOf(value);
|
||||||
|
if (keyId == null) {
|
||||||
|
log.warn("봉투 형식 오류 - uri={}, param={}", getRequestURI(), name);
|
||||||
|
return failed(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
PrivateKey privateKey = keyStore.resolve(keyId, (HttpServletRequest) getRequest());
|
||||||
|
if (privateKey == null) {
|
||||||
|
log.warn("전송암호화 키를 찾을 수 없음(만료·인스턴스 불일치) - uri={}, param={}, keyId={}",
|
||||||
|
getRequestURI(), name, keyId);
|
||||||
|
return failed(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
String plain = codec.decrypt(value, privateKey);
|
||||||
|
decrypted.put(value, plain);
|
||||||
|
usedKeyIds.add(keyId);
|
||||||
|
return plain;
|
||||||
|
} catch (PasswordDecryptException e) {
|
||||||
|
log.warn("전송암호화 복호화 실패 - uri={}, param={}, keyId={}, reason={}",
|
||||||
|
getRequestURI(), name, keyId, e.getMessage());
|
||||||
|
usedKeyIds.add(keyId);
|
||||||
|
return failed(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 봉투가 씌워지지 않은 파라미터 처리. 비밀번호 계열이 아니면 그대로 통과시킨다.
|
||||||
|
*
|
||||||
|
* <p>{@code ENFORCE} 에서 예외를 던지면 로그인 경로가 500 이 되므로 빈 값으로 바꿔
|
||||||
|
* 기존 인증 실패 흐름(아이디/비밀번호 확인)을 타게 한다.</p>
|
||||||
|
*/
|
||||||
|
private String handlePlaintext(String name, String value) {
|
||||||
|
PasswordCryptoProperties.PlaintextPolicy policy = properties.getPlaintextPolicy();
|
||||||
|
if (policy == PasswordCryptoProperties.PlaintextPolicy.NONE
|
||||||
|
|| !PasswordParamNames.isPasswordLike(name)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean reject = policy == PasswordCryptoProperties.PlaintextPolicy.ENFORCE;
|
||||||
|
if (!plaintextWarned) {
|
||||||
|
plaintextWarned = true;
|
||||||
|
log.warn("암호화되지 않은 비밀번호 파라미터 {} - policy={}, transport={}, uri={}, param={}",
|
||||||
|
reject ? "거부" : "허용", policy,
|
||||||
|
RequestTransport.isSecure((HttpServletRequest) getRequest()) ? "https" : "http",
|
||||||
|
getRequestURI(), name);
|
||||||
|
}
|
||||||
|
return reject ? "" : value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 복호화 실패 시의 값. 봉투 문자열을 그대로 흘려보내면 비밀번호 정책 검증 등이 엉뚱하게 통과할 수 있어
|
||||||
|
* 빈 값으로 바꾼다. 결과적으로 사용자에게는 일반적인 입력값 오류로 보인다.
|
||||||
|
*/
|
||||||
|
private String failed(String rawValue) {
|
||||||
|
decrypted.put(rawValue, "");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 클라이언트에 내려줄 공개키 1건. {@code PasswordKeyController} 응답 본문이기도 하다.
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class IssuedKey {
|
||||||
|
|
||||||
|
/** 봉투(ENC1)의 두 번째 세그먼트로 되돌아오는 키 식별자. */
|
||||||
|
private final String keyId;
|
||||||
|
|
||||||
|
/** X.509 SubjectPublicKeyInfo(SPKI) DER 을 표준 base64 로 인코딩한 값. */
|
||||||
|
private final String publicKey;
|
||||||
|
|
||||||
|
/** 남은 수명(초). 클라이언트 캐시 판단용. */
|
||||||
|
private final int expiresIn;
|
||||||
|
}
|
||||||
+76
@@ -0,0 +1,76 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 비밀번호 전송암호화 설정. {@code portal.security.password-encrypt.*}
|
||||||
|
*
|
||||||
|
* <p>브라우저 개발자도구 Network 탭에 비밀번호가 평문으로 보이는 것을 막기 위한 기능이다.</p>
|
||||||
|
*
|
||||||
|
* <p><b>이 기능은 XSS 방어도, MITM 방어도 아니다.</b> 스크립트가 주입되면 입력창에서 직접 탈취할 수 있고,
|
||||||
|
* HTTP 구간이면 중간자가 이 스크립트 자체를 바꿔치기할 수 있다. "전송 페이로드 평문 노출" 점검 지적에
|
||||||
|
* 대한 대응 범위로만 이해할 것.</p>
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties(prefix = "portal.security.password-encrypt")
|
||||||
|
public class PasswordCryptoProperties {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RSA 개인키 보관 범위.
|
||||||
|
*
|
||||||
|
* <ul>
|
||||||
|
* <li>{@code REQUEST} - 폼 진입마다 1회용 키를 발급하고 요청 1회 사용 후 폐기. 재전송 공격 차단이 가장 강하다.</li>
|
||||||
|
* <li>{@code SESSION} - 세션 단위로 키를 보관. 세션 복제 환경에 유리하다.</li>
|
||||||
|
* <li>{@code SERVER} - 서버 고정 키쌍 + TTL 로테이션. 무상태라 가장 단순하지만 재전송 방지 수단이 없다.</li>
|
||||||
|
* </ul>
|
||||||
|
*/
|
||||||
|
public enum KeyScope {
|
||||||
|
REQUEST, SESSION, SERVER
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 봉투(ENC1)가 적용되지 않은 <b>평문 비밀번호 파라미터</b>를 서버가 어떻게 다룰지.
|
||||||
|
* 전송 구간(HTTP/HTTPS) 자체를 막는 스위치가 아니다 — 전송 구간은 경고 문구에만 영향을 준다.
|
||||||
|
*
|
||||||
|
* <ul>
|
||||||
|
* <li>{@code NONE} - 무동작. 평문을 그대로 받는다.</li>
|
||||||
|
* <li>{@code PERMISSIVE} - 평문을 받되 서버 로그에 경고를 남기고, 화면에도 경고 팝업을 띄운다.</li>
|
||||||
|
* <li>{@code ENFORCE} - 평문 비밀번호를 거부한다(빈 값 치환 → 인증 실패).</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* <p>{@code ENFORCE} 는 전송 구간이 HTTP 여도 안전하게 켤 수 있다. {@link #softwareFallback} 이 켜져 있으면
|
||||||
|
* {@code crypto.subtle} 을 못 쓰는 환경에서도 클라이언트가 봉투를 만들기 때문이다. 다만 JS 를 끈
|
||||||
|
* 브라우저는 로그인하지 못하므로 {@code PERMISSIVE} 로 운영해 경고 로그를 지켜본 뒤 승격한다.</p>
|
||||||
|
*/
|
||||||
|
public enum PlaintextPolicy {
|
||||||
|
NONE, PERMISSIVE, ENFORCE
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 마스터 스위치. 꺼져 있으면 필터·엔드포인트가 모두 무동작이고 화면은 평문 전송한다. */
|
||||||
|
private boolean enabled = false;
|
||||||
|
|
||||||
|
/** 키 보관 범위. */
|
||||||
|
private KeyScope keyScope = KeyScope.REQUEST;
|
||||||
|
|
||||||
|
/** 발급된 키의 수명(초). REQUEST/SESSION 은 만료 기준, SERVER 는 로테이션 주기. */
|
||||||
|
private int keyTtlSeconds = 300;
|
||||||
|
|
||||||
|
/** 평문 비밀번호 파라미터 처리 정책. */
|
||||||
|
private PlaintextPolicy plaintextPolicy = PlaintextPolicy.NONE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code crypto.subtle} 을 쓸 수 없는 환경(원격 오리진 HTTP = 비 secure context)에서
|
||||||
|
* 순수 JS 구현(forge)으로 봉투를 만들지 여부.
|
||||||
|
*
|
||||||
|
* <p>forge 번들은 {@code crypto.subtle} 이 없을 때만 동적으로 내려가므로 HTTPS 운영 환경에서는
|
||||||
|
* 전송 바이트가 0 이다. 즉 이 값은 사실상 킬스위치다. 끄면 HTTP 개발환경은 평문으로 폴백한다
|
||||||
|
* ({@link #plaintextPolicy} 가 {@code ENFORCE} 면 로그인 불가).</p>
|
||||||
|
*/
|
||||||
|
private boolean softwareFallback = true;
|
||||||
|
|
||||||
|
/** RSA 키 길이. */
|
||||||
|
private int rsaKeySize = 2048;
|
||||||
|
}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 봉투 복호화 실패. 화면으로 스택을 올리지 않고 필터에서 흡수한다.
|
||||||
|
* 메시지에 평문이나 키 자료를 담지 않는다.
|
||||||
|
*/
|
||||||
|
public class PasswordDecryptException extends RuntimeException {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public PasswordDecryptException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PasswordDecryptException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
+81
@@ -0,0 +1,81 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
|
||||||
|
import javax.servlet.Filter;
|
||||||
|
import javax.servlet.FilterChain;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.ServletResponse;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 봉투(ENC1) 파라미터를 평문으로 되돌리는 서블릿 필터.
|
||||||
|
*
|
||||||
|
* <p>{@code PortalConfigSecurity} 에서 order {@code Integer.MIN_VALUE + 2} 로 등록해
|
||||||
|
* MultipartFilter({@code MIN_VALUE + 1}) "이후", Lucy XSS 필터({@code MIN_VALUE + 3}) "이전"에
|
||||||
|
* 실행된다. 자세한 이유는 {@link DecryptingRequestWrapper} / {@link DecryptingMultipartRequestWrapper}
|
||||||
|
* 주석 참고 — 멀티파트(파일 업로드 동반) 요청은 MultipartFilter 가 만든
|
||||||
|
* {@code MultipartHttpServletRequest} 가 폼 필드를 자체 파싱해 반환하므로, 이 필터가 그보다
|
||||||
|
* 먼저 실행되면 비밀번호 파라미터가 복호화되지 않은 채로 컨트롤러까지 전달된다(법인가입처럼
|
||||||
|
* 파일 첨부와 비밀번호가 같은 폼에 있는 경우 재현).</p>
|
||||||
|
*
|
||||||
|
* <p>기능이 꺼져 있거나 POST 가 아니면 아무것도 하지 않는다. 래퍼는 파라미터를 조회할 때만
|
||||||
|
* 복호화하므로, 봉투가 없는 요청에는 사실상 비용이 없다.</p>
|
||||||
|
*
|
||||||
|
* <p><b>{@code /internal/**} 은 대상에서 제외한다.</b> playwright 전용 테스트 정리 API
|
||||||
|
* ({@code TestCleanupInternalController} 등)는 공유 토큰({@code X-Internal-Token}) + IP 허용목록으로
|
||||||
|
* 이미 인증되는 서버-to-서버 호출이라 브라우저 암호화 대상이 아니다({@code MenuAccessInterceptor} 가
|
||||||
|
* 같은 이유로 {@code /internal/**} 을 제외하는 것과 동일 패턴). 이 경로를 필터에 그대로 태우면, 도구가
|
||||||
|
* 보내는 평문 {@code password} 파라미터가 {@code plaintext-policy=ENFORCE} 설정에 걸려 빈 문자열로
|
||||||
|
* 치환되고 내부 API 는 "필수값 누락"으로 거부한다(예: {@code /internal/test-cleanup/password}).</p>
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class PasswordDecryptFilter implements Filter {
|
||||||
|
|
||||||
|
private static final String INTERNAL_API_PREFIX = "/internal/";
|
||||||
|
|
||||||
|
private final PasswordCryptoProperties properties;
|
||||||
|
private final PasswordEnvelopeCodec codec;
|
||||||
|
private final PasswordKeyStore keyStore;
|
||||||
|
|
||||||
|
public PasswordDecryptFilter(PasswordCryptoProperties properties,
|
||||||
|
PasswordEnvelopeCodec codec,
|
||||||
|
PasswordKeyStore keyStore) {
|
||||||
|
this.properties = properties;
|
||||||
|
this.codec = codec;
|
||||||
|
this.keyStore = keyStore;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
|
||||||
|
throws IOException, ServletException {
|
||||||
|
|
||||||
|
if (!properties.isEnabled() || !(request instanceof HttpServletRequest)) {
|
||||||
|
chain.doFilter(request, response);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpServletRequest httpRequest = (HttpServletRequest) request;
|
||||||
|
if (!"POST".equalsIgnoreCase(httpRequest.getMethod()) || isInternalApiRequest(httpRequest)) {
|
||||||
|
chain.doFilter(request, response);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DecryptingRequestWrapper wrapper = httpRequest instanceof MultipartHttpServletRequest
|
||||||
|
? new DecryptingMultipartRequestWrapper((MultipartHttpServletRequest) httpRequest, codec, keyStore, properties)
|
||||||
|
: new DecryptingRequestWrapper(httpRequest, codec, keyStore, properties);
|
||||||
|
try {
|
||||||
|
chain.doFilter(wrapper, response);
|
||||||
|
} finally {
|
||||||
|
wrapper.consumeUsedKeys();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isInternalApiRequest(HttpServletRequest request) {
|
||||||
|
String path = request.getRequestURI().substring(request.getContextPath().length());
|
||||||
|
return path.startsWith(INTERNAL_API_PREFIX);
|
||||||
|
}
|
||||||
|
}
|
||||||
+104
@@ -0,0 +1,104 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.spec.GCMParameterSpec;
|
||||||
|
import javax.crypto.spec.OAEPParameterSpec;
|
||||||
|
import javax.crypto.spec.PSource;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.security.Key;
|
||||||
|
import java.security.PrivateKey;
|
||||||
|
import java.security.spec.MGF1ParameterSpec;
|
||||||
|
import java.util.Base64;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 클라이언트가 만든 봉투(envelope) 문자열의 파싱·복호화.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* ENC1.<keyId>.<b64url(RSA-OAEP(AES키))>.<b64url(iv 12B)>.<b64url(AES-GCM 암호문+태그)>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <p>세그먼트는 base64<b>url</b>(패딩 없음)이라 Lucy XSS 이스케이프와 urlencode 를 모두 통과해도
|
||||||
|
* 값이 변형되지 않는다.</p>
|
||||||
|
*
|
||||||
|
* <p>RSA-OAEP 는 반드시 MGF1 해시까지 SHA-256 으로 지정해야 한다. SunJCE 는
|
||||||
|
* {@code OAEPWithSHA-256AndMGF1Padding} 만 지정하면 MGF1 에 SHA-1 을 쓰는데,
|
||||||
|
* 브라우저 Web Crypto 의 {@code RSA-OAEP + SHA-256} 은 MGF1 도 SHA-256 이라 그대로 두면
|
||||||
|
* 복호화가 실패한다.</p>
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class PasswordEnvelopeCodec {
|
||||||
|
|
||||||
|
public static final String PREFIX = "ENC1.";
|
||||||
|
|
||||||
|
/** AES-GCM 인증 태그 길이(비트). Web Crypto 기본값과 동일. */
|
||||||
|
private static final int GCM_TAG_BITS = 128;
|
||||||
|
|
||||||
|
private static final Base64.Decoder URL_DECODER = Base64.getUrlDecoder();
|
||||||
|
|
||||||
|
/** 값이 봉투 형식인지. 파싱 비용 없이 접두사만 본다. */
|
||||||
|
public boolean isEnvelope(String value) {
|
||||||
|
return value != null && value.startsWith(PREFIX);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 봉투에서 keyId 만 추출. 형식이 어긋나면 {@code null}. */
|
||||||
|
public String keyIdOf(String value) {
|
||||||
|
String[] parts = split(value);
|
||||||
|
return parts == null ? null : parts[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RSA 개인키로 AES 키를 풀고 AES-GCM 으로 본문을 복호화한다.
|
||||||
|
*
|
||||||
|
* @throws PasswordDecryptException 형식 오류·키 불일치·태그 검증 실패
|
||||||
|
*/
|
||||||
|
public String decrypt(String value, PrivateKey privateKey) {
|
||||||
|
String[] parts = split(value);
|
||||||
|
if (parts == null) {
|
||||||
|
throw new PasswordDecryptException("봉투 형식이 올바르지 않다");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Key aesKey = unwrapAesKey(URL_DECODER.decode(parts[2]), privateKey);
|
||||||
|
byte[] iv = URL_DECODER.decode(parts[3]);
|
||||||
|
byte[] cipherText = URL_DECODER.decode(parts[4]);
|
||||||
|
|
||||||
|
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, aesKey, new GCMParameterSpec(GCM_TAG_BITS, iv));
|
||||||
|
return new String(cipher.doFinal(cipherText), StandardCharsets.UTF_8);
|
||||||
|
} catch (PasswordDecryptException e) {
|
||||||
|
throw e;
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new PasswordDecryptException("봉투 복호화 실패", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Key unwrapAesKey(byte[] wrapped, PrivateKey privateKey) {
|
||||||
|
try {
|
||||||
|
Cipher rsa = Cipher.getInstance("RSA/ECB/OAEPWithSHA-256AndMGF1Padding");
|
||||||
|
rsa.init(Cipher.DECRYPT_MODE, privateKey, new OAEPParameterSpec(
|
||||||
|
"SHA-256", "MGF1", MGF1ParameterSpec.SHA256, PSource.PSpecified.DEFAULT));
|
||||||
|
return new SecretKeySpec(rsa.doFinal(wrapped), "AES");
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new PasswordDecryptException("AES 키 언랩 실패", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** {@code ENC1.keyId.encKey.iv.cipher} 5개 세그먼트. 어긋나면 null. */
|
||||||
|
private String[] split(String value) {
|
||||||
|
if (!isEnvelope(value)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String[] parts = value.split("\\.", 5);
|
||||||
|
if (parts.length != 5) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (String part : parts) {
|
||||||
|
if (part.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return parts;
|
||||||
|
}
|
||||||
|
}
|
||||||
+57
@@ -0,0 +1,57 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
import org.springframework.http.CacheControl;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 비밀번호 전송암호화용 공개키 발급.
|
||||||
|
*
|
||||||
|
* <p>경로를 {@code /api/**} 아래에 둔 이유: {@code PortalConfigWebDispatcherServlet#addInterceptors}
|
||||||
|
* 가 {@code /api/**} 를 인터셉터(비밀번호 변경 강제·step-up 가드)에서 제외한다. 로그인 전 익명 상태에서
|
||||||
|
* 호출되므로 {@code /api/session/csrf} 와 같은 자리에 있어야 리다이렉트에 걸리지 않는다.</p>
|
||||||
|
*
|
||||||
|
* <p>GET 이라 CSRF 대상이 아니고, 공개키만 나가므로 인증도 요구하지 않는다.</p>
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/security")
|
||||||
|
public class PasswordKeyController {
|
||||||
|
|
||||||
|
private final PasswordCryptoProperties properties;
|
||||||
|
private final PasswordKeyStore keyStore;
|
||||||
|
|
||||||
|
public PasswordKeyController(PasswordCryptoProperties properties, PasswordKeyStore keyStore) {
|
||||||
|
this.properties = properties;
|
||||||
|
this.keyStore = keyStore;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/password-key.json")
|
||||||
|
public ResponseEntity<Map<String, Object>> issue(HttpServletRequest request) {
|
||||||
|
if (!properties.isEnabled()) {
|
||||||
|
// 클라이언트가 조용히 평문 폴백하도록 200 + enabled:false 로 답한다.
|
||||||
|
return noStore().body(Collections.<String, Object>singletonMap("enabled", Boolean.FALSE));
|
||||||
|
}
|
||||||
|
|
||||||
|
IssuedKey key = keyStore.issue(request);
|
||||||
|
Map<String, Object> body = new java.util.LinkedHashMap<>();
|
||||||
|
body.put("enabled", Boolean.TRUE);
|
||||||
|
body.put("alg", "RSA-OAEP-256");
|
||||||
|
body.put("keyId", key.getKeyId());
|
||||||
|
body.put("publicKey", key.getPublicKey());
|
||||||
|
body.put("expiresIn", key.getExpiresIn());
|
||||||
|
// REQUEST 는 1회용이라 클라이언트가 캐시하면 안 된다. 나머지는 만료까지 재사용해
|
||||||
|
// 비밀번호 검증용 ajax 가 호출마다 RSA 키쌍을 만들게 하지 않는다.
|
||||||
|
body.put("keyScope", properties.getKeyScope().name());
|
||||||
|
return noStore().body(body);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ResponseEntity.BodyBuilder noStore() {
|
||||||
|
return ResponseEntity.ok().cacheControl(CacheControl.noStore());
|
||||||
|
}
|
||||||
|
}
|
||||||
+52
@@ -0,0 +1,52 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
import java.security.KeyFactory;
|
||||||
|
import java.security.KeyPair;
|
||||||
|
import java.security.KeyPairGenerator;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.security.PrivateKey;
|
||||||
|
import java.security.PublicKey;
|
||||||
|
import java.security.spec.InvalidKeySpecException;
|
||||||
|
import java.security.spec.PKCS8EncodedKeySpec;
|
||||||
|
import java.util.Base64;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RSA 키쌍 생성/인코딩 헬퍼. 키 보관소 구현들이 공유한다.
|
||||||
|
*/
|
||||||
|
final class PasswordKeyPairs {
|
||||||
|
|
||||||
|
private PasswordKeyPairs() {
|
||||||
|
}
|
||||||
|
|
||||||
|
static KeyPair generate(int keySize) {
|
||||||
|
try {
|
||||||
|
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");
|
||||||
|
generator.initialize(keySize);
|
||||||
|
return generator.generateKeyPair();
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
throw new IllegalStateException("RSA 키쌍 생성 실패", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static String newKeyId() {
|
||||||
|
return UUID.randomUUID().toString().replace("-", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 브라우저 {@code crypto.subtle.importKey('spki', ...)} 가 그대로 먹는 형식. */
|
||||||
|
static String toSpkiBase64(PublicKey publicKey) {
|
||||||
|
return Base64.getEncoder().encodeToString(publicKey.getEncoded());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PKCS#8 바이트 → PrivateKey. 세션 복제(직렬화) 환경을 고려해
|
||||||
|
* {@link SessionScopedPasswordKeyStore} 는 키 객체 대신 바이트를 보관한다.
|
||||||
|
*/
|
||||||
|
static PrivateKey toPrivateKey(byte[] pkcs8) {
|
||||||
|
try {
|
||||||
|
return KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(pkcs8));
|
||||||
|
} catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
|
||||||
|
throw new IllegalStateException("RSA 개인키 복원 실패", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.security.PrivateKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 비밀번호 전송암호화용 RSA 키쌍 보관소. 구현체는 {@link PasswordCryptoProperties.KeyScope} 별로 존재하며
|
||||||
|
* {@link PasswordKeyStoreRouter} 가 설정값에 따라 위임한다.
|
||||||
|
*/
|
||||||
|
public interface PasswordKeyStore {
|
||||||
|
|
||||||
|
/** 새 공개키를 발급한다(구현에 따라 기존 키 재사용). */
|
||||||
|
IssuedKey issue(HttpServletRequest request);
|
||||||
|
|
||||||
|
/** keyId 에 대응하는 개인키. 없거나 만료됐으면 {@code null}. */
|
||||||
|
PrivateKey resolve(String keyId, HttpServletRequest request);
|
||||||
|
|
||||||
|
/** 요청 처리가 끝난 뒤 호출. 1회용 키를 폐기하는 구현에서만 의미가 있다. */
|
||||||
|
void consume(String keyId, HttpServletRequest request);
|
||||||
|
}
|
||||||
+57
@@ -0,0 +1,57 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.security.PrivateKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code portal.security.password-encrypt.key-scope} 설정값에 따라 실제 보관소로 위임한다.
|
||||||
|
* 설정은 yml 이므로 기동 시점에 고정된다(런타임 변경 시 재기동 필요).
|
||||||
|
*/
|
||||||
|
@Primary
|
||||||
|
@Component
|
||||||
|
public class PasswordKeyStoreRouter implements PasswordKeyStore {
|
||||||
|
|
||||||
|
private final PasswordCryptoProperties properties;
|
||||||
|
private final RequestScopedPasswordKeyStore requestScoped;
|
||||||
|
private final SessionScopedPasswordKeyStore sessionScoped;
|
||||||
|
private final ServerScopedPasswordKeyStore serverScoped;
|
||||||
|
|
||||||
|
public PasswordKeyStoreRouter(PasswordCryptoProperties properties,
|
||||||
|
RequestScopedPasswordKeyStore requestScoped,
|
||||||
|
SessionScopedPasswordKeyStore sessionScoped,
|
||||||
|
ServerScopedPasswordKeyStore serverScoped) {
|
||||||
|
this.properties = properties;
|
||||||
|
this.requestScoped = requestScoped;
|
||||||
|
this.sessionScoped = sessionScoped;
|
||||||
|
this.serverScoped = serverScoped;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IssuedKey issue(HttpServletRequest request) {
|
||||||
|
return delegate().issue(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PrivateKey resolve(String keyId, HttpServletRequest request) {
|
||||||
|
return delegate().resolve(keyId, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void consume(String keyId, HttpServletRequest request) {
|
||||||
|
delegate().consume(keyId, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
private PasswordKeyStore delegate() {
|
||||||
|
PasswordCryptoProperties.KeyScope scope = properties.getKeyScope();
|
||||||
|
if (scope == PasswordCryptoProperties.KeyScope.SESSION) {
|
||||||
|
return sessionScoped;
|
||||||
|
}
|
||||||
|
if (scope == PasswordCryptoProperties.KeyScope.SERVER) {
|
||||||
|
return serverScoped;
|
||||||
|
}
|
||||||
|
return requestScoped;
|
||||||
|
}
|
||||||
|
}
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 비밀번호 계열 파라미터명 판별. {@code plaintext-policy} 가 "평문으로 오면 안 되는 파라미터"를 가리는 데 쓴다.
|
||||||
|
*
|
||||||
|
* <p>실제 사용 중인 이름은 {@code password}, {@code password2}, {@code confirmPassword},
|
||||||
|
* {@code newPassword}, {@code currentPassword}, {@code inputPassword} 로 모두 "password" 를 포함한다.
|
||||||
|
* 향후 축약형이 생길 것을 대비해 {@code passwd}/{@code pwd} 도 함께 본다.</p>
|
||||||
|
*/
|
||||||
|
final class PasswordParamNames {
|
||||||
|
|
||||||
|
private PasswordParamNames() {
|
||||||
|
}
|
||||||
|
|
||||||
|
static boolean isPasswordLike(String name) {
|
||||||
|
if (name == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
String lower = name.toLowerCase();
|
||||||
|
return lower.contains("password") || lower.contains("passwd") || lower.contains("pwd");
|
||||||
|
}
|
||||||
|
}
|
||||||
+90
@@ -0,0 +1,90 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.security.KeyPair;
|
||||||
|
import java.security.PrivateKey;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 폼 진입마다 1회용 키를 발급하고 요청 1회 사용 후 폐기하는 보관소({@code key-scope: REQUEST}).
|
||||||
|
*
|
||||||
|
* <p>같은 keyId 로 두 번 복호화할 수 없으므로 재전송(replay) 공격이 차단된다. 개인키가 인스턴스
|
||||||
|
* 로컬 메모리에만 있으므로 WebLogic 다중 인스턴스에서는 스티키 세션이 전제다(현재 CSRF·단일세션
|
||||||
|
* 강제가 이미 세션 고정을 전제한다).</p>
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class RequestScopedPasswordKeyStore implements PasswordKeyStore {
|
||||||
|
|
||||||
|
/** 메모리 폭주 방지 상한. 초과 시 만료 스윕 후에도 남으면 발급을 거절하지 않고 가장 오래된 것부터 버린다. */
|
||||||
|
private static final int MAX_ENTRIES = 20_000;
|
||||||
|
|
||||||
|
private final PasswordCryptoProperties properties;
|
||||||
|
private final Map<String, Entry> entries = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
public RequestScopedPasswordKeyStore(PasswordCryptoProperties properties) {
|
||||||
|
this.properties = properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IssuedKey issue(HttpServletRequest request) {
|
||||||
|
sweep();
|
||||||
|
KeyPair keyPair = PasswordKeyPairs.generate(properties.getRsaKeySize());
|
||||||
|
String keyId = PasswordKeyPairs.newKeyId();
|
||||||
|
int ttl = properties.getKeyTtlSeconds();
|
||||||
|
entries.put(keyId, new Entry(keyPair.getPrivate(), System.currentTimeMillis() + ttl * 1000L));
|
||||||
|
return new IssuedKey(keyId, PasswordKeyPairs.toSpkiBase64(keyPair.getPublic()), ttl);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PrivateKey resolve(String keyId, HttpServletRequest request) {
|
||||||
|
Entry entry = entries.get(keyId);
|
||||||
|
if (entry == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (entry.expiresAt < System.currentTimeMillis()) {
|
||||||
|
entries.remove(keyId);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return entry.privateKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void consume(String keyId, HttpServletRequest request) {
|
||||||
|
entries.remove(keyId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 만료 항목 정리. 발급 시점에만 돌리므로 별도 스케줄러가 필요 없다. */
|
||||||
|
private void sweep() {
|
||||||
|
long now = System.currentTimeMillis();
|
||||||
|
Iterator<Map.Entry<String, Entry>> it = entries.entrySet().iterator();
|
||||||
|
while (it.hasNext()) {
|
||||||
|
if (it.next().getValue().expiresAt < now) {
|
||||||
|
it.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (entries.size() >= MAX_ENTRIES) {
|
||||||
|
log.warn("비밀번호 전송암호화 키 보관소 상한 초과 - size={}, 오래된 항목을 버린다", entries.size());
|
||||||
|
Iterator<Map.Entry<String, Entry>> overflow = entries.entrySet().iterator();
|
||||||
|
while (overflow.hasNext() && entries.size() >= MAX_ENTRIES) {
|
||||||
|
overflow.next();
|
||||||
|
overflow.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class Entry {
|
||||||
|
private final PrivateKey privateKey;
|
||||||
|
private final long expiresAt;
|
||||||
|
|
||||||
|
private Entry(PrivateKey privateKey, long expiresAt) {
|
||||||
|
this.privateKey = privateKey;
|
||||||
|
this.expiresAt = expiresAt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 요청이 TLS 구간으로 들어왔는지 판정한다. 경고 로그 문구를 가르는 용도다.
|
||||||
|
*
|
||||||
|
* <p>{@code request.isSecure()} 만 봐서는 안 된다. {@code PasswordDecryptFilter} 는 Lucy XSS 필터보다
|
||||||
|
* 먼저 돌아야 해서 order 가 {@code Integer.MIN_VALUE} 인데, {@code ForwardedHeaderFilter}
|
||||||
|
* ({@code PortalConfigForwardedHeader}) 도 {@code Ordered.HIGHEST_PRECEDENCE} = 같은 값이라
|
||||||
|
* 둘의 상대 순서가 보장되지 않는다. 즉 이 시점의 {@code isSecure()} 는 {@code X-Forwarded-Proto}
|
||||||
|
* 교정 <b>전</b> 값일 수 있다.</p>
|
||||||
|
*
|
||||||
|
* <p>그래서 헤더를 직접 본다. 앞단 프록시가 신뢰 경계 안이라는 전제는 {@code ForwardedHeaderFilter} 와 같다.</p>
|
||||||
|
*/
|
||||||
|
final class RequestTransport {
|
||||||
|
|
||||||
|
private RequestTransport() {
|
||||||
|
}
|
||||||
|
|
||||||
|
static boolean isSecure(HttpServletRequest request) {
|
||||||
|
String proto = request.getHeader("X-Forwarded-Proto");
|
||||||
|
if (proto != null && !proto.isEmpty()) {
|
||||||
|
// 프록시가 여러 단이면 "https, http" 처럼 쌓인다. 클라이언트에 가장 가까운 첫 값이 기준이다.
|
||||||
|
int comma = proto.indexOf(',');
|
||||||
|
String first = (comma >= 0 ? proto.substring(0, comma) : proto).trim();
|
||||||
|
return "https".equalsIgnoreCase(first);
|
||||||
|
}
|
||||||
|
return request.isSecure();
|
||||||
|
}
|
||||||
|
}
|
||||||
+81
@@ -0,0 +1,81 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.security.KeyPair;
|
||||||
|
import java.security.PrivateKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 서버 고정 키쌍 + TTL 로테이션 구현({@code key-scope: SERVER}).
|
||||||
|
*
|
||||||
|
* <p>직전 키를 1개 유예 보관해, 로테이션 순간에 이미 공개키를 받아 간 폼이 제출돼도 복호화된다.
|
||||||
|
* 재전송 방지 수단은 없으므로(같은 봉투를 여러 번 보내도 복호화됨) 인증 실패횟수 제한·계정 잠금에
|
||||||
|
* 의존한다. 무상태라 다중 인스턴스에서도 각자 동작하지만, 인스턴스마다 키가 달라
|
||||||
|
* 공개키 발급과 폼 제출이 같은 인스턴스로 가야 한다.</p>
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class ServerScopedPasswordKeyStore implements PasswordKeyStore {
|
||||||
|
|
||||||
|
private final PasswordCryptoProperties properties;
|
||||||
|
|
||||||
|
private volatile Holder current;
|
||||||
|
private volatile Holder previous;
|
||||||
|
|
||||||
|
public ServerScopedPasswordKeyStore(PasswordCryptoProperties properties) {
|
||||||
|
this.properties = properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IssuedKey issue(HttpServletRequest request) {
|
||||||
|
Holder holder = currentHolder();
|
||||||
|
int remaining = (int) Math.max(1, (holder.expiresAt - System.currentTimeMillis()) / 1000L);
|
||||||
|
return new IssuedKey(holder.keyId, holder.publicKeySpki, remaining);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PrivateKey resolve(String keyId, HttpServletRequest request) {
|
||||||
|
Holder holder = current;
|
||||||
|
if (holder != null && holder.keyId.equals(keyId)) {
|
||||||
|
return holder.privateKey;
|
||||||
|
}
|
||||||
|
Holder old = previous;
|
||||||
|
if (old != null && old.keyId.equals(keyId)) {
|
||||||
|
return old.privateKey;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void consume(String keyId, HttpServletRequest request) {
|
||||||
|
// 고정 키라 폐기하지 않는다.
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized Holder currentHolder() {
|
||||||
|
long now = System.currentTimeMillis();
|
||||||
|
if (current == null || current.expiresAt < now) {
|
||||||
|
KeyPair keyPair = PasswordKeyPairs.generate(properties.getRsaKeySize());
|
||||||
|
previous = current;
|
||||||
|
current = new Holder(
|
||||||
|
PasswordKeyPairs.newKeyId(),
|
||||||
|
keyPair.getPrivate(),
|
||||||
|
PasswordKeyPairs.toSpkiBase64(keyPair.getPublic()),
|
||||||
|
now + properties.getKeyTtlSeconds() * 1000L);
|
||||||
|
}
|
||||||
|
return current;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class Holder {
|
||||||
|
private final String keyId;
|
||||||
|
private final PrivateKey privateKey;
|
||||||
|
private final String publicKeySpki;
|
||||||
|
private final long expiresAt;
|
||||||
|
|
||||||
|
private Holder(String keyId, PrivateKey privateKey, String publicKeySpki, long expiresAt) {
|
||||||
|
this.keyId = keyId;
|
||||||
|
this.privateKey = privateKey;
|
||||||
|
this.publicKeySpki = publicKeySpki;
|
||||||
|
this.expiresAt = expiresAt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+84
@@ -0,0 +1,84 @@
|
|||||||
|
package com.eactive.apim.portal.common.security.passwordcrypto;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.security.KeyPair;
|
||||||
|
import java.security.PrivateKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 세션 단위로 키쌍을 보관하는 구현({@code key-scope: SESSION}).
|
||||||
|
*
|
||||||
|
* <p>개인키를 객체가 아니라 PKCS#8 바이트로 들고 있어 세션 복제(직렬화)에도 안전하다.
|
||||||
|
* 같은 keyId 가 세션 수명 동안 재사용되므로 재전송 방지는 IV 랜덤성과 애플리케이션의
|
||||||
|
* 인증 실패횟수 제한에 의존한다.</p>
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class SessionScopedPasswordKeyStore implements PasswordKeyStore {
|
||||||
|
|
||||||
|
private static final String SESSION_ATTR = "DJB_PWD_CRYPTO_KEY";
|
||||||
|
|
||||||
|
private final PasswordCryptoProperties properties;
|
||||||
|
|
||||||
|
public SessionScopedPasswordKeyStore(PasswordCryptoProperties properties) {
|
||||||
|
this.properties = properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IssuedKey issue(HttpServletRequest request) {
|
||||||
|
HttpSession session = request.getSession(true);
|
||||||
|
Holder holder = (Holder) session.getAttribute(SESSION_ATTR);
|
||||||
|
long now = System.currentTimeMillis();
|
||||||
|
if (holder == null || holder.expiresAt < now) {
|
||||||
|
KeyPair keyPair = PasswordKeyPairs.generate(properties.getRsaKeySize());
|
||||||
|
holder = new Holder(
|
||||||
|
PasswordKeyPairs.newKeyId(),
|
||||||
|
keyPair.getPrivate().getEncoded(),
|
||||||
|
PasswordKeyPairs.toSpkiBase64(keyPair.getPublic()),
|
||||||
|
now + properties.getKeyTtlSeconds() * 1000L);
|
||||||
|
session.setAttribute(SESSION_ATTR, holder);
|
||||||
|
}
|
||||||
|
int remaining = (int) Math.max(1, (holder.expiresAt - now) / 1000L);
|
||||||
|
return new IssuedKey(holder.keyId, holder.publicKeySpki, remaining);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PrivateKey resolve(String keyId, HttpServletRequest request) {
|
||||||
|
HttpSession session = request.getSession(false);
|
||||||
|
if (session == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Holder holder = (Holder) session.getAttribute(SESSION_ATTR);
|
||||||
|
if (holder == null || !holder.keyId.equals(keyId)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (holder.expiresAt < System.currentTimeMillis()) {
|
||||||
|
session.removeAttribute(SESSION_ATTR);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return PasswordKeyPairs.toPrivateKey(holder.privateKeyPkcs8);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void consume(String keyId, HttpServletRequest request) {
|
||||||
|
// 세션 수명 동안 재사용한다.
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final class Holder implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private final String keyId;
|
||||||
|
private final byte[] privateKeyPkcs8;
|
||||||
|
private final String publicKeySpki;
|
||||||
|
private final long expiresAt;
|
||||||
|
|
||||||
|
private Holder(String keyId, byte[] privateKeyPkcs8, String publicKeySpki, long expiresAt) {
|
||||||
|
this.keyId = keyId;
|
||||||
|
this.privateKeyPkcs8 = privateKeyPkcs8;
|
||||||
|
this.publicKeySpki = publicKeySpki;
|
||||||
|
this.expiresAt = expiresAt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,18 +1,5 @@
|
|||||||
package com.eactive.apim.portal.common.util;
|
package com.eactive.apim.portal.common.util;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.security.InvalidKeyException;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.util.Base64;
|
|
||||||
import javax.crypto.BadPaddingException;
|
|
||||||
import javax.crypto.Cipher;
|
|
||||||
import javax.crypto.IllegalBlockSizeException;
|
|
||||||
import javax.crypto.NoSuchPaddingException;
|
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
@Component("encryptionUtil")
|
|
||||||
public class EncryptionUtil {
|
public class EncryptionUtil {
|
||||||
|
|
||||||
public static String generateNewPassword() {
|
public static String generateNewPassword() {
|
||||||
@@ -53,40 +40,4 @@ public class EncryptionUtil {
|
|||||||
return newpassword.toString();
|
return newpassword.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Value("${encryption.key:kjbank_portal_application_1357902}")
|
|
||||||
private String secretKey; // Should be 16, 24, or 32 bytes long for AES-128, AES-192, or AES-256
|
|
||||||
|
|
||||||
private static final String ALGORITHM = "AES";
|
|
||||||
|
|
||||||
private SecretKeySpec createSecretKey() {
|
|
||||||
byte[] key = secretKey.getBytes(StandardCharsets.UTF_8);
|
|
||||||
return new SecretKeySpec(key, ALGORITHM);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String encrypt(String value) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
|
|
||||||
if (value == null || value.isEmpty()) {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
SecretKeySpec key = createSecretKey();
|
|
||||||
Cipher cipher = Cipher.getInstance(ALGORITHM);
|
|
||||||
cipher.init(Cipher.ENCRYPT_MODE, key);
|
|
||||||
|
|
||||||
byte[] encryptedBytes = cipher.doFinal(value.getBytes());
|
|
||||||
return Base64.getEncoder().encodeToString(encryptedBytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String decrypt(String encrypted) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
|
|
||||||
if (encrypted == null || encrypted.isEmpty()) {
|
|
||||||
return encrypted;
|
|
||||||
}
|
|
||||||
|
|
||||||
SecretKeySpec key = createSecretKey();
|
|
||||||
Cipher cipher = Cipher.getInstance(ALGORITHM);
|
|
||||||
cipher.init(Cipher.DECRYPT_MODE, key);
|
|
||||||
|
|
||||||
byte[] decryptedBytes = cipher.doFinal(Base64.getDecoder().decode(encrypted));
|
|
||||||
return new String(decryptedBytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.eactive.apim.portal.common.util;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.jsoup.Jsoup;
|
||||||
|
import org.jsoup.nodes.Document;
|
||||||
|
import org.jsoup.parser.Parser;
|
||||||
|
import org.jsoup.safety.Safelist;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 관리자가 작성한 공지 본문(HTML)을 화면에 그대로 넣을 수 있게 정제한다.
|
||||||
|
*
|
||||||
|
* <p>공지 본문은 eapim-admin(Summernote 에디터, PTL_PROPERTY 문구)에서 저장되는데, 저장 경로의
|
||||||
|
* XSS 필터 때문에 태그가 엔티티로 escape 된 채(예: {@code <p>}) 들어오는 경우가 있다.
|
||||||
|
* 일부만 escape 되기도 한다 - 자동 탐지 공지는 머리말만 PTL_PROPERTY 문구라 그 부분만 escape 된다.
|
||||||
|
* 공지 상세 화면은 클라이언트에서 엔티티를 한 번 풀어 렌더하므로 여기서도 같은 기준으로 한 번 푼다.</p>
|
||||||
|
*
|
||||||
|
* <p>푼 결과는 허용 태그만 남기고 나머지 태그는 제거한다(텍스트는 유지, script/style 은 내용째 제거).
|
||||||
|
* 속성은 링크·이미지·표 병합에 필요한 것만 남기며 style·class·on* 이벤트는 모두 버린다.</p>
|
||||||
|
*/
|
||||||
|
public final class NoticeHtmlSanitizer {
|
||||||
|
|
||||||
|
/** 상대 링크 판정용 기준 URI. 상대 링크는 {@link Safelist#preserveRelativeLinks} 로 그대로 남는다 */
|
||||||
|
private static final String BASE_URI = "http://localhost/";
|
||||||
|
|
||||||
|
/** Summernote 출력 + editor-content.css 가 스타일을 갖는 태그 */
|
||||||
|
private static final Safelist SAFELIST = new Safelist()
|
||||||
|
.addTags("p", "br", "hr", "div", "span",
|
||||||
|
"b", "strong", "i", "em", "u", "s", "strike", "del", "mark", "sub", "sup", "code", "pre",
|
||||||
|
"blockquote", "h1", "h2", "h3", "h4", "h5", "h6", "ul", "ol", "li",
|
||||||
|
"table", "caption", "colgroup", "col", "thead", "tbody", "tfoot", "tr", "th", "td",
|
||||||
|
"a", "img")
|
||||||
|
.addAttributes("a", "href", "title", "target")
|
||||||
|
.addAttributes("img", "src", "alt", "title", "width", "height")
|
||||||
|
.addAttributes("th", "colspan", "rowspan")
|
||||||
|
.addAttributes("td", "colspan", "rowspan")
|
||||||
|
.addAttributes("ol", "start")
|
||||||
|
.addProtocols("a", "href", "http", "https", "mailto", "tel")
|
||||||
|
// Summernote 는 붙여 넣은 이미지를 base64 data URI 로 본문에 넣는다
|
||||||
|
.addProtocols("img", "src", "http", "https", "data")
|
||||||
|
.addEnforcedAttribute("a", "rel", "noopener noreferrer")
|
||||||
|
.preserveRelativeLinks(true);
|
||||||
|
|
||||||
|
private static final Document.OutputSettings OUTPUT_SETTINGS = new Document.OutputSettings().prettyPrint(false);
|
||||||
|
|
||||||
|
private NoticeHtmlSanitizer() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return 정제된 HTML. 입력이 비었거나 정제 후 남는 내용이 없으면 {@code null}
|
||||||
|
*/
|
||||||
|
public static String sanitize(String html) {
|
||||||
|
if (StringUtils.isBlank(html)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String decoded = Parser.unescapeEntities(html, false);
|
||||||
|
String cleaned = Jsoup.clean(decoded, BASE_URI, SAFELIST, OUTPUT_SETTINGS);
|
||||||
|
return StringUtils.isBlank(cleaned) ? null : cleaned;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -172,6 +172,50 @@ public class StringMaskingUtil {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 요청 파라미터 로깅 시 값을 통째로 가릴 키. 부분일치(소문자)로 본다. */
|
||||||
|
private static final String[] SENSITIVE_PARAM_KEYWORDS = {
|
||||||
|
"password", "passwd", "pwd", "secret", "credential", "token"};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 요청 파라미터 맵을 로그용 문자열로 만든다. 비밀번호·시크릿·토큰 계열 키는 값을 {@code [****]} 로 가린다.
|
||||||
|
*
|
||||||
|
* <p>비밀번호 전송암호화가 켜져 있어도 이 시점의 파라미터는 이미 복호화된 평문이므로,
|
||||||
|
* 마스킹 없이 로깅하면 암호화 조치가 무의미해진다.</p>
|
||||||
|
*
|
||||||
|
* <pre>id=[user@a.com], password=[****]</pre>
|
||||||
|
*/
|
||||||
|
public static String maskParameterMap(java.util.Map<String, String[]> parameterMap) {
|
||||||
|
if (parameterMap == null || parameterMap.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (java.util.Map.Entry<String, String[]> entry : parameterMap.entrySet()) {
|
||||||
|
if (sb.length() > 0) {
|
||||||
|
sb.append(", ");
|
||||||
|
}
|
||||||
|
sb.append(entry.getKey()).append('=');
|
||||||
|
if (isSensitiveParamName(entry.getKey())) {
|
||||||
|
sb.append("[****]");
|
||||||
|
} else {
|
||||||
|
sb.append(Arrays.toString(entry.getValue()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isSensitiveParamName(String name) {
|
||||||
|
if (!isValidString(name)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
String lower = name.toLowerCase();
|
||||||
|
for (String keyword : SENSITIVE_PARAM_KEYWORDS) {
|
||||||
|
if (lower.contains(keyword)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// 폼(application/x-www-form-urlencoded) 본문에서 값을 리댁트할 파라미터 키(소문자 완전일치)
|
// 폼(application/x-www-form-urlencoded) 본문에서 값을 리댁트할 파라미터 키(소문자 완전일치)
|
||||||
private static final java.util.Set<String> SENSITIVE_FORM_PARAMS = new java.util.HashSet<>(Arrays.asList(
|
private static final java.util.Set<String> SENSITIVE_FORM_PARAMS = new java.util.HashSet<>(Arrays.asList(
|
||||||
"client_secret", "clientsecret", "secret", "password", "passwd", "pwd",
|
"client_secret", "clientsecret", "secret", "password", "passwd", "pwd",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.eactive.apim.portal.common.validator;
|
package com.eactive.apim.portal.common.validator;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.commons.lang3.Strings;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.validation.ConstraintValidator;
|
import javax.validation.ConstraintValidator;
|
||||||
@@ -39,14 +40,8 @@ public class CellPhoneValidator implements ConstraintValidator<CellPhone, String
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 기존의 prefix 체크 로직 유지
|
// 기존의 prefix 체크 로직 유지
|
||||||
return StringUtils.startsWith(cellPhone, "+821") ||
|
return Strings.CS.startsWithAny(cellPhone,
|
||||||
StringUtils.startsWith(cellPhone, "821") ||
|
"+821", "821", "010", "011", "016", "017", "018", "019");
|
||||||
StringUtils.startsWith(cellPhone, "010") ||
|
|
||||||
StringUtils.startsWith(cellPhone, "011") ||
|
|
||||||
StringUtils.startsWith(cellPhone, "016") ||
|
|
||||||
StringUtils.startsWith(cellPhone, "017") ||
|
|
||||||
StringUtils.startsWith(cellPhone, "018") ||
|
|
||||||
StringUtils.startsWith(cellPhone, "019");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isValidPartLength(String prefix, String middle, String last) {
|
private boolean isValidPartLength(String prefix, String middle, String last) {
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.eactive.apim.portal.common.validator;
|
package com.eactive.apim.portal.common.validator;
|
||||||
|
|
||||||
|
import com.eactive.apim.portal.common.security.PasswordPolicyProperties;
|
||||||
import com.eactive.apim.portal.common.util.PhoneNumberUtil;
|
import com.eactive.apim.portal.common.util.PhoneNumberUtil;
|
||||||
import org.apache.commons.beanutils.PropertyUtils;
|
import org.apache.commons.beanutils.PropertyUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import javax.validation.ConstraintValidator;
|
import javax.validation.ConstraintValidator;
|
||||||
import javax.validation.ConstraintValidatorContext;
|
import javax.validation.ConstraintValidatorContext;
|
||||||
@@ -26,6 +28,23 @@ public class PasswordRuleValidator implements ConstraintValidator<PasswordRule,
|
|||||||
// 공백 문자 정규식
|
// 공백 문자 정규식
|
||||||
private static final String BLANKPT = "(\\s)";
|
private static final String BLANKPT = "(\\s)";
|
||||||
|
|
||||||
|
/** 키보드 배열 인접 판정 기준 길이 (기존 연속 문자/숫자 규칙과 동일하게 3자) */
|
||||||
|
private static final int KEYBOARD_SEQUENCE_LENGTH = 3;
|
||||||
|
/** 키보드 배열 행. 대문자 기준으로 비교한다. */
|
||||||
|
private static final String[] KEYBOARD_ROWS = {
|
||||||
|
"QWERTYUIOP",
|
||||||
|
"ASDFGHJKL",
|
||||||
|
"ZXCVBNM",
|
||||||
|
"1234567890"
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 키보드 연속 문자 차단 여부. Spring 이 관리하는 경로(LocalValidatorFactoryBean)에서만 주입되며,
|
||||||
|
* 순수 {@code new} 로 생성된 경우 null 이라 기본값(차단)으로 동작한다.
|
||||||
|
*/
|
||||||
|
@Autowired(required = false)
|
||||||
|
private PasswordPolicyProperties passwordPolicyProperties;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(PasswordRule constraintAnnotation) {
|
public void initialize(PasswordRule constraintAnnotation) {
|
||||||
this.password = constraintAnnotation.password();
|
this.password = constraintAnnotation.password();
|
||||||
@@ -48,10 +67,21 @@ public class PasswordRuleValidator implements ConstraintValidator<PasswordRule,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return isValid(passwordValue, loginIdValue, mobileNumberValue);
|
return isValid(passwordValue, loginIdValue, mobileNumberValue, keyboardSequenceBlocked());
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 주입이 안 된 경우(순수 new)에는 기본값인 차단으로 동작한다. */
|
||||||
|
private boolean keyboardSequenceBlocked() {
|
||||||
|
return passwordPolicyProperties == null
|
||||||
|
? PasswordPolicyProperties.DEFAULT_KEYBOARD_SEQUENCE_BLOCK
|
||||||
|
: passwordPolicyProperties.isKeyboardSequenceBlocked();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isValid(String password, String loginId, String mobileNumber) {
|
public boolean isValid(String password, String loginId, String mobileNumber) {
|
||||||
|
return isValid(password, loginId, mobileNumber, PasswordPolicyProperties.DEFAULT_KEYBOARD_SEQUENCE_BLOCK);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isValid(String password, String loginId, String mobileNumber, boolean blockKeyboardSequence) {
|
||||||
// 영어, 숫자, 특수문자 포함한 MIN to MAX 글자 정규식
|
// 영어, 숫자, 특수문자 포함한 MIN to MAX 글자 정규식
|
||||||
String REGEX = "^((?=.*\\d)(?=.*[a-zA-Z])(?=.*[\\W]).{" + MIN + "," + MAX + "})$";
|
String REGEX = "^((?=.*\\d)(?=.*[a-zA-Z])(?=.*[\\W]).{" + MIN + "," + MAX + "})$";
|
||||||
|
|
||||||
@@ -81,6 +111,11 @@ public class PasswordRuleValidator implements ConstraintValidator<PasswordRule,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 키보드 배열 연속 문자 체크 (PortalProperty 로 on/off)
|
||||||
|
if (blockKeyboardSequence && hasKeyboardSequence(password)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// 공백 체크
|
// 공백 체크
|
||||||
matcher = Pattern.compile(BLANKPT).matcher(tmpPw);
|
matcher = Pattern.compile(BLANKPT).matcher(tmpPw);
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
@@ -118,6 +153,29 @@ public class PasswordRuleValidator implements ConstraintValidator<PasswordRule,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 키보드 배열상 인접한 문자가 {@value #KEYBOARD_SEQUENCE_LENGTH} 자 이상 이어지는지 (정·역방향 모두).
|
||||||
|
*
|
||||||
|
* <p>같은 행(row) 안에서 좌우로 이어지는 경우만 본다. 예) {@code qwe}, {@code asd}, {@code trewq}.
|
||||||
|
* 클라이언트 {@code static/js/password-policy.js} 의 {@code hasKeyboardSequence} 와 동일 규칙이어야 한다.</p>
|
||||||
|
*/
|
||||||
|
public static boolean hasKeyboardSequence(String password) {
|
||||||
|
if (password == null || password.length() < KEYBOARD_SEQUENCE_LENGTH) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
String tmpPw = password.toUpperCase();
|
||||||
|
for (int i = 0; i <= tmpPw.length() - KEYBOARD_SEQUENCE_LENGTH; i++) {
|
||||||
|
String chunk = tmpPw.substring(i, i + KEYBOARD_SEQUENCE_LENGTH);
|
||||||
|
String reversed = new StringBuilder(chunk).reverse().toString();
|
||||||
|
for (String row : KEYBOARD_ROWS) {
|
||||||
|
if (row.contains(chunk) || row.contains(reversed)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/** 아이디(이메일)의 @ 앞 local part 가 비밀번호에 포함되는지 (대소문자 무시) */
|
/** 아이디(이메일)의 @ 앞 local part 가 비밀번호에 포함되는지 (대소문자 무시) */
|
||||||
public static boolean containsLoginIdLocalPart(String password, String loginId) {
|
public static boolean containsLoginIdLocalPart(String password, String loginId) {
|
||||||
if (password == null || loginId == null || loginId.isEmpty()) {
|
if (password == null || loginId == null || loginId.isEmpty()) {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user