Commit graph

45 commits

Author SHA1 Message Date
Gergő Tisza 2b7633219b
Declare grant risk levels
createaccount is a core grant which by default isn't really
sensitive, but TitleBlacklist adds tboverride-account which
can be used for social engineering.

Using MediaWikiServices to change configuration is not great,
but it's the least bad option available today - other hooks run
too late, and the extension registry doesn't support extensions
overriding core values.

Bug: T290790
Depends-On: Ib7a195c167f82e686c4ede45388957f9988bf75d
Change-Id: I2d20190266e4094449b5857b88f962a444c2f9b5
2024-01-18 22:29:07 -08:00
James D. Forrester 84bd6740cc build: Update MediaWiki requirement to 1.42
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: I5c65444e6b5dc5344cfca2adf9b05396283bc5dd
2024-01-12 18:34:10 -05:00
James D. Forrester 623124a6ae extension.json: Drop RL targets definitions, no longer honoured
Bug: T328497
Change-Id: I6669f3db58a20a1828130379da174a0399b02c77
2024-01-12 08:53:55 -05:00
James D. Forrester ab2933a71e build: Update MediaWiki requirement to 1.41
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: I80f74331ef63c0577604d232e3700b125b33fb0a
2023-08-19 14:11:30 +08:00
Umherirrender 319b33cb46 Use HookHandlers for Scribunto hook
Bug: T271033
Change-Id: I486bf703a73d6196c7bb840ac37b290615c548e7
2023-08-15 15:29:02 +02:00
Umherirrender ffc9986a95 api: Rename php class behind action=titleblacklist
titleblacklist is not part of action=query (since a2f5ccd2 back in 2011)
and should not follow that naming schema.

No class alias as nobody needs to call the class directly

Change-Id: If57e5bd9291a894edf42835fed07d37cd8e8abed
2023-07-04 22:42:50 +02:00
Umherirrender 7ece0eddd0 tests: Use static provider in TitleBlacklistAuthenticationRequestTest
Shows up a deprecation message

Follow-Up: I5ff35ad0e894f0a27beae00257dc1fc599ad518d
Change-Id: I159d727d92ed1d5ca5721d9a290bff89c5922c8d
2023-05-19 22:27:21 +02:00
gerritbot 5109fe66b9 Update moved class EditPage
See T321882. Moved in Ibefc44eb64aed

Bug: T321681
Change-Id: I46fc958aa4b9b8406866e16f5f39624d62744465
2023-05-06 21:20:41 +00:00
Reedy f95b5ce792 Drop class aliases
Change-Id: I9698f39ec3e301266390032a53cb9249372f216a
2022-10-31 23:02:13 +00:00
Taavi Väänänen 8cb2f2f252
Add a class_alias for TitleBlacklistEntry too
TitleBlacklist compares cache version in app code, meaning that entries
with old versions will still be deserialized.

Bug: T307513
Change-Id: Icea6022fcf5530b2429ce660e2589dd5954577a7
2022-05-04 11:30:27 +03:00
Alexander Vorwerk a1c08ed427 Add class alias for TitleBlacklist and bump cache version
Bug: T307513
Change-Id: Ibcbec44fe0f1168594036cbc2e0b5199f9b88bff
2022-05-03 23:40:35 +02:00
Reedy 3113e6bf5f Namespace extension
Change-Id: I7917483168a3534d74b62dd2077026c0baa4cbe0
2022-04-08 14:24:11 +01:00
vladshapik 3025d83afc Replace uses of the deprecated setters of AbstractAuthenticationProvider
Since AbstractAuthenticationProvider ::setLogger, ::setManager,
::setConfig, ::setHookContainer methods had been soft deprecated,
so its usages were removed. AuthenticationProviderTestTrait
::initProvider was used in order to initialize
TitleBlacklistPreAuthenticationProvider in the test.
* Also bump required MW version to 1.37.0

Bug: T281994
Change-Id: I15b811a8596addad7a50b13d978851ebd86da9a5
2021-05-25 16:25:07 +00:00
Umherirrender fedb84b9c5 Use HookHandlers for core hooks
Bug: T271033
Change-Id: I42f323261b9acb24b0cf8cb9202ef5c804cc1a6d
2021-04-15 19:30:17 +00:00
DannyS712 e5a7ed6997 Update hooks to use PageSaveComplete
Extension requires MW 1.35+, always available

