Skip to content

Commit

Permalink
feature #26334 [SecurityBundle] Deprecate switch_user.stateless confi…
Browse files Browse the repository at this point in the history
…g node (chalasr)

This PR was merged into the 4.1-dev branch.

Discussion
----------

[SecurityBundle] Deprecate switch_user.stateless config node

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | symfony/symfony-docs#8447

unused since 4.0.

Commits
-------

5781b8f [SecurityBundle] Deprecate switch_user.stateless config node
  • Loading branch information
fabpot committed Feb 28, 2018
2 parents a5f58f2 + 5781b8f commit 4c98001
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions UPGRADE-4.1.md
Expand Up @@ -70,6 +70,7 @@ SecurityBundle
--------------

* The `logout_on_user_change` firewall option is deprecated.
* The `switch_user.stateless` firewall option is deprecated, use the `stateless` option instead.
* The `SecurityUserValueResolver` class is deprecated, use
`Symfony\Component\Security\Http\Controller\UserValueResolver` instead.

Expand Down
1 change: 1 addition & 0 deletions UPGRADE-5.0.md
Expand Up @@ -65,6 +65,7 @@ SecurityBundle
--------------

* The `logout_on_user_change` firewall option has been removed.
* The `switch_user.stateless` firewall option has been removed.
* The `SecurityUserValueResolver` class has been removed.

Translation
Expand Down
Expand Up @@ -249,7 +249,10 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
->scalarNode('provider')->end()
->scalarNode('parameter')->defaultValue('_switch_user')->end()
->scalarNode('role')->defaultValue('ROLE_ALLOWED_TO_SWITCH')->end()
->booleanNode('stateless')->defaultValue(false)->end()
->booleanNode('stateless')
->setDeprecated('The "%path%.%node%" configuration key has been deprecated in Symfony 4.1.')
->defaultValue(false)
->end()
->end()
->end()
;
Expand Down
Expand Up @@ -111,7 +111,7 @@ public function testFirewalls()
array(
'parameter' => '_switch_user',
'role' => 'ROLE_ALLOWED_TO_SWITCH',
'stateless' => true,
'stateless' => false,
),
),
array(
Expand Down
Expand Up @@ -66,7 +66,7 @@
'http_basic' => true,
'form_login' => true,
'anonymous' => true,
'switch_user' => array('stateless' => true),
'switch_user' => true,
'x509' => true,
'remote_user' => true,
'logout' => true,
Expand Down
Expand Up @@ -17,7 +17,7 @@
'http_basic' => true,
'form_login' => true,
'anonymous' => true,
'switch_user' => array('stateless' => true),
'switch_user' => true,
'x509' => true,
'remote_user' => true,
'logout' => true,
Expand Down
Expand Up @@ -49,7 +49,7 @@
<http-basic />
<form-login />
<anonymous />
<switch-user stateless="true" />
<switch-user />
<x509 />
<remote-user />
<user-checker />
Expand Down
Expand Up @@ -17,7 +17,7 @@
<http-basic />
<form-login />
<anonymous />
<switch-user stateless="true" />
<switch-user />
<x509 />
<remote-user />
<user-checker />
Expand Down
Expand Up @@ -49,7 +49,6 @@ security:
form_login: true
anonymous: true
switch_user:
stateless: true
x509: true
remote_user: true
logout: true
Expand Down
Expand Up @@ -12,8 +12,7 @@ security:
http_basic: true
form_login: true
anonymous: true
switch_user:
stateless: true
switch_user: true
x509: true
remote_user: true
logout: true
Expand Down
Expand Up @@ -132,7 +132,7 @@ public function testSwitchUserNotStatelessOnStatelessFirewall()
'some_firewall' => array(
'stateless' => true,
'http_basic' => null,
'switch_user' => array('stateless' => false),
'switch_user' => true,
),
),
));
Expand Down
Expand Up @@ -9,6 +9,6 @@ security:
user_can_switch: { password: test, roles: [ROLE_USER, ROLE_ALLOWED_TO_SWITCH] }
firewalls:
main:
stateless: true
switch_user:
parameter: X-Switch-User
stateless: true

0 comments on commit 4c98001

Please sign in to comment.