Commit graph

643 commits

Author SHA1 Message Date
Translation updater bot 58da740494 Localisation updates from https://translatewiki.net.
Change-Id: If236842d04df119ed8df070c1b56a5bbc1ca4c66
2024-03-18 08:31:18 +01:00
Umherirrender 0cf9669e85 build: Upgrade mediawiki/mediawiki-codesniffer to v43.0.0
Change-Id: Ibad3f653c0b78249eff781596c567182cce281c6
2024-03-11 19:29:34 +01:00
Translation updater bot 7ae7e22e54 Localisation updates from https://translatewiki.net.
Change-Id: I0f0f96ee1ed2d6ce0de49ce5a140d5f0d834057f
2024-03-06 08:19:57 +01:00
Translation updater bot 2c6dbe2d2f Localisation updates from https://translatewiki.net.
Change-Id: I5a6028f73ae4b5b8f11ca399681b0a3a6d7e52b8
2024-03-05 08:27:49 +01:00
Umherirrender 7fdd24ac9b Use LogicException instead of Exception
Change-Id: I7fcf5e33d1db4d137b0275b0a11f4d69db619515
2024-02-21 22:46:45 +01:00
jenkins-bot c54cea398a Merge "build: Updating dependencies" 2024-02-17 22:49:18 +00:00
libraryupgrader b6289eea14 build: Updating dependencies
composer:
* mediawiki/mediawiki-phan-config: 0.12.1 → 0.14.0

npm:
* grunt-banana-checker: 0.11.0 → 0.11.1

Change-Id: I831a3db961171cba3fd62861a5f6f596d7c51a32
2024-02-16 18:34:43 +00:00
Tim Starling fc9a494f29 Use Database::expr()
Bug: T350980
Change-Id: I369778002a880f1547940a097d96e55bcba9a08d
2024-02-16 14:20:53 +11:00
libraryupgrader e845943d60 build: Updating npm dependencies
* eslint-config-wikimedia: 0.25.0 → 0.26.0
* grunt-eslint: 24.0.1 → 24.3.0

Change-Id: I4e85a5f0b473442f479b06dbcdf2d9d893aee13b
2024-02-09 07:03:19 +00:00
libraryupgrader 624c4002b3 build: Updating npm dependencies
* eslint-plugin-compat: 4.0.2 → 4.2.0
  * https://github.com/advisories/GHSA-c2qf-rxjj-qqgw
  * https://github.com/advisories/GHSA-c2qf-rxjj-qqgw
  * https://github.com/advisories/GHSA-c2qf-rxjj-qqgw
* semver: 7.3.5 → 7.5.4
  * https://github.com/advisories/GHSA-c2qf-rxjj-qqgw
  * https://github.com/advisories/GHSA-c2qf-rxjj-qqgw
  * https://github.com/advisories/GHSA-c2qf-rxjj-qqgw
* word-wrap: 1.2.3 → 1.2.5
  * https://github.com/advisories/GHSA-j8xg-fqg3-53r7

Change-Id: I89e57e6bea74bfd3a0875cf927cbfefff3f58929
2024-02-04 03:12:57 +00:00
Reedy d96e30ec80 LoginNotify: Simplify returns in getMinExpiredId()
Follows-Up: Iea716e660353f16c47f873fe42edc2aeec1b4346
Change-Id: Ie351a210eea4eaf4101930fb18e6e149d4294ab4
2024-01-24 22:11:55 +00:00
Umherirrender 7a424d1fdb Stop writing to tablesUsed in tests
Bug: T351733
Change-Id: I6bb37ef79caac7738e70eed54554790deb762149
2024-01-20 12:30:57 +01:00
James D. Forrester 60a0218a1a build: Update MediaWiki requirement to 1.42
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: I57fbf5626575b7f1d7df67f6aecbb99d04504210
2024-01-12 14:12:07 -05:00
Umherirrender 160368a296 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I8943e4e63fb41ca758c9ed25a4abb7664e13bb9f
2024-01-06 17:07:32 +01:00
jenkins-bot 255ab2d74f Merge "tests: Pass HideUserUtils to LocalIdLookup" 2023-12-30 21:32:12 +00:00
Translation updater bot cfe84ef605 Localisation updates from https://translatewiki.net.
Change-Id: Iec1178ea12d43afe8859832eabd55de6edbd6d89
2023-12-22 17:46:18 +01:00
Umherirrender 19c781b681 tests: Pass HideUserUtils to LocalIdLookup
Follow-Up: I408acf7a57b0100fe18c455fc13141277a598925
Change-Id: I4f0190b416873a2aae0c579750b4999ba91baa17
2023-12-15 23:31:12 +01:00
Translation updater bot eba0733bf9 Localisation updates from https://translatewiki.net.
Change-Id: Ica5c7703811a4bdacd44e936cadc23d66bb64aeb
2023-12-01 09:39:58 +01:00
Translation updater bot 22f6c20d61 Localisation updates from https://translatewiki.net.
Change-Id: Ifd607c452cc61c7978c55a0006383dee643b25b3
2023-11-08 13:07:51 +01:00
Translation updater bot 0fac3fc8d0 Localisation updates from https://translatewiki.net.
Change-Id: I8767e07d68b95441c9a3229c18fe6206fa9dba7f
2023-10-27 09:20:37 +02:00
Tim Starling 6f32dafbc1 Use the new DatabaseVirtualDomains feature
Change-Id: I05b6361bd57ba6754bd308e04da1c635f95d042b
2023-10-26 14:50:22 +11:00
Umherirrender 70703bdce3 build: Add @phan-var to handle varying return value of hash_hmac
Since php8.0 hash_hmac throws exception and does not return false
Reported by phan running with php8.1

