Commit graph

7108 commits

Author SHA1 Message Date
Dreamy Jazz 8e4a1237f1 Hook on privateEvent and logEvent insert hooks like CuChangesInsert
Hook on to CheckUserInsertPrivateEventRow and CheckUserInsertLogEventRow
to override the IP, XFF and User-Agent string when the user is the
abuse filter user for log events.

These two hooks are being added as log entries are being removed from
cu_changes and added into two new tables. Because the columns and their
names are different for these tables, reusing the same hook won't work
for callers that rely on setting values for a specific column name.

Edits and log entries performed by the abuse filter user need to be
marked as being by the software (and not using the IP, XFF and
User-Agent provided in the main request).

These hooks will not be run until the appropriate config is set to
write to the two new tables. Until that point using the one currently
defined hook will work for all actions.

Bug: T324907
Bug: T44345
Depends-On: I7c7754323ade9a8d96273c1742f30b1b5fbe5828
Follow-Up: Idd77545af94f9f9930d9ff38ab6423a72e680df9
Change-Id: Id78417e9d95220946f110afbe1430df5b3bb4f4f
2023-01-08 13:09:52 +00:00
Dreamy Jazz d3d0910bee Add RecentChange as a optional parameter for CheckUser hook
Add RecentChange as a optional parameter to the code that hooks
on CheckUserInsertChangesRow as this hook will soon provide a
RecentChange object if this row was triggered by a RecentChange.
If this row was not triggered by a RecentChange, then this
parameter will be null. This needs to be added before the parameter
is added to the definition of the hook in the CheckUser extension
as the tests will fail if all usages do not already have the new
parameter.

Bug: T324907
Change-Id: I44e54a3fca5558a1cb8d8f06a3990ded863454bc
2023-01-08 13:09:23 +00:00
jenkins-bot 595b0a9969 Merge "Ensure IP, XFF and UA are valid for abuse filter user actions in CheckUser" 2023-01-06 20:51:17 +00:00
Translation updater bot 2d2a433d71 Localisation updates from https://translatewiki.net.
Change-Id: I78b761b3649f2e57d8af38d914a0858f5f86ff18
2023-01-06 08:52:20 +01:00
jenkins-bot 1ff0e96e38 Merge "Replace VariableHolder::$forFilter" 2023-01-05 21:23:24 +00:00
Translation updater bot ff24a5fbdc Localisation updates from https://translatewiki.net.
Change-Id: I0cfeabd35c9caa82c98d1e7f74e60d255a2b0baa
2023-01-05 09:05:17 +01:00
Translation updater bot ce5f4ab985 Localisation updates from https://translatewiki.net.
Change-Id: I44770a477ac4467408f844dee490195b73c55104
2023-01-04 08:28:22 +01:00
Translation updater bot 9c9a393de8 Localisation updates from https://translatewiki.net.
Change-Id: Icd7394c3dd5f2dd8c9516e37fa33f0f1709f9eb6
2023-01-02 08:41:30 +01:00
Translation updater bot 54281c362d Localisation updates from https://translatewiki.net.
Change-Id: I2cbaff774335d3249c6bb090a3d780b34f9d3a69
2022-12-29 09:59:16 +01:00
Translation updater bot eb1758a8ed Localisation updates from https://translatewiki.net.
Change-Id: I6795325df7f13577679f9aa2d325d0b10f528fb3
2022-12-26 09:08:26 +01:00
Translation updater bot 7a6e06368a Localisation updates from https://translatewiki.net.
Change-Id: I2851b500af8eab014881a29242f73d74eca3009a
2022-12-23 09:04:35 +01:00
jenkins-bot 24d797e6cc Merge "Create real integration test for variables" 2022-12-22 02:07:02 +00:00
Translation updater bot 29dc447a4a Localisation updates from https://translatewiki.net.
Change-Id: Ia4d1a0008e9fd9844d783c8bfed68d4726d66368
2022-12-21 09:12:34 +01:00
Translation updater bot ad7d5b53a3 Localisation updates from https://translatewiki.net.
Change-Id: Ic306eabc24e032539ee0401fda8f6274f6678f51
2022-12-20 09:28:25 +01:00
Translation updater bot f237857b3b Localisation updates from https://translatewiki.net.
Change-Id: Ic325be4f629ebbffc32980d9903acc4364d8a26b
2022-12-19 09:03:02 +01:00
Matěj Suchánek 3e0d1b0d38 Set old_content_model & new_content_model for past changes
We might consider adding an in-process cache because there
will be a duplicate database lookup for content model and
wikitext of the same revision.

