Skip to content

Commit f792232

Browse files
committed
Merge branch '2.7' into 2.8
Conflicts: reference/configuration/security.rst
2 parents 2d31a0f + f355248 commit f792232

File tree

8 files changed

+42
-22
lines changed

8 files changed

+42
-22
lines changed

book/forms.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,7 @@ The CSRF token can be customized on a form-by-form basis. For example::
18121812
'csrf_protection' => true,
18131813
'csrf_field_name' => '_token',
18141814
// a unique key to help generate the secret token
1815-
'intention' => 'task_item',
1815+
'csrf_token_id' => 'task_item',
18161816
));
18171817
}
18181818

@@ -1828,8 +1828,12 @@ section.
18281828

18291829
.. note::
18301830

1831-
The ``intention`` option is optional but greatly enhances the security of
1832-
the generated token by making it different for each form.
1831+
The ``csrf_token_id`` option is optional but greatly enhances the security
1832+
of the generated token by making it different for each form.
1833+
1834+
.. versionadded:: 2.4
1835+
The ``csrf_token_id`` option was introduced in Symfony 2.4. Prior, you
1836+
had to use the ``intention`` option.
18331837

18341838
.. caution::
18351839

components/expression_language/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Expression Language
2-
===================
1+
ExpressionLanguage
2+
==================
33

44
.. toctree::
55
:maxdepth: 2

cookbook/configuration/override_dir_structure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Override the ``cache`` Directory
3030
--------------------------------
3131

3232
You can change the default cache directory by overriding the ``getCacheDir`` method
33-
in the ``AppKernel`` class of you application::
33+
in the ``AppKernel`` class of your application::
3434

3535
// app/AppKernel.php
3636

cookbook/form/form_customization.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,8 @@ will be able to change the widget for each task as follows:
774774

775775
{% block _tasks_entry_widget %}
776776
<tr>
777-
<td>{{ form_widget(task.task) }}</td>
778-
<td>{{ form_widget(task.dueDate) }}</td>
777+
<td>{{ form_widget(form.task) }}</td>
778+
<td>{{ form_widget(form.dueDate) }}</td>
779779
</tr>
780780
{% endblock %}
781781

cookbook/profiler/data_collector.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ block and set the value of two variables called ``icon`` and ``text``:
160160
{% endset %}
161161

162162
{# the 'link' value set to 'false' means that this panel doesn't
163-
show a section in the web profiler (default is 'true'). #}
163+
show a section in the web profiler #}
164164
{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: false }) }}
165165
{% endblock %}
166166

@@ -203,7 +203,7 @@ must also define additional blocks:
203203
</div>
204204
{% endset %}
205205

206-
{{ include('@WebProfiler/Profiler/toolbar_item.html.twig') }}
206+
{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { 'link': true }) }}
207207
{% endblock %}
208208

209209
{% block head %}

cookbook/security/acl_advanced.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ Security Identities
4545
This is analog to the object identity, but represents a user, or a role in
4646
your application. Each role, or user has its own security identity.
4747

48+
.. caution::
49+
50+
For users, the security identity is based on the username. This means that,
51+
if for any reason, a user's username was to change, you must ensure its
52+
security identity is updated too. The
53+
:method:`MutableAclProvider::updateUserSecurityIdentity() <Symfony\\Component\\Security\\Acl\\Dbal\\MutableAclProvider::updateUserSecurityIdentity>`
54+
method is there to handle the update.
55+
4856
Database Table Structure
4957
------------------------
5058

cookbook/security/csrf_in_login_form.rst

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ provider available in the Security component:
3333
# ...
3434
form_login:
3535
# ...
36-
csrf_provider: security.csrf.token_manager
36+
csrf_token_generator: security.csrf.token_manager
3737
3838
.. code-block:: xml
3939
@@ -50,7 +50,7 @@ provider available in the Security component:
5050
5151
<firewall name="secured_area">
5252
<!-- ... -->
53-
<form-login csrf-provider="security.csrf.token_manager" />
53+
<form-login csrf-token-generator="security.csrf.token_manager" />
5454
</firewall>
5555
</config>
5656
</srv:container>
@@ -66,12 +66,16 @@ provider available in the Security component:
6666
// ...
6767
'form_login' => array(
6868
// ...
69-
'csrf_provider' => 'security.csrf.token_manager',
69+
'csrf_token_generator' => 'security.csrf.token_manager',
7070
),
7171
),
7272
),
7373
));
7474
75+
.. versionadded:: 2.4
76+
The ``csrf_token_generator`` option was introduced in Symfony 2.4. Prior,
77+
you had to use the ``csrf_provider`` option.
78+
7579
The Security component can be configured further, but this is all information
7680
it needs to be able to use CSRF in the login form.
7781

@@ -124,7 +128,7 @@ After this, you have protected your login form against CSRF attacks.
124128
.. tip::
125129

126130
You can change the name of the field by setting ``csrf_parameter`` and change
127-
the token ID by setting ``intention`` in your configuration:
131+
the token ID by setting ``csrf_token_id`` in your configuration:
128132

129133
.. configuration-block::
130134

@@ -140,7 +144,7 @@ After this, you have protected your login form against CSRF attacks.
140144
form_login:
141145
# ...
142146
csrf_parameter: _csrf_security_token
143-
intention: a_private_string
147+
csrf_token_id: a_private_string
144148
145149
.. code-block:: xml
146150
@@ -158,7 +162,7 @@ After this, you have protected your login form against CSRF attacks.
158162
<firewall name="secured_area">
159163
<!-- ... -->
160164
<form-login csrf-parameter="_csrf_security_token"
161-
intention="a_private_string"
165+
csrf-token-id="a_private_string"
162166
/>
163167
</firewall>
164168
</config>
@@ -176,11 +180,15 @@ After this, you have protected your login form against CSRF attacks.
176180
'form_login' => array(
177181
// ...
178182
'csrf_parameter' => '_csrf_security_token',
179-
'intention' => 'a_private_string',
183+
'csrf_token_id' => 'a_private_string'
180184
),
181185
),
182186
),
183187
));
184188
189+
.. versionadded:: 2.4
190+
The ``csrf_token_id`` option was introduced in Symfony 2.4. Prior, you
191+
had to use the ``intention`` option.
192+
185193
.. _`Cross-site request forgery`: https://en.wikipedia.org/wiki/Cross-site_request_forgery
186194
.. _`Forging Login Requests`: https://en.wikipedia.org/wiki/Cross-site_request_forgery#Forging_login_requests

reference/configuration/security.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ Each part will be explained in the next section.
161161
password_parameter: _password
162162
163163
# csrf token options
164-
csrf_parameter: _csrf_token
165-
intention: authenticate
166-
csrf_provider: my.csrf_provider.id
164+
csrf_parameter: _csrf_token
165+
csrf_token_id: authenticate
166+
csrf_token_generator: my.csrf_token_generator.id
167167
168168
# by default, the login form *must* be a POST, not a GET
169169
post_only: true
@@ -209,8 +209,8 @@ Each part will be explained in the next section.
209209
context: ~
210210
logout:
211211
csrf_parameter: _csrf_token
212-
csrf_provider: ~
213-
intention: logout
212+
csrf_token_generator: ~
213+
csrf_token_id: logout
214214
path: /logout
215215
target: /
216216
success_handler: ~

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy