Repository: imjjh/AiLectureSummary
Pull request #59: feat: 비밀번호 찾기 및 재설정 로직 구현 (이메일 인증 X)
Author: login: imjjh
Created: 2025-05-31T08:00:30Z | Merged: 2025-05-31T12:13:05Z



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Added password recovery and reset functionality, allowing users to request a temporary token and reset their password securely.
  - Integrated Redis for secure, temporary storage of password reset tokens.
- **Improvements**
  - Enhanced API documentation with additional Swagger/OpenAPI annotations and field descriptions for better clarity.
  - Updated validation and schema descriptions for user profile editing.
  - Improved security configuration to permit access to new password recovery endpoints.
- **Chores**
  - Added Redis configuration to application settings and development Docker environment.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->


Diff:
diff --git a/backend/build.gradle b/backend/build.gradle
index a85c395..fd9bee3 100644
--- a/backend/build.gradle
+++ b/backend/build.gradle
@@ -40,6 +40,7 @@ dependencies {
 	implementation 'io.jsonwebtoken:jjwt-api:0.12.6'
 	runtimeOnly   'io.jsonwebtoken:jjwt-impl:0.12.6'
 	runtimeOnly   'io.jsonwebtoken:jjwt-jackson:0.12.6' // for JSON parsing
+	implementation 'org.springframework.boot:spring-boot-starter-data-redis' // redis
 	implementation 'com.github.librepdf:openpdf:1.3.30' // PDF
 }
 
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/config/RedisConfig.java b/backend/src/main/java/com/ktnu/AiLectureSummary/config/RedisConfig.java
new file mode 100644
index 0000000..657b40b
--- /dev/null
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/config/RedisConfig.java
@@ -0,0 +1,30 @@
+package com.ktnu.AiLectureSummary.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.StringRedisTemplate;
+
+@Configuration
+public class RedisConfig {
+    /**
+     * Redis에서 String 타입의 key-value 저장을 쉽게 다룰 수 있도록 지원하는 템플릿 Bean입니다.
+     * 주로 단순 문자열 데이터를 처리할 때 사용됩니다.
+     */
+    @Bean
+    public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory connectionFactory) {
+        return new StringRedisTemplate(connectionFactory);
+    }
+
+    /**
+     * Redis에서 다양한 자료형(Object)을 다룰 수 있도록 설정된 일반적인 RedisTemplate Bean입니다.
+     * 복잡한 객체 직렬화 및 다양한 Redis 자료구조(Hash, List 등) 작업에 사용됩니다.
+     */
+    @Bean
+    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory connectionFactory) {
+        RedisTemplate<String, Object> template = new RedisTemplate<>();
+        template.setConnectionFactory(connectionFactory);
+        return template;
+    }
+}
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/config/SecurityConfig.java b/backend/src/main/java/com/ktnu/AiLectureSummary/config/SecurityConfig.java
index 5ac9548..423655f 100644
--- a/backend/src/main/java/com/ktnu/AiLectureSummary/config/SecurityConfig.java
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/config/SecurityConfig.java
@@ -4,7 +4,6 @@
 import lombok.RequiredArgsConstructor;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.http.HttpMethod;
 import org.springframework.security.authentication.AuthenticationManager;
 import org.springframework.security.config.Customizer;
 import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
