Skip to content

Conversation

@Dimo-2562
Copy link
Contributor

❤️ 기능 설명

JWT 기반 인증 필터를 구현하여 RESTful API 보안을 강화했습니다.

주요 변경사항

  1. JWT 인증 필터 구현

    • Authorization 헤더 Bearer 토큰 검증
    • UserPrincipal 생성 및 SecurityContext 설정
    • PENDING 상태 유저도 인증 허용
  2. UserPrincipal 개선

    • UserDetails 인터페이스 구현으로 Spring Security 통합
    • 핵심 필드만 유지 (id, role, email, onboardingCompleted)
  3. 인증 실패 시 401 JSON 응답

    • CustomAuthenticationEntryPointHandler 구현
    • BaseResponse 포맷으로 일관된 에러 응답
    • OAuth2 리다이렉트 대신 401 반환
  4. 컨트롤러 리팩토링

    • @AuthenticationPrincipal로 인증 정보 주입
    • HeaderUtil 제거하고 Spring Security 표준 방식 사용
  5. 테스트 커버리지

    • JWT 인증 필터 단위 테스트 (218 lines)
    • 온보딩 API 통합 테스트

테스트 결과

  • JwtAuthenticationFilterTest: 모든 시나리오 통과
  • OnboardingControllerIntegrationTest: 인증 검증 포함 모든 케이스 통과

연결된 issue

연결된 issue를 자동으로 닫기 위해 아래 {이슈넘버}를 입력해주세요.

close #162



✅ 체크리스트

  • PR 제목 규칙 잘 지켰는가?
  • 추가/수정사항을 설명하였는가?
  • 테스트 결과 사진을 넣었는가?
  • 이슈넘버를 적었는가?

@Dimo-2562 Dimo-2562 self-assigned this Jan 18, 2026
@Dimo-2562 Dimo-2562 added 🛠️ FEAT 새 기능 🌐 infra 인프라/배포 labels Jan 18, 2026
@Dimo-2562 Dimo-2562 merged commit 42a594b into develop Jan 18, 2026
1 check passed
@Dimo-2562 Dimo-2562 deleted the feat/#162 branch January 18, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠️ FEAT 새 기능 🌐 infra 인프라/배포

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] JWT 인증 필터 구현

2 participants