Skip to content

[Auth] Redis 도입 및 피드백 리팩토링#53

Merged
Creamcheesepie merged 6 commits into
mainfrom
feat/#38
Dec 15, 2025
Merged

[Auth] Redis 도입 및 피드백 리팩토링#53
Creamcheesepie merged 6 commits into
mainfrom
feat/#38

Conversation

@larama-C
Copy link
Copy Markdown
Collaborator

@larama-C larama-C commented Dec 12, 2025

🔗 관련 이슈

관련된 이슈 번호를 연결해주세요.
Close #이슈번호 를 쓰면 PR merge 시 자동으로 close 됩니다.

🚀 PR 개요

이 PR이 어떤 변경을 포함하고 있는지 간단히 설명해주세요.

  • 인증 도메인에서 RefreshToken 및 이메일 인증 코드 저장 방식을 Redis로 전환
  • PasswordEncoder 설정 분리 및 전역 Validation 예외 처리 추가
  • 인증/토큰 흐름 전반을 Redis 기반 구조로 리팩터링
  • DTO에 검증 로직 추가

📌 변경 사항

주요 변경 내용을 체크리스트 형태로 정리해주세요.

  • 기능 추가
  • 버그 수정
  • 리팩터링
  • 문서 업데이트
  • 테스트 추가/수정

🧪 테스트 방법

변경된 내용을 어떻게 테스트했는지 구체적으로 적어주세요.

📸 스크린샷 (선택)

UI 변경 또는 시각적으로 확인할 수 있는 변경이 있다면 첨부해주세요.

⚠️ 참고 사항

리뷰어가 알아야 할 사항이 있다면 자유롭게 작성해주세요.

  • 기존 RefreshToken JPA 저장소는 제거되었으며 Redis 기반으로 통합되었습니다.
  • Validation 예외(MethodArgumentNotValidException)는 GlobalExceptionHandler에서 공통 포맷으로 처리됩니다.
  • Redis가 실행되지 않은 환경에서는 인증 관련 기능이 정상 동작하지 않을 수 있습니다.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 12, 2025

Test Results

1 tests  ±0   1 ✅ ±0   0s ⏱️ ±0s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit df7b8c0. ± Comparison against base commit 7513b96.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 12, 2025

⭐ JaCoCo Coverage

Line Coverage: 11.31%

📄 Coverage Details

Overall Line Coverage: 11.22% (79 covered / 704 lines)

