WebKit Bugzilla
Attachment 370994 Details for
Bug 198391
: Add support of zxcvbn password strength checker to bugs.webkit.org website.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198391-20190530163852.patch (text/plain), 4.78 KB, created by
lingho@apple.com
on 2019-05-30 16:38:53 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
lingho@apple.com
Created:
2019-05-30 16:38:53 PDT
Size:
4.78 KB
patch
obsolete
>Subversion Revision: 245906 >diff --git a/Websites/bugs.webkit.org/ChangeLog b/Websites/bugs.webkit.org/ChangeLog >index 77d4fe6fa58c44d35f2fc9abbebc74803303c13e..c1d9010ba783fb9348d8959ea22bd0f030e41d33 100644 >--- a/Websites/bugs.webkit.org/ChangeLog >+++ b/Websites/bugs.webkit.org/ChangeLog >@@ -1,3 +1,18 @@ >+2019-05-30 Ling Ho <lingcherd_ho@apple.com> >+ >+ Add support of zxcvbn password strength checker to bugs.webkit.org website. >+ https://bugs.webkit.org/show_bug.cgi?id=198391 >+ rdar://problem/51278166 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Bugzilla/Config/Auth.pm: >+ (get_param_list): >+ * Bugzilla/User.pm: >+ (validate_password_check): >+ * template/en/default/admin/params/auth.html.tmpl: >+ * template/en/default/global/user-error.html.tmpl: >+ > 2019-05-13 Jer Noble <jer.noble@apple.com> > > Bugzilla should convert "r12345" to a trac.webkit.org link >diff --git a/Websites/bugs.webkit.org/Bugzilla/Config/Auth.pm b/Websites/bugs.webkit.org/Bugzilla/Config/Auth.pm >index 78d719b15d35bc7cfafe4ae876bae4f6d22311df..81c24e54ad59bd0b77d7e590958617b5e3ff886b 100644 >--- a/Websites/bugs.webkit.org/Bugzilla/Config/Auth.pm >+++ b/Websites/bugs.webkit.org/Bugzilla/Config/Auth.pm >@@ -107,11 +107,12 @@ sub get_param_list { > checker => \&check_regexp > }, > >+ # WEBKIT_CHANGES > { > name => 'password_complexity', > type => 's', > choices => [ 'no_constraints', 'mixed_letters', 'letters_numbers', >- 'letters_numbers_specialchars' ], >+ 'letters_numbers_specialchars', 'zxcvbn' ], > default => 'no_constraints', > checker => \&check_multi > }, >diff --git a/Websites/bugs.webkit.org/Bugzilla/User.pm b/Websites/bugs.webkit.org/Bugzilla/User.pm >index 077f11d1685bde5fb95ab81ed99aed403a75b26c..c81ee521e21c2650575596aa40e08b29257afd85 100644 >--- a/Websites/bugs.webkit.org/Bugzilla/User.pm >+++ b/Websites/bugs.webkit.org/Bugzilla/User.pm >@@ -31,6 +31,8 @@ use Storable qw(dclone); > use URI; > use URI::QueryParam; > >+use Data::Password::zxcvbn 'password_strength'; # WEBKIT_CHANGES >+ > use parent qw(Bugzilla::Object Exporter); > @Bugzilla::User::EXPORT = qw(is_available_username > login_to_id validate_password validate_password_check >@@ -2486,6 +2488,12 @@ sub validate_password_check { > } elsif ($complexity_level eq 'mixed_letters') { > return 'password_not_complex' > if ($password !~ /[[:lower:]]/ || $password !~ /[[:upper:]]/); >+ # WEBKIT_CHANGES >+ } elsif ($complexity_level eq 'zxcvbn') { >+ my %opts = (score_for_feedback => 3); >+ my $est_strength = password_strength($password, \%opts); >+ return 'Password is weak. ' . $est_strength->{feedback}->{warning} . '. ' >+ if ($est_strength->{score} < 4); > } > > # Having done these checks makes us consider the password untainted. >diff --git a/Websites/bugs.webkit.org/template/en/default/admin/params/auth.html.tmpl b/Websites/bugs.webkit.org/template/en/default/admin/params/auth.html.tmpl >index 902d2fc826bf33ff8bda10515f6891abfefe8245..aa65cf0dfe75ba242d5ce4f9f23b4be121544d38 100644 >--- a/Websites/bugs.webkit.org/template/en/default/admin/params/auth.html.tmpl >+++ b/Websites/bugs.webkit.org/template/en/default/admin/params/auth.html.tmpl >@@ -132,7 +132,8 @@ > "<li>letters_numbers - Passwords must contain at least one UPPER and one " _ > "lower case letter and a number.</li>" _ > "<li>letters_numbers_specialchars - Passwords must contain at least one " _ >- "letter, a number and a special character.</li></ul>" >+ "letter, a number and a special character.</li>" _ >+ "<li>zxcvbn - Enable zxcvbn strength estimator for password strength checking.</li></ul>" # WEBKIT_CHANGES > > password_check_on_login => > "If set, $terms.Bugzilla will check that the password meets the current " _ >diff --git a/Websites/bugs.webkit.org/template/en/default/global/user-error.html.tmpl b/Websites/bugs.webkit.org/template/en/default/global/user-error.html.tmpl >index 7421a1525010851006aa3bf9a38c4b0235cf58af..1c141d60e244e6efba4a5b3acec19895b2a315ae 100644 >--- a/Websites/bugs.webkit.org/template/en/default/global/user-error.html.tmpl >+++ b/Websites/bugs.webkit.org/template/en/default/global/user-error.html.tmpl >@@ -1462,6 +1462,15 @@ > request a new password</a> in order to log in again. > [% END %] > >+ [%# WEBKIT_CHANGES %] >+ [% ELSIF error.search("Password is weak") %] >+ [% title = "Password Is Weak" %] >+ [% error %] >+ [% IF locked_user %] >+ You must <a href="token.cgi?a=reqpw&loginname=[% locked_user.email FILTER uri %]&token=[% issue_hash_token(['reqpw']) FILTER uri %]"> >+ request a new password</a> in order to log in again. >+ [% END %] >+ > [% ELSIF error == "password_not_complex" %] > [% title = "Password Fails Requirements" %] > [% passregex = Param('password_complexity') %]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198391
:
370985
|
370994
|
371428
|
371435
|
371436