Repository navigation
Conversation
Rework assert_password_is_secure per review feedback on PR bugzilla#183. The default password_complexity (no_constraints) now applies no checks at all, matching main's current (empty-stub) behavior. The bmo complexity setting rejects passwords shorter than USER_PASSWORD_MIN_LENGTH, then requires 3 of 5 character-class/length features. The password_check hook is now only invoked when the core check has accepted the password, so an extension can add a rejection but can never clear one made by the core check. Update the hook's POD to match: reason is a reference to an undefined scalar, and an extension sets it to reject. Update two qa/ fixture passwords so they pass the bmo complexity check, which the QA test environment enables. Add t/password-policy.t, covering: no_constraints accepting a 1-character password, bmo rejecting short and long-but-simple passwords, bmo accepting a complex password, a hook rejecting an otherwise-accepted password, and a hook being unable to clear a core rejection.
topunix
force-pushed
the
bug-1851434-password
branch
from
November 12, 2026 23:02
9ce14ea to
db243e1
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1851434
Split out of #183 per review, which now carries only the secure_mail guard.
What changed
assert_password_is_secure has been an empty stub since Data::Password::passwdqc was removed in 8edd271, so no password check runs today. This PR follows the agreed direction that password quality should be hookable from core, with stricter policy living in an extension:
Tests
New t/password-policy.t (Bugzilla::Test::MockParams, no database needed; the hook is stubbed with Test2::Tools::Mock):
t/004template.t, t/005whitespace.t and t/012throwables.t also pass.
Upgrade note
Installs with passwdqc_* settings lose them, but those settings have not been enforced since passwdqc was removed. For enforcement, set password_complexity = bmo, or implement the password_check hook in an extension.