Package Summary (lowest first)
Package Line % Covered Missed
com/back/web7_9_codecrete_be/domain/chats/controller 0.00% 0 0
com/back/web7_9_codecrete_be/domain/location/service 0.00% 0 0
com/back/web7_9_codecrete_be/domain/chats/service 0.00% 0 0
com/back/web7_9_codecrete_be/domain/plans/controller 0.00% 0 10
com/back/web7_9_codecrete_be/domain/location/controller 0.00% 0 0
com/back/web7_9_codecrete_be/global/rsData 0.00% 0 11
com/back/web7_9_codecrete_be/domain/location/entity 0.00% 0 0
com/back/web7_9_codecrete_be/domain/auth/entity 0.00% 0 0
com/back/web7_9_codecrete_be/domain/auth/service 0.00% 0 66
com/back/web7_9_codecrete_be/domain/plans/service 0.00% 0 80
com/back/web7_9_codecrete_be/domain/users/controller 0.00% 0 0
com/back/web7_9_codecrete_be/domain/email/entity 0.00% 0 6
com/back/web7_9_codecrete_be/domain/users/service 0.00% 0 0
com/back/web7_9_codecrete_be/domain/auth/controller 0.00% 0 20
com/back/web7_9_codecrete_be/domain/concerts/controller 0.00% 0 3
com/back/web7_9_codecrete_be/domain/artists/controller 0.00% 0 0
com/back/web7_9_codecrete_be/domain/artists/service 0.00% 0 0
com/back/web7_9_codecrete_be/global/aspect 0.00% 0 4
com/back/web7_9_codecrete_be/domain/email/service 2.13% 1 46
com/back/web7_9_codecrete_be/domain/concerts/service 6.60% 13 184
com/back/web7_9_codecrete_be/domain/concerts/entity 8.57% 3 32
com/back/web7_9_codecrete_be/global/rq 12.90% 4 27
com/back/web7_9_codecrete_be/global/security 17.71% 17 79
com/back/web7_9_codecrete_be/domain/plans/entity 20.00% 11 44
com/back/web7_9_codecrete_be/domain/users/entity 35.00% 7 13
com/back/web7_9_codecrete_be/domain/chats/entity 100.00% 1 0
com/back/web7_9_codecrete_be/global/doc 100.00% 17 0
com/back/web7_9_codecrete_be/domain/artists/entity 100.00% 5 0
Lowest Covered Classes (Top 20)
Class Line % Covered Missed
com.back.web7_9_codecrete_be.domain.plans.service.PlanService 0.00% 0 80
com.back.web7_9_codecrete_be.domain.auth.service.AuthService 0.00% 0 40
com.back.web7_9_codecrete_be.global.security.JwtTokenProvider 0.00% 0 37
com.back.web7_9_codecrete_be.domain.auth.service.TokenService 0.00% 0 26
com.back.web7_9_codecrete_be.domain.auth.controller.AuthController 0.00% 0 20
com.back.web7_9_codecrete_be.domain.concerts.entity.Concert 0.00% 0 18
com.back.web7_9_codecrete_be.domain.plans.entity.Route 0.00% 0 18
com.back.web7_9_codecrete_be.domain.plans.entity.Plan 0.00% 0 16
com.back.web7_9_codecrete_be.domain.users.entity.User 0.00% 0 13
com.back.web7_9_codecrete_be.global.rsData.RsData 0.00% 0 11
com.back.web7_9_codecrete_be.domain.plans.controller.PlanController 0.00% 0 10
com.back.web7_9_codecrete_be.domain.plans.entity.PlanParticipant 0.00% 0 10
com.back.web7_9_codecrete_be.global.security.CustomUserDetail 0.00% 0 10
com.back.web7_9_codecrete_be.domain.concerts.entity.ConcertPlace 0.00% 0 9
com.back.web7_9_codecrete_be.domain.email.entity.VerificationCode 0.00% 0 6
com.back.web7_9_codecrete_be.domain.concerts.entity.TicketOffice 0.00% 0 5
com.back.web7_9_codecrete_be.global.aspect.ResponseAspect 0.00% 0 4
com.back.web7_9_codecrete_be.global.security.CustomUserDetailService 0.00% 0 3
com.back.web7_9_codecrete_be.domain.concerts.controller.ConcertController 0.00% 0 3
com.back.web7_9_codecrete_be.domain.chats.controller.ChatController 0.00% 0 0
Changed Classes (from this PR)
Source (PR) Class Prefix Line % Covered Missed
src/main/java/com/back/web7_9_codecrete_be/domain/auth/service/AuthService.java com.back.web7_9_codecrete_be.domain.auth.service.AuthService 0.00% 0 40
src/main/java/com/back/web7_9_codecrete_be/domain/auth/service/TokenService.java com.back.web7_9_codecrete_be.domain.auth.service.TokenService 0.00% 0 26
src/main/java/com/back/web7_9_codecrete_be/domain/auth/controller/AuthController.java com.back.web7_9_codecrete_be.domain.auth.controller.AuthController 0.00% 0 20
src/main/java/com/back/web7_9_codecrete_be/domain/auth/dto/request/EmailSendRequest.java com.back.web7_9_codecrete_be.domain.auth.dto.request.EmailSendRequest 0.00% 0 0
src/main/java/com/back/web7_9_codecrete_be/domain/auth/dto/request/EmailVerifyRequest.java com.back.web7_9_codecrete_be.domain.auth.dto.request.EmailVerifyRequest 0.00% 0 0
src/main/java/com/back/web7_9_codecrete_be/domain/auth/dto/request/LoginRequest.java com.back.web7_9_codecrete_be.domain.auth.dto.request.LoginRequest 0.00% 0 0
src/main/java/com/back/web7_9_codecrete_be/domain/auth/dto/request/SignupRequest.java com.back.web7_9_codecrete_be.domain.auth.dto.request.SignupRequest 0.00% 0 0
src/main/java/com/back/web7_9_codecrete_be/domain/auth/entity/RefreshToken.java com.back.web7_9_codecrete_be.domain.auth.entity.RefreshToken 0.00% 0 0
src/main/java/com/back/web7_9_codecrete_be/domain/auth/repository/RefreshTokenRedisRepository.java com.back.web7_9_codecrete_be.domain.auth.repository.RefreshTokenRedisRepository 0.00% 0 0
src/main/java/com/back/web7_9_codecrete_be/domain/auth/repository/RefreshTokenRepository.java com.back.web7_9_codecrete_be.domain.auth.repository.RefreshTokenRepository 0.00% 0 0
src/main/java/com/back/web7_9_codecrete_be/domain/email/repository/VerificationCodeRedisRepository.java com.back.web7_9_codecrete_be.domain.email.repository.VerificationCodeRedisRepository 0.00% 0 0
src/main/java/com/back/web7_9_codecrete_be/domain/email/repository/VerifiedEmailRepository.java com.back.web7_9_codecrete_be.domain.email.repository.VerifiedEmailRepository 0.00% 0 0
src/main/java/com/back/web7_9_codecrete_be/global/config/RedisConfig.java com.back.web7_9_codecrete_be.global.config.RedisConfig 0.00% 0 0
src/main/java/com/back/web7_9_codecrete_be/global/error/handler/GlobalExceptionHandler.java com.back.web7_9_codecrete_be.global.error.handler.GlobalExceptionHandler 0.00% 0 0
src/main/java/com/back/web7_9_codecrete_be/domain/email/service/EmailService.java com.back.web7_9_codecrete_be.domain.email.service.EmailService 2.13% 1 46
src/main/java/com/back/web7_9_codecrete_be/global/security/JwtAuthenticationFilter.java com.back.web7_9_codecrete_be.global.security.JwtAuthenticationFilter 3.33% 1 29
src/main/java/com/back/web7_9_codecrete_be/global/security/SecurityConfig.java com.back.web7_9_codecrete_be.global.security.SecurityConfig 100.00% 13 0
src/main/java/com/back/web7_9_codecrete_be/global/security/PassWordEncoderConfig.java com.back.web7_9_codecrete_be.global.security.PassWordEncoderConfig 100.00% 2 0

