-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security] Deprecate the old authentication mechanisms
- Loading branch information
Showing
16 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ | |
* An optional base class that creates a PostAuthenticationGuardToken for you. | ||
* | ||
* @author Ryan Weaver <[email protected]> | ||
* | ||
* @deprecated since Symfony 5.3, use the new authenticator system instead | ||
*/ | ||
abstract class AbstractGuardAuthenticator implements AuthenticatorInterface | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,14 @@ | |
use Symfony\Component\Security\Core\Exception\AuthenticationException; | ||
use Symfony\Component\Security\Core\Security; | ||
use Symfony\Component\Security\Guard\AbstractGuardAuthenticator; | ||
use Symfony\Component\Security\Http\Firewall\AnonymousAuthenticationListener; | ||
|
||
/** | ||
* A base class to make form login authentication easier! | ||
* | ||
* @author Ryan Weaver <[email protected]> | ||
* | ||
* @deprecated since Symfony 5.3, use the new authenticator system instead | ||
*/ | ||
abstract class AbstractFormLoginAuthenticator extends AbstractGuardAuthenticator | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,13 +32,17 @@ | |
use Symfony\Component\Security\Http\Authenticator\Passport\UserPassportInterface; | ||
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface; | ||
|
||
trigger_deprecation('symfony/security-guard', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', GuardBridgeAuthenticator::class); | ||
|
||
/** | ||
* This authenticator is used to bridge Guard authenticators with | ||
* the Symfony Authenticator system. | ||
* | ||
* @author Wouter de Jong <[email protected]> | ||
* | ||
* @internal | ||
* | ||
* @deprecated since Symfony 5.3 | ||
*/ | ||
class GuardBridgeAuthenticator implements InteractiveAuthenticatorInterface, AuthenticationEntryPointInterface | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,8 @@ | |
* | ||
* @author Ryan Weaver <[email protected]> | ||
* @author Amaury Leroux de Lens <[email protected]> | ||
* | ||
* @deprecated since Symfony 5.3, use the new authenticator system instead | ||
*/ | ||
interface AuthenticatorInterface extends AuthenticationEntryPointInterface | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,13 +28,17 @@ | |
use Symfony\Component\Security\Http\Firewall\AbstractListener; | ||
use Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface; | ||
|
||
trigger_deprecation('symfony/security-guard', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', GuardAuthenticationListener::class); | ||
|
||
/** | ||
* Authentication listener for the "guard" system. | ||
* | ||
* @author Ryan Weaver <[email protected]> | ||
* @author Amaury Leroux de Lens <[email protected]> | ||
* | ||
* @final | ||
* | ||
* @deprecated since Symfony 5.3, use the new authenticator system instead | ||
*/ | ||
class GuardAuthenticationListener extends AbstractListener | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,8 @@ | |
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface; | ||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; | ||
|
||
trigger_deprecation('symfony/security-guard', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', GuardAuthenticatorHandler::class); | ||
|
||
/** | ||
* A utility class that does much of the *work* during the guard authentication process. | ||
* | ||
|
@@ -31,6 +33,8 @@ | |
* @author Ryan Weaver <[email protected]> | ||
* | ||
* @final | ||
* | ||
* @deprecated since Symfony 5.3, use the new authenticator system instead | ||
*/ | ||
class GuardAuthenticatorHandler | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,11 +29,15 @@ | |
use Symfony\Component\Security\Guard\Token\GuardTokenInterface; | ||
use Symfony\Component\Security\Guard\Token\PreAuthenticationGuardToken; | ||
|
||
trigger_deprecation('symfony/security-guard', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', GuardAuthenticationProvider::class); | ||
|
||
/** | ||
* Responsible for accepting the PreAuthenticationGuardToken and calling | ||
* the correct authenticator to retrieve the authenticated token. | ||
* | ||
* @author Ryan Weaver <[email protected]> | ||
* | ||
* @deprecated since Symfony 5.3, use the new authenticator system instead | ||
*/ | ||
class GuardAuthenticationProvider implements AuthenticationProviderInterface | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
|
||
/** | ||
* @author Jean Pasdeloup <[email protected]> | ||
* @group legacy | ||
*/ | ||
class FormLoginAuthenticatorTest extends TestCase | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ | |
/** | ||
* @author Ryan Weaver <[email protected]> | ||
* @author Amaury Leroux de Lens <[email protected]> | ||
* @group legacy | ||
*/ | ||
class GuardAuthenticationListenerTest extends TestCase | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
|
||
/** | ||
* @author Ryan Weaver <[email protected]> | ||
* @group legacy | ||
*/ | ||
class GuardAuthenticationProviderTest extends TestCase | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ | |
|
||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; | ||
|
||
trigger_deprecation('symfony/security-guard', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', GuardTokenInterface::class); | ||
|
||
/** | ||
* A marker interface that both guard tokens implement. | ||
* | ||
|
@@ -21,6 +23,8 @@ | |
* interface. | ||
* | ||
* @author Ryan Weaver <[email protected]> | ||
* | ||
* @deprecated since Symfony 5.3, use the new authenticator system instead | ||
*/ | ||
interface GuardTokenInterface extends TokenInterface | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,13 +14,17 @@ | |
use Symfony\Component\Security\Core\Authentication\Token\AbstractToken; | ||
use Symfony\Component\Security\Core\User\UserInterface; | ||
|
||
trigger_deprecation('symfony/security-guard', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', PostAuthenticationGuardToken::class); | ||
|
||
/** | ||
* Used as an "authenticated" token, though it could be set to not-authenticated later. | ||
* | ||
* If you're using Guard authentication, you *must* use a class that implements | ||
* GuardTokenInterface as your authenticated token (like this class). | ||
* | ||
* @author Ryan Weaver <[email protected]> | ||
* | ||
* @deprecated since Symfony 5.3, use the new authenticator system instead | ||
*/ | ||
class PostAuthenticationGuardToken extends AbstractToken implements GuardTokenInterface | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ | |
|
||
use Symfony\Component\Security\Core\Authentication\Token\AbstractToken; | ||
|
||
trigger_deprecation('symfony/security-guard', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', PreAuthenticationGuardToken::class); | ||
|
||
/** | ||
* The token used by the guard auth system before authentication. | ||
* | ||
|
@@ -21,6 +23,8 @@ | |
* successful, a different authenticated token is returned | ||
* | ||
* @author Ryan Weaver <[email protected]> | ||
* | ||
* @deprecated since Symfony 5.3, use the new authenticator system instead | ||
*/ | ||
class PreAuthenticationGuardToken extends AbstractToken implements GuardTokenInterface | ||
{ | ||
|