mediawiki-extensions-Echo/tests/phpunit
Matěj Suchánek 11b9e66f9f Disallow anonymous non-IP agents, handle truncated names
Why:
* Echo stores agents by their user id or by the name if the user
  is not registered. This works for IPs since the "event_agent_ip"
  field has limit of 39 bytes (32× [0-9A-F] + 7× colon for IPv6).
* However, it's possible to hold a user identity that is not
  an IP address, but the user name has not been or cannot be
  registered (e.g., external users). Echo wouldn't validate this
  and would attempt to insert the user name into "event_agent_ip",
  possibly causing silent truncation and data corruption.

What:
* Do not let events with such agents be saved. For now, log an
  error in the production. Wikibase, the only known source of this
  problem, has already been fixed.
* In runtime, replace every possibly corrupted user name with
  a placeholder to avoid unexpected null values and exceptions
  in production.

Bug: T367638
Change-Id: Ic2bd218b10651d13da9e9aea54dd2d668a33d946
Depends-On: I03b4367355dc5a3fc0c14aad5fdf19fbcd0caa3d
Depends-On: I92eb93983e81708b289e9f7d837884d539dade0b
2024-11-14 11:44:19 +01:00
..
Api Use namespaced classes 2024-10-20 00:55:03 +02:00
Cache tests: Namespace the PHP classes 2024-10-03 20:30:06 +00:00
Controller Merge "Avoid event insertion if possible" 2024-10-30 15:06:30 +00:00
Formatters tests: Namespace the PHP classes 2024-10-03 20:30:06 +00:00
integration Disallow anonymous non-IP agents, handle truncated names 2024-11-14 11:44:19 +01:00
maintenance Use explicit nullable type on parameter arguments (for PHP 8.4) 2024-10-26 15:05:13 +02:00
Mapper tests: Namespace the PHP classes 2024-10-03 20:30:06 +00:00
Model tests: Namespace the PHP classes 2024-10-03 20:30:06 +00:00
revision_txt Ping users mentioned in edit summaries 2018-02-22 12:37:35 -08:00
unit tests: Namespace the PHP classes 2024-10-03 20:30:06 +00:00
ContainmentSetTest.php Use namespaced classes 2024-10-20 00:55:03 +02:00
DbFactoryTest.php tests: Namespace the PHP classes 2024-10-03 20:30:06 +00:00
DiscussionParserTest.php tests: Namespace the PHP classes 2024-10-03 20:30:06 +00:00
EchoHooksTest.php tests: Namespace the PHP classes 2024-10-03 20:30:06 +00:00
NotificationsTest.php tests: Namespace the PHP classes 2024-10-03 20:30:06 +00:00
NotificationStructureTest.php tests: Namespace the PHP classes 2024-10-03 20:30:06 +00:00
NotifUserTest.php tests: Namespace the PHP classes 2024-10-03 20:30:06 +00:00
ServiceWiringTest.php Use $this->getServiceContainer() in maintenance and tests 2023-11-09 20:18:48 +00:00
SummaryParserTest.php tests: Namespace the PHP classes 2024-10-03 20:30:06 +00:00
TalkPageFunctionalTest.php Merge "Avoid event insertion if possible" 2024-10-30 15:06:30 +00:00
ThankYouEditTest.php Explicitly call DeferredUpdates::tryOpportunisticExecute() in ThankYouEditTest 2024-11-07 12:16:46 -08:00
UnreadWikisTest.php tests: Namespace the PHP classes 2024-10-03 20:30:06 +00:00
UserLocatorTest.php Use explicit nullable type on parameter arguments (for PHP 8.4) 2024-10-26 15:05:13 +02:00