Skip to content
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

FIX: Error when length less than 4 in Provider().password() #2176 #2178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DevFoxxx
Copy link

@DevFoxxx DevFoxxx commented Feb 14, 2025

What does this change

Adds a warning message and adjusts the password length when the requested length is less than the number of required character categories (special characters, digits, uppercase, and lowercase).

What was wrong

When the password length was less than 4 (for example, 2), the password() function did not ensure that all required character types would be included, leading to unexpected behavior. This caused an error when the length was smaller than the minimum required for character categories.

How this fixes it

The modification checks if the requested password length is smaller than the number of required character categories. In that case, the function automatically adjusts the password length to the minimum value needed to fulfill the requirements for each character category. Additionally, a warning message is printed to inform the user of this adjustment.

Fixes #2176

Checklist

  • I have read the documentation about CONTRIBUTING
  • I have read the documentation about Coding style
  • I have run make lint

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.

Error when length less than 4 in Provider().password()
1 participant