Diff
Modified: trunk/Websites/bugs.webkit.org/Bugzilla/Config/Auth.pm (246139 => 246140)
--- trunk/Websites/bugs.webkit.org/Bugzilla/Config/Auth.pm 2019-06-06 03:14:47 UTC (rev 246139)
+++ trunk/Websites/bugs.webkit.org/Bugzilla/Config/Auth.pm 2019-06-06 03:20:00 UTC (rev 246140)
@@ -107,11 +107,12 @@
checker => \&check_regexp
},
+ # WEBKIT_CHANGES
{
name => 'password_complexity',
type => 's',
choices => [ 'no_constraints', 'mixed_letters', 'letters_numbers',
- 'letters_numbers_specialchars' ],
+ 'letters_numbers_specialchars', 'zxcvbn_password_checker' ],
default => 'no_constraints',
checker => \&check_multi
},
Modified: trunk/Websites/bugs.webkit.org/Bugzilla/Install/Requirements.pm (246139 => 246140)
--- trunk/Websites/bugs.webkit.org/Bugzilla/Install/Requirements.pm 2019-06-06 03:14:47 UTC (rev 246139)
+++ trunk/Websites/bugs.webkit.org/Bugzilla/Install/Requirements.pm 2019-06-06 03:20:00 UTC (rev 246140)
@@ -161,6 +161,12 @@
# 2.0 is the first version that will work with JSON::RPC.
version => '2.01',
},
+ # WEBKIT_CHANGES
+ {
+ package => 'Data-Password-zxcvbn',
+ module => 'Data::Password::zxcvbn',
+ version => 0
+ },
);
if (ON_WINDOWS) {
Modified: trunk/Websites/bugs.webkit.org/Bugzilla/User.pm (246139 => 246140)
--- trunk/Websites/bugs.webkit.org/Bugzilla/User.pm 2019-06-06 03:14:47 UTC (rev 246139)
+++ trunk/Websites/bugs.webkit.org/Bugzilla/User.pm 2019-06-06 03:20:00 UTC (rev 246140)
@@ -31,6 +31,8 @@
use URI;
use URI::QueryParam;
+use Data::Password::zxcvbn qw(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 @@
} elsif ($complexity_level eq 'mixed_letters') {
return 'password_not_complex'
if ($password !~ /[[:lower:]]/ || $password !~ /[[:upper:]]/);
+ # WEBKIT_CHANGES
+ } elsif ($complexity_level eq 'zxcvbn_password_checker') {
+ 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.
Modified: trunk/Websites/bugs.webkit.org/ChangeLog (246139 => 246140)
--- trunk/Websites/bugs.webkit.org/ChangeLog 2019-06-06 03:14:47 UTC (rev 246139)
+++ trunk/Websites/bugs.webkit.org/ChangeLog 2019-06-06 03:20:00 UTC (rev 246140)
@@ -1,3 +1,20 @@
+2019-06-05 Ling Ho <[email protected]>
+
+ 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 David Kilzer.
+
+ * Bugzilla/Config/Auth.pm:
+ (get_param_list):
+ * Bugzilla/Install/Requirements.pm:
+ (REQUIRED_MODULES):
+ * 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 <[email protected]>
Bugzilla should convert "r12345" to a trac.webkit.org link
Modified: trunk/Websites/bugs.webkit.org/template/en/default/admin/params/auth.html.tmpl (246139 => 246140)
--- trunk/Websites/bugs.webkit.org/template/en/default/admin/params/auth.html.tmpl 2019-06-06 03:14:47 UTC (rev 246139)
+++ trunk/Websites/bugs.webkit.org/template/en/default/admin/params/auth.html.tmpl 2019-06-06 03:20:00 UTC (rev 246140)
@@ -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_password_checker - 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 " _
Modified: trunk/Websites/bugs.webkit.org/template/en/default/global/user-error.html.tmpl (246139 => 246140)
--- trunk/Websites/bugs.webkit.org/template/en/default/global/user-error.html.tmpl 2019-06-06 03:14:47 UTC (rev 246139)
+++ trunk/Websites/bugs.webkit.org/template/en/default/global/user-error.html.tmpl 2019-06-06 03:20:00 UTC (rev 246140)
@@ -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 FILTER html %]
+ [% IF locked_user %]
+ You must <a href="" 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') %]