Introduce a BlockManager service
authorThalia <thalia.e.chan@googlemail.com>
Fri, 5 Apr 2019 19:13:17 +0000 (20:13 +0100)
committerThalia <thalia.e.chan@googlemail.com>
Mon, 29 Apr 2019 16:47:55 +0000 (17:47 +0100)
commit52f7720227491d80156880e8ddfbaf744f8e676f
tree80f621bd89e645c0c8e7f527e75af4162976ed21
parentb942fc27c93e54868298608698fe6b965907d33e
Introduce a BlockManager service

This introduces a minimal BlockManager service, for getting blocks
that apply to a User.

Move the part of User::getBlockedStatus that checks for the blocks
into BlockManager::getUserBlock, and move the related helper
methods from User to BlockManager.

Hard deprecate or remove these helper methods, and move to private
methods in the BlockManager:
* User::getBlockFromCookieValue
* User::isLocallyBlockedProxy
* User::inDnsBlacklist

Soft deprecate these helper methods, and move to public methods in
the BlockManager:
* User::isDnsBlacklisted

Add tests to cover the methods moved to BlockManager.

Bug: T219441
Change-Id: I0af658d71288376735cebe541215383b56bb72e5
RELEASE-NOTES-1.34
includes/MediaWikiServices.php
includes/ServiceWiring.php
includes/auth/AuthManager.php
includes/block/BlockManager.php [new file with mode: 0644]
includes/user/User.php
tests/phpunit/includes/auth/AuthManagerTest.php
tests/phpunit/includes/block/BlockManagerTest.php [new file with mode: 0644]
tests/phpunit/includes/user/UserTest.php