Deprecate PasswordPolicyChecks::checkPopularPasswordBlacklist
authorReedy <reedy@wikimedia.org>
Thu, 27 Dec 2018 20:19:35 +0000 (20:19 +0000)
committerReedy <reedy@wikimedia.org>
Thu, 27 Dec 2018 20:45:49 +0000 (20:45 +0000)
Change-Id: I4c90e361b7538efeb0c5efa7ca61aed2e468591c

RELEASE-NOTES-1.33
includes/DefaultSettings.php
includes/password/PasswordPolicyChecks.php
tests/phpunit/includes/password/PasswordPolicyChecksTest.php

index 7566b63..759d912 100644 (file)
@@ -195,6 +195,9 @@ because of Phabricator reports.
   returns the same information in a more useful format.
 * For Linker::generateTOC() and Linker::tocList(), passing strings or booleans
   as the $lang parameter was deprecated. The same applies to DummyLinker.
   returns the same information in a more useful format.
 * For Linker::generateTOC() and Linker::tocList(), passing strings or booleans
   as the $lang parameter was deprecated. The same applies to DummyLinker.
+* The PasswordPolicy 'PasswordCannotBePopular' has been deprecated. To
+  follow best practices, it is reccommended to use 'PasswordNotInLargeBlacklist'
+  instead which blacklists 100,000 commonly used passwords.
 * …
 
 === Other changes in 1.33 ===
 * …
 
 === Other changes in 1.33 ===
index 7f0f59d..f7c3fce 100644 (file)
@@ -4487,6 +4487,7 @@ $wgCentralIdLookupProvider = 'local';
  *             commonly chosen. Set to integer n to ban the top n passwords.
  *             If you want to ban all common passwords on file, use the
  *             PHP_INT_MAX constant.
  *             commonly chosen. Set to integer n to ban the top n passwords.
  *             If you want to ban all common passwords on file, use the
  *             PHP_INT_MAX constant.
+ *             Deprecated since 1.33. Use PasswordNotInLargeBlacklist instead.
  *     - PasswordNotInLargeBlacklist - Password not in best practices list of
  *             100,000 commonly used passwords. Due to the size of the list this
  *      is a probabilistic test.
  *     - PasswordNotInLargeBlacklist - Password not in best practices list of
  *             100,000 commonly used passwords. Due to the size of the list this
  *      is a probabilistic test.
@@ -8777,6 +8778,7 @@ $wgSearchRunSuggestedQuery = true;
  *
  * @see maintenance/createCommonPasswordCdb.php
  * @since 1.27
  *
  * @see maintenance/createCommonPasswordCdb.php
  * @since 1.27
+ * @deprecated since 1.33
  * @var string path to file
  */
 $wgPopularPasswordFile = __DIR__ . '/password/commonpasswords.cdb';
  * @var string path to file
  */
 $wgPopularPasswordFile = __DIR__ . '/password/commonpasswords.cdb';
index 81b8a0d..c3af88f 100644 (file)
@@ -143,6 +143,7 @@ class PasswordPolicyChecks {
         * @param User $user
         * @param string $password
         * @since 1.27
         * @param User $user
         * @param string $password
         * @since 1.27
+        * @deprecated since 1.33
         * @return Status
         * @see $wgPopularPasswordFile
         */
         * @return Status
         * @see $wgPopularPasswordFile
         */
@@ -150,6 +151,8 @@ class PasswordPolicyChecks {
                global $wgPopularPasswordFile, $wgSitename;
                $status = Status::newGood();
                if ( $policyVal > 0 ) {
                global $wgPopularPasswordFile, $wgSitename;
                $status = Status::newGood();
                if ( $policyVal > 0 ) {
+                       wfDeprecated( __METHOD__, '1.33' );
+
                        $langEn = Language::factory( 'en' );
                        $passwordKey = $langEn->lc( trim( $password ) );
 
                        $langEn = Language::factory( 'en' );
                        $passwordKey = $langEn->lc( trim( $password ) );
 
index 215201e..9f9824f 100644 (file)
@@ -148,6 +148,7 @@ class PasswordPolicyChecksTest extends MediaWikiTestCase {
         */
        public function testCheckPopularPasswordBlacklist( $expected, $password ) {
                global $IP;
         */
        public function testCheckPopularPasswordBlacklist( $expected, $password ) {
                global $IP;
+               $this->hideDeprecated( 'PasswordPolicyChecks::checkPopularPasswordBlacklist' );
                $this->setMwGlobals( [
                        'wgSitename' => 'sitename',
                        'wgPopularPasswordFile' => "$IP/includes/password/commonpasswords.cdb"
                $this->setMwGlobals( [
                        'wgSitename' => 'sitename',
                        'wgPopularPasswordFile' => "$IP/includes/password/commonpasswords.cdb"