8주차 미션 [루크]#20
Open
yujining3827 wants to merge 62 commits into
Open
Conversation
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.
🚩 관련 이슈
📌 구현 결과
미션 1. Spring Security 적용 및 회원가입 API 구현
Spring Security 의존성을 추가하고 기본 보안 설정을 적용했습니다.
회원가입 시 사용할 email, password 필드를 Member 엔티티 및 DTO에 추가했습니다.
BCryptPasswordEncoder를 Bean으로 등록하고 비밀번호 암호화를 적용했습니다.
회원가입 API(
/api/v1/members/signup)를 구현했습니다.회원가입 시 이메일 중복 검증 로직을 추가했습니다.
DTO → Entity 변환 책임을 MemberConverter로 분리했습니다.
회원가입 성공 시 공통 응답 형식(ApiResponse)을 반환하도록 구현했습니다.
미션 2. Public API / Private API 분리 및 예외 처리 구현
Spring Security의
permitAll()과authenticated()를 사용하여 Public API와 Private API를 분리했습니다.회원가입 API 및 Swagger 관련 경로는 Public API로 설정했습니다.
그 외 API는 인증이 필요한 Private API로 설정했습니다.
AuthenticationEntryPoint를 구현하여 인증 실패(401) 시 JSON 형태의 공통 응답을 반환하도록 처리했습니다.AccessDeniedHandler를 구현하여 인가 실패(403) 시 JSON 형태의 공통 응답을 반환하도록 처리했습니다.기존 Spring Security 기본 로그인 HTML 응답 대신 공통 JSON 응답이 반환되도록 수정했습니다.
❓ 리뷰 요청
🤔 질문
💬 기타 공유 사항