Bug: T230295
Change-Id: I9723f21069e03a49fa7131bd8f79c6e7e442104b
2022-12-18 16:01:45 +00:00
Matěj Suchánek 396d892c60 Use ActionSpecifier to load the IP address
To avoid access to the global request context.

Change-Id: I4d97dbe8b693f1fcd5a4e84f2376752d8e954c18
2022-12-17 22:52:24 +01:00
Matěj Suchánek 52dcd4624f Use ActionSpecifier throughout the code
The motivation is to have a single immutable object providing
information about the action. It can represent the current
action being filtered, but also a past action stored in the
abuse log. It will hopefully help us get rid of passing
User(Identity) and Title/LinkTarget objects around together.

Change-Id: I52fa3a7ea14c98d33607d4260acfed3d3ba60f65
2022-12-16 22:52:03 +00:00
Translation updater bot 50b20b8ccd Localisation updates from https://translatewiki.net.
Change-Id: I21ba42200d50f3c95daa660eab5b11e673e42831
2022-12-16 08:45:50 +01:00
Translation updater bot 43fa3f0c94 Localisation updates from https://translatewiki.net.
Change-Id: I903a43b04c58b145228258f1509d5338848c051e
2022-12-15 11:34:40 +01:00
Translation updater bot 9309758ef2 Localisation updates from https://translatewiki.net.
Change-Id: Icff4db34b276ea124ccdc8b88678d2a01b7773b0
2022-12-14 08:14:50 +01:00
Željko Filipin cd876b9892 selenium: Remove webdriverio npm package
The `webdriverio` package does not need to be an explicit dependency.
It is a dependency of `@wdio/cli`.

Bug: T325059
Change-Id: I6064c8a8709b464a0efd3232c17d72d21a92cc7b
2022-12-13 16:48:52 +01:00
Translation updater bot e0b6a4e019 Localisation updates from https://translatewiki.net.
Change-Id: I6609ce3374b34c4f6a02e42b9a0d748d46aa5106
2022-12-13 08:16:22 +01:00
Translation updater bot 9f0b3cb60f Localisation updates from https://translatewiki.net.
Change-Id: I85136334346d7a0bd8348d0d59d80ae23384fd73
2022-12-12 08:21:42 +01:00
Umherirrender 4139e5ef05 pager: Avoid unneeded database connection
Change-Id: Id548d1adab39c4a9b4e7ead4c87510b2fed39ff1
2022-12-11 13:06:08 +01:00
Umherirrender 6d65684a34 Replace deprecated Linker::commentBlock
Bug: T324906
Change-Id: I3b8f9b1295315d3a3cae6bbda2c5553129d2ba13
2022-12-10 22:32:53 +01:00
Translation updater bot aa30892c8c Localisation updates from https://translatewiki.net.
Change-Id: I7783116e09239c9aebf76a0c53f596b7099e0a0e
2022-12-09 08:44:55 +01:00
Translation updater bot 9c54babf3d Localisation updates from https://translatewiki.net.
Change-Id: Ifb6b97fc94b41f6c4338a456553430750d8bed32
2022-12-08 08:27:58 +01:00
Translation updater bot 8700f8e01e Localisation updates from https://translatewiki.net.
Change-Id: Ica79cfc24f14ee0513f32c30d4b02bc171be8008
2022-12-07 08:12:35 +01:00
libraryupgrader 4c2a289f8f build: Updating qs to 6.5.3
* https://github.com/advisories/GHSA-hrpp-h998-j3pp

Change-Id: I95797347e95635aeb204c8b3a3c57a44a05cb26a
2022-12-07 00:29:28 +00:00
Translation updater bot 9202efc328 Localisation updates from https://translatewiki.net.
Change-Id: I27f64840e9730a9c9567035950a0470ed613d3f9
2022-12-06 08:50:25 +01:00
Translation updater bot 263dbb8d69 Localisation updates from https://translatewiki.net.
Change-Id: I5a5b9fbe730346cccb7ef8b96b3b6432d4963bf2
2022-12-05 08:32:36 +01:00
Translation updater bot 43dd2a7b35 Localisation updates from https://translatewiki.net.
Change-Id: If9fe367536dd3a6fede80f840d03e008dfc27c3f
2022-12-02 09:07:06 +01:00
Matěj Suchánek dc59cad0a5 Replace VariableHolder::$forFilter
Each generator knows in which situation it is executed, and it
can pass this information to the computer. VariableHolder should
just hold the variables.

