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: ensure generated passwords have correct characters when mixed_case & special_characters enabled #2532

Merged

Conversation

tiff-o
Copy link
Contributor

@tiff-o tiff-o commented Aug 11, 2022

Summary

Previously, when mixed_case and special_characters were enabled, the generated password would sometimes exclude the mixed_case characters because they were being overwritten by special characters instead.

This PR ensures that when mixed_case and special_characters are both true (unless the generated password length is not enough to include all), the generated password includes at least:

  • 1 upper case letter
  • 1 lower case letter
  • 1 special character

Should the generated password not allow for this (e.g. generated password length is 1), then ensure that special characters take priority over letters and numbers.

Fixes Issue #2512

Other Information

@tiff-o tiff-o merged commit 5eb00cf into faker-ruby:master Aug 11, 2022
@tiff-o tiff-o force-pushed the fix/password-with-mixed-case-and-special-chars branch from 6a112e4 to 5eb00cf Compare August 11, 2022 11:46
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