feat: google oauth2-login 구현 및 순환 참조 해결과 서비스 책임 분리를 통한 구조 개선#11
Merged
DongHyeonka merged 2 commits intoSynapsesa:developfrom Jun 17, 2025
Merged
feat: google oauth2-login 구현 및 순환 참조 해결과 서비스 책임 분리를 통한 구조 개선#11DongHyeonka merged 2 commits intoSynapsesa:developfrom
DongHyeonka merged 2 commits intoSynapsesa:developfrom
Conversation
- **순환 참조 해결**: - `SecurityConfig`와 `AccountService` 간의 순환 의존성을 해결하기 위해, `CustomOAuth2UserService`와 `CustomUserDetailsService`가 `AccountService` 대신 `MemberRepository`를 직접 사용하도록 변경 - `PasswordEncoder`를 별도의 `PasswordEncoderConfig`로 분리하여 의존성 고리를 끊음 - **서비스 책임 분리**: - 소셜 로그인 시 회원 등록 및 조회 로직을 `CustomOAuth2UserService`가 MemberRegistrationService 여기서 처리하도록 수정하여 `AccountService`와의 의존성을 제거 - `AccountService`는 일반 회원가입 비즈니스 로직에만 집중하도록 책임 명확화 - **인증 객체 개선**: - `PrincipalUser`가 항상 DB에 저장된 최종 `Member` 정보를 기준으로 권한, 아이디, 비밀번호를 반환하도록 수정하여 데이터 불일치 문제 해결 - **테스트 환경 개선**: - `application-test.yml`에 가짜 OAuth2 클라이언트 설정을 추가하여 통합 테스트 환경에서 `ClientRegistrationRepository` Bean 생성 오류 해결 - 컨트롤러 테스트(`@WebMvcTest`)에서 `SecurityConfig`를 로드하지 않도록 변경하여 테스트 속도 및 격리 수준 향상 (`addFilters = false`)
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.
📌 관련 이슈
✨ PR 작업 내용
순환 참조 해결:
SecurityConfig와AccountService간의 순환 의존성을 해결하기 위해,CustomOAuth2UserService와CustomUserDetailsService가AccountService대신MemberRepository를 직접 사용하도록 변경PasswordEncoder를 별도의PasswordEncoderConfig로 분리하여 의존성 고리를 끊음서비스 책임 분리:
CustomOAuth2UserService가 MemberRegistrationService 여기서 처리하도록 수정하여AccountService와의 의존성을 제거AccountService는 일반 회원가입 비즈니스 로직에만 집중하도록 책임 명확화인증 객체 개선:
PrincipalUser가 항상 DB에 저장된 최종Member정보를 기준으로 권한, 아이디, 비밀번호를 반환하도록 수정하여 데이터 불일치 문제 해결테스트 환경 개선:
application-test.yml에 가짜 OAuth2 클라이언트 설정을 추가하여 통합 테스트 환경에서ClientRegistrationRepositoryBean 생성 오류 해결@WebMvcTest)에서SecurityConfig를 로드하지 않도록 변경하여 테스트 속도 및 격리 수준 향상 (addFilters = false)이미지 첨부
다음 할 일