🔗 Full HTML report: See artifact jacoco-full-html on this run → https://github.com/prgrms-web-devcourse-final-project/WEB7_9_codecrete_BE/actions/runs/20165676192

Comment on lines 1 to +5
spring:
data:
redis:
host: localhost
port: 6379
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

application-test.yml에도 이 부분을 추가하면 CI 실행에 문제 없을 것 같습니다!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

방금 커밋해서 테스트 잘 돌아가는거 확인했습니다! 감사합니다!

Copy link
Copy Markdown
Collaborator

@ys0221 ys0221 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셧습니다!!

Copy link
Copy Markdown
Collaborator

@Creamcheesepie Creamcheesepie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다.

public class EmailSendRequest {

@NotBlank(message = "이메일은 필수입니다.")
@Email(message = "이메일 형식이 올바르지 않습니다.")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Email 어노테이션은 생각보다 검증을 탄탄해주게 하지 않아서 해당 부분은 정규식으로 수정하는 게 좋을 것 같습니다.
관련 링크

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다! 추후 반영하겠습니다!


@NotBlank(message = "인증 코드는 필수입니다.")
@Pattern(
regexp = "^[A-Z0-9]{6}$",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정규표현식 처리하신 것 잘하신 것 같습니다.

@Creamcheesepie Creamcheesepie merged commit a6c19c0 into main Dec 15, 2025
2 checks passed
@Creamcheesepie Creamcheesepie deleted the feat/#38 branch December 15, 2025 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Auth] Redis 도입

4 participants