-
Notifications
You must be signed in to change notification settings - Fork 44
[volume-1] 회원가입, 내 정보 조회, 비밀번호 수정 구현 #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: plan11plan
Are you sure you want to change the base?
[volume-1] 회원가입, 내 정보 조회, 비밀번호 수정 구현 #41
Conversation
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- PasswordEncoder 인터페이스 및 BCrypt 구현체 추가 - Password.fromEncoded() 메서드 추가 - UserService에서 회원가입 시 패스워드 암호화 - AuthenticationService에서 암호화된 패스워드 비교 - 관련 테스트 코드 수정 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- UserService에서 비밀번호 변경 시 암호화된 비밀번호와 비교 - 새 비밀번호도 암호화하여 저장 - UserModel.changePassword는 단순 필드 변경만 수행 - UserModelTest의 비밀번호 관련 테스트 제거 (로직이 UserService로 이동) - UserServiceIntegrationTest 암호화를 고려한 검증으로 수정 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
📌 Summary
🧭 Context & Decision
문제 정의
선택지와 결정 — 4번의 시도
시도 1: 요구사항을 그대로 전달
시도 2: AI가 설계 → 내가 결정
시도 3: 내가 설계 문서 작성 → AI 피드백
시도 4: 내가 시범 구현 → AI가 스타일 참고하여 나머지 구현 (최종 선택)
트레이드오프
미해결 고민
🏗️ Design Overview
변경 범위
apps/commerce-api(메인 변경),modules/jpa(테스트 픽스처)UserModel,LoginId,Password,Name,BirthDate,Email,UserRepository,UserService,AuthenticationServicePasswordEncoder,BCryptPasswordEncoderImpl,UserRepositoryImpl,UserJpaRepositoryUserV1Controller,UserV1Dto,UserV1ApiSpechttp/commerce-api/user-v1.http(26개 케이스)주요 컴포넌트 책임
UserModelLoginIdPasswordfromEncoded()팩토리로 암호화된 값 로딩NamegetMaskedName()으로 마지막 글자*마스킹BirthDatetoDateString()으로 yyyyMMdd 변환EmailUserServiceAuthenticationServiceBCryptPasswordEncoderImplPasswordEncoder인터페이스 구현. Spring Security BCrypt 위임UserRepositoryImplUserRepository도메인 인터페이스를 JPA로 구현하는 어댑터UserV1Controller🔁 Flow Diagram
회원가입 Flow
내 정보 조회 Flow
비밀번호 변경 Flow
sequenceDiagram autonumber participant Client participant Controller participant AuthService participant UserService participant PasswordEncoder participant DB Client->>Controller: PATCH /api/v1/users/password (헤더 + JSON body) Controller->>AuthService: authenticate(loginId, headerPassword) AuthService-->>Controller: 인증 성공 Controller->>UserService: changePassword(loginId, currentPw, newPw) UserService->>DB: find(LoginId) UserService->>PasswordEncoder: matches(currentPw, storedPw) - 현재 비밀번호 확인 UserService->>PasswordEncoder: matches(newPw, storedPw) - 동일 비밀번호 재사용 방지 UserService->>UserService: newPassword.validateNotContainBirthday(birthDate) UserService->>PasswordEncoder: encode(newPw) UserService->>DB: save(UserModel) UserService-->>Controller: void Controller-->>Client: ApiResponse ("비밀번호가 성공적으로 변경되었습니다.")🧪 테스트 전략