Bug: T250566
Change-Id: I35a288d38e944df4498d63f1d686ee7904909c74
2020-06-23 19:26:40 +00:00
Reedy 2bc7fd869e Convert to manifest_version 2
Bug: T252470
Change-Id: I7e0b6220367a02ff27f40c569d66c41fb186472d
2020-05-12 01:38:19 +00:00
Umherirrender 1243bed54d Use MediaWikiServices::getAuthManager
This required MediaWiki 1.35

Change-Id: I40b1cfd33427cb0c0cc3b484525997f1d2263562
2020-04-12 00:00:28 +00:00
JJMC89 d9e7e13f9e extension.json: Add tboverride and tboverride-account to grants
* tboverride to editprotected
* tboverride-account to createaccount

Bug: T241114
Change-Id: Iacde8059779b985c33ee31538663b8e55833adf9
2020-03-21 20:01:12 +00:00
James D. Forrester 762ef4c02b Drop use of wgParser, replaced in 1.32 and to be removed in 1.35
Bug: T160811
Change-Id: Iefb5557f6dd1c300515dc532485e906d57e2d37f
2019-10-28 20:03:37 +00:00
Bartosz Dziewoński cba4d461b9 VE: Update for errorformat=html
Update matchFunction() to match the new format of responses.

Remove custom error message from process(), it's worse than the default.

Bug: T229532
Depends-On: I3b9c4fefc0869ef7999c21cef754434febd852ec
Change-Id: Ibeae79c95557a7af699716c9d921f34c310bee6d
2019-08-22 00:38:02 +00:00
Derick Alangi 088bfe3028 TitleBlacklistHooks: Fix TitleBlacklist hooks to conform with MW
Also, cleanup various legacy behavior of hooks: as they return true. In
addition, objects are passed by reference by default.

I see more room for improvements, but will keep doing them in later change
sets.

Change-Id: I1ff3ec493a1d161cfbcfacf49b1af486a93b1052
2019-06-05 18:21:55 +00:00
Reedy 52358f2362 Update MediaWiki namespaced AtEase global functions
Change-Id: I90fbb959b5011a4fa06a766b2dbe91554bcf3c71
2019-02-13 02:31:11 +00:00
Bartosz Dziewoński 3c8be5e7c6 Add mobile target to VE plugin modules
Bug: T213774
Change-Id: I6441fb2278c76e66c68badb937c339f012fe7f5a
2019-01-15 01:06:00 +01:00
Ed Sanders d62cb11ea8 Bring in VE support
Bug: T211242
Depends-On: I9d7efbecfd954acff86f279f75aa80a9fcc10c89
Change-Id: Ibaf8a37f1aaef510923bde5ed9114f1f00fff461
2018-12-07 18:49:43 +00:00
zoranzoki21 bbec41c935 Move all apihelp translatable messages to separate files
Bug: T189982
Change-Id: I215dca32ed6bad6c4dafd0814b8cbb0887b3dd75
2018-11-25 05:28:45 +01:00
Jayprakash12345 a4d5a715a3 Remove deprecated dieUsageMsg methods
Bug: T189222
Change-Id: Ie026662aed64fab6d6e47d9eaff5c80dd36e0a79
2018-03-09 12:10:06 +00:00
Kunal Mehta 843434f64d Move classes into includes/
Change-Id: I24d0b37d49337efd35d12adf6adbfc403e81fa50
2018-02-15 14:35:32 -08:00
Jayprakash12345 3c8df981b8 Use SPDX 3.0 license identifier
Bug: T183858
Change-Id: I9529acdc4da032f853d64e5fbbe3aff46f050ccd
2018-01-29 05:52:37 +00:00
Umherirrender 54294b8fa5 Move TitleBlacklistEntry to own file
Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass

Change-Id: I75e2a3a959b7d7bbad2dca68c9c62ea10e948fb4
2017-12-21 22:24:59 +01:00
Reedy d89183d408 Re-instate "Remove pre-authmanager code"
This reverts commit ecf9bc4424.

Fixes copy paste fail from Id686d75e0a6b475a79f7f715791d867dc6fb400c,
should've been preauth, not primary

Change-Id: I8c5456af1ca3bf89c4fd1791b113ac3a16350989
2017-10-12 14:01:26 +00:00
EddieGP ecf9bc4424 Revert "Remove pre-authmanager code"
This reverts commit 259a236821.
It broke beta completely. Revert for now.

