Skip to content

Commit 40d8af1

Browse files
committed
minor #14096 Fix inconsistent security docs (norkunas)
This PR was merged into the 5.1 branch. Discussion ---------- Fix inconsistent security docs According to the https://symfony.com/doc/current/security.html#a-authentication-firewalls since version 5.1 `anonymous: lazy` configuration was replaced with `anonymous: true; lazy: true`. I've replaced those old occurences to the new format. Commits ------- 0025c06 Fix inconsistent security docs
2 parents 9398863 + 0025c06 commit 40d8af1

File tree

4 files changed

+30
-24
lines changed

4 files changed

+30
-24
lines changed

security/form_login.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ First, enable ``form_login`` under your firewall:
2828
2929
firewalls:
3030
main:
31-
anonymous: lazy
31+
anonymous: true
32+
lazy: true
3233
form_login:
3334
login_path: login
3435
check_path: login
@@ -46,8 +47,7 @@ First, enable ``form_login`` under your firewall:
4647
https://symfony.com/schema/dic/security/security-1.0.xsd">
4748
4849
<config>
49-
<firewall name="main">
50-
<anonymous lazy="true"/>
50+
<firewall name="main" anonymous="true" lazy="true">
5151
<form-login login-path="login" check-path="login"/>
5252
</firewall>
5353
</config>
@@ -59,7 +59,8 @@ First, enable ``form_login`` under your firewall:
5959
$container->loadFromExtension('security', [
6060
'firewalls' => [
6161
'main' => [
62-
'anonymous' => 'lazy',
62+
'anonymous' => true,
63+
'lazy' => true,
6364
'form_login' => [
6465
'login_path' => 'login',
6566
'check_path' => 'login',

security/guard_authentication.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ Finally, configure your ``firewalls`` key in ``security.yaml`` to use this authe
189189
# ...
190190
191191
main:
192-
anonymous: lazy
192+
anonymous: true
193+
lazy: true
193194
logout: ~
194195
195196
guard:
@@ -217,8 +218,7 @@ Finally, configure your ``firewalls`` key in ``security.yaml`` to use this authe
217218
218219
<!-- if you want, disable storing the user in the session
219220
add 'stateless="true"' to the firewall -->
220-
<firewall name="main" pattern="^/">
221-
<anonymous lazy="true"/>
221+
<firewall name="main" pattern="^/" anonymous="true" lazy="true">
222222
<logout/>
223223
224224
<guard>
@@ -241,7 +241,8 @@ Finally, configure your ``firewalls`` key in ``security.yaml`` to use this authe
241241
'firewalls' => [
242242
'main' => [
243243
'pattern' => '^/',
244-
'anonymous' => 'lazy',
244+
'anonymous' => true,
245+
'lazy' => true,
245246
'logout' => true,
246247
'guard' => [
247248
'authenticators' => [

security/json_login_setup.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ First, enable the JSON login under your firewall:
1717
1818
firewalls:
1919
main:
20-
anonymous: lazy
20+
anonymous: true
21+
lazy: true
2122
json_login:
2223
check_path: /login
2324
@@ -34,8 +35,7 @@ First, enable the JSON login under your firewall:
3435
https://symfony.com/schema/dic/security/security-1.0.xsd">
3536
3637
<config>
37-
<firewall name="main">
38-
<anonymous lazy="true"/>
38+
<firewall name="main" anonymous="true" lazy="true">
3939
<json-login check-path="/login"/>
4040
</firewall>
4141
</config>
@@ -47,7 +47,8 @@ First, enable the JSON login under your firewall:
4747
$container->loadFromExtension('security', [
4848
'firewalls' => [
4949
'main' => [
50-
'anonymous' => 'lazy',
50+
'anonymous' => true,
51+
'lazy' => true,
5152
'json_login' => [
5253
'check_path' => '/login',
5354
],
@@ -165,7 +166,8 @@ The security configuration should be:
165166
166167
firewalls:
167168
main:
168-
anonymous: lazy
169+
anonymous: true
170+
lazy: true
169171
json_login:
170172
check_path: login
171173
username_path: security.credentials.login
@@ -184,8 +186,7 @@ The security configuration should be:
184186
https://symfony.com/schema/dic/security/security-1.0.xsd">
185187
186188
<config>
187-
<firewall name="main">
188-
<anonymous lazy="true"/>
189+
<firewall name="main" anonymous="true" lazy="true">
189190
<json-login check-path="login"
190191
username-path="security.credentials.login"
191192
password-path="security.credentials.password"/>
@@ -199,7 +200,8 @@ The security configuration should be:
199200
$container->loadFromExtension('security', [
200201
'firewalls' => [
201202
'main' => [
202-
'anonymous' => 'lazy',
203+
'anonymous' => true,
204+
'lazy' => true,
203205
'json_login' => [
204206
'check_path' => 'login',
205207
'username_path' => 'security.credentials.login',

security/multiple_guard_authenticators.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ This is how your security configuration can look in action:
2727
# ...
2828
firewalls:
2929
default:
30-
anonymous: lazy
30+
anonymous: true
31+
lazy: true
3132
guard:
3233
authenticators:
3334
- App\Security\LoginFormAuthenticator
@@ -48,8 +49,7 @@ This is how your security configuration can look in action:
4849
4950
<config>
5051
<!-- ... -->
51-
<firewall name="default">
52-
<anonymous lazy="true"/>
52+
<firewall name="default" anonymous="true" lazy="true">
5353
<guard entry-point="App\Security\LoginFormAuthenticator">
5454
<authenticator>App\Security\LoginFormAuthenticator</authenticator>
5555
<authenticator>App\Security\FacebookConnectAuthenticator</authenticator>
@@ -68,7 +68,8 @@ This is how your security configuration can look in action:
6868
// ...
6969
'firewalls' => [
7070
'default' => [
71-
'anonymous' => 'lazy',
71+
'anonymous' => true,
72+
'lazy' => true,
7273
'guard' => [
7374
'entry_point' => LoginFormAuthenticator::class,
7475
'authenticators' => [
@@ -105,7 +106,8 @@ the solution is to split the configuration into two separate firewalls:
105106
authenticators:
106107
- App\Security\ApiTokenAuthenticator
107108
default:
108-
anonymous: lazy
109+
anonymous: true
110+
lazy: true
109111
guard:
110112
authenticators:
111113
- App\Security\LoginFormAuthenticator
@@ -133,8 +135,7 @@ the solution is to split the configuration into two separate firewalls:
133135
<authenticator>App\Security\ApiTokenAuthenticator</authenticator>
134136
</guard>
135137
</firewall>
136-
<firewall name="default">
137-
<anonymous lazy="true"/>
138+
<firewall name="default" anonymous="true" lazy="true">
138139
<guard>
139140
<authenticator>App\Security\LoginFormAuthenticator</authenticator>
140141
</guard>
@@ -163,7 +164,8 @@ the solution is to split the configuration into two separate firewalls:
163164
],
164165
],
165166
'default' => [
166-
'anonymous' => 'lazy',
167+
'anonymous' => true,
168+
'lazy' => true,
167169
'guard' => [
168170
'authenticators' => [
169171
LoginFormAuthenticator::class,

0 commit comments

Comments
 (0)