8000 feature #42326 [Security] Deprecate remaining `LogoutHandlerInterface… · symfony/symfony@d8e91b6 · GitHub
[go: up one dir, main page]

Skip to content

Commit d8e91b6

Browse files
committed
feature #42326 [Security] Deprecate remaining LogoutHandlerInterface implementations (chalasr)
This PR was merged into the 5.4 branch. Discussion ---------- [Security] Deprecate remaining `LogoutHandlerInterface` implementations | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | yes | Tickets | - | License | MIT | Doc PR | - Commits ------- f972780 [Security] Deprecate remaining `LogoutHandlerInterface` implementations
2 parents e43725f + f972780 commit d8e91b6

9 files changed

+30
-0
lines changed

UPGRADE-5.4.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ Security
4545
* Deprecate `TokenInterface:isAuthenticated()` and `setAuthenticated()` methods without replacement.
4646
Security tokens won't have an "authenticated" flag anymore, so they will always be considered authenticated
4747
* Deprecate `DeauthenticatedEvent`, use `TokenDeauthenticatedEvent` instead
48+
* Deprecate `CookieClearingLogoutHandler`, `SessionLogoutHandler` and `CsrfTokenClearingLogoutHandler`.
49+
Use `CookieClearingLogoutListener`, `SessionLogoutListener` and `CsrfTokenClearingLogoutListener` instead

UPGRADE-6.0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ Security
326326
* Remove `TokenInterface:isAuthenticated()` and `setAuthenticated()` methods without replacement.
327327
Security tokens won't have an "authenticated" flag anymore, so they will always be considered authenticated
328328
* Remove `DeauthenticatedEvent`, use `TokenDeauthenticatedEvent` instead
329+
* Remove `CookieClearingLogoutHandler`, `SessionLogoutHandler` and `CsrfTokenClearingLogoutHandler`.
330+
Use `CookieClearingLogoutListener`, `SessionLogoutListener` and `CsrfTokenClearingLogoutListener` instead
329331

330332
SecurityBundle
331333
--------------

src/Symfony/Component/Security/Http/CHANGELOG.md

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

77
* Deprecate not setting the 5th argument (`$exceptionOnNoToken`) of `AccessListener` to `false`
88
* Deprecate `DeauthenticatedEvent`, use `TokenDeauthenticatedEvent` instead
9+
* Deprecate `CookieClearingLogoutHandler`, `SessionLogoutHandler` and `CsrfTokenClearingLogoutHandler`.
10+
Use `CookieClearingLogoutListener`, `SessionLogoutListener` and `CsrfTokenClearingLogoutListener` instead
911

1012
5.3
1113
---

src/Symfony/Component/Security/Http/Logout/CookieClearingLogoutHandler.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
1414
use Symfony\Component\HttpFoundation\Request;
1515
use Symfony\Component\HttpFoundation\Response;
1616
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
17+
use Symfony\Component\Security\Http\EventListener\CookieClearingLogoutListener;
18+
19+
trigger_deprecation('symfony/security-http', '5.4', 'The "%s" class is deprecated, use "%s" instead.', CookieClearingLogoutHandler::class, CookieClearingLogoutListener::class);
1720

1821
/**
1922
* This handler clears the passed cookies when a user logs out.
2023
*
2124
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
25+
*
26+
* @deprecated since Symfony 5.4, use {@link CookieClearingLogoutListener} instead
2227
*/
2328
class CookieClearingLogoutHandler implements LogoutHandlerInterface
2429
{

src/Symfony/Component/Security/Http/Logout/CsrfTokenClearingLogoutHandler.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@
1515
use Symfony\Component\HttpFoundation\Response;
1616
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1717
use Symfony\Component\Security\Csrf\TokenStorage\ClearableTokenStorageInterface;
18+
use Symfony\Component\Security\Http\EventListener\CsrfTokenClearingLogoutListener;
19+
20+
trigger_deprecation('symfony/security-http', '5.4', 'The "%s" class is deprecated, use "%s" instead.', CsrfTokenClearingLogoutHandler::class, CsrfTokenClearingLogoutListener::class);
1821

1922
/**
2023
* @author Christian Flothmann <christian.flothmann@sensiolabs.de>
24+
*
25+
* @deprecated since Symfony 5.4, use {@link CsrfTokenClearingLogoutListener} instead
2126
*/
2227
class CsrfTokenClearingLogoutHandler implements LogoutHandlerInterface
2328
{

src/Symfony/Component/Security/Http/Logout/SessionLogoutHandler.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
1414
use Symfony\Component\HttpFoundation\Request;
1515
use Symfony\Component\HttpFoundation\Response;
1616
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
17+
use Symfony\Component\Security\Http\EventListener\SessionLogoutListener;
18+
19+
trigger_deprecation('symfony/security-http', '5.4', 'The "%s" class is deprecated, use "%s" instead.', SessionLogoutHandler::class, SessionLogoutListener::class);
1720

1821
/**
1922
* Handler for clearing invalidating the current session.
2023
*
2124
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
25+
*
26+
* @deprecated since Symfony 5.4, use {@link SessionLogoutListener} instead
2227
*/
2328
class SessionLogoutHandler implements LogoutHandlerInterface
2429
{

src/Symfony/Component/Security/Http/Tests/Logout/CookieClearingLogoutHandlerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
2020
use Symfony\Component\Security\Http\Logout\CookieClearingLogoutHandler;
2121

22+
/**
23+
* @group legacy
24+
*/
2225
class CookieClearingLogoutHandlerTest extends TestCase
2326
{
2427
public function testLogout()

src/Symfony/Component/Security/Http/Tests/Logout/CsrfTokenClearingLogoutHandlerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
use Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage;
2222
use Symfony\Component\Security\Http\Logout\CsrfTokenClearingLogoutHandler;
2323

24+
/**
25+
* @group legacy
26+
*/
2427
class CsrfTokenClearingLogoutHandlerTest extends TestCase
2528
{
2629
private $session;

src/Symfony/Component/Security/Http/Tests/Logout/SessionLogoutHandlerTest.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\Authentication\Token\TokenInterface;
1919
use Symfony\Component\Security\Http\Logout\SessionLogoutHandler;
2020

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

0 commit comments

Comments
 (0)
0