Commit graph

652 commits

Author SHA1 Message Date
libraryupgrader f28fa8915d build: Updating composer dependencies
* mediawiki/minus-x: 1.1.1 → 1.1.3
* php-parallel-lint/php-parallel-lint: 1.3.2 → 1.4.0

Change-Id: Ied0958fb8376a7a18dd8ad4c661f26477d944bd1
2024-05-05 21:59:42 +00:00
Translation updater bot bc05842dea Localisation updates from https://translatewiki.net.
Change-Id: I848dbfaf89c7c73ea42097fb95d9a4f00a188eca
2024-04-26 09:48:33 +02:00
jenkins-bot 9dc76fbf83 Merge "Use loginnotify_seen_net table by default" 2024-04-24 07:16:01 +00:00
Translation updater bot 47118f0ef2 Localisation updates from https://translatewiki.net.
Change-Id: I76509cea34aa430e83acf0925dc6f9393d393ad5
2024-04-22 09:28:45 +02:00
libraryupgrader 2a07d8896d build: Updating eslint-config-wikimedia to 0.27.0
Change-Id: Id21110fd0f3b6fedba623a49740c23703055b9cb
2024-04-19 01:03:01 +00:00
Dreamy Jazz 8afd8f865c Use loginnotify_seen_net table by default
Why:
* Because of schema changes being made in CheckUser, the cu_changes
  table will soon only contain rows for edit-like actions. Log
  events, including successful login attempts, will be stored to
  the cu_log_event and cu_private_event tables.
* As the integration with CheckUser is being removed, it does not
  make sense to add support to read data from these tables.
  Furthermore, the schema changes should not break LoginNotify
  which means that no changes are needed to prevent server errors.
* As such, making wikis use the loginnotify_seen_net table by
  default should mean that only third-party wikis which understand
  the deprecation would still continue to use the CheckUser
  integration.

What:
* Set wgLoginNotifyUseSeenTable as true and
  wgLoginNotifyUseCheckUser as false in extension.json

Bug: T362321
Change-Id: Ic1e81c547b6e7e3d012aa91c6bcd2e4b4d0913b5
2024-04-11 13:02:44 +01:00
Translation updater bot caa84fe162 Localisation updates from https://translatewiki.net.
Change-Id: I49527984d35a7d70dc348a94c14cc9267ab69374
2024-04-09 09:27:05 +02:00
Translation updater bot 57dcb88c04 Localisation updates from https://translatewiki.net.
Change-Id: Ifca17a9b436c3fab67cfe3ffec509ed4f9aff393
2024-04-08 09:26:14 +02:00
Translation updater bot f711c0c05c Localisation updates from https://translatewiki.net.
Change-Id: I2174b268304fcf823587b754b43dec21c75e8efa
2024-03-26 08:20:03 +01:00
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