wiki.techinc.nl/tests/phpunit/includes/auth
Tim Starling 66f85fa125 AuthManager: deny auto-creation for globally blocked users
* In AuthManager::autoCreateUser(), check the permissions of the
  performer instead of relying on the secondary providers. This means
  that auto-creation will be denied when the anonymous user is globally
  IP-blocked.
* Remove create account block check from
  CheckBlocksSecondaryAuthenticationProvider. testUserForCreation() is
  supposed to only do target name checks, but it's not actually
  possible to block a non-existent local name. So we don't need this
  code.
* Add a $performer parameter to autoCreateUser() so that
  Special:CreateLocalAccount can have elevated permissions when it
  creates an account with IP block exemption.
* When a performer is passed, don't use the session as a cache.
* Since we are passing autocreateaccount as the action to
  PermissionManager instead of createaccount, some special cases need to
  be tweaked. Previously AuthManager checked for either
  autocreateaccount or createaccount rights. Now PermissionManager does
  that when the action is autocreateaccount.

By removing redundant checks from testUserForCreation(), the number of
ipblocks queries during a normal Special:CreateAccount post request is
reduced from 8 to 6.

The CentralAuth change I7e7a7fc8bcd86285f857063a38de02b41b5175d0 should
be merged immediately after this one.

Bug: T234371
Bug: T345683
Change-Id: If2937c7d717d2adc249f608d4585122b02a43fff
2023-10-20 10:07:50 +11:00
..
AbstractPasswordPrimaryAuthenticationProviderTest.php Namespace Config-related classes under \MediaWiki\Config 2023-09-21 05:41:58 +00:00
AbstractPreAuthenticationProviderTest.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
AbstractPrimaryAuthenticationProviderTest.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
AuthenticationRequestTest.php Just another 80 or so PHPStorm inspection fixes (#4) 2023-03-25 00:39:06 +00:00
AuthenticationRequestTestCase.php tests: Allow overridable data providers to be static 2023-05-16 16:28:43 +01:00
AuthManagerTest.php AuthManager: deny auto-creation for globally blocked users 2023-10-20 10:07:50 +11:00
ButtonAuthenticationRequestTest.php tests: Allow overridable data providers to be static 2023-05-16 16:28:43 +01:00
CheckBlocksSecondaryAuthenticationProviderTest.php AuthManager: deny auto-creation for globally blocked users 2023-10-20 10:07:50 +11:00
ConfirmLinkAuthenticationRequestTest.php tests: Make some PHPUnit data providers static 2023-05-20 01:05:27 +02:00
ConfirmLinkSecondaryAuthenticationProviderTest.php Namespace Config-related classes under \MediaWiki\Config 2023-09-21 05:41:58 +00:00
CreatedAccountAuthenticationRequestTest.php tests: Allow overridable data providers to be static 2023-05-16 16:28:43 +01:00
CreateFromLoginAuthenticationRequestTest.php tests: Allow overridable data providers to be static 2023-05-16 16:28:43 +01:00
CreationReasonAuthenticationRequestTest.php tests: Allow overridable data providers to be static 2023-05-16 16:28:43 +01:00
EmailNotificationSecondaryAuthenticationProviderTest.php Namespace Config-related classes under \MediaWiki\Config 2023-09-21 05:41:58 +00:00
LocalPasswordPrimaryAuthenticationProviderTest.php Use short callable syntax for build-in functions like "lcfirst" 2023-10-18 10:58:52 +02:00
PasswordAuthenticationRequestTest.php Do not use UTSysop directly in auth tests 2023-08-16 00:34:30 +00:00
PasswordDomainAuthenticationRequestTest.php Do not use UTSysop directly in auth tests 2023-08-16 00:34:30 +00:00
RememberMeAuthenticationRequestTest.php tests: Allow overridable data providers to be static 2023-05-16 16:28:43 +01:00
ResetPasswordSecondaryAuthenticationProviderTest.php Namespace Config-related classes under \MediaWiki\Config 2023-09-21 05:41:58 +00:00
TemporaryPasswordAuthenticationRequestTest.php Do not use UTSysop directly in auth tests 2023-08-16 00:34:30 +00:00
TemporaryPasswordPrimaryAuthenticationProviderTest.php Use short callable syntax for build-in functions like "lcfirst" 2023-10-18 10:58:52 +02:00
ThrottlePreAuthenticationProviderTest.php Make use of assertStatusGood/Error and such in tests 2023-10-04 17:16:00 +00:00
ThrottlerTest.php tests: Make some PHPUnit data providers static 2023-03-24 02:53:57 +00:00
UserDataAuthenticationRequestTest.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
UsernameAuthenticationRequestTest.php tests: Allow overridable data providers to be static 2023-05-16 16:28:43 +01:00