minor #39138 [Security] Removing Unused AnonymousPassport (weaverryan)

This PR was merged into the 5.2 branch.

Discussion
----------

[Security] Removing Unused AnonymousPassport

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | none
| License       | MIT
| Doc PR        | not needed

This is not used - it's leftover from the security component authenticator changes. I double-checked with @wouterj.

Cheers!

Commits
-------

79571e0e77 Removing AnonymousPassport
This commit is contained in:
Robin Chalas 2020-11-22 15:59:58 +01:00
commit ac2822f61f
3 changed files with 0 additions and 33 deletions

View File

@ -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();

View File

@ -1,25 +0,0 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* 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 <wouter@wouterj.nl>
*
* @internal
* @experimental in 5.2
*/
class AnonymousPassport implements PassportInterface
{
use PassportTrait;
}

View File

@ -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 () {}))];
}