Skip to content

Commit 65da1a9

Browse files
committed
Merge branch '2.5' into 2.6
2 parents 65b0822 + 6f1bbab commit 65da1a9

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

book/routing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,8 +1021,8 @@ routing system can be:
10211021
/**
10221022
* @Route(
10231023
* "/articles/{_locale}/{year}/{title}.{_format}",
1024-
* defaults: {"_format": "html"},
1025-
* requirements: {
1024+
* defaults={"_format": "html"},
1025+
* requirements={
10261026
* "_locale": "en|fr",
10271027
* "_format": "html|rss",
10281028
* "year": "\d+"

book/security.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ But who can you login as? Where do users come from?
275275
or :doc:`build your own </cookbook/security/custom_authentication_provider>`.
276276

277277
.. _security-user-providers:
278+
.. _where-do-users-come-from-user-providers:
278279

279280
B) Configuring how Users are Loaded
280281
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -433,6 +434,7 @@ If you'd like to load your users via the Doctrine ORM, that's easy! See
433434

434435
.. _book-security-encoding-user-password:
435436
.. _c-encoding-the-users-password:
437+
.. _encoding-the-user-s-password:
436438

437439
C) Encoding the User's Password
438440
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cookbook/cache/varnish.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ Ensure Consistent Caching Behaviour
6565

6666
Varnish uses the cache headers sent by your application to determine how
6767
to cache content. However, versions prior to Varnish 4 did not respect
68-
``Cache-Control: no-cache``. To ensure consistent behaviour, use the following
69-
configuration if you are still using Varnish 3:
68+
``Cache-Control: no-cache``, ``no-store`` and ``private``. To ensure
69+
consistent behavior, use the following configuration if you are still
70+
using Varnish 3:
7071

7172
.. configuration-block::
7273

@@ -76,13 +77,19 @@ configuration if you are still using Varnish 3:
7677
/* By default, Varnish3 ignores Cache-Control: no-cache and private
7778
https://www.varnish-cache.org/docs/3.0/tutorial/increasing_your_hitrate.html#cache-control
7879
*/
79-
if (beresp.http.Cache-Control ~ "no-cache" ||
80-
beresp.http.Cache-Control ~ "private"
80+
if (beresp.http.Cache-Control ~ "private" ||
81+
beresp.http.Cache-Control ~ "no-cache" ||
82+
beresp.http.Cache-Control ~ "no-store"
8183
) {
8284
return (hit_for_pass);
8385
}
8486
}
8587
88+
.. tip::
89+
90+
You can see the default behavior of Varnish in the form of a VCL file:
91+
`default.vcl`_ for Varnish 3, `builtin.vcl`_ for Varnish 4.
92+
8693
Enable Edge Side Includes (ESI)
8794
-------------------------------
8895

@@ -143,7 +150,7 @@ Symfony adds automatically:
143150
.. tip::
144151

145152
If you followed the advice about ensuring a consistent caching
146-
behaviour, those vcl functions already exist. Just append the code
153+
behavior, those vcl functions already exist. Just append the code
147154
to the end of the function, they won't interfere with each other.
148155

149156
.. index::
@@ -172,3 +179,5 @@ proxy before it has expired, it adds complexity to your caching setup.
172179
.. _`Surrogate-Capability Header`: http://www.w3.org/TR/edge-arch
173180
.. _`cache invalidation`: http://tools.ietf.org/html/rfc2616#section-13.10
174181
.. _`FOSHttpCacheBundle`: http://foshttpcachebundle.readthedocs.org/
182+
.. _`default.vcl`: https://www.varnish-cache.org/trac/browser/bin/varnishd/default.vcl?rev=3.0
183+
.. _`builtin.vcl`: https://www.varnish-cache.org/trac/browser/bin/varnishd/builtin.vcl?rev=4.0

cookbook/security/api_key_authentication.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ value and then a User object is created::
4949

5050
if (!$apiKey) {
5151
throw new BadCredentialsException('No API key found');
52+
53+
// or to just skip api key authentication
54+
// return null;
5255
}
5356

5457
return new PreAuthenticatedToken(
@@ -100,7 +103,9 @@ is to create a token object that contains all of the information from the
100103
request that you need to authenticate the user (e.g. the ``apikey`` query
101104
parameter). If that information is missing, throwing a
102105
:class:`Symfony\\Component\\Security\\Core\\Exception\\BadCredentialsException`
103-
will cause authentication to fail.
106+
will cause authentication to fail. You might want to return ``null`` instead
107+
to just skip the authentication, so Symfony can fallback to another authentication
108+
method, if any.
104109

105110
2. supportsToken
106111
~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)