Skip to content

Comments

[fix] 비밀번호 특수문자 정규식 통일#82

Merged
k3vin7 merged 1 commit intomainfrom
feat/auth
Feb 17, 2026
Merged

[fix] 비밀번호 특수문자 정규식 통일#82
k3vin7 merged 1 commit intomainfrom
feat/auth

Conversation

@k3vin7
Copy link
Contributor

@k3vin7 k3vin7 commented Feb 17, 2026

Summary

  • PasswordRequestDto(auth, user)의 비밀번호 정규식을 SignupRequestDto와 동일하게 통일
  • 기존: [!@#$%^&*()] (9개 특수문자만 허용) → 변경: [^a-zA-Z0-9] (모든 특수문자 허용)
  • ~ 등 특수문자가 비밀번호 재설정/변경 시 거부되던 문제 해결

Test plan

  • 전체 테스트 통과 확인
  • ~ 포함 비밀번호로 재설정/변경 정상 동작 확인

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link

Summary of Changes

Hello @k3vin7, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 비밀번호 유효성 검사 로직의 일관성을 확보하고 사용자 경험을 개선하기 위해 PasswordRequestDto에 사용되는 비밀번호 정규식을 업데이트합니다. 기존에는 특정 특수문자만 허용하여 일부 문자가 포함된 비밀번호가 거부되는 문제가 있었으나, 이번 변경으로 모든 특수문자를 허용하도록 정규식을 확장하여 비밀번호 재설정 및 변경 시 발생하던 오류를 해결했습니다.

Highlights

  • 비밀번호 정규식 통일: PasswordRequestDto(인증 및 사용자 모듈)의 비밀번호 정규식을 SignupRequestDto와 동일하게 변경하여 일관성을 확보했습니다.
  • 특수문자 허용 범위 확장: 기존에 9개의 특정 특수문자만 허용하던 정규식을 모든 특수문자를 허용하도록 [!@#$%^&*()]에서 [^a-zA-Z0-9]로 업데이트했습니다.
  • 비밀번호 재설정/변경 오류 해결: ~와 같은 특정 특수문자가 포함된 비밀번호가 재설정 또는 변경 시 거부되던 문제를 해결했습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/main/java/com/daramg/server/auth/dto/PasswordRequestDto.kt
    • 비밀번호 유효성 검사 정규식을 업데이트하여 모든 특수문자를 허용하도록 변경했습니다.
  • src/main/java/com/daramg/server/user/dto/PasswordRequestDto.kt
    • 비밀번호 유효성 검사 정규식을 업데이트하여 모든 특수문자를 허용하도록 변경했습니다.
Activity
  • 이 PR에 대한 특정 활동(댓글, 검토 등)은 제공되지 않았습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

비밀번호 특수문자 정규식을 통일하여 일관성을 높이는 좋은 변경입니다. 다만, 여러 DTO에서 동일한 비밀번호 정규식과 오류 메시지가 중복으로 사용되고 있습니다. 이를 별도의 상수 파일로 추출하여 관리하면 향후 유지보수성을 크게 향상시킬 수 있습니다. 관련하여 각 파일에 구체적인 개선 의견을 남겼습니다.

Comment on lines 11 to 14
@get:Pattern(
regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%^&*()]).{10,}\$",
regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^a-zA-Z0-9]).{10,}\$",
message = "비밀번호는 영어 대문자와 소문자, 숫자, 특수문자를 모두 포함하여 10자 이상이어야 합니다"
)

Choose a reason for hiding this comment

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

medium

비밀번호 유효성 검사 정규식과 메시지가 여러 DTO에 중복으로 정의되어 있습니다. 이는 향후 비밀번호 정책 변경 시 여러 파일을 수정해야 하는 번거로움과 실수를 유발할 수 있습니다.

공통 상수로 분리하여 재사용성을 높이고 유지보수를 용이하게 하는 것을 권장합니다. 예를 들어, common 패키지 하위에 ValidationConstants와 같은 객체를 만들어 관리할 수 있습니다.

// common/validation/ValidationConstants.kt
object ValidationConstants {
    const val PASSWORD_REGEX = "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^a-zA-Z0-9]).{10,}\$"
    const val PASSWORD_MESSAGE = "비밀번호는 영어 대문자와 소문자, 숫자, 특수문자를 모두 포함하여 10자 이상이어야 합니다"
}

이렇게 하면 DTO에서는 다음과 같이 간결하게 사용할 수 있습니다.

@get:Pattern(
    regexp = ValidationConstants.PASSWORD_REGEX,
    message = ValidationConstants.PASSWORD_MESSAGE
)

Comment on lines 6 to 9
@get:Pattern(
regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%^&*()]).{10,}\$",
regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^a-zA-Z0-9]).{10,}\$",
message = "비밀번호는 영어 대문자와 소문자, 숫자, 특수문자를 모두 포함하여 10자 이상이어야 합니다"
)

Choose a reason for hiding this comment

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

medium

이 DTO에서도 비밀번호 유효성 검사 로직이 중복으로 정의되어 있습니다.

auth 패키지의 PasswordRequestDto에 제안한 것과 같이, 공통 상수를 만들어 중복을 제거하고 유지보수성을 향상시키는 것을 고려해 보세요.

@k3vin7 k3vin7 merged commit bd8b51d into main Feb 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant