mediawiki-extensions-AbuseF.../tests/phpunit/integration
Dreamy Jazz 774f4f02ef Create protected variable access logs POSTSEND
Why:
* The ProtectedVarsAccessLogger::logViewProtectedVariableValue
  method creates a debounced log entry for accessing protected
  variable values.
* This log can be created when a user calls the 'abuselog' query
  API. This API query is made using a GET request.
* Because the ProtectedVarsAccessLogger creates the log
  when it is called, the TransactionProfiler raises a warning
  about writing to the primary DB on a GET request.
* We should address this warning by creating the log entry on
  POSTSEND, in a similar way to how the CheckUser extension
  creates CheckUser log entries.

What:
* Wrap the call to ProtectedVarsAccessLogger::log in
  ::logViewProtectedVariableValue with a DeferredUpdate callback
  that is run POSTSEND.
** As part of this, the expectations that the code only uses the
   replica DBs are silenced inside the DeferredUpdate as the
   PostSend-GET expectations do not usually allow for writes.
   The only other method would to be create the log via a job,
   but we want the log creation to occur quickly and reliably.

Bug: T379083
Change-Id: If14e65b27b0bdd4fd0b99319024ffa281bf44656
2024-11-11 14:33:47 +00:00
..
Api Use explicit nullable type on parameter arguments (for PHP 8.4) 2024-10-26 14:38:46 +02:00
ChangeTags Use StatusValue::getMessages() instead of deprecated methods 2024-05-28 21:04:59 +00:00
Hooks Use namespaced classes 2024-10-19 21:55:40 +02:00
Maintenance Expand SearchFilters.php to search by consequence 2024-08-22 22:07:37 +01:00
Parser Use namespaced classes 2024-10-19 21:55:40 +02:00
Special Disallow protected variable access on AbuseFilterViewTestBatch 2024-07-10 05:31:03 -07:00
Watcher tests: Use IDatabase for mocking instead of DBConnRef 2024-05-02 22:32:05 +02:00
AbuseFilterExtensionJsonTest.php Use namespaced classes 2024-10-19 21:55:40 +02:00
AbuseFilterServicesTest.php Add missing AbuseFilterServices::getHookRunner() 2023-06-14 17:35:43 +02:00
AbuseLoggerTest.php Add integration test to verify logs are saved in CheckUser 2024-03-01 16:11:33 +00:00
ActionVariablesIntegrationTest.php Use explicit nullable type on parameter arguments (for PHP 8.4) 2024-10-26 14:38:46 +02:00
EchoNotifierTest.php Use explicit nullable type on parameter arguments (for PHP 8.4) 2024-10-26 14:38:46 +02:00
FilteredActionsHandlerTest.php Use namespaced classes 2024-10-19 21:55:40 +02:00
FilterRunnerTest.php Use explicit nullable type on parameter arguments (for PHP 8.4) 2024-10-26 14:38:46 +02:00
FilterStoreTest.php Miscellaneous minor fixes 2024-07-03 02:31:38 +02:00
FilterValidatorTest.php Merge "Allow variables to be restricted by user right" 2024-06-04 17:20:17 +00:00
ProtectedVarsAccessLoggerTest.php Create protected variable access logs POSTSEND 2024-11-11 14:33:47 +00:00