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

Skip to content

Commit 425aa8f

Browse files
author
Daniel Tschinder
committed
Fix spacing, wording and style
1 parent 2081fc4 commit 425aa8f

File tree

3 files changed

+18
-25
lines changed

3 files changed

+18
-25
lines changed

book/security.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,10 @@ firewall is activated does *not* mean, however, that the HTTP authentication
181181
username and password box is displayed for every URL. For example, any user
182182
can access ``/foo`` without being prompted to authenticate.
183183

184-
.. note::
184+
.. tip::
185185

186-
You can also match a request against other options of the request and
187-
not only the URL. For more information and examples read
188-
:doc:`/cookbook/security/firewall_restriction`.
186+
You can also match a request against other options of the request. For more
187+
information and examples read :doc:`/cookbook/security/firewall_restriction`.
189188

190189
.. image:: /images/book/security_anonymous_user_access.png
191190
:align: center

cookbook/security/firewall_restriction.rst

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ 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
9-
restrict the initialization of a firewall against other options from the request.
8+
In most cases, matching against the URL is sufficient, but in special cases you can further
9+
restrict the initialization of a firewall against other options of the request.
1010

1111
.. note::
1212

1313
You can use any of this restrictions individually or mix them together to get
1414
your desired firewall configuration.
1515

16-
Restricting by pattern
16+
Restricting by Pattern
1717
----------------------
1818

1919
This is the default restriction and restricts a firewall to only be initialized if the request URL
@@ -26,11 +26,10 @@ matches the configured ``pattern``.
2626
# app/config/security.yml
2727
2828
# ...
29-
3029
security:
3130
firewalls:
3231
secured_area:
33-
pattern: ^/admin
32+
pattern: ^/admin
3433
# ...
3534
3635
.. code-block:: xml
@@ -56,11 +55,10 @@ matches the configured ``pattern``.
5655
// app/config/security.php
5756
5857
// ...
59-
6058
$container->loadFromExtension('security', array(
6159
'firewalls' => array(
6260
'secured_area' => array(
63-
'pattern' => '^/admin',
61+
'pattern' => '^/admin',
6462
// ...
6563
),
6664
),
@@ -71,16 +69,16 @@ activated if the URL starts (due to the ``^`` regex character) with ``/admin`. I
7169
the URL does not match this pattern, the firewall will not be activated and subsequent
7270
firewalls will have the opportunity to be matched for this request.
7371
74-
Restricting by host
72+
Restricting by Host
7573
-------------------
7674
7775
.. versionadded:: 2.4
7876
Support for restricting security firewalls to a specific host was introduced in
7977
Symfony 2.4.
8078
81-
If matching against the pattern only is not enough, the request can also be matched against
82-
``host``. When the configuration option ``host`` is set the firewall will be restricted to
83-
only initialize if the host from the request matches against the configuration option.
79+
If matching against the ``pattern`` only is not enough, the request can also be matched against
80+
``host``. When the configuration option ``host`` is set, the firewall will be restricted to
81+
only initialize if the host from the request matches against the configuration.
8482

8583
.. configuration-block::
8684

@@ -89,11 +87,10 @@ only initialize if the host from the request matches against the configuration o
8987
# app/config/security.yml
9088
9189
# ...
92-
9390
security:
9491
firewalls:
9592
secured_area:
96-
host: ^admin\.example\.com$
93+
host: ^admin\.example\.com$
9794
# ...
9895
9996
.. code-block:: xml
@@ -119,11 +116,10 @@ only initialize if the host from the request matches against the configuration o
119116
// app/config/security.php
120117
121118
// ...
122-
123119
$container->loadFromExtension('security', array(
124120
'firewalls' => array(
125121
'secured_area' => array(
126-
'host' => '^admin\.example\.com$',
122+
'host' => '^admin\.example\.com$',
127123
// ...
128124
),
129125
),
@@ -136,7 +132,7 @@ If the hostname does not match this pattern, the firewall will not be activated
136132
and subsequent firewalls will have the opportunity to be matched for this
137133
request.
138134

139-
Restricting by http methods
135+
Restricting by Http Methods
140136
---------------------------
141137

142138
.. versionadded:: 2.5
@@ -153,11 +149,10 @@ the provided http methods.
153149
# app/config/security.yml
154150
155151
# ...
156-
157152
security:
158153
firewalls:
159154
secured_area:
160-
methods: [GET, POST]
155+
methods: [GET, POST]
161156
# ...
162157
163158
.. code-block:: xml
@@ -183,11 +178,10 @@ the provided http methods.
183178
// app/config/security.php
184179
185180
// ...
186-
187181
$container->loadFromExtension('security', array(
188182
'firewalls' => array(
189183
'secured_area' => array(
190-
'methods' => array('GET', 'POST'),
184+
'methods' => array('GET', 'POST'),
191185
// ...
192186
),
193187
),

reference/configuration/security.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Each part will be explained in the next section.
109109
# restrict the firewall to a specific host
110110
host: admin\.example\.com
111111
# restrict the firewall to specific http methods
112-
methods: [GET,POST]
112+
methods: [GET, POST]
113113
request_matcher: some.service.id
114114
access_denied_url: /foo/error403
115115
access_denied_handler: some.service.id

0 commit comments

Comments
 (0)