Bug: T178062
Change-Id: If4e09bb92e8c7769f0bd95bab20cb38aab19c283
2017-10-12 12:34:34 +00:00
Reedy 259a236821 Remove pre-authmanager code
Bug: T178033
Change-Id: Id686d75e0a6b475a79f7f715791d867dc6fb400c
2017-10-12 00:42:04 +00:00
Brad Jorsch 8ce9c9bc8a Add titleblacklistlog to viewrestrictedlogs grant
Bug: T149235
Depends-On: I8e2304e7b6f2af0c3d21d7d7390e4979b8eaee39
Change-Id: I0cff164c91128a9cc4b8700527ed1f4090a368a5
2016-10-26 15:28:34 -04:00
Reedy 496afa6548 Replace ArticleSaveComplete hook usage
Bug: T147558
Change-Id: I30f8e4d3c98a421036374245522bc0784ceafec3
2016-10-06 17:24:42 +01:00
Reedy 1ebec92f0a Remove 'UnitTestList' hook
No longer needed now that extension unittests are autodiscovered.

Bug: T142120
Bug: T142121
Change-Id: Id86f4909e9c74c884ce33434717ad6993cbcc2bd
2016-08-05 17:38:12 +01:00
Bartosz Dziewoński 8437d98027 Add "targets": [ "desktop", "mobile" ] to 'mediawiki.api.titleblacklist' module
Bug: T97202
Change-Id: I6bffc6088f04527c0c5ca8ea8ec33de800582ee6
2016-08-03 18:56:33 +02:00
Gergő Tisza 17d3a9e313 Update for AuthManager
Bug: T110469
Change-Id: I9690d2fe6b172fcc85e1a8f7f91af21c6422d870
Depends-On: I8b52ec8ddf494f23941807638f149f15b5e46b0c
2016-05-12 00:23:11 +00:00
Bartosz Dziewoński 97b433286d Return better error information via the API
* Use only a single error code 'titleblacklist-forbidden'
  to allow API users to easily identify TitleBlacklist errors.
* Return the internal code ('message') and the matching entry's text
  ('line') in machine-readable format, same as action=titleblacklist
  (depends on I1334ba21a2862973a9d8ff5be2c9bec06a82698b in MediaWiki).

This bumps the version requirement to 1.27, as older MediaWiki
versions would ignore the error in new format entirely.

Example API output change, for action=edit:

Before:
  {
      "error": {
          "code": "custom-message",
          "info": "TitleBlacklist prevents this title from being created",
          "*": "See http://localhost/w/api.php for API usage"
      }
  }
After:
  {
      "error": {
          "code": "titleblacklist-forbidden",
          "info": "TitleBlacklist prevents this title from being created",
          "message": "custom-message",
          "line": ".*test.* <errmsg=custom-message> # test rule",
          "*": "See http://localhost/w/api.php for API usage"
      }
  }

Bug: T115258
Change-Id: I42a0c5b0ea7e61088dd609b764dd7d1396c60cd5
2015-11-02 14:04:37 +00:00
jenkins-bot c1d392dcff Merge "Add ignoretitleblacklist to account creation API" 2015-10-26 17:57:48 +00:00
Bartosz Dziewoński 321cfac7aa extension.json: Correct name and URL
Change-Id: I49364f374efe6425cec433d3f2c8e59451ad0c65
2015-10-20 14:53:26 +02:00
Bartosz Dziewoński 811439b68e Remove support for MediaWiki 1.24 'AbortMove' hook
TitleBlacklist already only supports MediaWiki 1.25+ (see TitleBlacklist.php).

Change-Id: Iea583f31913e57c76d2c755d85deb65cfc935190
2015-10-20 14:50:43 +02:00
Alex Monk ce99786864 Add ignoretitleblacklist to account creation API
Bug: T109517
Change-Id: Ie4d879f692cddc47d730d9aee9a9a534e9d22937
2015-10-18 15:19:20 +01:00
Alex Monk e483b741af Add config option to disable blocking auto account creations
Bug: T35429
Change-Id: I83a80ba1c9f23962a8df5e8478b30c8b6e00eb70
2015-07-09 18:41:28 +00:00
Kunal Mehta 95c1d76f00 Set manifest_version in extension.json
Bug: T100745
Change-Id: I657a8c2b1678174a4828b25cad129d7e7b0b680d
2015-05-28 20:39:27 -07:00
Alex Monk d372b43a75 Use extension registration, replace constants with some reasonable values, kill i18n shim
Bug: T87982
Change-Id: I9ab045da49179618d7c5558b2b066fba2736ae6e
2015-05-19 17:23:14 +01:00