mediawiki-extensions-AbuseF.../includes/Hooks
Dreamy Jazz a5b68cf46d Don't attempt to steal or create the FilterUser in CheckUserHandler
Why:
* When CheckUser asks the AbuseFilter extension for modifications
  to rows inserted into the CheckUser tables, the AbuseFilter
  extension attempts to get the Filter user via User::newSystemUser
* User::newSystemUser can deadlock if multiple requests to create
  the system user are being made at once.
* The CheckUserHander does not need to create the abuse filter system
  and instead only needs to know if a given $user is the equal to
  the FilterUser.
* As such the FilterUser service needs to provide a way to check if
  a given $user is equal without creating the FilterUser.

What:
* Add FilterUser::isUserSameAs which returns a boolean value
  indicating whether the Abuse Filter system user is the equal
  to a given UserIdentity in the same way that UserIdentity::equals
  is implemented.
* Refactor ::getUser to get the username for the filter user in
  a separate method, so that the ::isUserSameAs method can also
  use this method. Name this new method ::getFilterUserName.
* Add a test for the FilterUser service to ensure consistent test
  coverage
* Convert the @covers and @coversDefaultClass annotations to be
  a @covers for the class. This is because PHPUnit recommends this in
  https://docs.phpunit.de/en/9.6/annotations.html#appendixes-annotations-covers-tables-annotations

Bug: T356275
Bug: T346967
Change-Id: I8a101781bb47612deabb0f2a06a398ac13e860e6
2024-01-31 19:32:52 +00:00
..
Handlers Don't attempt to steal or create the FilterUser in CheckUserHandler 2024-01-31 19:32:52 +00:00
AbuseFilterAlterVariablesHook.php Use namespaced classes 2023-12-10 23:03:12 +01:00
AbuseFilterBuilderHook.php Move documentation from hooks.txt to hook interfaces 2021-03-31 21:50:30 +02:00
AbuseFilterComputeVariableHook.php Fix various typos and documentation issues 2023-09-04 12:55:17 +02:00
AbuseFilterContentToStringHook.php Move documentation from hooks.txt to hook interfaces 2021-03-31 21:50:30 +02:00
AbuseFilterCustomActionsHook.php Create a dedicated namespace for all consequences-related classes 2020-12-18 19:27:33 +00:00
AbuseFilterDeprecatedVariablesHook.php Fix method names of hook interfaces 2021-03-09 17:03:14 +00:00
AbuseFilterFilterActionHook.php Use namespaced Title 2023-08-19 19:49:36 +02:00
AbuseFilterGenerateGenericVarsHook.php Clean up line indent with mixed tabs and whitespaces 2022-07-31 16:34:07 +02:00
AbuseFilterGenerateTitleVarsHook.php Use namespaced Title 2023-08-19 19:49:36 +02:00
AbuseFilterGenerateUserVarsHook.php Use namespaced classes 2023-12-10 23:03:12 +01:00
AbuseFilterGenerateVarsForRecentChangeHook.php Use namespaced classes 2023-12-10 23:03:12 +01:00
AbuseFilterGetDangerousActionsHook.php build: Updating dependencies 2021-07-21 18:51:18 +00:00
AbuseFilterHookRunner.php Use namespaced classes 2023-12-10 23:03:12 +01:00
AbuseFilterInterceptVariableHook.php Fix method names of hook interfaces 2021-03-09 17:03:14 +00:00
AbuseFilterShouldFilterActionHook.php Use namespaced classes 2023-12-10 23:03:12 +01:00