merge: (#1034) gateway 서버를 main서버로 흡수 - #1038
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughGateway의 JWT 인증과 CORS를 dms-main으로 이전하고, Passport 무결성 계층과 dms-gateway 모듈을 제거했다. Gradle, CI, JaCoCo, Codecov 설정은 main 서비스만 대상으로 조정했다. ChangesGateway 기능 통합 및 제거
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Client
participant JwtAuthenticationFilter
participant JwtParser
participant SecurityContext
Client->>JwtAuthenticationFilter: Bearer JWT 요청
JwtAuthenticationFilter->>JwtParser: extractUserInfo(token)
JwtParser-->>JwtAuthenticationFilter: PassportUser
JwtAuthenticationFilter->>SecurityContext: 인증 객체 저장
JwtAuthenticationFilter-->>Client: 필터 체인 계속 진행
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
dms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtParser.kt (1)
34-49: 📐 Maintainability & Code Quality | 🔵 Trivial예상치 못한 예외의 원인 정보가 사라집니다.
catch (e: Exception) { throw InternalServerError }에서 원본 예외e를 로깅하거나 cause로 체이닝하지 않아, 실제 운영 환경에서 500 에러가 발생했을 때 근본 원인을 추적하기 어렵습니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@dms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtParser.kt` around lines 34 - 49, Update the unexpected-exception handler in getClaims so the original exception e is preserved when throwing InternalServerError, either by chaining it as the cause or logging it through the established error-logging mechanism. Keep the existing ExpiredJwtException, InvalidClaimException, and JwtException handling unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@codecov.yml`:
- Line 9: 실제 업로드 수와 일치하도록 codecov.yml 9-9의 after_n_builds 값을 조정하세요.
.github/workflows/CI.yml 23-23의 codecov-action은 main-service에 대해 한 번만 실행되므로 해당
단일 업로드를 기다리도록 설정하고, CI.yml에는 별도 변경이 필요 없습니다.
In
`@dms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/JwtAuthenticationFilter.kt`:
- Around line 28-33: Update JwtAuthenticationFilter.shouldNotFilter to consider
the request HTTP method alongside the path, so only methods explicitly allowed
for each SecurityPaths.PERMIT_ALL_PATHS entry bypass JWT parsing. Ensure
/schools/code bypasses authentication for GET but not PATCH, preserving the
existing path-matching behavior for other permitted paths.
In
`@dms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtParser.kt`:
- Around line 52-56: Update the authority parsing in JwtParser so a missing
AUTHORITY claim is also converted to InvalidTokenException. Handle the nullable
result from claims.get(...) together with invalid enum values, while preserving
the existing valid-authority behavior.
---
Nitpick comments:
In
`@dms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtParser.kt`:
- Around line 34-49: Update the unexpected-exception handler in getClaims so the
original exception e is preserved when throwing InternalServerError, either by
chaining it as the cause or logging it through the established error-logging
mechanism. Keep the existing ExpiredJwtException, InvalidClaimException, and
JwtException handling unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 9ef59b61-7d59-434b-ae37-ecc02b6799c4
📒 Files selected for processing (57)
.github/workflows/CI.ymlbuild.gradle.ktscodecov.ymldms-gateway/Dockerfiledms-gateway/build.gradle.ktsdms-gateway/gateway-core/build.gradle.ktsdms-gateway/gateway-core/config/detekt/detekt.ymldms-gateway/gateway-core/src/main/kotlin/team/aliens/dms/common/error/DmsException.ktdms-gateway/gateway-core/src/main/kotlin/team/aliens/dms/common/error/ErrorProperty.ktdms-gateway/gateway-core/src/main/kotlin/team/aliens/dms/common/error/ErrorStatus.ktdms-gateway/gateway-core/src/main/kotlin/team/aliens/dms/domain/auth/model/Authority.ktdms-gateway/gateway-core/src/main/kotlin/team/aliens/dms/domain/auth/model/Passport.ktdms-gateway/gateway-core/src/main/kotlin/team/aliens/dms/domain/auth/model/UserAuthInfo.ktdms-gateway/gateway-infrastructure/build.gradle.ktsdms-gateway/gateway-infrastructure/config/detekt/detekt.ymldms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/DmsGatewayApplication.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/config/JacksonConfig.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/config/PropertiesScanConfig.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/config/RouteConfig.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/config/properties/ServicesProperties.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/error/GatewayGlobalExceptionHandler.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/error/GlobalErrorCode.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/error/GlobalExceptions.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/AuthorizationHeaderGatewayFilterFactory.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityPaths.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityProperties.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/ExpiredTokenException.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/InvalidTokenException.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/error/SecurityErrorCode.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportAdapter.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportIntegrityGenerator.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportProperties.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportSecurityProperties.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtParser.ktdms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtProperties.ktdms-gateway/gateway-infrastructure/src/main/resources/application-dev.ymldms-gateway/gateway-infrastructure/src/main/resources/application-local.ymldms-gateway/gateway-infrastructure/src/main/resources/application-prod.ymldms-gateway/gateway-infrastructure/src/main/resources/application.ymldms-gateway/gateway-infrastructure/src/test/kotlin/team/aliens/GatewayApplicationTests.ktdms-main/main-core/src/main/kotlin/team/aliens/dms/domain/auth/model/Passport.ktdms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/config/CorsConfig.ktdms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/config/PropertiesScanConfig.ktdms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/FilterConfig.ktdms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/JwtAuthenticationFilter.ktdms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/PassportFilter.ktdms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/security/CorsProperties.ktdms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityConfig.ktdms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportIntegrityGenerator.ktdms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportProperties.ktdms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportSecurityProperties.ktdms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportValidator.ktdms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtParser.ktdms-main/main-infrastructure/src/main/resources/application.ymldms-main/main-infrastructure/src/test/kotlin/team/aliens/dms/global/filter/JwtAuthenticationFilterTest.ktdms-main/main-infrastructure/src/test/kotlin/team/aliens/dms/global/security/token/JwtParserTest.ktsettings.gradle.kts
💤 Files with no reviewable changes (44)
- dms-gateway/gateway-infrastructure/src/main/resources/application-local.yml
- dms-gateway/gateway-infrastructure/src/test/kotlin/team/aliens/GatewayApplicationTests.kt
- dms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportSecurityProperties.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/config/properties/ServicesProperties.kt
- dms-gateway/gateway-infrastructure/src/main/resources/application.yml
- dms-gateway/build.gradle.kts
- dms-gateway/gateway-core/src/main/kotlin/team/aliens/dms/domain/auth/model/UserAuthInfo.kt
- dms-gateway/gateway-core/src/main/kotlin/team/aliens/dms/common/error/DmsException.kt
- dms-gateway/gateway-core/build.gradle.kts
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/DmsGatewayApplication.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/config/PropertiesScanConfig.kt
- dms-gateway/Dockerfile
- dms-gateway/gateway-core/src/main/kotlin/team/aliens/dms/common/error/ErrorProperty.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/error/GlobalExceptions.kt
- dms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportProperties.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportSecurityProperties.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportProperties.kt
- dms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportValidator.kt
- dms-gateway/gateway-core/src/main/kotlin/team/aliens/dms/domain/auth/model/Authority.kt
- dms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportIntegrityGenerator.kt
- dms-gateway/gateway-core/config/detekt/detekt.yml
- dms-gateway/gateway-core/src/main/kotlin/team/aliens/dms/domain/auth/model/Passport.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityPaths.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/InvalidTokenException.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/error/GatewayGlobalExceptionHandler.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtProperties.kt
- dms-gateway/gateway-infrastructure/src/main/resources/application-dev.yml
- dms-main/main-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/PassportFilter.kt
- dms-gateway/gateway-infrastructure/src/main/resources/application-prod.yml
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/error/GlobalErrorCode.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/config/JacksonConfig.kt
- dms-gateway/gateway-core/src/main/kotlin/team/aliens/dms/common/error/ErrorStatus.kt
- dms-gateway/gateway-infrastructure/config/detekt/detekt.yml
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportIntegrityGenerator.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/error/SecurityErrorCode.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/ExpiredTokenException.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityProperties.kt
- dms-main/main-core/src/main/kotlin/team/aliens/dms/domain/auth/model/Passport.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/passport/PassportAdapter.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtParser.kt
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/config/RouteConfig.kt
- settings.gradle.kts
- dms-gateway/gateway-infrastructure/build.gradle.kts
- dms-gateway/gateway-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/AuthorizationHeaderGatewayFilterFactory.kt
5dc067f to
008008b
Compare
📊 Main Service Coverage Report
|
작업 내용 설명
주요 변경 사항
JwtParser/JwtAuthenticationFilter)으로 포팅, Passport HMAC 무결성 계층(PassportIntegrityGenerator/PassportValidator/PassportProperties등) 제거globalcors설정을 main의CorsConfigurationSource빈(CorsConfig/CorsProperties)으로 포팅dms-gateway(gateway-core, gateway-infrastructure) 모듈 및 Dockerfile 삭제settings.gradle.kts,build.gradle.kts(jacocoGatewayServiceReport 태스크),.github/workflows/CI.yml,codecov.yml에서 gateway 관련 설정 제거contracts모듈은 main-core/persistence/infrastructure/presentation이 직접 의존 중이라 삭제 대상에서 제외(원래 이슈 체크리스트엔 삭제 대상으로 적혀 있었으나 확인 후 제외)참고 (리뷰 시 확인 필요)
.github/workflows/prod-cd.yml의 gateway 배포 관련 항목은 이번 PR에 포함하지 않음 — 별도로 정리 예정체크리스트
관련 이슈
Summary by CodeRabbit
새로운 기능
변경 사항
테스트/운영