Change-Id: I0fb2e01e3e9457cd63948afe2a20439a1c800790
2022-12-02 08:10:15 +01:00
Translation updater bot 3bc6a4d3cc Localisation updates from https://translatewiki.net.
Change-Id: Ia319fd7fc2b241bec03a97020dbb7acd31e811c3
2022-12-01 08:14:22 +01:00
Translation updater bot 5455f12a36 Localisation updates from https://translatewiki.net.
Change-Id: Ia70de44bab4f3dbeec96356ea17cc3daae4cb430
2022-11-30 08:52:13 +01:00
Translation updater bot b4c18d6ec1 Localisation updates from https://translatewiki.net.
Change-Id: Ie045eb7efcf98208ad850fa4e83b10dc16d746f0
2022-11-29 08:57:55 +01:00
Translation updater bot e37f636ef7 Localisation updates from https://translatewiki.net.
Change-Id: I87cf70e89210fc3a104cc48712b9c73ad9d11cc6
2022-11-28 08:48:45 +01:00
Matěj Suchánek 702d77e3ce Create real integration test for variables
For fixing bugs like T65632, T105325, or T264104, we will need
to update code in more than one place at once. To prevent
regressions, create an integration test which tests the whole
pipeline, from the request submission to variable evaluation.
Edits are simulated using action=edit API call because the hook
AbuseFilter uses is run from EditPage.

To increase confidence in test coverage, remove some annotations
from AbuseFilterConsequencesTest or make them less greedy.
Ideally, it would only test consequences.

This patch includes refactoring of AbuseFilterCreateAccountTestTrait
which now only inserts the user into the database if it really
should be created.
It also restores test coverage of some other classes.

Change-Id: I661f4e0e2bcac4770e499708fca4e4e153f31fed
2022-11-26 18:51:38 +01:00
Translation updater bot e98e48473d Localisation updates from https://translatewiki.net.
Change-Id: Ibb73f3f5b8923f6c923d16c4ad850a133a969ba2
2022-11-25 08:24:47 +01:00
Translation updater bot ef8e67add0 Localisation updates from https://translatewiki.net.
Change-Id: I441d597991cca996c4c192df90fca851ea3d44c9
2022-11-24 08:16:15 +01:00
Translation updater bot afecfc8605 Localisation updates from https://translatewiki.net.
Change-Id: Ifb40e788d6b43035a197f05993a1be4cbd83fef2
2022-11-23 08:31:18 +01:00
Translation updater bot 1bf5fa23a6 Localisation updates from https://translatewiki.net.
Change-Id: I8b222282897c1cdf70959635a3f0218213112c08
2022-11-22 08:32:50 +01:00
Translation updater bot 049ba9101c Localisation updates from https://translatewiki.net.
Change-Id: I6d72f272a5b67a23f5383d0249c1bda3ced20c95
2022-11-21 08:14:53 +01:00
Translation updater bot 5392d4dcdc Localisation updates from https://translatewiki.net.
Change-Id: I67dd7a2140152ac1e4b6dfefb9930d09861771b7
2022-11-18 08:40:25 +00:00
jenkins-bot 6c34801068 Merge "Register AbuseFilter menu as standard tabs" 2022-11-17 17:45:26 +00:00
Jon Robson 62e96a46a8 Register AbuseFilter menu as standard tabs
Core now supports special pages registering sub menus
natively in skins. The menu is rendered when the skin
supports it, so at current time of writing this will
only work in Vector 2022 and MinervaNeue.

The existing menu that appears under the abuse filter
page title is converted into the new format. For other skins
no difference.

Bug: T315553
Change-Id: Ief51a9c60125c11e3b735fabee2a4544b7955f64
2022-11-17 16:35:34 +00:00
Translation updater bot 1781476fbf Localisation updates from https://translatewiki.net.
Change-Id: I21544640c6dcb035aef38e754e922730234e64ce
2022-11-17 08:26:13 +01:00
Reedy 4f4f01f96d EchoNotifierTest: Use namespaced Event class
Re-enables test

Depends-On: Ib57ea2db947285946f31fa9912b37181044df9d3
Change-Id: I082868f4759a5da14235803ebd8a80e794cfe41c
2022-11-12 06:28:33 +00:00
dreamyjazz 627a73ec5e Ensure IP, XFF and UA are valid for abuse filter user actions in CheckUser
Change the IP to 127.0.0.1 (to indicate an internal IP), and blank
the XFF and UA when the performer of an action being logged by
CheckUser is the abuse filter user. Actions performed by the abuse
filter user can only be initated by the software, and as such should
not use the request's IP, XFF and UA. Also test the newly added
code.

Bug: T44345
Depends-On: I28acaaebd2d0067b700da0930e7b7ba924fa5c1c
Change-Id: Idd77545af94f9f9930d9ff38ab6423a72e680df9
2022-11-11 23:19:22 +00:00