Change-Id: I2374daf5e0954bef91da65454d973ef3d1eb2183
2023-10-06 19:25:35 +02:00
Translation updater bot 2f4996cf14 Localisation updates from https://translatewiki.net.
Change-Id: Ia5de941b15cc8279af27e79746a423dee466a126
2023-10-02 10:57:39 +02:00
jenkins-bot fac8b00395 Merge "Don't notify of failed logins for system or temporary users" 2023-09-13 09:54:54 +00:00
jenkins-bot 79f766d525 Merge "LoginNotify seen subnets table" 2023-09-13 09:54:52 +00:00
Translation updater bot 923c328594 Localisation updates from https://translatewiki.net.
Change-Id: I0527c9666dabc3c4cfe2db9f8722d3fb62f04d1b
2023-09-06 08:42:32 +02:00
Tim Starling a0a387d195 Don't notify of failed logins for system or temporary users
Bug: T329774
Change-Id: I65fa3da22f45002e013d3bd5c8b0efda5f8b5edb
2023-09-04 17:01:52 +10:00
Tim Starling 534e3ce4b3 LoginNotify seen subnets table
Add a table which stores a summary of each user's IP address subnet in
each time bucket, defaulting to 15 days. On edit (and other changes
causing a recentchanges row) and successful login update the table.

On attempted login, check whether the subnet is in the table in any
time bucket back to the expiry time.

Add a job and a maintenance script for purging expired rows.

Disabled by default for now. The idea is to enable it by default after
we have some experience with using it in WMF production.

If CheckUser integration is disabled (the future intended state), the
cache and LoginNotifyChecks job are suppressed since they are
unnecessary.

Details:

* Rename setCurrentAddressAsKnown() to recordKnownWithCookie() and
  split off recordKnown() which does the same thing except without
  sending the cookie. We use recordKnown() to store the IP address
  without sending the cookie, on non-login changes.
* Reorganise isKnownSystemFast() for clarity, and return emphatic
  USER_NOT_KNOWN if the user is not in the table, cache or cookie
  and CheckUser integration is disabled.
* Replace time() calls with a mockable method.

Bug: T345052
Change-Id: Iea716e660353f16c47f873fe42edc2aeec1b4346
2023-09-04 15:04:36 +10:00
Tim Starling 4c369696cc ServiceWiring, dependency injection
* Make LoginNotify into a service. Use a static getInstance() method
  instead of a services container class, since there is only one
  service.
* Removed references to $wgLoginNotifyEnableForPriv. The feature was
  removed in I888c6009fffad1712.

Change-Id: I9120b470d27a0d09e508bd4e12eb2bde2f38d34d
2023-09-04 15:04:36 +10:00
Tim Starling 8521667df9 Doc review and general cleanup
* Remove notification attributes such as title-message, unused since the
  initial commit since it used the new (2015) formatter system.
* isKnownSystemSlow() is always called with a third parameter, and it
  doesn't seem to be nullable in callers.
* Yes, most of the things make sense.
* Add reason why CheckUser has no cuc_ip_hex index.
* Use foreach
* Too late to truncate the hash now