@@ -32,9 +31,9 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
                 .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) // httponly 설정
                 .authorizeHttpRequests(auth -> auth
                         .requestMatchers("/api/members/login", "/api/members/register", "/health",
-                                "/v3/api-docs/**",
+                                "/v3/api-docs/**","/api/members/find-password","/api/members/reset-password",
                                 "/swagger-ui/**",
-                                "/swagger-ui.html").permitAll() // 로그인, 회원가입, 스웨거 인증없이 접근 허용
+                                "/swagger-ui.html").permitAll() // 로그인, 회원가입, 스웨거, 헬스체크, 비밀번호 변경 인증없이 접근 허용
 //                        .requestMatchers(HttpMethod.GET, "/api/Lecture/**").permitAll()
                         .anyRequest().authenticated() // 그 외 요청은 인증 필요
                 )
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/controller/HealthController.java b/backend/src/main/java/com/ktnu/AiLectureSummary/controller/HealthController.java
index 72bbb26..57268d7 100644
--- a/backend/src/main/java/com/ktnu/AiLectureSummary/controller/HealthController.java
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/controller/HealthController.java
@@ -5,6 +5,10 @@
 
 @RestController
 public class HealthController {
+    /**
+     * 헬스 체크 (서버 깨우기)
+     * @return
+     */
     @GetMapping("/health")
     public String healthCheck() {
         return "OK";
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberController.java b/backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberController.java
index 9d42c31..fb79bb5 100644
--- a/backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberController.java
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberController.java
@@ -7,6 +7,7 @@
 import com.ktnu.AiLectureSummary.security.CustomUserDetails;
 import com.ktnu.AiLectureSummary.service.MemberService;
 import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
 import lombok.RequiredArgsConstructor;
@@ -22,16 +23,16 @@ public class MemberController {
 
     private final MemberService memberService;
     private final CookieProperties cookieProperties;
-    
+
     @PostMapping("/register")
     @Operation(summary = "회원가입", description = "사용자 정보를 입력받아 이메일 중복 체크후 회원가입")
-    public ResponseEntity<ApiResponse<Void>> register(@Valid @RequestBody MemberRegisterRequest request){
+    public ResponseEntity<ApiResponse<Void>> register(@Valid @RequestBody MemberRegisterRequest request) {
         memberService.register(request);
         return ResponseEntity.status(201).body(ApiResponse.success("회원가입 성공", null));
     }
 
     @PostMapping("/login")
-    @Operation(summary = "로그인" , description = "사용자 정보를 입력 받아 로그인 시도 성공시 jwt(httponly) 반환")
+    @Operation(summary = "로그인", description = "사용자 정보를 입력 받아 로그인 시도 성공시 jwt(httponly) 반환")
     public ResponseEntity<ApiResponse<MemberLoginResponse>> login(@Valid @RequestBody MemberLoginRequest request, HttpServletResponse response) { // HttpServletResponse response는 응답 헤더, 쿠키를 직접 조작할수 있게 하기 위해 사용됨
         // 로그인 처리 시도 (memberService에서 인증 처리 + JWT 발급)
         MemberLoginResponse result = memberService.login(request);
@@ -40,7 +41,7 @@ public ResponseEntity<ApiResponse<MemberLoginResponse>> login(@Valid @RequestBod
         ResponseCookie cookie = ResponseCookie.from("token", result.getAccessToken())
                 .httpOnly(cookieProperties.isHttpOnly())
                 .path("/")
-                .sameSite(cookieProperties.getSameSite()) // SameSite=None: 다른 도메인에서도 쿠키 전송 허용 (HTTPS 필요)
+                .sameSite(cookieProperties.getSameSite()) // CSRF 방어엔 Lax 이상 권장, 배포시 도메인 분리로 None 사용 예정
                 .secure(cookieProperties.isSecure()) // https 에서만 전송 // 개발 환경 false
                 .maxAge(3600) // JWT 만료 시간과 일치시킬 것 (쿠키 만료시 자동 삭제)
                 .build();
@@ -51,10 +52,11 @@ public ResponseEntity<ApiResponse<MemberLoginResponse>> login(@Valid @RequestBod
     }
 
 
-
     //비즈니스 로직이 거의 없고 가공 없는 응답만 주는 경우엔 Controller에서 처리
+
     /**
      * jwt를 덮어씌움 만료시간 0초로 설정 기존에 토큰은 제대로 삭제되는게 아니라 보완 필요
+     *
      * @param response
      * @return
      */
@@ -67,7 +69,7 @@ public ResponseEntity<ApiResponse<Void>> logout(HttpServletResponse response) {
                 .secure(cookieProperties.isSecure()) // https 환경 대응
                 .path("/")
                 .maxAge(0) // 즉시 만료
-                .sameSite(cookieProperties.getSameSite()) // SameSite=None: 다른 도메인에서도 쿠키 전송 허용 (HTTPS 필요)
+                .sameSite(cookieProperties.getSameSite()) //
                 .build();
 
         // TODO (refreshtoken 또는 blacklist 추가 예정)
@@ -85,19 +87,18 @@ public ResponseEntity<ApiResponse<MemberMeResponse>> getCurrentUser(@Authenticat
     }
 
 
-
     @PatchMapping("/edit")
     @Operation(summary = "계정 정보 변경", description = "사용자 입력으로 이름, 비밀번호를 수정합니다. 아이디는 수정할 수 없습니다.")
     public ResponseEntity<ApiResponse<MemberEditResponse>> editProfile(@AuthenticationPrincipal CustomUserDetails userDetails, @Valid @RequestBody MemberEditRequest request) {
         MemberEditResponse memberEditResponse = memberService.editProfile(userDetails, request);
-
+        // TODO 둘다 NULL이면? 커스텀 예외 처리
         // 비밀번호 변경으로 토큰 재발급한 경우
         if (memberEditResponse.getToken() != null) {
             ResponseCookie cookie = ResponseCookie.from("token", memberEditResponse.getToken())
                     .httpOnly(cookieProperties.isHttpOnly())
                     .secure(cookieProperties.isSecure())
                     .path("/")
-                    .sameSite(cookieProperties.getSameSite()) // SameSite=None: 다른 도메인에서도 쿠키 전송 허용 (HTTPS 필요)
+                    .sameSite(cookieProperties.getSameSite())
                     .maxAge(3600)
                     .build();
 
@@ -109,4 +110,37 @@ public ResponseEntity<ApiResponse<MemberEditResponse>> editProfile(@Authenticati
         // 비밀번호 등 민감한 정보를 변경하지 않은 경우
         return ResponseEntity.ok(ApiResponse.success("수정된 사용자 정보", memberEditResponse));
     }
+
+
+    /**
+     * 비밀번호 변경을 위해 사용자 이름과 이메일을 입력받아 일치하면 비밀번호를 변경할 수 있는 임시 토큰을 발급합니다.
+     * 발급 받은 임시 토큰은 비밀번호 재설정 요청에서 헤더에 붙여서 전달해 주어야 비밀번호 변경이 가능합니다.
+     * 학습/테스트용 기능으로 실서비스에선 이메일 인증이 필요함
+     * @param request
+     * @return
+     */
+    @PostMapping("/find-password")
+    @Operation(summary = "비밀번호 찾기 요청(이메일 이름 입력)", description = "사용자 이름과 이메일을 입력받아 일치하면 비밀번호를 변경할 수 있는 임시 토큰을 발급합니다.\n" +
+            "        발급 받은 임시 토큰은 비밀번호 재설정 요청에서 헤더에 붙여서 전달해 주어야 비밀번호 변경이 가능합니다.")
+    public ResponseEntity<ApiResponse<MemberPasswordResetTokenResponse>> findPassword(@Valid @RequestBody MemberFindPasswordRequest request) {        // 실제 이메일 인증 등을 통하지 않아서 위험한 방식
+        MemberPasswordResetTokenResponse response = memberService.findPassword(request);
+        return ResponseEntity.ok(ApiResponse.success("사용자의 이름과 이메일 일치, 임시 토큰 발급(15분 유효)", response));
+    }
+
+    /**
+     * /find-password에서 발급받은 임시토큰을 사용하여 비밀번호를 수정합니다.
+     * @param request
+     * @return
+     */
+    @PostMapping("/reset-password")
+    @Operation(summary = "비밀번호 재설정 요청(비밀번호 입력)",
+            description = "사용자의 비밀번호를 재설정 합니다. 비밀번호 찾기 요청에서 발급 받은 임시토큰을 커스텀헤더" +
+                    "Reset-Token:... 으로 함께 전송합니다.")
+
+    public ResponseEntity<ApiResponse<Void>> resetPassword(
+            @Parameter(description = "비밀번호 재설정을 위한 임시 토큰",required = true) @RequestHeader("Reset-Token") String token,
+            @Valid @RequestBody MemberResetPasswordRequest request) {
+        memberService.resetPassword(token, request);
+        return ResponseEntity.ok(ApiResponse.success("새로운 비밀번호로 수정되었습니다.", null));
+    }
 }
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberLectureController.java b/backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberLectureController.java
index 00a4913..c81f0fd 100644
--- a/backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberLectureController.java
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberLectureController.java
@@ -7,6 +7,7 @@
 import com.ktnu.AiLectureSummary.security.CustomUserDetails;
 import com.ktnu.AiLectureSummary.service.MemberLectureService;
 import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
 import jakarta.validation.Valid;
 import lombok.RequiredArgsConstructor;
 import org.springframework.http.ResponseEntity;
@@ -48,7 +49,9 @@ public class MemberLectureController {
      */
     @GetMapping("/{lectureId}")
     @Operation(summary = "내 특정 강의 상세 조희",description = "로그인한 사용자가 등록한 특정 강의의 전체 요약 내용을 조회합니다. (제목, 원문, AI 요약, 사용자 메모 포함)")
-    public ResponseEntity<ApiResponse<LectureDetailResponse>> getLectureDetail(@AuthenticationPrincipal CustomUserDetails user,@PathVariable Long lectureId){
+    public ResponseEntity<ApiResponse<LectureDetailResponse>> getLectureDetail(
+            @AuthenticationPrincipal CustomUserDetails user,
+            @Parameter(description = "강의 ID", example = "1") @PathVariable Long lectureId){
         LectureDetailResponse lectureDetailResponse = memberLectureService.getLectureDetail(user, lectureId);
         return ResponseEntity.ok(ApiResponse.success("강의 상세 조회 성공", lectureDetailResponse));
     }
@@ -67,7 +70,7 @@ public ResponseEntity<ApiResponse<LectureDetailResponse>> getLectureDetail(@Auth
     @Operation(summary = "내 특정 강의 메모 저장", description = "로그인한 사용자가 등록한 특정 강의의 메모를 저장합니다. 기존 메모가 있다면 수정합니다.")
     public ResponseEntity<ApiResponse<LectureDetailResponse>> saveMemo(
             @AuthenticationPrincipal CustomUserDetails user,
-            @PathVariable Long lectureId,
+            @Parameter(description = "강의 ID", example = "1") @PathVariable Long lectureId,
             @RequestBody @Valid MemoRequest request
     ) {
         LectureDetailResponse lectureDetailResponse = memberLectureService.saveMemo(user, lectureId, request.getMemo());
@@ -86,7 +89,7 @@ public ResponseEntity<ApiResponse<LectureDetailResponse>> saveMemo(
     @Operation(summary = "내 특정 강의 메모 삭제", description = "로그인한 사용자가 등록한 특정 강의의 메모를 삭제합니다.")
     public ResponseEntity<ApiResponse<LectureDetailResponse>> deleteMemo(
             @AuthenticationPrincipal CustomUserDetails user,
-            @PathVariable Long lectureId
+            @Parameter(description = "강의 ID", example = "1") @PathVariable Long lectureId
     ) {
         LectureDetailResponse lectureDetailResponse = memberLectureService.deleteMemo(user, lectureId);
         return ResponseEntity.ok(ApiResponse.success("개인 메모 삭제 성공", lectureDetailResponse));
@@ -104,7 +107,8 @@ public ResponseEntity<ApiResponse<LectureDetailResponse>> deleteMemo(
     @Operation(summary = "내 특정 강의 제목 수정", description = "로그인 한 사용자가 등록한 특정 강의의 제목을 수정합니다.")
     public ResponseEntity<ApiResponse<LectureDetailResponse>> saveLectureTitle(
             @AuthenticationPrincipal CustomUserDetails user,
-            @PathVariable Long lectureId, @RequestBody @Valid CustomTitleRequest requests){
+            @Parameter(description = "강의 ID", example = "1") @PathVariable Long lectureId,
+            @RequestBody @Valid CustomTitleRequest requests){
         LectureDetailResponse lectureDetailResponse = memberLectureService.updateCustomTitle(user,lectureId,requests.getTitle());
 
         return ResponseEntity.ok(ApiResponse.success("강의 제목 수정 성공", lectureDetailResponse));
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/domain/Member.java b/backend/src/main/java/com/ktnu/AiLectureSummary/domain/Member.java
index 13aaf31..7af8852 100644
--- a/backend/src/main/java/com/ktnu/AiLectureSummary/domain/Member.java
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/domain/Member.java
@@ -43,9 +43,17 @@ public class Member {
      * - null 불가
      */
     @Column(nullable = false)
-    @Setter(AccessLevel.PUBLIC) // 비밀번호 수정 가능
+    @Setter(AccessLevel.PRIVATE) // 비밀번호 수정 가능
     private String password;
 
+    /**
+     * 비밀번호를 변경하는 도메인 메서드
+     * 호출 전 반드시 암호화된 비밀번호를 넘겨야함!
+     */
+    public void changePassword(String encodedPassword) {
+        this.setPassword(encodedPassword);
+    }
+
     /**
      * 사용자 이름
      * - null 불가
@@ -58,6 +66,7 @@ public class Member {
     /**
      * 활성 상태 여부 (탈퇴한 계정 관리용)
      */
+    @Builder.Default
     @Column(nullable = false)
     private boolean active = true;
 
@@ -96,4 +105,6 @@ public class Member {
     @Column(nullable = false)
     private Role role;
 
+
+
 }
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/dto/CustomTitleRequest.java b/backend/src/main/java/com/ktnu/AiLectureSummary/dto/CustomTitleRequest.java
index e08096d..f2ca13d 100644
--- a/backend/src/main/java/com/ktnu/AiLectureSummary/dto/CustomTitleRequest.java
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/dto/CustomTitleRequest.java
@@ -1,12 +1,13 @@
 package com.ktnu.AiLectureSummary.dto;
 
 
-import jakarta.validation.Valid;
+import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.constraints.NotBlank;
 import lombok.Getter;
 
 @Getter
 public class CustomTitleRequest {
     @NotBlank(message = "제목은 공백일 수 없습니다.")
+    @Schema(description = "수정할 제목", example = "수정된 제목")
     private String title;
 }
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberEditRequest.java b/backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberEditRequest.java
index 8a4441e..1ded4b1 100644
--- a/backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberEditRequest.java
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberEditRequest.java
@@ -2,18 +2,16 @@
 
 import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.constraints.Pattern;
-import jakarta.validation.constraints.Size;
 import lombok.Getter;
 
 @Getter
 public class MemberEditRequest {
 
-    @Schema(description = "사용자 비밀번호", example = "testpassword123!")
+    @Schema(description = "사용자 비밀번호 (선택 사항)", example = "testpassword123!")
     @Pattern(regexp = "^(?=\\S+$).{8,20}$", message = "비밀번호는 공백 없이 8자 이상 20자 이하여야 합니다.")
-    @Size(min = 8, max = 20, message = "비밀번호는 8자 이상 20자 이하여야 합니다.")
     private String password;
 
     @Pattern(regexp = "^(?!.*\\s{2,}).{1,30}$", message = "사용자 이름에는 연속된 공백을 포함할 수 없으며, 최대 30자까지 가능합니다.")
-    @Schema(description = "사용자 이름", example = "testUser")
+    @Schema(description = "사용자 이름 (선택 사항)", example = "testUser1")
     private String username;
 }
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberFindPasswordRequest.java b/backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberFindPasswordRequest.java
new file mode 100644
index 0000000..87f73fe
--- /dev/null
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberFindPasswordRequest.java
@@ -0,0 +1,19 @@
+package com.ktnu.AiLectureSummary.dto.member;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.Email;
+import jakarta.validation.constraints.NotBlank;
+import lombok.Getter;
+
+@Getter
+public class MemberFindPasswordRequest {
+
+    @NotBlank(message = "이름은 필수 입력값입니다.")
+    @Schema(description = "사용자 이름", example = "testUser")
+    private String name;
+
+    @NotBlank(message = "이메일은 필수 입력값입니다.")
+    @Email(message = "이메일 형식이 올바르지 않습니다.")
+    @Schema(description = "사용자 이메일", example = "test@example.com")
+    private String email;
+}
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberPasswordResetTokenResponse.java b/backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberPasswordResetTokenResponse.java
new file mode 100644
index 0000000..d61a56c
--- /dev/null
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberPasswordResetTokenResponse.java
@@ -0,0 +1,10 @@
+package com.ktnu.AiLectureSummary.dto.member;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public class MemberPasswordResetTokenResponse {
+    private String token;
+}
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberResetPasswordRequest.java b/backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberResetPasswordRequest.java
new file mode 100644
index 0000000..ce15282
--- /dev/null
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberResetPasswordRequest.java
@@ -0,0 +1,16 @@
+package com.ktnu.AiLectureSummary.dto.member;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Pattern;
+import lombok.Getter;
+
+@Getter
+public class MemberResetPasswordRequest {
+
+    @NotBlank
+    @Pattern(regexp = "^(?=\\S+$).{8,20}$", message = "비밀번호는 공백 없이 8자 이상 20자 이하여야 합니다.")
+    @Schema(description = "새로운 비밀번호", example = "password123!")
+    private String newPassword;
+
+}
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/dto/memberLecture/MemoRequest.java b/backend/src/main/java/com/ktnu/AiLectureSummary/dto/memberLecture/MemoRequest.java
index f036d6f..c7579c1 100644
--- a/backend/src/main/java/com/ktnu/AiLectureSummary/dto/memberLecture/MemoRequest.java
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/dto/memberLecture/MemoRequest.java
@@ -1,5 +1,6 @@
 package com.ktnu.AiLectureSummary.dto.memberLecture;
 
+import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.constraints.Size;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
@@ -10,5 +11,6 @@
 @NoArgsConstructor
 public class MemoRequest {
     @Size(max = 1000, message = "메모는 최대 1000자 까지 입력 가능합니다.")
+    @Schema(description = "사용자 작성 메모", example = "메모를 작성합니다. 안녕하세요. 오늘은 0530입니다.")
     private String memo;
 }
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/repository/MemberRepository.java b/backend/src/main/java/com/ktnu/AiLectureSummary/repository/MemberRepository.java
index 2691c79..39b15a6 100644
--- a/backend/src/main/java/com/ktnu/AiLectureSummary/repository/MemberRepository.java
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/repository/MemberRepository.java
@@ -29,7 +29,7 @@
 @Repository
 public interface MemberRepository extends JpaRepository<Member,Long> {
     Optional <Member> findByEmail(String email);
-    Optional <Member> findByUsername(String username);
+    Optional<Member> findByUsernameAndEmail(String username, String email);// 비밀번호 찾기 시 사용
     Boolean existsByEmail(String email); // 회원가입 중복 체크
 
 }
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/security/handler/CustomAuthenicationEntryPoint.java b/backend/src/main/java/com/ktnu/AiLectureSummary/security/handler/CustomAuthenicationEntryPoint.java
index f25c47b..1b446c3 100644
--- a/backend/src/main/java/com/ktnu/AiLectureSummary/security/handler/CustomAuthenicationEntryPoint.java
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/security/handler/CustomAuthenicationEntryPoint.java
@@ -22,7 +22,7 @@ public void commence(HttpServletRequest request, HttpServletResponse response, A
 
         String message = authException instanceof UsernameNotFoundException
                 ? "존재 하지 않는 계정입니다"
-                : "인증이 필요합니다.";
+                : "로그인 이후 이용 가능합니다.";
 
         response.getWriter().write("{\"message\": \"" + message + "\"}");    }
 }
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/service/LectureApplicationService.java b/backend/src/main/java/com/ktnu/AiLectureSummary/service/LectureApplicationService.java
index 84060dd..9efc5f8 100644
--- a/backend/src/main/java/com/ktnu/AiLectureSummary/service/LectureApplicationService.java
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/service/LectureApplicationService.java
@@ -8,9 +8,7 @@
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
-@RequiredArgsConstructor
-@Service
-@Transactional
+
 
 /**
  * 사용자의 강의 업로드 요청을 처리하는 애플리케이션 서비스
@@ -21,6 +19,9 @@
  * 내부적으로 LectureService와 MemberLectureService를 조합하여
  * 하나의 유스케이스 단위 로직을 처리합니다.
  */
+@RequiredArgsConstructor
+@Service
+@Transactional
 public class LectureApplicationService {
     private final LectureService lectureService;
     private final MemberLectureService memberLectureService;
diff --git a/backend/src/main/java/com/ktnu/AiLectureSummary/service/MemberService.java b/backend/src/main/java/com/ktnu/AiLectureSummary/service/MemberService.java
index 29c8590..adb36f8 100644
--- a/backend/src/main/java/com/ktnu/AiLectureSummary/service/MemberService.java
+++ b/backend/src/main/java/com/ktnu/AiLectureSummary/service/MemberService.java
@@ -2,11 +2,7 @@
 
 import com.ktnu.AiLectureSummary.domain.Member;
 import com.ktnu.AiLectureSummary.domain.Role;
-import com.ktnu.AiLectureSummary.dto.member.MemberEditResponse;
-import com.ktnu.AiLectureSummary.dto.member.MemberEditRequest;
-import com.ktnu.AiLectureSummary.dto.member.MemberLoginRequest;
-import com.ktnu.AiLectureSummary.dto.member.MemberLoginResponse;
-import com.ktnu.AiLectureSummary.dto.member.MemberRegisterRequest;
+import com.ktnu.AiLectureSummary.dto.member.*;
 import com.ktnu.AiLectureSummary.exception.DuplicateLoginIdException;
 import com.ktnu.AiLectureSummary.exception.InvalidPasswordException;
 import com.ktnu.AiLectureSummary.exception.MemberNotFoundException;
@@ -14,20 +10,24 @@
 import com.ktnu.AiLectureSummary.security.CustomUserDetails;
 import com.ktnu.AiLectureSummary.security.JwtProvider;
 import jakarta.transaction.Transactional;
+import jakarta.validation.Valid;
 import lombok.RequiredArgsConstructor;
+import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Service;
 
 
 import org.springframework.security.crypto.password.PasswordEncoder;
 
+import java.time.Duration;
+import java.util.UUID;
+
 @Service
 @RequiredArgsConstructor
 public class MemberService {
     private final MemberRepository memberRepository;
     private final PasswordEncoder passwordEncoder;
     private final JwtProvider jwtProvider;
-
-
+    private final StringRedisTemplate stringRedisTemplate;
     /**
      * 사용자가 입력한 정보로 회원가입 시도합니다.
      * 이메일이 중복인 경우 실패 중복되지 않으면 성공합니다.
@@ -109,7 +109,8 @@ public MemberEditResponse editProfile(CustomUserDetails user, MemberEditRequest
             member.setUsername(newUsername);
         }
         if (newPassword != null && !passwordEncoder.matches(newPassword, member.getPassword())) {
-            member.setPassword(passwordEncoder.encode(newPassword));
+            String encoded = passwordEncoder.encode(newPassword);
+            member.changePassword(encoded);
             token = jwtProvider.createToken(member.getId());
         }
 
@@ -119,4 +120,54 @@ public MemberEditResponse editProfile(CustomUserDetails user, MemberEditRequest
                 .token(token)
                 .build();
     }
+
+    /**
+     * 비밀번호 찾기: 비밀번호 수정을 위한 임시 토큰 발급(15분 유효)
+     * @param request
+     * @return
+     */
+    public MemberPasswordResetTokenResponse findPassword(MemberFindPasswordRequest request) {
+        String name = request.getName();
+        String email = request.getEmail();
+
+        Member member = memberRepository.findByUsernameAndEmail(name, email)
+                .orElseThrow(() -> new MemberNotFoundException("존재하지 않는 사용자 정보입니다."));
+
+        // 이름과 이메일이 일치하는 사용자가 존재함을 확인했으므로, 임시 토큰을 발급 (실제 서비스의 경우 이메일로 토큰 전송)
+        String token = UUID.randomUUID().toString(); // 유니버설 고유 식별자 생성
+        // redis에 토큰 저장 // key: "reset: token..." value: email, TTL: 15min
+        stringRedisTemplate.opsForValue().set("reset:" + token, email, Duration.ofMinutes(15));
+
+        // 비밀번호 재설정용 임시 토큰 발급
+        MemberPasswordResetTokenResponse response = new MemberPasswordResetTokenResponse(token);
+        return response;
+    }
+
+    /**
+     * 비밀번호 찾기: 임시 토큰을 가진 사용자가 비밀 번호를 수정합니다. 수정 후 토큰은 삭제됩니다.
+     * @param token
+     * @param request
+     */
+    @Transactional
+    public void resetPassword(String token, MemberResetPasswordRequest request) {
+        // redis에서 이메일 조회
+        String key = "reset:" + token;
+        String email = stringRedisTemplate.opsForValue().get(key);
+
+        // 토큰 유효성 확인
+        if (email == null) {
+            throw new InvalidPasswordException("유효하지 않거나 만료된 토큰입니다.");
+        }
+
+        // 이메일로 사용자 조회
+        Member member = memberRepository.findByEmail(email)
+                .orElseThrow(()->new MemberNotFoundException("사용자를 찾을 수 없습니다."));
+
+        // 새 비밀번호로 변경
+        String encodedPassword = passwordEncoder.encode(request.getNewPassword());
+        member.changePassword(encodedPassword);
+
+        // 토큰 삭제 (1회성 사용)
+        stringRedisTemplate.delete(key);
+    }
 }
diff --git a/backend/src/main/resources/application.yml b/backend/src/main/resources/application.yml
index 1599761..0cc0778 100644
--- a/backend/src/main/resources/application.yml
+++ b/backend/src/main/resources/application.yml
@@ -24,10 +24,18 @@ spring:
     secure: ${COOKIE_SECURE}
     same-site: ${COOKIE_SAME_SITE}
 
+  data:
+    redis:
+      host: redis
+      port: 6379
+      timeout: 6000
+
 jwt:
   secret: ${JWT_SECRET}
   expiration: 3600000
 #  expiration: ${JWT_EXPIRATION}
 
+
+
 fastapi:
   url: ${FASTAPI_URL}
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index 9b8edc8..ff2e8c8 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -60,5 +60,12 @@ services:
     env_file:
       - ./.env.fastapi
 
+  redis:
+    image: redis:latest
+    container_name: redis
+    ports:
+      - "6379:6379"
+    # restart: always
+
 volumes:
   mysql-data:


Reviews:
user: login: copilot-pull-request-reviewer[bot]
body: ## Pull Request Overview

This PR integrates Redis into the development environment, refactors service annotations, and enhances API documentation with Swagger annotations.

- Add Redis service to Docker Compose and Spring Boot (application.yml, build.gradle, RedisConfig)
- Refactor placement of Spring annotations in `LectureApplicationService`
- Enhance Swagger documentation on DTOs and controller methods

### Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

<details>
<summary>Show a summary per file</summary>

| File                                                    | Description                                                         |
| ------------------------------------------------------- | ------------------------------------------------------------------- |
| docker-compose.dev.yml                                  | Add Redis service definition                                        |
| backend/src/main/resources/application.yml              | Configure Spring Data Redis properties                              |
| backend/build.gradle                                    | Add Spring Data Redis starter dependency                            |
| backend/src/main/java/com/ktnu/AiLectureSummary/config/RedisConfig.java | Provide RedisTemplate and StringRedisTemplate beans                 |
| backend/src/main/java/com/ktnu/AiLectureSummary/service/LectureApplicationService.java | Move annotations to class declaration                               |
| backend/src/main/java/com/ktnu/AiLectureSummary/dto/memberLecture/MemoRequest.java | Add Swagger `@Schema` for memo field                                |
| backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberEditRequest.java   | Update example value for `username`                                 |
| backend/src/main/java/com/ktnu/AiLectureSummary/dto/CustomTitleRequest.java         | Add Swagger `@Schema` and remove unused import                      |
| backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberLectureController.java | Add `@Parameter` annotation on path variables                       |
| backend/src/main/java/com/ktnu/AiLectureSummary/controller/HealthController.java    | Add JavaDoc for health check endpoint                               |
</details>



<details>
<summary>Comments suppressed due to low confidence (1)</summary>

**backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberLectureController.java:111**
* [nitpick] Rename the parameter 'requests' to the singular 'request' for clarity and consistency with surrounding code.
```
@RequestBody @Valid CustomTitleRequest requests){
```
</details>


state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-31T08:01:59Z
user: login: copilot-pull-request-reviewer[bot]
body: Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-31T08:10:57Z
user: login: copilot-pull-request-reviewer[bot]
body: Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-31T08:10:57Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 6**

<details>
<summary>♻️ Duplicate comments (5)</summary><blockquote>

<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/controller/HealthController.java (1)</summary><blockquote>

`8-11`: **Fill in the @return JavaDoc description**  
The `@return` tag is currently empty. Please provide a concise description, for example:  
```java
/**
 * 헬스 체크 (서버 깨우기)
 * @return "OK" 문자열을 반환하여 서버 상태를 나타냅니다.
 */
```

</blockquote></details>
<details>
<summary>docker-compose.dev.yml (2)</summary><blockquote>

`64-64`: **Pin Redis image to a specific version**  
Using `redis:latest` can cause unexpected upgrades. Consider a fixed, lightweight tag (e.g., `redis:7.0-alpine`) for reproducible builds.

---

`68-68`: **Enable a restart policy for the Redis service**  
Uncomment and set a restart policy (e.g., `restart: always`) to improve container resilience during development.

</blockquote></details>
<details>
<summary>backend/src/main/resources/application.yml (1)</summary><blockquote>

`38-39`: **Remove extraneous blank lines**  
There are more than two consecutive blank lines which can be trimmed to maintain consistency.

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 YAMLlint (1.37.1)</summary>

[warning] 39-39: too many blank lines

(3 > 2) (empty-lines)

</details>

</details>

</blockquote></details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/config/RedisConfig.java (1)</summary><blockquote>

`24-29`: _🛠️ Refactor suggestion_

**Configure explicit serializers to avoid JDK serialization.**

The `RedisTemplate<String, Object>` uses default JDK serialization which is inefficient and can cause compatibility issues. Configure explicit serializers for better performance.




```diff
 @Bean
 public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory connectionFactory) {
     RedisTemplate<String, Object> template = new RedisTemplate<>();
     template.setConnectionFactory(connectionFactory);
+    
+    // Configure serializers
+    template.setKeySerializer(new StringRedisSerializer());
+    template.setValueSerializer(new GenericJackson2JsonRedisSerializer());
+    template.setHashKeySerializer(new StringRedisSerializer());
+    template.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());
+    
     return template;
 }
```

Add the required import:
```diff
+import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
```

</blockquote></details>

</blockquote></details>

<details>
<summary>🧹 Nitpick comments (11)</summary><blockquote>

<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberLectureController.java (1)</summary><blockquote>

`110-111`: **Improve parameter naming consistency in `saveLectureTitle`**  
The parameter `requests` is plural and deviates from other methods (e.g., `saveMemo` uses `request`). Rename to `request` to align with the DTO type and project conventions.  


Suggested diff:
```diff
- public ResponseEntity<ApiResponse<LectureDetailResponse>> saveLectureTitle(
-         @AuthenticationPrincipal CustomUserDetails user,
-         @Parameter(description = "강의 ID", example = "1") @PathVariable Long lectureId,
-         @RequestBody @Valid CustomTitleRequest requests){
+ public ResponseEntity<ApiResponse<LectureDetailResponse>> saveLectureTitle(
+         @AuthenticationPrincipal CustomUserDetails user,
+         @Parameter(description = "강의 ID", example = "1") @PathVariable Long lectureId,
+         @RequestBody @Valid CustomTitleRequest request){
     LectureDetailResponse lectureDetailResponse = memberLectureService.updateCustomTitle(user, lectureId, request.getTitle());
     return ResponseEntity.ok(ApiResponse.success("강의 제목 수정 성공", lectureDetailResponse));
 }
```

</blockquote></details>
<details>
<summary>backend/src/main/resources/application.yml (1)</summary><blockquote>

`29-31`: **Specify duration unit for Redis timeout**  
For clarity and to avoid ambiguity, consider specifying the timeout with an explicit unit (e.g., `timeout: 6000ms`).

</blockquote></details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/security/handler/CustomAuthenicationEntryPoint.java (2)</summary><blockquote>

`23-24`: **Correct spacing in the UsernameNotFoundException message**  
The phrase `"존재 하지 않는 계정입니다"` should be `"존재하지 않는 계정입니다"` (no extra space) for proper Korean grammar.

---

`23-27`: **Externalize hardcoded messages for maintainability**  
Consider moving these user-facing strings to a `messages.properties` or i18n resource bundle to facilitate localization and avoid code changes for text updates.

</blockquote></details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/config/SecurityConfig.java (1)</summary><blockquote>

`34-36`: **Update the Korean comment for accuracy.**

The comment mentions "비밀번호 변경" (password change) but should be "비밀번호 찾기/재설정" (password recovery/reset) to accurately reflect the functionality being implemented.



```diff
-                                "/swagger-ui.html").permitAll() // 로그인, 회원가입, 스웨거, 헬스체크, 비밀번호 변경 인증없이 접근 허용
+                                "/swagger-ui.html").permitAll() // 로그인, 회원가입, 스웨거, 헬스체크, 비밀번호 찾기/재설정 인증없이 접근 허용
```

</blockquote></details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberPasswordResetTokenResponse.java (1)</summary><blockquote>

`6-10`: **Consider adding Swagger documentation for API consistency.**

The DTO implementation is functionally correct. Consider adding Swagger annotations for consistent API documentation across the application.



```diff
+import io.swagger.v3.oas.annotations.media.Schema;
+
 @Getter
 @AllArgsConstructor
+@Schema(description = "비밀번호 재설정 토큰 응답")
 public class MemberPasswordResetTokenResponse {
+    @Schema(description = "비밀번호 재설정 토큰", example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...")
     private String token;
 }
```

</blockquote></details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberController.java (4)</summary><blockquote>

`125-125`: **Consider adding rate limiting and additional security headers.**

While the current implementation is functional, consider enhancing security:

```java
@PostMapping("/find-password")
@Operation(summary = "비밀번호 찾기 요청(이메일 이름 입력)", description = "...")
public ResponseEntity<ApiResponse<MemberPasswordResetTokenResponse>> findPassword(
        @Valid @RequestBody MemberFindPasswordRequest request,
        HttpServletRequest httpRequest) {
    // Add rate limiting based on IP address
    // Log security events for monitoring
    MemberPasswordResetTokenResponse response = memberService.findPassword(request);
    return ResponseEntity.ok(ApiResponse.success("...", response));
}
```

Additional security considerations:
- Rate limiting per IP/user to prevent abuse
- Security event logging for monitoring
- Consider CAPTCHA for automated attack prevention




Also applies to: 141-141

---

`122-128`: **Well-documented endpoint with security considerations noted.**

Good implementation of the password recovery request endpoint. The Swagger documentation clearly explains the functionality and the comment about email verification being needed for production is important context.



Consider adding rate limiting to prevent abuse of this endpoint in production.

---

`135-145`: **Improve header naming convention and consider security implications.**

The endpoint implementation is functional but has some considerations:

1. **Header Naming**: "Reset-Token" doesn't follow HTTP header naming conventions
2. **Security**: Custom headers might not be the best practice for sensitive tokens



Consider using a standard header naming convention:

```diff
-            @Parameter(description = "비밀번호 재설정을 위한 임시 토큰",required = true) @RequestHeader("Reset-Token") String token,
+            @Parameter(description = "비밀번호 재설정을 위한 임시 토큰",required = true) @RequestHeader("X-Reset-Token") String token,
```


For production, consider using the Authorization header with a custom scheme (e.g., `Authorization: ResetToken <token>`) or include the token in the request body for better security, as custom headers might be logged or cached inappropriately.

---

`135-145`: **Consider standard Authorization header instead of custom header.**

The endpoint implementation is correct, but the custom "Reset-Token" header is unconventional.


Consider using the standard Authorization header for better REST API conventions:

```java
@PostMapping("/reset-password")
@Operation(summary = "비밀번호 재설정 요청(비밀번호 입력)",
        description = "사용자의 비밀번호를 재설정 합니다. 비밀번호 찾기 요청에서 발급 받은 임시토큰을 Authorization 헤더로 전송합니다.")
public ResponseEntity<ApiResponse<Void>> resetPassword(
        @Parameter(description = "비밀번호 재설정을 위한 임시 토큰", required = true) 
        @RequestHeader("Authorization") String authHeader,
        @Valid @RequestBody MemberResetPasswordRequest request) {
    
    // Extract token from "Bearer <token>" format
    String token = authHeader.startsWith("Bearer ") ? 
        authHeader.substring(7) : authHeader;
    
    memberService.resetPassword(token, request);
    return ResponseEntity.ok(ApiResponse.success("새로운 비밀번호로 수정되었습니다.", null));
}
```

Alternatively, if you prefer the custom header approach, ensure it's consistently documented across your API.

</blockquote></details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/service/MemberService.java (1)</summary><blockquote>

`13-13`: **Remove unused import.**

The `jakarta.validation.Valid` import appears to be unused in this service class. The `@Valid` annotation is typically used in controller methods for request validation.



```diff
-import jakarta.validation.Valid;
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between aea66986f39f598b62249e69ff65c895eb2aecd4 and 659736ef564b086edc85d1b3ef4144da4b3a95b9.

</details>

<details>
<summary>📒 Files selected for processing (19)</summary>

* `backend/build.gradle` (1 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/config/RedisConfig.java` (1 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/config/SecurityConfig.java` (1 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/controller/HealthController.java` (1 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberController.java` (7 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberLectureController.java` (5 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/domain/Member.java` (3 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/dto/CustomTitleRequest.java` (1 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberEditRequest.java` (1 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberFindPasswordRequest.java` (1 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberPasswordResetTokenResponse.java` (1 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberResetPasswordRequest.java` (1 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/dto/memberLecture/MemoRequest.java` (2 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/repository/MemberRepository.java` (1 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/security/handler/CustomAuthenicationEntryPoint.java` (1 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/service/LectureApplicationService.java` (2 hunks)
* `backend/src/main/java/com/ktnu/AiLectureSummary/service/MemberService.java` (3 hunks)
* `backend/src/main/resources/application.yml` (1 hunks)
* `docker-compose.dev.yml` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Graph Analysis (2)</summary>

<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberPasswordResetTokenResponse.java (3)</summary><blockquote>

<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberEditRequest.java (1)</summary>

* `Getter` (7-17)

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberResetPasswordRequest.java (1)</summary>

* `Getter` (8-16)

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberFindPasswordRequest.java (1)</summary>

* `Getter` (8-19)

</details>

</blockquote></details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/dto/CustomTitleRequest.java (2)</summary><blockquote>

<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberEditRequest.java (1)</summary>

* `Getter` (7-17)

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/dto/memberLecture/MemoRequest.java (1)</summary>

* `Getter` (9-16)

</details>

</blockquote></details>

</details><details>
<summary>🪛 YAMLlint (1.37.1)</summary>

<details>
<summary>backend/src/main/resources/application.yml</summary>

[warning] 39-39: too many blank lines

(3 > 2) (empty-lines)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (39)</summary><blockquote>

<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/service/LectureApplicationService.java (1)</summary>

`22-24`: **Relocated class-level annotations correctly**  
The annotations `@RequiredArgsConstructor`, `@Service`, and `@Transactional` have been moved to immediately precede the class declaration, maintaining the original behavior without any changes to logic or API.

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/dto/CustomTitleRequest.java (2)</summary>

`4-4`: **Add Swagger `@Schema` import for API documentation**  
The new import `io.swagger.v3.oas.annotations.media.Schema` is necessary for the `@Schema` annotation on this DTO.

---

`11-11`: **Annotate the `title` field with OpenAPI `@Schema`**  
The `description` and `example` align with existing DTOs (e.g., `MemoRequest`), improving Swagger documentation consistency.

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/dto/memberLecture/MemoRequest.java (2)</summary>

`3-3`: **Add Swagger `@Schema` import for memo DTO**  
Importing `io.swagger.v3.oas.annotations.media.Schema` enables the new `@Schema` annotation for enhanced API docs.

---

`14-14`: **Document `memo` field with OpenAPI `@Schema`**  
The `description` and `example` match project conventions, improving clarity in generated API specs.

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberLectureController.java (4)</summary>

`10-10`: **Import Swagger `@Parameter` annotation**  
Adding `io.swagger.v3.oas.annotations.Parameter` is required to annotate path variables for OpenAPI.

---

`52-54`: **Annotate `lectureId` in `getLectureDetail` with `@Parameter`**  
The description "강의 ID" and example "1" improve path variable documentation and align with other endpoints.

---

`73-73`: **Annotate `lectureId` in `saveMemo` with `@Parameter`**  
Ensures consistent OpenAPI metadata across memo-related endpoints.

---

`92-92`: **Annotate `lectureId` in `deleteMemo` with `@Parameter`**  
Maintains documentation consistency for delete operations.

</details>
<details>
<summary>backend/build.gradle (1)</summary>

`43-43`: **Add Redis dependency for password reset tokens**  
The `spring-boot-starter-data-redis` dependency is correctly added to support Redis integration.

</details>
<details>
<summary>backend/src/main/resources/application.yml (1)</summary>

`27-32`: **Configure Redis connection settings**  
The new `spring.data.redis` properties correctly specify host, port, and timeout for Redis integration.

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/security/handler/CustomAuthenicationEntryPoint.java (1)</summary>

`23-27`: **Approve updated default authentication message**  
The default error message now reads `"로그인 이후 이용 가능합니다."`, which clearly informs users of the login requirement.

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/repository/MemberRepository.java (2)</summary>

`32-32`: **LGTM! Repository method implementation is correct.**

The new `findByUsernameAndEmail` method follows Spring Data JPA naming conventions and is appropriately designed for password recovery functionality requiring both username and email verification.

---

`32-32`: **LGTM! Appropriate repository method for password reset verification.**

The new repository method follows Spring Data JPA naming conventions and will automatically generate the query to find a member by both username and email. This dual-field verification enhances security for the password reset process by requiring users to provide both credentials.

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberResetPasswordRequest.java (2)</summary>

`8-16`: **LGTM! Well-implemented DTO with proper validation.**

The DTO implementation follows best practices with:
- Appropriate validation constraints matching the system's password policy
- Consistent regex pattern with other password-related DTOs
- Proper Swagger documentation for API clarity
- Korean language support for user-friendly error messages

---

`8-16`: **LGTM! Proper validation and consistent with existing patterns.**

The DTO implements appropriate validation for password reset requests:
- `@NotBlank` ensures the field is required
- `@Pattern` with regex `^(?=\\S+$).{8,20}$` enforces no whitespace and 8-20 character length
- `@Schema` provides proper API documentation

The validation pattern is consistent with `MemberEditRequest` from the relevant snippets, ensuring uniform password policies across the application.

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberFindPasswordRequest.java (1)</summary>

`11-18`: **Validation implementation looks good.**

The validation annotations and Swagger documentation are properly implemented. The Korean error messages are consistent with the project's localization.

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/domain/Member.java (3)</summary>

`46-47`: **Excellent encapsulation improvement.**

Making the password setter private prevents unauthorized direct modification and enforces controlled updates through the domain method.

---

`49-55`: **Domain method implementation is correct.**

The `changePassword` method properly encapsulates password updates and the documentation clearly indicates the requirement for pre-encoded passwords.

---

`69-71`: **Proper default value configuration.**

Adding `@Builder.Default` ensures the `active` field defaults to `true` when using the builder pattern, preventing potential null/false initialization issues.

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberEditRequest.java (2)</summary>

`10-12`: **Documentation improvement for optional field.**

Adding "(선택 사항)" clearly indicates the password field is optional for editing. The `@Pattern` validation already enforces the 8-20 character length requirement, making the removed `@Size` annotation redundant.

---

`14-16`: **Clear optional field documentation.**

The "(선택 사항)" addition and updated example value improve the API documentation clarity for optional username editing.

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/config/RedisConfig.java (1)</summary>

`15-18`: **StringRedisTemplate configuration is appropriate.**

The `StringRedisTemplate` is properly configured and suitable for simple string-based operations like storing password reset tokens.

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/service/MemberService.java (8)</summary>

`5-5`: **LGTM! Clean dependency additions for Redis integration.**

The new imports and Redis dependency injection are properly structured to support the password reset functionality.



Also applies to: 13-13, 15-15, 21-22, 30-30

---

`112-113`: **Good encapsulation improvement using domain method.**

Replacing direct password setter with `member.changePassword(encoded)` improves encapsulation and follows domain-driven design principles.

---

`152-172`: **Excellent password reset implementation with proper security measures.**

The method correctly:
- Validates token existence and retrieval from Redis
- Throws appropriate exceptions for invalid/expired tokens
- Updates password using the domain method
- Deletes token after use (one-time usage)
- Uses `@Transactional` for data consistency

The error handling and token lifecycle management follow security best practices.

---

`112-113`: **Good encapsulation improvement!**

Excellent change to use the domain method `changePassword()` instead of direct setter access. This promotes better encapsulation and allows the domain object to enforce business rules around password changes.

---

`5-5`: **LGTM: Import statements are appropriate for the new functionality.**

The new imports support Redis operations, UUID generation, time duration handling, and validation annotations needed for the password reset feature.



Also applies to: 13-13, 15-15, 21-22

---

`30-30`: **LGTM: Redis dependency injection is correctly implemented.**

The StringRedisTemplate is properly injected and will be used for temporary token storage in the password reset flow.

---

`112-113`: **Good refactoring: Using domain method for password change.**

This change improves encapsulation by using the domain object's `changePassword` method instead of directly setting the password field.

---

`152-172`: **Excellent token validation and one-time use enforcement.**

The implementation correctly:
- Validates token existence and expiration
- Enforces one-time token usage by deleting after use
- Uses the domain method for password change
- Provides appropriate error messages

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberController.java (6)</summary>

`10-10`: **Clean code improvements and import additions.**

The added imports and minor formatting/comment improvements enhance code readability without affecting functionality.



Also applies to: 26-26, 29-29, 35-35, 44-44, 56-56, 72-72, 94-94, 101-101

---

`122-128`: **Well-designed password recovery endpoint with comprehensive documentation.**

The endpoint design is solid:
- Appropriate HTTP method (POST) for state-changing operation
- Clear Swagger documentation explaining the workflow
- Proper validation with `@Valid`
- Consistent response structure using `ApiResponse`

The documentation clearly explains this is for testing/learning purposes and notes the need for email verification in production.

---

`135-145`: **Excellent password reset endpoint implementation.**

Strong design choices:
- Uses custom header `Reset-Token` for token transmission (more secure than URL parameters)
- Comprehensive Swagger documentation with parameter descriptions
- Proper validation and error handling
- Clear success response

The custom header approach prevents token exposure in logs and browser history.

---

`122-145`: <details>
<summary>✅ Verification successful</summary>

**Verify security configuration allows unauthenticated access.**

These new endpoints need to be accessible without authentication. Ensure that the security configuration properly permits these endpoints.

---

🏁 Script executed:

```shell
#!/bin/bash
# Description: Verify that the new password reset endpoints are configured to allow unauthenticated access

# Search for SecurityConfig to check if these endpoints are permitted
ast-grep --pattern 'class $_ {
  $$$
  .requestMatchers($$$).permitAll()
  $$$
}'

# Also search for specific endpoint patterns
rg -A 5 -B 5 "find-password|reset-password" --type java
```

Length of output: 4954

---



</details>

**Security configuration permits new endpoints**

Verified that `/api/members/find-password` and `/api/members/reset-password` are already listed in `.requestMatchers(...).permitAll()` in `backend/src/main/java/com/ktnu/AiLectureSummary/config/SecurityConfig.java`. No further changes needed.

---

`10-10`: **LGTM: Minor improvements to imports, formatting, and documentation.**

The added imports, formatting adjustments, and comment updates improve code readability and documentation.



Also applies to: 26-26, 29-29, 35-35, 44-44, 56-56, 59-59, 72-72, 94-94, 101-101, 113-113

---

`122-128`: **Well-documented endpoint with security considerations noted.**

The endpoint is properly implemented with:
- Appropriate HTTP method (POST)
- Good validation with `@Valid`
- Excellent Swagger documentation
- Clear acknowledgment that email verification would be needed for production

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/config/SecurityConfig.java (1)</summary>

`34-36`: **LGTM! Proper security configuration for password reset endpoints.**

The security configuration correctly allows unauthenticated access to the password reset endpoints, which is essential since users cannot authenticate when they've forgotten their passwords. The implementation follows security best practices for password recovery flows.

</details>
<details>
<summary>backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberPasswordResetTokenResponse.java (1)</summary>

`1-10`: **LGTM! Clean and minimal DTO design.**

The DTO follows a clean, minimal design appropriate for encapsulating a password reset token response. The use of Lombok annotations reduces boilerplate while maintaining readability and follows established patterns in the codebase.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-05-31T08:12:34Z
user: login: ddoyo
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-31T12:12:56Z

Review comments:
diff_hunk: @@ -60,5 +60,12 @@ services:
     env_file:
       - ./.env.fastapi
 
+  redis:
+    image: redis:latest
path: docker-compose.dev.yml
user: login: Copilot
body: Using the 'latest' tag can lead to unexpected upgrades; pin Redis to a specific version (e.g., 'redis:7.0-alpine') for reproducible builds.
```suggestion
    image: redis:7.0-alpine
```
created_at: 2025-05-31T08:01:58Z
author_association: CONTRIBUTOR
diff_hunk: @@ -60,5 +60,12 @@ services:
     env_file:
       - ./.env.fastapi
 
+  redis:
+    image: redis:latest
+    container_name: redis
+    ports:
+      - "6379:6379"
+    # restart: always
path: docker-compose.dev.yml
user: login: Copilot
body: [nitpick] Consider enabling a restart policy such as 'restart: always' to improve container resilience during development.
```suggestion
    restart: always
```
created_at: 2025-05-31T08:01:58Z
author_association: CONTRIBUTOR
diff_hunk: @@ -24,10 +24,18 @@ spring:
     secure: ${COOKIE_SECURE}
     same-site: ${COOKIE_SAME_SITE}
 
+  data:
+    redis:
+      host: redis
+      port: 6379
+      timeout: 6000
+
 jwt:
   secret: ${JWT_SECRET}
   expiration: 3600000
 #  expiration: ${JWT_EXPIRATION}
 
+
+
path: backend/src/main/resources/application.yml
user: login: Copilot
body: [nitpick] Remove extraneous blank lines to keep the configuration file concise and consistent.
```suggestion

```
created_at: 2025-05-31T08:01:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -5,6 +5,10 @@
 
 @RestController
 public class HealthController {
+    /**
+     * 헬스 체크 (서버 깨우기)
+     * @return
path: backend/src/main/java/com/ktnu/AiLectureSummary/controller/HealthController.java
user: login: Copilot
body: Provide a description for the @return tag, e.g., '@return "OK" when the service is healthy'.
created_at: 2025-05-31T08:01:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,30 @@
+package com.ktnu.AiLectureSummary.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.StringRedisTemplate;
+
+@Configuration
+public class RedisConfig {
+    /**
+     * Redis에서 String 타입의 key-value 저장을 쉽게 다룰 수 있도록 지원하는 템플릿 Bean입니다.
+     * 주로 단순 문자열 데이터를 처리할 때 사용됩니다.
+     */
+    @Bean
+    public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory connectionFactory) {
+        return new StringRedisTemplate(connectionFactory);
+    }
+
+    /**
+     * Redis에서 다양한 자료형(Object)을 다룰 수 있도록 설정된 일반적인 RedisTemplate Bean입니다.
+     * 복잡한 객체 직렬화 및 다양한 Redis 자료구조(Hash, List 등) 작업에 사용됩니다.
+     */
+    @Bean
+    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory connectionFactory) {
+        RedisTemplate<String, Object> template = new RedisTemplate<>();
path: backend/src/main/java/com/ktnu/AiLectureSummary/config/RedisConfig.java
user: login: Copilot
body: Configure key and value serializers (e.g., StringRedisSerializer or Jackson2JsonRedisSerializer) on RedisTemplate to avoid relying on default JDK serialization.
created_at: 2025-05-31T08:01:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -32,9 +31,9 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
                 .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) // httponly 설정
                 .authorizeHttpRequests(auth -> auth
                         .requestMatchers("/api/members/login", "/api/members/register", "/health",
-                                "/v3/api-docs/**",
+                                "/v3/api-docs/**","/api/members/find-password","/api/members/reset-password",
path: backend/src/main/java/com/ktnu/AiLectureSummary/config/SecurityConfig.java
user: login: coderabbitai[bot]
body: _💡 Verification agent_

<details>
<summary>🧩 Analysis chain</summary>

**Verify rate limiting for password reset endpoints.**

The password recovery endpoints are now accessible without authentication, which is correct for this functionality. However, ensure that proper rate limiting is implemented in the controller or service layer to prevent abuse of these endpoints.

---

🏁 Script executed:

```shell
#!/bin/bash
# Description: Check if rate limiting or throttling is implemented for password reset endpoints
# Expected: Find rate limiting annotations or configurations

echo "Searching for rate limiting implementations..."
rg -A 3 -B 3 "RateLimiter|@RateLimit|Throttle|rate.limit" --type java

echo "Checking controller implementations for password reset endpoints..."
ast-grep --pattern 'class $_ {
  $$$
  @PostMapping("$_find-password")
  $$$
}' --lang java

ast-grep --pattern 'class $_ {
  $$$  
  @PostMapping("$_reset-password")
  $$$
}' --lang java
```

Length of output: 510

---



</details>

**Action Required: Implement rate limiting for password reset endpoints**

No evidence of throttling or rate-limiting was found for the unauthenticated `/api/members/find-password` and `/api/members/reset-password` endpoints. To prevent abuse, please introduce rate limiting (e.g. via annotations, a filter, or a resilience4j/Spring Cloud Gateway configuration) in the controller or service layer.

• No matches for `RateLimiter|@RateLimit|Throttle|rate.limit` in the Java codebase  
• Endpoints needing protection:  
  - `@PostMapping("/api/members/find-password")` in your MemberController  
  - `@PostMapping("/api/members/reset-password")` in your MemberController  

Example using Resilience4j’s RateLimiter annotation:
```java
@PostMapping("/api/members/reset-password")
@RateLimiter(name = "passwordResetLimiter")
public ResponseEntity<Void> resetPassword(@RequestBody ResetPasswordRequest req) { … }
```

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In backend/src/main/java/com/ktnu/AiLectureSummary/config/SecurityConfig.java at
line 34, the password reset endpoints /api/members/find-password and
/api/members/reset-password are exposed without authentication but lack rate
limiting, which risks abuse. To fix this, add rate limiting annotations such as
@RateLimiter from Resilience4j on the corresponding controller methods handling
these endpoints, or implement rate limiting via a filter or gateway
configuration to restrict the number of requests allowed in a given time frame.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-31T08:12:33Z
author_association: NONE
diff_hunk: @@ -0,0 +1,19 @@
+package com.ktnu.AiLectureSummary.dto.member;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.Email;
+import jakarta.validation.constraints.NotBlank;
+import lombok.Getter;
+
+@Getter
+public class MemberFindPasswordRequest {
+
+    @NotBlank(message = "이름은 필수 입력값입니다.")
+    @Schema(description = "사용자 이름", example = "testUser")
+    private String name;
+
+    @NotBlank(message = "이메일은 필수 입력값입니다.")
+    @Email(message = "이메일 형식이 올바르지 않습니다.")
+    @Schema(description = "사용자 이메일", example = "test@example.com")
+    private String email;
+}
path: backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberFindPasswordRequest.java
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add constructor for DTO instantiation.**

The DTO lacks a constructor for creating instances. Consider adding `@AllArgsConstructor` or a custom constructor to enable proper instantiation.



```diff
 @Getter
+@AllArgsConstructor
 public class MemberFindPasswordRequest {
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
@Getter
@AllArgsConstructor
public class MemberFindPasswordRequest {

    @NotBlank(message = "이름은 필수 입력값입니다.")
    @Schema(description = "사용자 이름", example = "testUser")
    private String name;

    @NotBlank(message = "이메일은 필수 입력값입니다.")
    @Email(message = "이메일 형식이 올바르지 않습니다.")
    @Schema(description = "사용자 이메일", example = "test@example.com")
    private String email;
}
```

</details>

<!-- suggestion_end -->

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In
backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberFindPasswordRequest.java
around lines 8 to 19, the DTO class lacks a constructor for instantiation. Add
an @AllArgsConstructor annotation or define a custom constructor that
initializes all fields to enable proper creation of MemberFindPasswordRequest
instances.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-31T08:12:33Z
author_association: NONE
diff_hunk: @@ -119,4 +120,54 @@ public MemberEditResponse editProfile(CustomUserDetails user, MemberEditRequest
                 .token(token)
                 .build();
     }
+
+    /**
+     * 비밀번호 찾기: 비밀번호 수정을 위한 임시 토큰 발급(15분 유효)
+     * @param request
+     * @return
+     */
+    public MemberPasswordResetTokenResponse findPassword(MemberFindPasswordRequest request) {
+        String name = request.getName();
+        String email = request.getEmail();
+
+        Member member = memberRepository.findByUsernameAndEmail(name, email)
+                .orElseThrow(() -> new MemberNotFoundException("존재하지 않는 사용자 정보입니다."));
+
+        // 이름과 이메일이 일치하는 사용자가 존재함을 확인했으므로, 임시 토큰을 발급 (실제 서비스의 경우 이메일로 토큰 전송)
+        String token = UUID.randomUUID().toString(); // 유니버설 고유 식별자 생성
+        // redis에 토큰 저장 // key: "reset: token..." value: email, TTL: 15min
+        stringRedisTemplate.opsForValue().set("reset:" + token, email, Duration.ofMinutes(15));
+
+        // 비밀번호 재설정용 임시 토큰 발급
+        MemberPasswordResetTokenResponse response = new MemberPasswordResetTokenResponse(token);
+        return response;
+    }
path: backend/src/main/java/com/ktnu/AiLectureSummary/service/MemberService.java
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Security concern: Password reset without email verification.**

The implementation correctly generates tokens and stores them in Redis with appropriate TTL, but the lack of email verification poses a security risk. An attacker who knows a user's name and email can initiate password reset.

Consider adding additional verification steps for production use:
- Email-based token delivery
- Rate limiting for password reset requests
- Additional user verification (security questions, etc.)



The current implementation is suitable for development/testing but should be enhanced before production deployment.

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In backend/src/main/java/com/ktnu/AiLectureSummary/service/MemberService.java
around lines 129 to 144, the password reset method lacks email verification,
allowing anyone with a user's name and email to generate a reset token. To fix
this, implement an email verification step by sending the generated token to the
user's registered email address instead of returning it directly. Additionally,
add rate limiting to the password reset requests and consider extra user
verification methods like security questions to enhance security before
production deployment.
```

</details>

---

_🛠️ Refactor suggestion_

**Review token generation and storage security.**

The password recovery implementation has several considerations:

1. **Token Security**: `UUID.randomUUID()` may not be cryptographically secure enough for password reset tokens. Consider using `SecureRandom` for better security.
2. **Method Logic**: The method finds user by username AND email, but only stores email in Redis. This could be confusing since the validation only uses email.



Consider this more secure approach:

```diff
-        String token = UUID.randomUUID().toString(); // 유니버설 고유 식별자 생성
+        // Generate cryptographically secure token
+        SecureRandom secureRandom = new SecureRandom();
+        byte[] tokenBytes = new byte[32];
+        secureRandom.nextBytes(tokenBytes);
+        String token = Base64.getUrlEncoder().withoutPadding().encodeToString(tokenBytes);
```

Also consider storing user ID instead of email for better consistency:

```diff
-        stringRedisTemplate.opsForValue().set("reset:" + token, email, Duration.ofMinutes(15));
+        stringRedisTemplate.opsForValue().set("reset:" + token, member.getId().toString(), Duration.ofMinutes(15));
```

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In backend/src/main/java/com/ktnu/AiLectureSummary/service/MemberService.java
around lines 129 to 144, replace the use of UUID.randomUUID() with a
cryptographically secure token generator such as SecureRandom or a similar
secure method to generate the password reset token. Additionally, instead of
storing the email in Redis under the token key, store the user's unique ID to
maintain consistency and improve security. Update the Redis key-value storage
accordingly and ensure the rest of the method logic aligns with these changes.
```

</details>

---

_🛠️ Refactor suggestion_

**Review token exposure and add rate limiting considerations.**

The implementation is functionally correct, but consider these security improvements:

1. **Token exposure**: The token is returned directly in the response, which may be logged in server logs or browser history.
2. **Rate limiting**: No protection against repeated password reset attempts.


Consider these improvements for production use:

```java
public MemberPasswordResetTokenResponse findPassword(MemberFindPasswordRequest request) {
    // Add rate limiting check here
    String name = request.getName();
    String email = request.getEmail();

    Member member = memberRepository.findByUsernameAndEmail(name, email)
            .orElseThrow(() -> new MemberNotFoundException("존재하지 않는 사용자 정보입니다."));

    String token = UUID.randomUUID().toString();
    stringRedisTemplate.opsForValue().set("reset:" + token, email, Duration.ofMinutes(15));

    // In production, send token via email instead of returning it
    // emailService.sendPasswordResetEmail(email, token);
    
    return new MemberPasswordResetTokenResponse(token);
}
```

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In backend/src/main/java/com/ktnu/AiLectureSummary/service/MemberService.java
around lines 129 to 144, the password reset token is returned directly in the
response which risks exposure through logs or browser history, and there is no
rate limiting to prevent abuse. To fix this, implement a rate limiting check at
the start of the method to restrict repeated requests, and instead of returning
the token in the response, send it securely via email using an email service.
Remove the token from the response to avoid direct exposure.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-31T08:12:34Z
author_association: NONE
diff_hunk: @@ -119,4 +120,54 @@ public MemberEditResponse editProfile(CustomUserDetails user, MemberEditRequest
                 .token(token)
                 .build();
     }
+
+    /**
+     * 비밀번호 찾기: 비밀번호 수정을 위한 임시 토큰 발급(15분 유효)
+     * @param request
+     * @return
+     */
+    public MemberPasswordResetTokenResponse findPassword(MemberFindPasswordRequest request) {
+        String name = request.getName();
+        String email = request.getEmail();
+
+        Member member = memberRepository.findByUsernameAndEmail(name, email)
+                .orElseThrow(() -> new MemberNotFoundException("존재하지 않는 사용자 정보입니다."));
+
+        // 이름과 이메일이 일치하는 사용자가 존재함을 확인했으므로, 임시 토큰을 발급 (실제 서비스의 경우 이메일로 토큰 전송)
+        String token = UUID.randomUUID().toString(); // 유니버설 고유 식별자 생성
+        // redis에 토큰 저장 // key: "reset: token..." value: email, TTL: 15min
+        stringRedisTemplate.opsForValue().set("reset:" + token, email, Duration.ofMinutes(15));
+
+        // 비밀번호 재설정용 임시 토큰 발급
+        MemberPasswordResetTokenResponse response = new MemberPasswordResetTokenResponse(token);
+        return response;
+    }
+
+    /**
+     * 비밀번호 찾기: 임시 토큰을 가진 사용자가 비밀 번호를 수정합니다. 수정 후 토큰은 삭제됩니다.
+     * @param token
+     * @param request
+     */
+    @Transactional
+    public void resetPassword(String token, MemberResetPasswordRequest request) {
+        // redis에서 이메일 조회
+        String key = "reset:" + token;
+        String email = stringRedisTemplate.opsForValue().get(key);
+
+        // 토큰 유효성 확인
+        if (email == null) {
+            throw new InvalidPasswordException("유효하지 않거나 만료된 토큰입니다.");
+        }
+
+        // 이메일로 사용자 조회
+        Member member = memberRepository.findByEmail(email)
+                .orElseThrow(()->new MemberNotFoundException("사용자를 찾을 수 없습니다."));
+
+        // 새 비밀번호로 변경
+        String encodedPassword = passwordEncoder.encode(request.getNewPassword());
+        member.changePassword(encodedPassword);
+
+        // 토큰 삭제 (1회성 사용)
+        stringRedisTemplate.delete(key);
+    }
path: backend/src/main/java/com/ktnu/AiLectureSummary/service/MemberService.java
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Improve error handling and consider rate limiting.**

The password reset logic is functionally correct but has some improvements to consider:

1. **Exception Type**: Using `InvalidPasswordException` for token validation is semantically incorrect.
2. **Security**: No rate limiting on password reset attempts.



```diff
         // 토큰 유효성 확인
         if (email == null) {
-            throw new InvalidPasswordException("유효하지 않거나 만료된 토큰입니다.");
+            throw new IllegalArgumentException("유효하지 않거나 만료된 토큰입니다.");
         }
```


Consider implementing rate limiting on password reset attempts to prevent abuse. You could use Redis to track reset attempts per email/IP address.


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
    public void resetPassword(String token, MemberResetPasswordRequest request) {
        // redis에서 이메일 조회
        String key = "reset:" + token;
        String email = stringRedisTemplate.opsForValue().get(key);

        // 토큰 유효성 확인
        if (email == null) {
            throw new IllegalArgumentException("유효하지 않거나 만료된 토큰입니다.");
        }

        // 이메일로 사용자 조회
        Member member = memberRepository.findByEmail(email)
                .orElseThrow(() -> new MemberNotFoundException("사용자를 찾을 수 없습니다."));

        // 새 비밀번호로 변경
        String encodedPassword = passwordEncoder.encode(request.getNewPassword());
        member.changePassword(encodedPassword);

        // 토큰 삭제 (1회성 사용)
        stringRedisTemplate.delete(key);
    }
```

</details>

<!-- suggestion_end -->

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In backend/src/main/java/com/ktnu/AiLectureSummary/service/MemberService.java
around lines 152 to 172, replace the use of InvalidPasswordException for token
validation with a more appropriate exception type like InvalidTokenException to
better reflect the error context. Additionally, implement rate limiting on
password reset attempts by tracking the number of attempts per email or IP
address using Redis, and block or delay further attempts when a threshold is
exceeded to prevent abuse.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-31T08:12:34Z
author_association: NONE

PR comments:
user: login: vercel[bot]
created_at: 2025-05-31T08:00:35Z
body: [vc]: #gYX4f0MIUbRZA6feSuyjpJ07/Liwv1jqGLbOGzz2QwE=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJhaXN1bW1hcnlfbW9ubyIsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiJhaXN1bW1hcnltb25vLWdpdC1mZWF0LWZpbmRwYXNzd29yZC1qYW5nanVuaG8ycy1wcm9qZWN0cy52ZXJjZWwuYXBwIn0sImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9qYW5nanVuaG8ycy1wcm9qZWN0cy9haXN1bW1hcnlfbW9uby85SjR3YUU5MTU4aFJkaURrbzNWV3dTRnRHVzdyIiwicHJldmlld1VybCI6ImFpc3VtbWFyeW1vbm8tZ2l0LWZlYXQtZmluZHBhc3N3b3JkLWphbmdqdW5obzJzLXByb2plY3RzLnZlcmNlbC5hcHAiLCJuZXh0Q29tbWl0U3RhdHVzIjoiREVQTE9ZRUQiLCJyb290RGlyZWN0b3J5IjoiZnJvbnRlbmQifV19
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **aisummary_mono** | ✅ Ready ([Inspect](https://vercel.com/jangjunho2s-projects/aisummary_mono/9J4waE9158hRdiDko3VWwSFtGW7r)) | [Visit Preview](https://aisummarymono-git-feat-findpassword-jangjunho2s-projects.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/aisummarymono-git-feat-findpassword-jangjunho2s-projects.vercel.app?via=pr-comment-feedback-link) | May 31, 2025 8:02am |


author_association: NONE
user: login: coderabbitai[bot]
created_at: 2025-05-31T08:00:38Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

## Walkthrough

This update introduces password recovery and reset functionality to the backend system. It adds Redis integration for temporary token storage, updates member and security logic for password reset flows, enhances API documentation with Swagger annotations, and adjusts Docker and application configuration files to support a Redis service.

## Changes

| File(s)                                                                                      | Change Summary                                                                                                       |
|----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| backend/build.gradle, backend/src/main/resources/application.yml, docker-compose.dev.yml      | Added Redis dependency, configuration, and service for Docker Compose.                                              |
| backend/src/main/java/com/ktnu/AiLectureSummary/config/RedisConfig.java                      | Introduced Redis configuration class with beans for `StringRedisTemplate` and `RedisTemplate`.                      |
| backend/src/main/java/com/ktnu/AiLectureSummary/config/SecurityConfig.java                   | Allowed unauthenticated access to password recovery/reset endpoints. Updated comments and imports.                   |
| backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberController.java             | Added endpoints for password recovery and reset with Swagger annotations. Minor comment/documentation updates.       |
| backend/src/main/java/com/ktnu/AiLectureSummary/controller/HealthController.java             | Added JavaDoc comment to health check endpoint.                                                                     |
| backend/src/main/java/com/ktnu/AiLectureSummary/controller/MemberLectureController.java      | Added Swagger `@Parameter` annotations to `lectureId` path variables.                                               |
| backend/src/main/java/com/ktnu/AiLectureSummary/domain/Member.java                           | Made password setter private, added `changePassword` method, and set builder default for `active` field.            |
| backend/src/main/java/com/ktnu/AiLectureSummary/dto/CustomTitleRequest.java                  | Added Swagger `@Schema` annotation to `title` field.                                                                |
| backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberEditRequest.java            | Updated Swagger descriptions to indicate optional fields; removed `@Size` from `password`.                          |
| backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberFindPasswordRequest.java    | Added new DTO for password recovery requests.                                                                       |
| backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberPasswordResetTokenResponse.java | Added new DTO for password reset token responses.                                                               |
| backend/src/main/java/com/ktnu/AiLectureSummary/dto/member/MemberResetPasswordRequest.java   | Added new DTO for password reset requests.                                                                          |
| backend/src/main/java/com/ktnu/AiLectureSummary/dto/memberLecture/MemoRequest.java           | Added Swagger `@Schema` annotation to `memo` field.                                                                 |
| backend/src/main/java/com/ktnu/AiLectureSummary/repository/MemberRepository.java             | Changed query method to require both username and email for member lookup.                                          |
| backend/src/main/java/com/ktnu/AiLectureSummary/security/handler/CustomAuthenicationEntryPoint.java | Updated default error message for unauthenticated access.                                                     |
| backend/src/main/java/com/ktnu/AiLectureSummary/service/LectureApplicationService.java       | Moved class-level annotations; no logic changes.                                                                    |
| backend/src/main/java/com/ktnu/AiLectureSummary/service/MemberService.java                   | Added password recovery/reset methods using Redis; updated profile edit logic.                                      |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant MemberController
    participant MemberService
    participant Redis
    participant MemberRepository

    User->>MemberController: POST /api/members/find-password (username, email)
    MemberController->>MemberService: findPassword(request)
    MemberService->>MemberRepository: findByUsernameAndEmail(username, email)
    MemberRepository-->>MemberService: Member or not found
    alt Member found
        MemberService->>Redis: SET reset:<token> = email (TTL 15min)
        MemberService-->>MemberController: return token
        MemberController-->>User: return token
    else Not found
        MemberService-->>MemberController: error
        MemberController-->>User: error
    end

    User->>MemberController: POST /api/members/reset-password (token, newPassword)
    MemberController->>MemberService: resetPassword(token, request)
    MemberService->>Redis: GET reset:<token>
    alt Token valid
        MemberService->>MemberRepository: findByEmail(email)
        MemberRepository-->>MemberService: Member
        MemberService->>Member: changePassword(encodedPassword)
        MemberService->>Redis: DEL reset:<token>
        MemberService-->>MemberController: success
        MemberController-->>User: success
    else Token invalid
        MemberService-->>MemberController: error
        MemberController-->>User: error
    end
```

## Suggested reviewers

- minwoChoi

## Poem

> A hop, a skip, a password reset,
> Redis now keeps tokens set.
> With Docker's help, a service new,
> Recovery flows for users too.
> Swagger docs now shine so bright,
> Secure and clear—just feels right!
> 🐇✨

<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS4AzEtS6ARPsAAPYAiewBxrkQHwzgBjrIgeB7IQBrxwBJBwFQJyEAdDsBBychAG1rAEDXIAApAF3HAFS7AH3HIQA9xwFzJyAANAEoDADlsZgFKLgBWAE4DAFVEGpRmISFYI31jcCgyenwbHAJiMmUaeiZWdi5efmFRcSkZeSYlKlV1LR1ekyg4VFRMUcJSciophVmMTkgqAHdIRErmNAp5OQVNlTVNbS6MCGPqmAwCNAMADWgwA9AJsPALLQNEQqLQrB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NAzVwDY1VLVqDGqAALAIHwFYCrNtABgFgNqC0A4sAgYBlLVs1xZbNtmzUPZuAZoB6gtQAQPUCBAgghN4aDTVpp01yKawKSWgIRstD6AgAA= -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

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.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=imjjh/AiLectureSummary&utm_content=59):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: NONE