This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Bundle
Fabien Potencier e84bd65e91 feature #33663 [Security] Make stateful firewalls turn responses private only when needed (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Make stateful firewalls turn responses private only when needed

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26769 *et al.*
| License       | MIT
| Doc PR        | -

Replaces #28089

By taking over session usage tracking and replacing it with token usage tracking, we can prevent responses that don't actually use the token from turning responses private without changing anything to the lifecycle of security listeners. This makes the behavior much more seamless, allowing to still log the user with the monolog processor, and display it in the profiler toolbar.

This works by using two separate token storage services:
- `security.token_storage` now tracks access to the token and increments the session usage tracker when needed. This is the service that is injected in userland.
- `security.untracked_token_storage` is a raw token storage that just stores the token and is disconnected from the session. This service is injected in places where reading the session doesn't impact the generated output in any way (as e.g. in Monolog processors, etc.)

Commits
-------

20df3a125c [Security] Make stateful firewalls turn responses private only when needed
2019-09-24 17:09:00 +02:00
..
DebugBundle Adding .gitattributes to remove Tests directory from "dist" 2019-09-16 10:12:51 +02:00
FrameworkBundle Allow Twig 3 2019-09-23 16:04:59 +02:00
SecurityBundle feature #33663 [Security] Make stateful firewalls turn responses private only when needed (nicolas-grekas) 2019-09-24 17:09:00 +02:00
TwigBundle [TwigBundle] typo 2019-09-23 16:56:34 +02:00
WebProfilerBundle Revert \"feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)\" 2019-09-23 17:45:34 +02:00
WebServerBundle Adding .gitattributes to remove Tests directory from "dist" 2019-09-16 10:12:51 +02:00
FullStack.php [FrameworkBundle] changed some default configs from canBeEnabled to canBeDisabled 2017-01-07 14:17:04 -08:00