Change-Id: I310bc53ba881842845b9358309954f89c355f81c
2023-09-04 15:04:36 +10:00
Ammarpad 3cd669d148 Hooks: Do not attempt user creation when there's no username
Bug: T345373
Change-Id: I9b7d8dbb67eb9277e121e52a6140773302d74734
2023-08-31 19:00:04 +01:00
Translation updater bot f81e1a7e9d Localisation updates from https://translatewiki.net.
Change-Id: Ieb92fd4c485446cd8534336939c8ec4e3f877bb0
2023-08-28 09:30:22 +02:00
Tim Starling a47af7c73d Fix deprecations and non-static providers
Change-Id: Ia267a93a13191a2289aff70d47c31b2afcb1647b
2023-08-25 15:10:07 +10:00
Tim Starling 40024f461d Updates for new Echo namespace
Change-Id: I6f83b0353bd33a06b2c9c9506c4114de60b9132f
2023-08-24 10:55:15 +10:00
Tim Starling 3560438921 Add integration tests
Bug: T344785
Change-Id: I6d2d2502599938747aef0f02106afbea33c24e41
2023-08-24 10:38:49 +10:00
Tim Starling a247ba5c79 If the user is known in the slow path, don't forget to notify
If the IP address associated with a failed login is found in CheckUser
for the relevant user, the notification was previously omitted.
Notification of failure with a known IP was only possible when the IP
was in the cache or cookie. So, fix that.

Change-Id: I498e6b71d0fab9dd9af63c9c5f88fbcaf6a53fc3
2023-08-24 10:32:05 +10:00
Tim Starling c524ee65a4 Fix incorrect locator
Bug: T344785
Change-Id: I71f4433896b2758d1a5d8984192bf06fddc89468
2023-08-24 10:28:33 +10:00
jenkins-bot f9a8169b84 Merge "Replace some moved Title class uses, now MediaWiki\Title\Title" 2023-08-19 16:48:24 +00:00
James D. Forrester 7b6daae158 build: Update MediaWiki requirement to 1.41
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: I9941a4f13c1ac7093bc136b611e8a618dbc8920d
2023-08-19 13:29:57 +08:00
gerritbot 9057082c99 Replace some moved Title class uses, now MediaWiki\Title\Title
Bug: T321681
Change-Id: I20b5e7eda88aacee80f0c82e4bd360ca4524ab8c
2023-08-19 04:17:24 +00:00
Umherirrender 4edd893fcc Use HookHandlers for Echo hook
Bug: T344297
Depends-On: Iffa2b409502b4269c9746e0304feb4aaee37a86e
Change-Id: I38fd96f2c4a5913b89d5dd760efb68273cb344a1
2023-08-16 00:59:03 +02:00
Umherirrender f02ff3ab36 Use HookHandlers for core hooks
The use of "HookHandlers" attribute in extension.json makes it possible
to inject services into hook handler classes in a future patch.

Bug: T344297
Change-Id: Icfa49dc56848c9b375f09d67ed839d0e10f57bfb
2023-08-16 00:34:21 +02:00
gerritbot eb79e7b8b8 Migrate ILB::getConnectionRef() calls to ILB::getMaintenanceConnectionRef()
Deprecated since 1.39 (I6e7544763bd)

Remove deprecated ILB::reuseConnection() calls as well

Bug: T343277
Change-Id: I477c216fe75bb393fc892ded13f3d117b6fda4aa
2023-08-03 22:27:44 +00:00
Translation updater bot 02e4e6ac72 Localisation updates from https://translatewiki.net.
Change-Id: I93b1ea338835ecc791ce092336915bf693cf74a3
2023-07-31 08:58:58 +02:00
Translation updater bot 64c57047e6 Localisation updates from https://translatewiki.net.
Change-Id: I81f156f349a5d36872eb8e3388d3fcada0a01c12
2023-07-24 09:38:32 +02:00
Translation updater bot 275d760177 Localisation updates from https://translatewiki.net.
Change-Id: I3ebd783fdb8f311a2bc1f7ff8c8c606f439c623c
2023-06-08 10:39:40 +02:00
Umherirrender 222b7475fb Create HookRunner class
Only core hooks are run, but own HookRunner is recommended

Bug: T263353
Change-Id: I2506f4af21ef955a7feeb145d5173f46ca11b334
2023-06-05 22:47:00 +02:00
libraryupgrader 122d47d87d build: Updating grunt-banana-checker to 0.11.0
Change-Id: I2b9ba2b446f9e5ee51e2430aa303ec64c13b634d
2023-06-01 19:26:20 +00:00
Translation updater bot acfa62bafb Localisation updates from https://translatewiki.net.
Change-Id: I0cecf8fb87c210f9ca9d3732e0d24f305aced219
2023-05-30 08:56:56 +02:00
Translation updater bot 5575acaae5 Localisation updates from https://translatewiki.net.
Change-Id: I7b57d9dda76f82f8dab124dfd6b12525ad091c52
2023-05-22 08:45:47 +02:00