-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Enhancement](auth) Improve password validation to align with MySQL STRONG policy #60188
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: master
Are you sure you want to change the base?
Conversation
…TRONG policy
Enhance the validatePlainPassword function in MysqlPassword.java to fully comply
with MySQL's STRONG password validation policy.
Changes:
1. Require all 4 character types (digit, lowercase, uppercase, special character)
instead of the previous "3 out of 4" requirement.
2. Add dictionary word check to reject passwords containing common weak words.
- Built-in dictionary includes common words like: password, admin, test, root, etc.
- Support loading custom dictionary from external file via the new global variable
`validate_password_dictionary_file`.
3. Implement lazy loading for external dictionary file:
- Dictionary is loaded on first password validation call.
- Automatically reloads when the file path is changed.
- Falls back to built-in dictionary if file loading fails.
4. Improve error messages to clearly indicate which requirements are missing.
5. Add comprehensive unit tests for all validation scenarios.
New global variable:
- `validate_password_dictionary_file`: Path to custom dictionary file (one word per line).
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-H: Total hot run time: 31426 ms |
TPC-DS: Total hot run time: 172454 ms |
ClickBench: Total hot run time: 26.77 s |
FE UT Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
|
run buildall |
TPC-H: Total hot run time: 31278 ms |
TPC-DS: Total hot run time: 172511 ms |
ClickBench: Total hot run time: 26.76 s |
FE UT Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
What problem does this PR solve?
Enhance the validatePlainPassword function in MysqlPassword.java to fully comply with MySQL's STRONG password validation policy.
Changes:
Require all 4 character types (digit, lowercase, uppercase, special character) instead of the previous "3 out of 4" requirement.
Add dictionary word check to reject passwords containing common weak words.
validate_password_dictionary_file.Implement lazy loading for external dictionary file:
Improve error messages to clearly indicate which requirements are missing.
Add comprehensive unit tests for all validation scenarios.
New global variable:
validate_password_dictionary_file: Path to custom dictionary file (one word per line).Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)