-
Notifications
You must be signed in to change notification settings - Fork 0
Auth > API 필드 유효성 정책 동기화를 위한 정적파일 추가 #446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
- 이메일, 비밀번호, 비밀번호 확인, 사용자명 필드에 대한 유효성 검증 규칙 추가 - 각 필드의 정규표현식, 길이, 메시지 정의
- 유효성 규칙 엔드포인트를 jwt 인가 없이 접근할 수 있도록 규칙 추가 - 엔드포인트를 auth 도메인에 맞추도록, validation-rules 파일 위치 수정
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.
Pull Request Overview
This PR adds static validation rules for Auth API fields to enable synchronization of field validation policies between frontend and backend. The implementation provides a JSON configuration file containing validation rules for email, password, password confirmation, and username fields.
- Added validation-rules.json static file with regex patterns, length constraints, and error messages for auth fields
- Updated JWT filter configuration to allow public access to the validation rules endpoint
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
services/auth/application/src/main/resources/static/auth/validation-rules.json | New static JSON file defining validation rules for email, password, passwordConfirm, and username fields |
monolith/main-runner/src/main/resources/properties/jwt/blolet.jwt.filter.yml | Added public access endpoint for validation-rules.json in JWT filter configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
"type": "string", | ||
"required": true, | ||
"regexp": { | ||
"pattern": "^[A-Za-z\\d!\"#$%&'()*+,\\-./:;<=>?@\\[\\]^_`{|}~]+$", |
Copilot
AI
Sep 23, 2025
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.
The password regex pattern allows all special characters without requiring complexity rules (uppercase, lowercase, digits, special chars). Consider implementing stronger password complexity requirements for better security.
"pattern": "^[A-Za-z\\d!\"#$%&'()*+,\\-./:;<=>?@\\[\\]^_`{|}~]+$", | |
"pattern": "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[!\"#$%&'()*+,\\-./:;<=>?@\\[\\]^_`{|}~])[A-Za-z\\d!\"#$%&'()*+,\\-./:;<=>?@\\[\\]^_`{|}~]+$", |
Copilot uses AI. Check for mistakes.
"messages": { | ||
"required": "닉네임을 입력하십시오.", | ||
"minLength": "닉네임은 최소 2자 이상이어야 합니다.", | ||
"maxLength": "닉네임은 최대 8자까지 입력할 수 있습니다." |
Copilot
AI
Sep 23, 2025
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.
The username field lacks pattern validation, which could allow problematic characters or formatting. Consider adding a regex pattern to restrict allowed characters (e.g., alphanumeric and safe special characters only).
"messages": { | |
"required": "닉네임을 입력하십시오.", | |
"minLength": "닉네임은 최소 2자 이상이어야 합니다.", | |
"maxLength": "닉네임은 최대 8자까지 입력할 수 있습니다." | |
"regexp": { | |
"pattern": "^[a-zA-Z0-9_-]+$", | |
"flags": "u" | |
}, | |
"messages": { | |
"required": "닉네임을 입력하십시오.", | |
"minLength": "닉네임은 최소 2자 이상이어야 합니다.", | |
"maxLength": "닉네임은 최대 8자까지 입력할 수 있습니다.", | |
"regexp": "닉네임은 영문, 숫자, 밑줄(_), 또는 하이픈(-)만 사용할 수 있습니다." |
Copilot uses AI. Check for mistakes.
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.
@wch-os 님, 언제나 리즈너블한 제안과 작업 감사합니다.
이번 리뷰는 논의 후 다시 이어 가겠습니다!
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.
💬 (On Discussion) 정적 파일 위치
어느 모듈에 두는 게 좋을지 논의 중입니다!
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.
다음처럼 결정하였으니, 참고 부탁드립니다!
- Domain 모듈에 두기
단, 커스텀 정적 경로를 만들어 제공 (+ 실행 모듈에 정적배포 설정을 추가하여 제어)
배포 전략의 수정이 도메인 모듈에 영향을 주지 않기 위함.
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.
다음처럼 결정하였으니, 참고 부탁드립니다!
- Domain 모듈에 두기
단, 커스텀 정적 경로를 만들어 제공 (+ 실행 모듈에 정적배포 설정을 추가하여 제어)
배포 전략의 수정이 도메인 모듈에 영향을 주지 않기 위함.
- 유효성 검증 규칙 파일은 도메인에 대한 유효성 정책이므로 domain 모듈 내에 위치하도록 수정 - 유효성 검증 규칙 파일을 배포 과정에서 domain 모듈의 추가 수정 없이 배포 전략을 유연하게 바꿀 수 있도록, /resources/validation 커스텀한 경로에 위치하도록 함
- /validation 으로 시작하는 모든 요청은 정적 파일을 조회하는 요청으로 간주하고, src/main/resources/validation의 커스텀한 경로 안에서 정적 파일을 조회해서 응답하도록 함
- jwt 액세스 토큰 없이 유효성 검증 파일에 접근할 수 있도록 규칙 추가
Issues
Description
Auth API에서 사용되는 필드에 대한 유효성 검증 규칙을 담은 정적 파일 구현
각 필드의 정규표현식, 길이, 메시지 정의
Review Points
How Has This Been Tested?