From 79571e0e7722aa57ac86f67df2220b366e4d3d18 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 22 Nov 2020 09:18:58 -0500 Subject: [PATCH] Removing AnonymousPassport This is not used - is leftover from the security component authenticator changes --- .../Authentication/AuthenticatorManager.php | 5 ---- .../Passport/AnonymousPassport.php | 25 ------------------- .../UserProviderListenerTest.php | 3 --- 3 files changed, 33 deletions(-) delete mode 100644 src/Symfony/Component/Security/Http/Authenticator/Passport/AnonymousPassport.php diff --git a/src/Symfony/Component/Security/Http/Authentication/AuthenticatorManager.php b/src/Symfony/Component/Security/Http/Authentication/AuthenticatorManager.php index 2b6328ea35..318fd7bd21 100644 --- a/src/Symfony/Component/Security/Http/Authentication/AuthenticatorManager.php +++ b/src/Symfony/Component/Security/Http/Authentication/AuthenticatorManager.php @@ -22,7 +22,6 @@ use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface; use Symfony\Component\Security\Http\Authenticator\InteractiveAuthenticatorInterface; -use Symfony\Component\Security\Http\Authenticator\Passport\AnonymousPassport; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\BadgeInterface; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface; @@ -219,10 +218,6 @@ class AuthenticatorManager implements AuthenticatorManagerInterface, UserAuthent $this->eventDispatcher->dispatch($loginEvent, SecurityEvents::INTERACTIVE_LOGIN); } - if ($passport instanceof AnonymousPassport) { - return $response; - } - $this->eventDispatcher->dispatch($loginSuccessEvent = new LoginSuccessEvent($authenticator, $passport, $authenticatedToken, $request, $response, $this->firewallName)); return $loginSuccessEvent->getResponse(); diff --git a/src/Symfony/Component/Security/Http/Authenticator/Passport/AnonymousPassport.php b/src/Symfony/Component/Security/Http/Authenticator/Passport/AnonymousPassport.php deleted file mode 100644 index 678745eea0..0000000000 --- a/src/Symfony/Component/Security/Http/Authenticator/Passport/AnonymousPassport.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Security\Http\Authenticator\Passport; - -/** - * A passport used during anonymous authentication. - * - * @author Wouter de Jong - * - * @internal - * @experimental in 5.2 - */ -class AnonymousPassport implements PassportInterface -{ - use PassportTrait; -} diff --git a/src/Symfony/Component/Security/Http/Tests/EventListener/UserProviderListenerTest.php b/src/Symfony/Component/Security/Http/Tests/EventListener/UserProviderListenerTest.php index b43aebde96..95f99de8d0 100644 --- a/src/Symfony/Component/Security/Http/Tests/EventListener/UserProviderListenerTest.php +++ b/src/Symfony/Component/Security/Http/Tests/EventListener/UserProviderListenerTest.php @@ -16,9 +16,7 @@ use Symfony\Component\Security\Core\User\User; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface; -use Symfony\Component\Security\Http\Authenticator\Passport\AnonymousPassport; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; -use Symfony\Component\Security\Http\Authenticator\Passport\Passport; use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport; use Symfony\Component\Security\Http\Event\CheckPassportEvent; use Symfony\Component\Security\Http\EventListener\UserProviderListener; @@ -61,7 +59,6 @@ class UserProviderListenerTest extends TestCase public function provideCompletePassports() { - yield [new AnonymousPassport()]; yield [new SelfValidatingPassport(new UserBadge('wouter', function () {}))]; }