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

Support dynamic password lengths for Rails > 5.2 #5166

Open
wants to merge 2 commits into
base: master
from

Conversation

@manojmj92
Copy link

@manojmj92 manojmj92 commented Nov 26, 2019

Hello,

Rails now supports length validator to have dynamic min and max values.

I feel this would be a nice addition to have Devise support this feature. I have made the change such that no current installations of Devise will have trouble with this change. Everything should work as perfectly as before.

This change is useful for instances where applications have the need to support dynamic password lengths, without a system restart. Such applications will just have to override the password_length method in their own classes to support dynamic password lengths.

Real world use case: We have been trying to implement dynamic password length at GitLab. Implementation issue: https://gitlab.com/gitlab-org/gitlab/issues/36776
Right now, we have implemented the same using a monkey patch for the password length validator

@sourcelevel-bot
Copy link

@sourcelevel-bot sourcelevel-bot bot commented Nov 26, 2019

Hello, @manojmj92! This is your first Pull Request that will be reviewed by SourceLevel, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.

lib/devise.rb Outdated Show resolved Hide resolved
@manojmj92 manojmj92 force-pushed the manojmj92:dynamic_password_length branch from 032f163 to ca66541 Nov 26, 2019
@sourcelevel-bot
Copy link

@sourcelevel-bot sourcelevel-bot bot commented Nov 26, 2019

SourceLevel has finished reviewing this Pull Request and has found:

  • 2 possible new issues (including those that may have been commented here).

See more details about this review.

@manojmj92 manojmj92 force-pushed the manojmj92:dynamic_password_length branch 2 times, most recently from dcfc2c3 to 3fd43fc Nov 27, 2019
@manojmj92
Copy link
Author

@manojmj92 manojmj92 commented Dec 2, 2019

Hello @tegon, could you kindly review? 🙂

@manojmj92
Copy link
Author

@manojmj92 manojmj92 commented May 3, 2020

@carlosantoniodasilva could you please review? 🙂

@carlosantoniodasilva
Copy link
Member

@carlosantoniodasilva carlosantoniodasilva commented May 11, 2020

@manojmj92 sorry about the delay here, things have been a bit crazy but this is on my radar to get back to you. Thanks for the work.

@manojmj92 manojmj92 force-pushed the manojmj92:dynamic_password_length branch from 3fd43fc to 188fe6c May 11, 2020
@manojmj92
Copy link
Author

@manojmj92 manojmj92 commented Aug 26, 2020

Hello @carlosantoniodasilva, could you please review? 🙂

@carlosantoniodasilva
Copy link
Member

@carlosantoniodasilva carlosantoniodasilva commented Aug 27, 2020

@manojmj92 yes, my apologies, this one slipped through the cracks, appreciate the ping. I've recently started to catch up on some of the issues/PRs here and this one is high on my radar, I'll get to it soon, just have a few other things to wrap up first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.