Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #60188

…TRONG policy (#60188)

### What problem does this PR solve?

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.

Change the password dictionary file path resolution to use
`Config.security_plugins_dir`
as the base directory prefix. New
`GlobalVariable.validatePasswordDictionaryFile` only
needs to specify the filename, and the full path will be constructed as:
`${security_plugins_dir}/<filename>`
@github-actions github-actions bot requested a review from yiguolei as a code owner January 28, 2026 07:32
@Thearas
Copy link
Contributor

Thearas commented Jan 28, 2026

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Jan 28, 2026
@Thearas
Copy link
Contributor

Thearas commented Jan 28, 2026

run buildall

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 97.96% (48/49) 🎉
Increment coverage report
Complete coverage report

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.

4 participants