Refactor/스프링 시큐리티 의존성 제거#12
Merged
GoGradually merged 3 commits intomasterfrom Dec 31, 2025
Hidden character warning
The head ref may contain hidden characters: "refactor/\uc2a4\ud504\ub9c1-\uc2dc\ud050\ub9ac\ud2f0-\uc758\uc874\uc131-\uc81c\uac70"
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
이 PR은 Spring Security 및 JWT 관련 의존성을 제거하여 인증 책임을 API Gateway로 위임하는 아키텍처 변경을 수행합니다.
주요 변경사항:
- Spring Security와 JWT 라이브러리 의존성 제거
- JWT 기반 인증 인프라 코드 전체 삭제 (필터, 프로바이더, 토큰 클래스 등)
MemberIdArgumentResolver가 JWT 토큰 대신 HTTP 헤더(X-Member-Id)에서 사용자 정보를 추출하도록 변경
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| build.gradle | Spring Security와 JWT(jjwt) 의존성 제거 |
| application-dev.yml | JWT 공개키 경로 설정 제거 |
| application-prod.yml | JWT 공개키 경로 설정 제거 |
| SecurityConfig.java | Spring Security 설정 클래스 전체 삭제 (필터 체인, 인증 매니저 등) |
| JwtAuthenticationFilter.java | JWT 인증 필터 삭제 |
| JwtAuthenticationProvider.java | JWT 인증 프로바이더 삭제 |
| JwtAuthenticationToken.java | JWT 인증 토큰 클래스 삭제 |
| JwtTokenProvider.java | JWT 토큰 검증 및 파싱 로직 삭제 |
| RsaKeyProvider.java | RSA 공개키 로더 유틸리티 삭제 |
| MemberIdArgumentResolver.java | JwtTokenProvider 의존성 제거, 생성자 삭제 |
| PinitNotificationApplicationTests.java | JwtTokenProvider 모의 객체 제거 |
Comment on lines
14
to
19
| @Slf4j | ||
| @Component | ||
| public class MemberIdArgumentResolver implements HandlerMethodArgumentResolver { | ||
| private final JwtTokenProvider jwtTokenProvider; | ||
|
|
||
| public MemberIdArgumentResolver(JwtTokenProvider jwtTokenProvider) { | ||
| this.jwtTokenProvider = jwtTokenProvider; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean supportsParameter(MethodParameter parameter) { |
There was a problem hiding this comment.
(1) 문제점: JwtTokenProvider 의존성이 제거되면서 MemberIdArgumentResolver가 검증되지 않은 HTTP 헤더(X-Member-Id)를 직접 읽어 사용하게 됩니다. 이는 클라이언트가 임의의 헤더 값을 설정하여 다른 사용자로 위장할 수 있는 심각한 보안 취약점을 만듭니다.
(2) 영향: 인증되지 않은 사용자가 다른 사용자의 푸시 토큰을 등록/삭제하거나 구독 상태를 조회할 수 있어, 사용자 데이터 무결성과 개인정보 보호에 치명적인 문제가 발생합니다.
(3) 수정 제안: JWT 검증 로직을 제거하기 전에 다음 중 하나를 먼저 적용해야 합니다:
- API Gateway에서 인증 후 설정한
X-Member-Id헤더만 신뢰할 수 있도록 서비스 레벨 네트워크 격리 및 클라이언트 요청의 해당 헤더 제거 정책 구현 - 또는 내부 통신용 서명/암호화된 헤더를 사용하고 이를 검증하는 로직 추가
- 또는 요청이 신뢰할 수 있는 API Gateway에서 왔는지 검증하는 메커니즘 구현 (예: 공유 시크릿 기반 서명)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경된 점