Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5781b8f

Browse files
committed
[SecurityBundle] Deprecate switch_user.stateless config node
1 parent 308e12c commit 5781b8f

File tree

12 files changed

+14
-11
lines changed

12 files changed

+14
-11
lines changed

UPGRADE-4.1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ SecurityBundle
7070
--------------
7171

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

UPGRADE-5.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ SecurityBundle
6565
--------------
6666

6767
* The `logout_on_user_change` firewall option has been removed.
68+
* The `switch_user.stateless` firewall option has been removed.
6869
* The `SecurityUserValueResolver` class has been removed.
6970

7071
Translation

src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,10 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
249249
->scalarNode('provider')->end()
250250
->scalarNode('parameter')->defaultValue('_switch_user')->end()
251251
->scalarNode('role')->defaultValue('ROLE_ALLOWED_TO_SWITCH')->end()
252-
->booleanNode('stateless')->defaultValue(false)->end()
252+
->booleanNode('stateless')
253+
->setDeprecated('The "%path%.%node%" configuration key has been deprecated in Symfony 4.1.')
254+
->defaultValue(false)
255+
->end()
253256
->end()
254257
->end()
255258
;

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function testFirewalls()
111111
array(
112112
'parameter' => '_switch_user',
113113
'role' => 'ROLE_ALLOWED_TO_SWITCH',
114-
'stateless' => true,
114+
'stateless' => false,
115115
),
116116
),
117117
array(

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
'http_basic' => true,
6767
'form_login' => true,
6868
'anonymous' => true,
69-
'switch_user' => array('stateless' => true),
69+
'switch_user' => true,
7070
'x509' => true,
7171
'remote_user' => true,
7272
'logout' => true,

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/no_custom_user_checker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
'http_basic' => true,
1818
'form_login' => true,
1919
'anonymous' => true,
20-
'switch_user' => array('stateless' => true),
20+
'switch_user' => true,
2121
'x509' => true,
2222
'remote_user' => true,
2323
'logout' => true,

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<http-basic />
5050
<form-login />
5151
<anonymous />
52-
<switch-user stateless="true" />
52+
<switch-user />
5353
<x509 />
5454
<remote-user />
5555
<user-checker />

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/no_custom_user_checker.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<http-basic />
1818
<form-login />
1919
<anonymous />
20-
<switch-user stateless="true" />
20+
<switch-user />
2121
<x509 />
2222
<remote-user />
2323
<user-checker />

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ security:
4949
form_login: true
5050
anonymous: true
5151
switch_user:
52-
stateless: true
5352
x509: true
5453
remote_user: true
5554
logout: true

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/no_custom_user_checker.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ security:
1212
http_basic: true
1313
form_login: true
1414
anonymous: true
15-
switch_user:
16-
stateless: true
15+
switch_user: true
1716
x509: true
1817
remote_user: true
1918
logout: true

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function testSwitchUserNotStatelessOnStatelessFirewall()
132132
'some_firewall' => array(
133133
'stateless' => true,
134134
'http_basic' => null,
135-
'switch_user' => array('stateless' => false),
135+
'switch_user' => true,
136136
),
137137
),
138138
));

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/JsonLogin/switchuser_stateless.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ security:
99
user_can_switch: { password: test, roles: [ROLE_USER, ROLE_ALLOWED_TO_SWITCH] }
1010
firewalls:
1111
main:
12+
stateless: true
1213
switch_user:
1314
parameter: X-Switch-User
14-
stateless: true

0 commit comments

Comments
 (0)