Commit graph

24 commits

Author SHA1 Message Date
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
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 a47af7c73d Fix deprecations and non-static providers
Change-Id: Ia267a93a13191a2289aff70d47c31b2afcb1647b
2023-08-25 15:10:07 +10: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
gerritbot b20e68feb7 Update moved class RawMessage
See T321882. Moved in I195cf4c67bd514

Bug: T321681
Change-Id: I68df612983a9b3cb49d6be44168a889429d474f9
2023-05-19 14:55:32 +03:00
gerritbot 4974e8c1e9 Update moved class FauxRequest
See T321882. Moved in I832b133aaf61ee

Bug: T321681
Change-Id: I82d99b9826a5790a2f6a04db9298d732edb34293
2023-05-19 10:24:50 +00:00
Umherirrender 3261b8ebd2 Replace deprecated Hooks::run
Bug: T335536
Change-Id: I8d3e2e1da24379c6f963c9f2e01770bf383b32d4
2023-04-27 22:36:41 +02:00
gerritbot 0ecf7ee302 Update moved class WikiMap
See T321882. Moved in I60cf4b9ef02b9d5

Bug: T321681
Change-Id: I1fdefa8f3eee67758a59d36a38209b1e418d9281
2023-04-25 09:54:12 +00:00
Umherirrender f1610a37a1 Avoid use of deprecated User::idFromName
Use the User object directly

Bug: T325687
Change-Id: Id719e33f860204f912429631b50391edce8e56ec
2022-12-21 22:34:26 +01:00
Alexander Vorwerk 591a9b49b4 Replace usages of deprecated wfWikiID()
The global function wfWikiID() is deprecated since 1.35 and it's usages
should be replaced with WikiMap::getCurrentWikiId().

Bug: T298059
Change-Id: I87140148f53266a2bc828a4fae75aa28aa098602
2021-12-21 01:58:01 +00:00
ZabeMath 8d8e0e7da1 Avoid using User::setOption()
User::setOption() is deprecated and should be replaced with UserOptionsManager::setOption()

Bug: T277818
Change-Id: Idd89847f2363645862b1d81488d7eb5727d8baab
2021-04-02 21:06:06 +02:00
Umherirrender 674c24f807 Add missing @var and improve documentation
Change-Id: Iee58d1ac85939290c341568ebb10dc757e664425
2020-12-17 20:55:01 +01:00
Reedy 68b1b460d6 Make use of BatchRowIterator::setCaller
Bug: T261014
Change-Id: I803145598f8690e6f054defdc8361cc07a08d2e8
2020-09-04 18:30:20 +01:00
DannyS712 a5d764e44f Fix PSR12.Properties.ConstantVisibility.NotFound
Bug: T253169
Change-Id: Ie5a9ba0e65eeda936e63ea2345515a9b59a1ff11
2020-05-19 23:23:47 +00:00
Umherirrender 159b6b3b38 Improve param docs
Change-Id: I4b91b39757bb1a2717550f7c771537ee28ce0761
2020-02-29 21:28:35 +01:00
libraryupgrader 3103915e78 build: Updating mediawiki/mediawiki-codesniffer to 29.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingParamName
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch

Additional changes:
* Also sorted "composer fix" command to run phpcbf last.

Change-Id: Ie0f3c44edd654994ca1aa3c55a40cbef22465c0b
2020-01-14 07:37:43 +00:00
Gergő Tisza 24bb65b54a
Add new $extraData parameter from I8aab48177 to auth audit hook call
Update the login emulator test script to match the changed signature
of AuthManagerLoginAuthenticateAudit.

Change-Id: Id482d2e2205960a0facd334e456d3a23bcad0ece
2018-12-13 10:35:28 -08:00
Umherirrender 866f1883b4 Remove unneeded @codingStandardsIgnore
* Break long lines
* Sniff fixed, see T178725

Change-Id: Iaeea06ece1c58f625dfdd3e0e9f6bd53351cc104
2018-03-29 16:09:33 +00:00
Huji Lee edba4520bf Correct the way that loginAttempt.php verifies a user exists
Change-Id: Ib548914ffa36085925fa63d365e30b8d2ffed4f7
2018-03-13 00:01:29 +00:00
Max Semenik c7a27caee9 Update loginAttempt.php for new login handling code
Bug: T187519
Change-Id: I98982c339c1960c755a95829b4e4bd827d6e37ba
2018-02-20 19:15:34 -08:00
Huji Lee dc821dbb1e Use the proper way to override the User-Agent header of a request
This builds on I01221923387a9e94499efdda39b2e40ee207e27c

Bug: T183722
Change-Id: I7676f0882620eb99ac756bc29bd8b3ef2e2a4f7a
2018-02-03 20:15:10 -05:00
Huji Lee 0cd8f9e926 Maintenance script to generate fake login attemps from any IP
Depends on: Ifb28222cf75ad23859bbdceff332cf1e526afe9c

Bug: T183722
Change-Id: I01221923387a9e94499efdda39b2e40ee207e27c
2018-02-01 20:10:48 -05:00
Max Semenik c211fc1875 Use getBatchSize() instead of direct field access
Change-Id: Ie11dd951b8be4ffe8bc982c6ef64482352e3ca38
2017-11-08 06:54:20 +00:00
Max Semenik e13be59e42 Remove support for per-group preference defaults
Not used and introduces serious compexity, likely causing
the bug with users receiving notifications they've opted out of.

Bug: T174220
Change-Id: I888c6009fffad17121765678387022ed7d454cb0
2017-10-13 17:12:20 -07:00