-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor : 이메일 인증 및 비밀번호 재설정 링크 구조 개선 및 redirectUrl 적용 #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2c13640
15367e9
953ebc9
f7b4231
7e7aa88
a045faf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,12 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| package org.ezcode.codetest.application.usermanagement.auth.dto.request; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import lombok.AllArgsConstructor; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import lombok.Getter; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @Getter | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @AllArgsConstructor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public class ResetPasswordRequest { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private String email; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private String newPassword; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private String token; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+6
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 필수 입력 검증 및 문서화 추가 필요 비밀번호 재설정 요청에는 보안상 중요한 검증이 필요합니다:
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.Email;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Pattern;
+@Schema(description = "비밀번호 재설정 요청")
@Getter
@AllArgsConstructor
public class ResetPasswordRequest {
+ @Schema(description = "사용자 이메일")
+ @Email(message = "올바른 이메일 형식이 아닙니다")
+ @NotBlank(message = "이메일은 필수입니다")
private String email;
+
+ @Schema(description = "새 비밀번호")
+ @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{8,}$",
+ message = "비밀번호는 8자 이상이며, 대소문자, 숫자, 특수문자를 포함해야 합니다")
+ @NotBlank(message = "새 비밀번호는 필수입니다")
private String newPassword;
+
+ @Schema(description = "인증 토큰")
+ @NotBlank(message = "토큰은 필수입니다")
private String token;
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 웅 나중에 비번 수정 다시 리팩토링할때 반영할게 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @minjee2758 네, 알겠습니다! 나중에 비밀번호 관련 기능을 리팩토링하실 때 함께 적용하시면 되겠네요. 👍 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package org.ezcode.codetest.application.usermanagement.auth.dto.request; | ||
|
|
||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
|
|
||
| @Getter | ||
| @AllArgsConstructor | ||
| @Schema(description = "이메일 전송 요청") | ||
| public class SendEmailRequest { | ||
| @Schema(description = "인증 완료 후 리다이렉트할 URL") | ||
| private String redirectUrl; | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
보안 검증 필요: redirectUrl 필드에 대한 입력 검증 추가
redirectUrl필드는 오픈 리다이렉트 공격에 취약할 수 있습니다. 허용된 도메인 목록이나 URL 패턴 검증을 추가하는 것을 권장합니다.📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오키
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@minjee2758 네, 보안 검증에 대해 이해해 주셔서 감사합니다!
redirectUrl필드에 대한 입력 검증을 추가하시면 오픈 리다이렉트 공격을 방지할 수 있습니다. 구현하시면서 추가적인 도움이 필요하시면 언제든 말씀해 주세요.