Skip to content

Commit b7471d5

Browse files
committed
[Security] Deprecate the old authentication mechanisms
1 parent 1be2a05 commit b7471d5

18 files changed

+60
-2
lines changed

Firewall/AbstractAuthenticationListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface;
3232
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
3333

34+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', AbstractAuthenticationListener::class);
35+
3436
/**
3537
* The AbstractAuthenticationListener is the preferred base class for all
3638
* browser-/HTTP-based authentication requests.
@@ -47,6 +49,8 @@
4749
*
4850
* @author Fabien Potencier <[email protected]>
4951
* @author Johannes M. Schmitt <[email protected]>
52+
*
53+
* @deprecated since Symfony 5.3, use the new authenticator system instead
5054
*/
5155
abstract class AbstractAuthenticationListener extends AbstractListener
5256
{

Firewall/AbstractPreAuthenticatedListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface;
2626
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2727

28+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', AbstractPreAuthenticatedListener::class);
29+
2830
/**
2931
* AbstractPreAuthenticatedListener is the base class for all listener that
3032
* authenticates users based on a pre-authenticated request (like a certificate
@@ -33,6 +35,8 @@
3335
* @author Fabien Potencier <[email protected]>
3436
*
3537
* @internal
38+
*
39+
* @deprecated since Symfony 5.3, use the new authenticator system instead
3640
*/
3741
abstract class AbstractPreAuthenticatedListener extends AbstractListener
3842
{

Firewall/AnonymousAuthenticationListener.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
2020
use Symfony\Component\Security\Core\Exception\AuthenticationException;
2121

22+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', AnonymousAuthenticationListener::class);
23+
2224
// Help opcache.preload discover always-needed symbols
2325
class_exists(AnonymousToken::class);
2426

@@ -28,7 +30,7 @@ class_exists(AnonymousToken::class);
2830
*
2931
* @author Fabien Potencier <[email protected]>
3032
*
31-
* @final
33+
* @deprecated since Symfony 5.3, use the new authenticator system instead
3234
*/
3335
class AnonymousAuthenticationListener extends AbstractListener
3436
{

Firewall/BasicAuthenticationListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@
2222
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
2323
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface;
2424

25+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', AnonymousAuthenticationListener::class);
26+
2527
/**
2628
* BasicAuthenticationListener implements Basic HTTP authentication.
2729
*
2830
* @author Fabien Potencier <[email protected]>
2931
*
3032
* @final
33+
*
34+
* @deprecated since Symfony 5.3, use the new authenticator system instead
3135
*/
3236
class BasicAuthenticationListener extends AbstractListener
3337
{

Firewall/RememberMeListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,16 @@
2424
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface;
2525
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2626

27+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', RememberMeListener::class);
28+
2729
/**
2830
* RememberMeListener implements authentication capabilities via a cookie.
2931
*
3032
* @author Johannes M. Schmitt <[email protected]>
3133
*
3234
* @final
35+
*
36+
* @deprecated since Symfony 5.3, use the new authenticator system instead
3337
*/
3438
class RememberMeListener extends AbstractListener
3539
{

Firewall/RemoteUserAuthenticationListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@
1818
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
1919
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2020

21+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', RemoteUserAuthenticationListener::class);
22+
2123
/**
2224
* REMOTE_USER authentication listener.
2325
*
2426
* @author Fabien Potencier <[email protected]>
2527
* @author Maxime Douailin <[email protected]>
28+
*
29+
* @deprecated since Symfony 5.3, use the new authenticator system instead
2630
*/
2731
class RemoteUserAuthenticationListener extends AbstractPreAuthenticatedListener
2832
{

Firewall/UsernamePasswordFormAuthenticationListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@
2929
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface;
3030
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
3131

32+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', UsernamePasswordFormAuthenticationListener::class);
33+
3234
/**
3335
* UsernamePasswordFormAuthenticationListener is the default implementation of
3436
* an authentication via a simple form composed of a username and a password.
3537
*
3638
* @author Fabien Potencier <[email protected]>
39+
*
40+
* @deprecated since Symfony 5.3, use the new authenticator system instead
3741
*/
3842
class UsernamePasswordFormAuthenticationListener extends AbstractAuthenticationListener
3943
{

Firewall/UsernamePasswordJsonAuthenticationListener.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@
3636
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
3737
use Symfony\Contracts\Translation\TranslatorInterface;
3838

39+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', UsernamePasswordJsonAuthenticationListener::class);
40+
3941
/**
4042
* UsernamePasswordJsonAuthenticationListener is a stateless implementation of
4143
* an authentication via a JSON document composed of a username and a password.
4244
*
4345
* @author Kévin Dunglas <[email protected]>
4446
*
45-
* @final
47+
* @deprecated since Symfony 5.3, use the new authenticator system instead
4648
*/
4749
class UsernamePasswordJsonAuthenticationListener extends AbstractListener
4850
{

Firewall/X509AuthenticationListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@
1818
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
1919
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2020

21+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', X509AuthenticationListener::class);
22+
2123
/**
2224
* X509 authentication listener.
2325
*
2426
* @author Fabien Potencier <[email protected]>
27+
*
28+
* @deprecated since Symfony 5.3, use the new authenticator system instead
2529
*/
2630
class X509AuthenticationListener extends AbstractPreAuthenticatedListener
2731
{

Tests/Firewall/AbstractPreAuthenticatedListenerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
use Symfony\Component\Security\Core\Exception\AuthenticationException;
2323
use Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener;
2424

25+
/**
26+
* @group legacy
27+
*/
2528
class AbstractPreAuthenticatedListenerTest extends TestCase
2629
{
2730
public function testHandleWithValidValues()

Tests/Firewall/AnonymousAuthenticationListenerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
2323
use Symfony\Component\Security\Http\Firewall\AnonymousAuthenticationListener;
2424

25+
/**
26+
* @group legacy
27+
*/
2528
class AnonymousAuthenticationListenerTest extends TestCase
2629
{
2730
public function testHandleWithTokenStorageHavingAToken()

Tests/Firewall/BasicAuthenticationListenerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
2727
use Symfony\Component\Security\Http\Firewall\BasicAuthenticationListener;
2828

29+
/**
30+
* @group legacy
31+
*/
2932
class BasicAuthenticationListenerTest extends TestCase
3033
{
3134
public function testHandleWithValidUsernameAndPasswordServerParameters()

Tests/Firewall/RememberMeListenerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface;
3030
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
3131

32+
/**
33+
* @group legacy
34+
*/
3235
class RememberMeListenerTest extends TestCase
3336
{
3437
public function testOnCoreSecurityDoesNotTryToPopulateNonEmptyTokenStorage()

Tests/Firewall/RemoteUserAuthenticationListenerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
1919
use Symfony\Component\Security\Http\Firewall\RemoteUserAuthenticationListener;
2020

21+
/**
22+
* @group legacy
23+
*/
2124
class RemoteUserAuthenticationListenerTest extends TestCase
2225
{
2326
public function testGetPreAuthenticatedData()

Tests/Firewall/SwitchUserListenerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
use Symfony\Component\Security\Http\SecurityEvents;
3131
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
3232

33+
/**
34+
* @group legacy
35+
*/
3336
class SwitchUserListenerTest extends TestCase
3437
{
3538
private $tokenStorage;

Tests/Firewall/UsernamePasswordFormAuthenticationListenerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy;
3333
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface;
3434

35+
/**
36+
* @group legacy
37+
*/
3538
class UsernamePasswordFormAuthenticationListenerTest extends TestCase
3639
{
3740
/**

Tests/Firewall/UsernamePasswordJsonAuthenticationListenerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333

3434
/**
3535
* @author Kévin Dunglas <[email protected]>
36+
*
37+
* @group legacy
3638
*/
3739
class UsernamePasswordJsonAuthenticationListenerTest extends TestCase
3840
{

Tests/Firewall/X509AuthenticationListenerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
1919
use Symfony\Component\Security\Http\Firewall\X509AuthenticationListener;
2020

21+
/**
22+
* @group legacy
23+
*/
2124
class X509AuthenticationListenerTest extends TestCase
2225
{
2326
/**

0 commit comments

Comments
 (0)