Changeset 246140 in webkit


Ignore:
Timestamp:
Jun 5, 2019 8:20:00 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Add support of zxcvbn password strength checker to bugs.webkit.org website.
https://bugs.webkit.org/show_bug.cgi?id=198391
rdar://problem/51278166

Patch by Ling Ho <lingcherd_ho@apple.com> on 2019-06-05
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:
Location:
trunk/Websites/bugs.webkit.org
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Websites/bugs.webkit.org/Bugzilla/Config/Auth.pm

    r214224 r246140  
    108108  },
    109109
     110  # WEBKIT_CHANGES
    110111  {
    111112   name => 'password_complexity',
    112113   type => 's',
    113114   choices => [ 'no_constraints', 'mixed_letters', 'letters_numbers',
    114                 'letters_numbers_specialchars' ],
     115                'letters_numbers_specialchars', 'zxcvbn_password_checker' ],
    115116   default => 'no_constraints',
    116117   checker => \&check_multi
  • trunk/Websites/bugs.webkit.org/Bugzilla/Install/Requirements.pm

    r240167 r246140  
    161161        # 2.0 is the first version that will work with JSON::RPC.
    162162        version => '2.01',
     163    },
     164    # WEBKIT_CHANGES
     165    {
     166        package => 'Data-Password-zxcvbn',
     167        module  => 'Data::Password::zxcvbn',
     168        version => 0
    163169    },
    164170    );
  • trunk/Websites/bugs.webkit.org/Bugzilla/User.pm

    r214224 r246140  
    3131use URI;
    3232use URI::QueryParam;
     33
     34use Data::Password::zxcvbn qw(password_strength); # WEBKIT_CHANGES
    3335
    3436use parent qw(Bugzilla::Object Exporter);
     
    24872489        return 'password_not_complex'
    24882490          if ($password !~ /[[:lower:]]/ || $password !~ /[[:upper:]]/);
     2491    # WEBKIT_CHANGES
     2492    } elsif ($complexity_level eq 'zxcvbn_password_checker') {
     2493        my %opts = (score_for_feedback => 3);
     2494        my $est_strength = password_strength($password, \%opts);
     2495        return 'Password is weak. ' . $est_strength->{feedback}->{warning}
     2496          if ($est_strength->{score} < 4);
    24892497    }
    24902498
  • trunk/Websites/bugs.webkit.org/ChangeLog

    r245261 r246140  
     12019-06-05  Ling Ho  <lingcherd_ho@apple.com>
     2
     3        Add support of zxcvbn password strength checker to bugs.webkit.org website.
     4        https://bugs.webkit.org/show_bug.cgi?id=198391
     5        rdar://problem/51278166
     6
     7        Reviewed by David Kilzer.
     8
     9        * Bugzilla/Config/Auth.pm:
     10        (get_param_list):
     11        * Bugzilla/Install/Requirements.pm:
     12        (REQUIRED_MODULES):
     13        * Bugzilla/User.pm:
     14        (validate_password_check):
     15        * template/en/default/admin/params/auth.html.tmpl:
     16        * template/en/default/global/user-error.html.tmpl:
     17
    1182019-05-13  Jer Noble  <jer.noble@apple.com>
    219
  • trunk/Websites/bugs.webkit.org/template/en/default/admin/params/auth.html.tmpl

    r214224 r246140  
    133133    "lower case letter and a number.</li>" _
    134134    "<li>letters_numbers_specialchars - Passwords must contain at least one " _
    135     "letter, a number and a special character.</li></ul>"
     135    "letter, a number and a special character.</li>" _
     136    "<li>zxcvbn_password_checker - Enable zxcvbn strength estimator for password strength checking.</li></ul>" # WEBKIT_CHANGES
    136137
    137138  password_check_on_login =>
  • trunk/Websites/bugs.webkit.org/template/en/default/global/user-error.html.tmpl

    r214224 r246140  
    14631463    [% END %]
    14641464
     1465  [%# WEBKIT_CHANGES %]
     1466  [% ELSIF error.search("Password is weak") %]
     1467    [% title = "Password Is Weak" %]
     1468    [% error FILTER html %]
     1469    [% IF locked_user %]
     1470      You must <a href="token.cgi?a=reqpw&amp;loginname=[% locked_user.email FILTER uri %]&amp;token=[% issue_hash_token(['reqpw']) FILTER uri %]">
     1471      request a new password</a> in order to log in again.
     1472    [% END %]
     1473
    14651474  [% ELSIF error == "password_not_complex" %]
    14661475    [% title = "Password Fails Requirements" %]
Note: See TracChangeset for help on using the changeset viewer.