Skip to content

Conversation

@gisu1102
Copy link
Contributor

마이크로서비스 아키텍처 구현의 첫 단계로 Security와 Common 모듈 분리를 완료했습니다. 기존의 단일 모듈 구조에서 codin-security와 codin-common 모듈을 분리하여 코드 재사용성과 확장성을 개선했습니다.

분리 완료 현황

완료된 분리 작업

  • codin-common: 공통 응답, 예외, 기본 엔티티 분리 완료
  • codin-security: JWT 검증, Resource Server 설정 분리 완료
  • 적용 모듈: codin-core, codin-ticketing-api, codin-ticketing-sse

향후 분리 예정

  • codin-auth: OAuth2 로그인, 토큰 발급 기능 (Authorization Server)

아키텍처 변경사항

이전 구조 (Before)

codin-core (모놀리틱)
├── 공통 응답 클래스 (CommonResponse, SingleResponse, ListResponse)
├── 공통 예외 클래스 (GlobalException, NotFoundException)
├── 보안 설정 (JWT 검증 + OAuth2 로그인)
├── 보안 필터 (JwtAuthenticationFilter)
├── Rate Limiting
├── Base Entity (BaseTimeEntity)
└── 비즈니스 로직

codin-ticketing-api (중복 코드)
├── 응답 클래스 중복 정의
├── 예외 클래스 중복 정의
└── 보안 설정 중복 구현

codin-ticketing-sse (중복 코드)
├── 응답 클래스 중복 정의
└── 보안 설정 중복 구현

codin-common (공통 모듈)
├── 공통 응답 클래스
│ ├── CommonResponse
│ ├── SingleResponse
│ ├── ListResponse
│ └── ExceptionResponse
├── 공통 예외 클래스
│ ├── GlobalException
│ ├── NotFoundException
│ └── GlobalErrorCode
├── Rate Limiting
│ ├── RateLimitInterceptor
│ ├── RateLimitService
│ └── RateLimitBucketConstants
└── 기본 엔티티
├── BaseTimeEntity
└── Department

현재 구조 (After) - ✅ 분리 완료

codin-security (보안 모듈)
├── JWT 검증 (Resource Server 전용)
│ ├── JwtService (검증 전용)
│ ├── JwtTokenValidator
│ └── TokenUserDetails
├── Resource Server 설정
│ └── ResourceServerSecurityConfig
├── 보안 필터
│ ├── JwtAuthenticationFilter
│ └── ExceptionHandlerFilter
├── 보안 유틸리티
│ ├── SecurityUtils
│ └── TokenUtil
└── Spring Boot AutoConfiguration
└── CodinSecurityAutoConfiguration

codin-core (메인 애플리케이션)
├── depends on: codin-common, codin-security
├── 순수 비즈니스 로직
├── 도메인 모델
└── API 컨트롤러

codin-ticketing-api (티켓팅 API)
├── depends on: codin-common, codin-security
└── 티켓팅 비즈니스 로직

codin-ticketing-sse (실시간 이벤트)
├── depends on: codin-common, codin-security
└── SSE 이벤트 처리

기술적 구현 세부사항

1. 모듈간 의존성 계층구조

codin-common (Level 0)
↑ 의존
codin-security (Level 1)
↑ 의존
Application Modules (Level 2)
├── codin-core
├── codin-ticketing-api
└── codin-ticketing-sse

검증 완료 사항

빌드 독립성 확인

AutoConfiguration 동작 확인

기능 무결성 검증

다음 단계: codin-auth 분리 계획

분리 예정 기능들

// codin-auth로 이동 예정인 기능들 (현재 codin-core에 남아있음)

  • OAuth2LoginSuccessHandler
  • OAuth2LoginFailureHandler
  • AppleAuthService, GoogleAuthService
  • JwtTokenProvider (토큰 발급)
  • CustomOAuth2UserService
  • AuthController

🔍 코드 리뷰 체크포인트

  • codin-common의 공통 기능 범위가 적절한가?
  • codin-security가 Resource Server 역할에만 집중하는가?
  • 순환 의존성이 없는가?
  • 새로운 마이크로서비스 추가가 용이한가?

이번 Security & Common 모듈 분리를 통해 CODIN 백엔드는 확장 가능하고 유지보수가 용이한 마이크로서비스 아키텍처의 기반을 마련했습니다.

gisu1102 and others added 30 commits July 11, 2025 23:50
oAuth2 로그인 성공 후 리다이렉트 Param 추가 및 NPE 에러 해결
기존 쿠키에 access_token, refresh_token은 유지 (추후 제거)

- 헤더: Authorization: Bearer (accessToken)
- 쿠키: x-refresh-token: (refreshToken)
BlockController를 제외한 Block Domain 리팩토링

- User Domain에 UserValidator 추가#214
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
#211 에서 적용한 GlobalException, GlobalErrorCode 형태로 코드를 리팩토링 했습니다.
gisu1102 and others added 27 commits October 16, 2025 21:42
feat : name 1글자 대상 단체알림 발송
chore: OAuth2 로그인 attribute 값 확인용 로그 추가
…d-name

feat: add name field to UserTicketingParticipationInfoUpdateRequest
feat: add name field to UserTicketingParticipationInfoUpdateRequest
기존: Authorization Server + Resource Server 역할을 모두 담당하는 단일 설정
변경: Resource Server 전용 설정으로 분리 (codin-security 모듈)
OAuth2 로그인 및 토큰 발급은 별도의 codin-auth 모듈로 분리 예정
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 17, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/security-common-split

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants