Skip to content

Commit 9c4b9fe

Browse files
committed
(WIP) Updated security/* articles to Symfony 4
1 parent 8e9dc96 commit 9c4b9fe

21 files changed

+58
-58
lines changed

security/access_control.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Take the following ``access_control`` entries as an example:
3333

3434
.. code-block:: yaml
3535
36-
# app/config/security.yml
36+
# config/packages/security.yaml
3737
security:
3838
# ...
3939
access_control:
@@ -171,7 +171,7 @@ pattern so that it is only accessible by requests from the local server itself:
171171

172172
.. code-block:: yaml
173173
174-
# app/config/security.yml
174+
# config/packages/security.yaml
175175
security:
176176
# ...
177177
access_control:
@@ -252,7 +252,7 @@ key:
252252

253253
.. code-block:: yaml
254254
255-
# app/config/security.yml
255+
# config/packages/security.yaml
256256
security:
257257
# ...
258258
access_control:
@@ -300,7 +300,7 @@ the user will be redirected to ``https``:
300300

301301
.. code-block:: yaml
302302
303-
# app/config/security.yml
303+
# config/packages/security.yaml
304304
security:
305305
# ...
306306
access_control:

security/access_denied_handler.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ configure it under your firewall:
3838

3939
.. code-block:: yaml
4040
41-
# app/config/security.yml
41+
# config/packages/security.yaml
4242
firewalls:
4343
# ...
4444

security/api_key_authentication.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ and ``provider`` keys:
292292

293293
.. code-block:: yaml
294294
295-
# app/config/security.yml
295+
# config/packages/security.yaml
296296
security:
297297
# ...
298298
@@ -364,7 +364,7 @@ If you have defined ``access_control``, make sure to add a new entry:
364364

365365
.. code-block:: yaml
366366
367-
# app/config/security.yml
367+
# config/packages/security.yaml
368368
security:
369369
# ...
370370
@@ -423,7 +423,7 @@ configuration or set it to ``false``:
423423

424424
.. code-block:: yaml
425425
426-
# app/config/security.yml
426+
# config/packages/security.yaml
427427
security:
428428
# ...
429429

security/csrf_in_login_form.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ use the default provider available in the security component:
5959

6060
.. code-block:: yaml
6161
62-
# app/config/security.yml
62+
# config/packages/security.yaml
6363
security:
6464
# ...
6565
@@ -171,7 +171,7 @@ After this, you have protected your login form against CSRF attacks.
171171

172172
.. code-block:: yaml
173173
174-
# app/config/security.yml
174+
# config/packages/security.yaml
175175
security:
176176
# ...
177177

security/custom_password_authenticator.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ using the ``simple_form`` key:
153153

154154
.. code-block:: yaml
155155
156-
# app/config/security.yml
156+
# config/packages/security.yaml
157157
security:
158158
# ...
159159

security/custom_provider.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ When a user submits a username and password, the authentication layer asks
99
the configured user provider to return a user object for a given username.
1010
Symfony then checks whether the password of this user is correct and generates
1111
a security token so the user stays authenticated during the current session.
12-
Out of the box, Symfony has four user providers: ``memory``, ``entity``,
12+
Out of the box, Symfony has four user providers: ``memory``, ``entity``,
1313
``ldap`` and ``chain``. In this entry you'll see how you can create your
1414
own user provider, which could be useful if your users are accessed via a
1515
custom database, a file, or - as shown in this example - a web service.
@@ -185,7 +185,7 @@ to the list of providers in the "security" section. Choose a name for the user p
185185

186186
.. code-block:: yaml
187187
188-
# app/config/security.yml
188+
# config/packages/security.yaml
189189
security:
190190
# ...
191191
@@ -233,7 +233,7 @@ users, e.g. by filling in a login form. You can do this by adding a line to the
233233

234234
.. code-block:: yaml
235235
236-
# app/config/security.yml
236+
# config/packages/security.yaml
237237
security:
238238
# ...
239239
@@ -301,7 +301,7 @@ is compared to the hashed password returned by your ``getPassword()`` method.
301301

302302
.. code-block:: yaml
303303
304-
# app/config/security.yml
304+
# config/packages/security.yaml
305305
security:
306306
# ...
307307

security/firewall_restriction.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ How to Restrict Firewalls to a Specific Request
55
===============================================
66

77
When using the Security component, you can create firewalls that match certain request options.
8-
In most cases, matching against the URL is sufficient, but in special cases you can further
8+
In most cases, matching against the URL is sufficient, but in special cases you can further
99
restrict the initialization of a firewall against other options of the request.
1010

1111
.. note::
1212

13-
You can use any of these restrictions individually or mix them together to get
14-
your desired firewall configuration.
13+
You can use any of these restrictions individually or mix them together to get
14+
your desired firewall configuration.
1515

1616
Restricting by Pattern
1717
----------------------
1818

19-
This is the default restriction and restricts a firewall to only be initialized if the request URL
20-
matches the configured ``pattern``.
19+
This is the default restriction and restricts a firewall to only be initialized if the request URL
20+
matches the configured ``pattern``.
2121

2222
.. configuration-block::
2323

2424
.. code-block:: yaml
2525
26-
# app/config/security.yml
26+
# config/packages/security.yaml
2727
2828
# ...
2929
security:
@@ -64,23 +64,23 @@ matches the configured ``pattern``.
6464
),
6565
));
6666
67-
The ``pattern`` is a regular expression. In this example, the firewall will only be
67+
The ``pattern`` is a regular expression. In this example, the firewall will only be
6868
activated if the URL starts (due to the ``^`` regex character) with ``/admin``. If
69-
the URL does not match this pattern, the firewall will not be activated and subsequent
69+
the URL does not match this pattern, the firewall will not be activated and subsequent
7070
firewalls will have the opportunity to be matched for this request.
7171

7272
Restricting by Host
7373
-------------------
7474

75-
If matching against the ``pattern`` only is not enough, the request can also be matched against
76-
``host``. When the configuration option ``host`` is set, the firewall will be restricted to
75+
If matching against the ``pattern`` only is not enough, the request can also be matched against
76+
``host``. When the configuration option ``host`` is set, the firewall will be restricted to
7777
only initialize if the host from the request matches against the configuration.
7878

7979
.. configuration-block::
8080

8181
.. code-block:: yaml
8282
83-
# app/config/security.yml
83+
# config/packages/security.yaml
8484
8585
# ...
8686
security:
@@ -138,7 +138,7 @@ the provided HTTP methods.
138138

139139
.. code-block:: yaml
140140
141-
# app/config/security.yml
141+
# config/packages/security.yaml
142142
143143
# ...
144144
security:

security/force_https.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ to use HTTPS then you could use the following configuration:
1313

1414
.. code-block:: yaml
1515
16-
# app/config/security.yml
16+
# config/packages/security.yaml
1717
security:
1818
# ...
1919
@@ -61,7 +61,7 @@ role:
6161

6262
.. code-block:: yaml
6363
64-
# app/config/security.yml
64+
# config/packages/security.yaml
6565
security:
6666
# ...
6767

security/form_login.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ a relative/absolute URL or a Symfony route name:
4242

4343
.. code-block:: yaml
4444
45-
# app/config/security.yml
45+
# config/packages/security.yaml
4646
security:
4747
# ...
4848
@@ -99,7 +99,7 @@ previously requested URL and always redirect to the default page:
9999

100100
.. code-block:: yaml
101101
102-
# app/config/security.yml
102+
# config/packages/security.yaml
103103
security:
104104
# ...
105105
@@ -198,7 +198,7 @@ parameter is included in the request, you may use the value of the
198198

199199
.. code-block:: yaml
200200
201-
# app/config/security.yml
201+
# config/packages/security.yaml
202202
security:
203203
# ...
204204
@@ -264,7 +264,7 @@ option to define a new target via a relative/absolute URL or a Symfony route nam
264264

265265
.. code-block:: yaml
266266
267-
# app/config/security.yml
267+
# config/packages/security.yaml
268268
security:
269269
# ...
270270
@@ -351,7 +351,7 @@ redirects can be customized using the ``target_path_parameter`` and
351351

352352
.. code-block:: yaml
353353
354-
# app/config/security.yml
354+
# config/packages/security.yaml
355355
security:
356356
# ...
357357

security/form_login_setup.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ First, enable form login under your firewall:
1818

1919
.. code-block:: yaml
2020
21-
# app/config/security.yml
21+
# config/packages/security.yaml
2222
security:
2323
# ...
2424
@@ -300,7 +300,7 @@ all URLs (including the ``/login`` URL), will cause a redirect loop:
300300

301301
.. code-block:: yaml
302302
303-
# app/config/security.yml
303+
# config/packages/security.yaml
304304
305305
# ...
306306
access_control:
@@ -338,7 +338,7 @@ fixes the problem:
338338

339339
.. code-block:: yaml
340340
341-
# app/config/security.yml
341+
# config/packages/security.yaml
342342
343343
# ...
344344
access_control:

security/guard_authentication.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Finally, configure your ``firewalls`` key in ``security.yml`` to use this authen
260260

261261
.. code-block:: yaml
262262
263-
# app/config/security.yml
263+
# config/packages/security.yaml
264264
security:
265265
# ...
266266

security/impersonating_user.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ firewall listener:
2323

2424
.. code-block:: yaml
2525
26-
# app/config/security.yml
26+
# config/packages/security.yaml
2727
security:
2828
# ...
2929
@@ -129,7 +129,7 @@ setting:
129129

130130
.. code-block:: yaml
131131
132-
# app/config/security.yml
132+
# config/packages/security.yaml
133133
security:
134134
# ...
135135

security/json_login_setup.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ First, enable the JSON login under your firewall:
1111

1212
.. code-block:: yaml
1313
14-
# app/config/security.yml
14+
# config/packages/security.yaml
1515
security:
1616
# ...
1717
@@ -151,7 +151,7 @@ The security configuration should be:
151151

152152
.. code-block:: yaml
153153
154-
# app/config/security.yml
154+
# config/packages/security.yaml
155155
security:
156156
# ...
157157

security/ldap.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ use the ``ldap`` user provider.
127127

128128
.. code-block:: yaml
129129
130-
# app/config/security.yml
130+
# config/packages/security.yaml
131131
security:
132132
# ...
133133
@@ -326,7 +326,7 @@ Configuration example for form login
326326

327327
.. code-block:: yaml
328328
329-
# app/config/security.yml
329+
# config/packages/security.yaml
330330
security:
331331
# ...
332332
@@ -380,7 +380,7 @@ Configuration example for HTTP Basic
380380

381381
.. code-block:: yaml
382382
383-
# app/config/security.yml
383+
# config/packages/security.yaml
384384
security:
385385
# ...
386386
@@ -433,7 +433,7 @@ Configuration example for form login and query_string
433433

434434
.. code-block:: yaml
435435
436-
# app/config/security.yml
436+
# config/packages/security.yaml
437437
security:
438438
# ...
439439

security/multiple_guard_authenticators.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This is how your security configuration can look in action:
2222

2323
.. code-block:: yaml
2424
25-
# app/config/security.yml
25+
# config/packages/security.yaml
2626
security:
2727
# ...
2828
firewalls:
@@ -93,7 +93,7 @@ the solution is to split the configuration into two separate firewalls:
9393

9494
.. code-block:: yaml
9595
96-
# app/config/security.yml
96+
# config/packages/security.yaml
9797
security:
9898
# ...
9999
firewalls:

0 commit comments

Comments
 (0)