aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerick Alangi <alangiderick@gmail.com>2023-08-04 20:52:24 +0100
committerDerick Alangi <alangiderick@gmail.com>2023-08-06 12:42:14 +0100
commitf6c9ced9346a1fd8765d473a82e8f83126272bf1 (patch)
treea0b4ac4fe1f6f08c3b851fbbc72bf067e6a2b20f
parent59af14aef19e057d9c1bbba05eb0010a03e8234d (diff)
downloadmediawikicore-f6c9ced9346a1fd8765d473a82e8f83126272bf1.tar.gz
mediawikicore-f6c9ced9346a1fd8765d473a82e8f83126272bf1.zip
Auth: Various deprecated interface methods have been removed
These methods were already hard deprecated since 1.37, they can really go away now, no usage found per CS. Change-Id: I07add3f8aa33ab26ac9de28814448b2039026216
-rw-r--r--RELEASE-NOTES-1.415
-rw-r--r--includes/auth/AbstractAuthenticationProvider.php54
-rw-r--r--includes/auth/AuthenticationProvider.php43
-rw-r--r--tests/phpunit/unit/includes/auth/AbstractAuthenticationProviderTest.php25
4 files changed, 6 insertions, 121 deletions
diff --git a/RELEASE-NOTES-1.41 b/RELEASE-NOTES-1.41
index d2ffcd565d75..4191d295b020 100644
--- a/RELEASE-NOTES-1.41
+++ b/RELEASE-NOTES-1.41
@@ -256,6 +256,11 @@ because of Phabricator reports.
* SearchDatabase::db, deprecated since 1.38, has been removed.
* SearchDatabase::lb has been removed without deprecation, use ::dbProvider
instead.
+* AbstractAuthenticationProvider::setLogger(), ::setManager(), ::setConfig()
+ and ::setHookContainer() have been removed and also from it's related
+ interface, AuthenticationProvider. The corresponding properties are set in
+ AbstractAuthenticationProvider::init(). For side effects, you can override
+ AbstractAuthenticationProvider::postInitSetup().
* Title::newFromTitleValue(), deprecated since 1.34, has been removed.
* SpecialPageAction has been removed without deprecation. There were no known
uses outside of core.
diff --git a/includes/auth/AbstractAuthenticationProvider.php b/includes/auth/AbstractAuthenticationProvider.php
index 5e090f4a946d..28a4feeadf3e 100644
--- a/includes/auth/AbstractAuthenticationProvider.php
+++ b/includes/auth/AbstractAuthenticationProvider.php
@@ -93,60 +93,6 @@ abstract class AbstractAuthenticationProvider implements AuthenticationProvider
}
/**
- * @deprecated since 1.37. For extension-defined authentication providers
- * that were using this method to trigger other work, please override
- * AbstractAuthenticationProvider::postInitSetup instead. If your extension
- * was using this to explicitly change the logger of an existing
- * AuthenticationProvider object, please file a report on phabricator -
- * there is no non-deprecated way to do this anymore.
- */
- public function setLogger( LoggerInterface $logger ) {
- wfDeprecated( __METHOD__, '1.37' );
- $this->logger = $logger;
- }
-
- /**
- * @deprecated since 1.37. For extension-defined authentication providers
- * that were using this method to trigger other work, please override
- * AbstractAuthenticationProvider::postInitSetup instead. If your extension
- * was using this to explicitly change the AuthManager of an existing
- * AuthenticationProvider object, please file a report on phabricator -
- * there is no non-deprecated way to do this anymore.
- */
- public function setManager( AuthManager $manager ) {
- wfDeprecated( __METHOD__, '1.37' );
- $this->manager = $manager;
- }
-
- /**
- * @deprecated since 1.37. For extension-defined authentication providers
- * that were using this method to trigger other work, please override
- * AbstractAuthenticationProvider::postInitSetup instead. If your extension
- * was using this to explicitly change the Config of an existing
- * AuthenticationProvider object, please file a report on phabricator -
- * there is no non-deprecated way to do this anymore.
- * @param Config $config
- */
- public function setConfig( Config $config ) {
- wfDeprecated( __METHOD__, '1.37' );
- $this->config = $config;
- }
-
- /**
- * @deprecated since 1.37. For extension-defined authentication providers
- * that were using this method to trigger other work, please override
- * AbstractAuthenticationProvider::postInitSetup instead. If your extension
- * was using this to explicitly change the HookContainer of an existing
- * AuthenticationProvider object, please file a report on phabricator -
- * there is no non-deprecated way to do this anymore.
- */
- public function setHookContainer( HookContainer $hookContainer ) {
- wfDeprecated( __METHOD__, '1.37' );
- $this->hookContainer = $hookContainer;
- $this->hookRunner = new HookRunner( $hookContainer );
- }
-
- /**
* @inheritDoc
* @note Override this if it makes sense to support more than one instance
*/
diff --git a/includes/auth/AuthenticationProvider.php b/includes/auth/AuthenticationProvider.php
index 74396d077f94..80e3c757c8e5 100644
--- a/includes/auth/AuthenticationProvider.php
+++ b/includes/auth/AuthenticationProvider.php
@@ -23,9 +23,6 @@
namespace MediaWiki\Auth;
-use Config;
-use MediaWiki\HookContainer\HookContainer;
-
/**
* An AuthenticationProvider is used by AuthManager when authenticating users.
*
@@ -39,44 +36,6 @@ use MediaWiki\HookContainer\HookContainer;
interface AuthenticationProvider {
/**
- * Set AuthManager
- * @deprecated since 1.37. For extension-defined authentication providers
- * that were using this method to trigger other work, please override
- * AbstractAuthenticationProvider::postInitSetup instead. If your extension
- * was using this to explicitly change the AuthManager (or Config, or
- * HookContainer) of an existing AuthenticationProvider object, please
- * file a report on phabricator - there is no non-deprecated way to do this
- * anymore.
- * @param AuthManager $manager
- */
- public function setManager( AuthManager $manager );
-
- /**
- * Set configuration
- * @deprecated since 1.37. For extension-defined authentication providers
- * that were using this method to trigger other work, please override
- * AbstractAuthenticationProvider::postInitSetup instead. If your extension
- * was using this to explicitly change the AuthManager (or Config, or
- * HookContainer) of an existing AuthenticationProvider object, please
- * file a report on phabricator - there is no non-deprecated way to do this
- * anymore.
- * @param Config $config
- */
- public function setConfig( Config $config );
-
- /**
- * @deprecated since 1.37. For extension-defined authentication providers
- * that were using this method to trigger other work, please override
- * AbstractAuthenticationProvider::postInitSetup instead. If your extension
- * was using this to explicitly change the AuthManager (or Config, or
- * HookContainer) of an existing AuthenticationProvider object, please
- * file a report on phabricator - there is no non-deprecated way to do this
- * anymore.
- * @param HookContainer $hookContainer
- */
- public function setHookContainer( HookContainer $hookContainer );
-
- /**
* Return a unique identifier for this instance
*
* This must be the same across requests. If multiple instances return the
@@ -108,7 +67,7 @@ interface AuthenticationProvider {
* @see AuthManager::getAuthenticationRequests()
* @param string $action
* @param array $options Options are:
- * - username: User name related to the action, or null/unset if anon.
+ * - username: Username related to the action, or null/unset if anon.
* - ACTION_LOGIN: The currently logged-in user, if any.
* - ACTION_CREATE: The account creator, if non-anonymous.
* - ACTION_LINK: The local user being linked to.
diff --git a/tests/phpunit/unit/includes/auth/AbstractAuthenticationProviderTest.php b/tests/phpunit/unit/includes/auth/AbstractAuthenticationProviderTest.php
index 8620a46c77df..0b6237621ea4 100644
--- a/tests/phpunit/unit/includes/auth/AbstractAuthenticationProviderTest.php
+++ b/tests/phpunit/unit/includes/auth/AbstractAuthenticationProviderTest.php
@@ -18,11 +18,6 @@ class AbstractAuthenticationProviderTest extends \MediaWikiUnitTestCase {
use AuthenticationProviderTestTrait;
public function testAbstractAuthenticationProvider() {
- $this->hideDeprecated( 'MediaWiki\Auth\AbstractAuthenticationProvider::setConfig' );
- $this->hideDeprecated( 'MediaWiki\Auth\AbstractAuthenticationProvider::setLogger' );
- $this->hideDeprecated( 'MediaWiki\Auth\AbstractAuthenticationProvider::setManager' );
- $this->hideDeprecated( 'MediaWiki\Auth\AbstractAuthenticationProvider::setHookContainer' );
-
$provider = $this->getMockForAbstractClass( AbstractAuthenticationProvider::class );
$providerPriv = TestingAccessWrapper::newFromObject( $provider );
@@ -39,26 +34,6 @@ class AbstractAuthenticationProviderTest extends \MediaWikiUnitTestCase {
$this->assertSame( $config, $providerPriv->config );
$this->assertSame( $userNameUtils, $providerPriv->userNameUtils );
- // test AbstractAuthenticationProvider::setLogger
- $obj = $this->getMockForAbstractClass( LoggerInterface::class );
- $provider->setLogger( $obj );
- $this->assertSame( $obj, $providerPriv->logger, 'setLogger' );
-
- // test AbstractAuthenticationProvider::setManager
- $obj = $this->createMock( AuthManager::class );
- $provider->setManager( $obj );
- $this->assertSame( $obj, $providerPriv->manager, 'setManager' );
-
- // test AbstractAuthenticationProvider::setConfig
- $obj = new HashConfig();
- $provider->setConfig( $obj );
- $this->assertSame( $obj, $providerPriv->config, 'setConfig' );
-
- // test AbstractAuthenticationProvider::setHookContainer
- $obj = $this->createHookContainer();
- $provider->setHookContainer( $obj );
- $this->assertSame( $obj, $providerPriv->hookContainer, 'setHookContainer' );
-
// test AbstractAuthenticationProvider::getUniqueId
$this->assertIsString( $provider->getUniqueId(), 'getUniqueId' );
}