Skip to content

Commit 7cc109b

Browse files
committed
Fixes after view and update CHANGELOG/UPGRADE
1 parent 8554c93 commit 7cc109b

File tree

6 files changed

+17
-8
lines changed

6 files changed

+17
-8
lines changed

UPGRADE-5.4.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ SecurityBundle
5858
Security
5959
--------
6060

61-
* Deprecate the `$authManager` argument of `AccessListener`
62-
* Deprecate the `$authenticationManager` argument of the `AuthorizationChecker` constructor
61+
* Deprecate `AnonymousToken`, as the related authenticator was deprecated in 5.3
62+
* Deprecate `Token::getCredentials()`, tokens should no longer contain credentials (as they represent authenticated sessions)
63+
* Deprecate not returning an `UserInterface` from `Token::getUser()`
64+
* Deprecate the `$authManager` argument of `AccessListener`, the argument will be removed
65+
* Deprecate the `$authenticationManager` argument of the `AuthorizationChecker` constructor, the argument will be removed
6366
* Deprecate not setting `$authenticatorManagerEnabled` to `true` in `SecurityDataCollector` and `DebugFirewallCommand`
6467
(this is the default behavior when using `enable_authenticator_manager: true`)
6568
* Deprecate setting the `$alwaysAuthenticate` argument to `true` and not setting the

UPGRADE-6.0.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ Routing
206206
Security
207207
--------
208208

209+
* Remove `AnonymousToken`
210+
* Remove `Token::getCredentials()`, tokens should no longer contain credentials (as they represent authenticated sessions)
211+
* Restrict the return type of `Token::getUser()` to `UserInterface` (removing `string|\Stringable`)
209212
* Remove the 4th and 5th argument of `AuthorizationChecker`
210213
* Remove the 5th argument of `AccessListener`
211214
* Remove class `User`, use `InMemoryUser` or your own implementation instead.

src/Symfony/Component/Security/Core/Authentication/Token/PreAuthenticatedToken.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class PreAuthenticatedToken extends AbstractToken
3131
public function __construct($user, /*string*/ $firewallName, /*array*/ $roles = [])
3232
{
3333
if (\is_string($roles)) {
34-
trigger_deprecation('symfony/security-core', '5.4', 'Argument $credentials of "%s" is deprecated.', __METHOD__);
34+
trigger_deprecation('symfony/security-core', '5.4', 'Argument $credentials of "%s()" is deprecated.', __METHOD__);
3535

3636
$credentials = $firewallName;
3737
$firewallName = $roles;
@@ -63,7 +63,7 @@ public function __construct($user, /*string*/ $firewallName, /*array*/ $roles =
6363
public function getProviderKey()
6464
{
6565
if (1 !== \func_num_args() || true !== func_get_arg(0)) {
66-
trigger_deprecation('symfony/security-core', '5.2', 'Method "%s" is deprecated, use "getFirewallName()" instead.', __METHOD__);
66+
trigger_deprecation('symfony/security-core', '5.2', 'Method "%s()" is deprecated, use "getFirewallName()" instead.', __METHOD__);
6767
}
6868

6969
return $this->firewallName;
@@ -79,7 +79,7 @@ public function getFirewallName(): string
7979
*/
8080
public function getCredentials()
8181
{
82-
trigger_deprecation('symfony/security-core', '5.4', 'Method "%s" is deprecated.', __METHOD__);
82+
trigger_deprecation('symfony/security-core', '5.4', 'Method "%s()" is deprecated.', __METHOD__);
8383

8484
return $this->credentials;
8585
}

src/Symfony/Component/Security/Core/Authentication/Token/RememberMeToken.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function setAuthenticated(bool $authenticated)
6969
public function getProviderKey()
7070
{
7171
if (1 !== \func_num_args() || true !== func_get_arg(0)) {
72-
trigger_deprecation('symfony/security-core', '5.2', 'Method "%s" is deprecated, use "getFirewallName()" instead.', __METHOD__);
72+
trigger_deprecation('symfony/security-core', '5.2', 'Method "%s()" is deprecated, use "getFirewallName()" instead.', __METHOD__);
7373
}
7474

7575
return $this->firewallName;
@@ -95,7 +95,7 @@ public function getSecret()
9595
*/
9696
public function getCredentials()
9797
{
98-
trigger_deprecation('symfony/security-core', '5.4', 'Method "%s" is deprecated.', __METHOD__);
98+
trigger_deprecation('symfony/security-core', '5.4', 'Method "%s()" is deprecated.', __METHOD__);
9999

100100
return '';
101101
}

src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function getRoleNames(): array;
4444
*
4545
* @return mixed The user credentials
4646
*
47-
* @deprecated since 5.4.
47+
* @deprecated since 5.4
4848
*/
4949
public function getCredentials();
5050

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ CHANGELOG
44
5.4
55
---
66

7+
* Deprecate `AnonymousToken`, as the related authenticator was deprecated in 5.3
8+
* Deprecate `Token::getCredentials()`, tokens should no longer contain credentials (as they represent authenticated sessions)
9+
* Deprecate returning `string|\Stringable` from `Token::getUser()` (it must return a `UserInterface`)
710
* Deprecate the `$authenticationManager` argument of the `AuthorizationChecker` constructor
811
* Deprecate setting the `$alwaysAuthenticate` argument to `true` and not setting the
912
`$exceptionOnNoToken` argument to `false` of `AuthorizationChecker`

0 commit comments

Comments
 (0)