mediawiki-extensions-Echo/tests/phpunit/integration
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
..
Push tests: Namespace the PHP classes 2024-10-03 20:30:06 +00:00
ContainmentSetTest.php Use namespaced classes 2023-12-11 16:39:00 +01:00
EventIntegrationTest.php Disallow anonymous non-IP agents, handle truncated names 2024-11-14 11:44:19 +01:00
ServicesTest.php Don't hold reference to MediaWikiServices instance in tests 2024-06-26 11:27:22 +02:00