Commit Graph

44435 Commits

Author SHA1 Message Date
Nicolas Grekas
5cd1d7b4cc [Security] add "anonymous: lazy" mode to firewalls 2019-09-25 16:50:19 +02:00
Fabien Potencier
3c7172d81e feature #33584 [Security] Deprecate isGranted()/decide() on more than one attribute (wouterj)
This PR was squashed before being merged into the 4.4 branch (closes #33584).

Discussion
----------

[Security] Deprecate isGranted()/decide() on more than one attribute

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | -
| License       | MIT
| Doc PR        | tbd

While I expect it not be used much, it is currently possible to call `isGranted()` on more than one attribute:

```php
if ($this->authorizationChecker->isGranted(['ROLE_USER', 'ROLE_ADMIN'])) {
    // ...
}
```

Supporting this includes a couple of problems/questions:

- It is not clear whether this is `OR` or `AND`;
- In fact, this is left over to the voter to decide upon. So it can vary for each voter and writers of new voters need to consider this (otherwise, you get issues like https://github.com/LeaseWeb/LswSecureControllerBundle/issues/4 );
- It promotes to vote over roles instead of actions.

I think we can do better. In the past, we've created all tooling for this to be self-explaining and easier:

```php
// ExpressionLanguage component (also includes other functions, like `is_granted('EDIT')`)
if ($this->authorizationChecker->isGranted("has_role('ROLE_USER') or has_role('ROLE_ADMIN')")) {
    // ...
}

// calling it multiple times in PHP (may reduce performance)
if ($this->authorizationChecker->isGranted('ROLE_USER')
    || $this->authorizationChecker->isGranted('ROLE_ADMIN')
) {
    // ...
}

// or by using Role Hierarchy, if a user really wants to vote on roles
```

This PR deprecates passing more than one attribute to `isGranted()` and `decide()` to remove this confusing bit in Security usage.

Backwards compatiblity help
---

I need some help in how to approach changing the `VoterInterface::vote(TokenInterface $token, $subject, array $attributes)` method in a backwards compatible way. Removing `array` breaks all Voters, so does changing it to `string` and removed the parameter all together.

Commits
-------

c64b0beffb [Security] Deprecate isGranted()/decide() on more than one attribute
2019-09-24 17:21:06 +02:00
Wouter J
c64b0beffb [Security] Deprecate isGranted()/decide() on more than one attribute 2019-09-24 17:21:01 +02:00
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
Yonel Ceruto
e95d27b31a minor #33686 Fixed a minor typo in the UPGRADE to 5.0 guide (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

Fixed a minor typo in the UPGRADE to 5.0 guide

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

I tried to fix this in the 4.3 branch too ... but the `UPGRADE-5.0.md` is quite different. Should these two files be exactly the same?

* https://github.com/symfony/symfony/blob/4.3/UPGRADE-5.0.md
* https://github.com/symfony/symfony/blob/4.4/UPGRADE-5.0.md

Commits
-------

8532d62 Fixed a minor typo in the UPGRADE to 5.0 guide
2019-09-24 10:07:40 -04:00
Javier Eguiluz
8532d62c5f Fixed a minor typo in the UPGRADE to 5.0 guide 2019-09-24 15:52:36 +02:00
Nicolas Grekas
20df3a125c [Security] Make stateful firewalls turn responses private only when needed 2019-09-23 21:34:59 +02:00
Christian Flothmann
b00b633665 feature #33609 [Form][SubmitType] Add "validate" option (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[Form][SubmitType] Add "validate" option

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/8763
| License       | MIT
| Doc PR        | TODO

The second part of the ticket requires more work but is kind of unrelated.

Commits
-------

a2bc06d811 [Form][SubmitType] Add "validate" option
2019-09-23 17:54:07 +02:00
Fabien Potencier
3f96ef2b65 feature #33621 Revert "feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)" (lyrixx)
This PR was squashed before being merged into the 4.4 branch (closes #33621).

Discussion
----------

Revert "feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)"

This reverts commit 21a05de9bf, reversing
changes made to 24faadc905.

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? |
| Tickets       | Fix #33467
| License       | MIT
| Doc PR        |

Commits
-------

e767bb1b42 Revert \"feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)\"
2019-09-23 17:45:42 +02:00
Grégoire Pineau
e767bb1b42 Revert \"feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)\" 2019-09-23 17:45:34 +02:00
Nicolas Grekas
c1ab2c64c5 [TwigBundle] typo 2019-09-23 16:56:34 +02:00
Nicolas Grekas
4ca6eea758 [TwigBundle] fix test case 2019-09-23 16:55:33 +02:00
Fabien Potencier
8eaa5a86f4 minor #33649 Allow Twig 3 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

Allow Twig 3

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Needs https://github.com/twigphp/Twig/pull/3156
And https://github.com/twigphp/Twig/pull/3158

Commits
-------

09f4eb5cd8 Allow Twig 3
2019-09-23 16:39:44 +02:00
Fabien Potencier
ca108747e3 minor #33651 [Yaml] hint to the --parse-tags when parsing tags fails (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Yaml] hint to the --parse-tags when parsing tags fails

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/issues/28465#issuecomment-533182079
| License       | MIT
| Doc PR        |

Commits
-------

012111524b hint to the --parse-tags when parsing tags fails
2019-09-23 16:33:39 +02:00
Nicolas Grekas
09f4eb5cd8 Allow Twig 3 2019-09-23 16:04:59 +02:00
Yonel Ceruto
9e44f58054 minor #33660 Minor tweaks to the Welcome Page (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

Minor tweaks to the Welcome Page

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Sorry, I'm late on https://github.com/symfony/symfony/pull/33613 and https://github.com/symfony/symfony/pull/33614 but I realized 3 minor visual issues:
 * the background color of the warning message for consistency should be `$lightColor()` and imho a little bit smaller.
 * the check icon has a very wide margin in relation to the edge of the rounded box:
![check-margin-before](https://user-images.githubusercontent.com/2028198/65379790-3ee95a00-dc9c-11e9-97d6-af6c10837c6d.png) vs ![check-margin-after](https://user-images.githubusercontent.com/2028198/65379810-b1f2d080-dc9c-11e9-8167-7ebbd0f92927.png)
 * and the resources (doc links) on wide screens have a very small space between them.

I've also removed some useless css classes (footer).

| before | after |
| --- | --- |
| ![welcome-page-before](https://user-images.githubusercontent.com/2028198/65379730-e2d20600-dc9a-11e9-8a8a-10763baadfda.png) | ![welcome-page-after](https://user-images.githubusercontent.com/2028198/65379731-ecf40480-dc9a-11e9-88a1-bda59bf04814.png) |

tested on Chrome and Firefox.

Commits
-------

8484378 Minor tweaks
2019-09-23 09:57:08 -04:00
Nicolas Grekas
ba313d3d25 Merge branch '4.3' into 4.4
* 4.3:
  [travis] fix typo
  [travis] more CI fixes
2019-09-23 15:12:44 +02:00
Nicolas Grekas
8e598209a7 Merge branch '3.4' into 4.3
* 3.4:
  [travis] fix typo
  [travis] more CI fixes
2019-09-23 15:09:56 +02:00
Yonel Ceruto
84843780de Minor tweaks 2019-09-23 09:09:39 -04:00
Nicolas Grekas
d958312ef1 [travis] fix typo 2019-09-23 15:08:55 +02:00
Nicolas Grekas
2bfef232e0 minor #33673 [travis] more CI fixes (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[travis] more CI fixes

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

27b1986cc2 [travis] more CI fixes
2019-09-23 15:05:40 +02:00
Nicolas Grekas
27b1986cc2 [travis] more CI fixes 2019-09-23 15:04:01 +02:00
Nicolas Grekas
7788612c3c Merge branch '4.3' into 4.4
* 4.3:
  [travis] fix CI
2019-09-23 12:19:18 +02:00
Nicolas Grekas
be6a196f7d Merge branch '3.4' into 4.3
* 3.4:
  [travis] fix CI
2019-09-23 12:16:38 +02:00
Nicolas Grekas
87c8ad4996 minor #33665 [travis] fix CI (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[travis] fix CI

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

a0961d3b99 [travis] fix CI
2019-09-23 12:15:35 +02:00
Nicolas Grekas
a0961d3b99 [travis] fix CI 2019-09-23 12:05:30 +02:00
Fabien Potencier
be5cd6903f bug #33662 [Twig] Remove deprecated tag usage (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Twig] Remove deprecated tag usage

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

cd74cb32ef [Twig] Remove deprecated tag usage
2019-09-23 11:08:11 +02:00
Thomas Calvet
a2bc06d811 [Form][SubmitType] Add "validate" option 2019-09-23 10:33:29 +02:00
Fabien Potencier
cd74cb32ef [Twig] Remove deprecated tag usage 2019-09-22 21:45:18 +02:00
Nicolas Grekas
d4e6a37b14 minor #33657 [travis] fix testing flipped versions (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[travis] fix testing flipped versions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

68f6aef81e [travis] fix testing flipped versions
2019-09-21 10:09:02 +02:00
Nicolas Grekas
0bc6b91cf9 Merge branch '4.3' into 4.4
* 4.3:
  [travis] honor .gitattributes when building local packages
2019-09-21 10:01:39 +02:00
Nicolas Grekas
418c78c3bd Merge branch '3.4' into 4.3
* 3.4:
  [travis] honor .gitattributes when building local packages
2019-09-21 10:01:30 +02:00
Nicolas Grekas
6723e60540 minor #33656 [travis] honor .gitattributes when building local packages (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[travis] honor .gitattributes when building local packages

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

d7fbb0a4a4 [travis] honor .gitattributes when building local packages
2019-09-21 10:01:14 +02:00
Nicolas Grekas
68f6aef81e [travis] fix testing flipped versions 2019-09-21 09:59:34 +02:00
Nicolas Grekas
d7fbb0a4a4 [travis] honor .gitattributes when building local packages 2019-09-21 09:26:15 +02:00
Nicolas Grekas
3e48be0301 Merge branch '4.3' into 4.4
* 4.3:
  [FrameworkBundle] fix tests
  fix typo
2019-09-21 01:13:17 +02:00
Nicolas Grekas
48e4453696 Merge branch '3.4' into 4.3
* 3.4:
  fix typo
2019-09-21 01:13:10 +02:00
Nicolas Grekas
8ccb42bb72 [FrameworkBundle] fix tests 2019-09-21 01:13:06 +02:00
Nicolas Grekas
276f190d22 fix typo 2019-09-20 23:40:23 +02:00
Nicolas Grekas
5495b54456 Merge branch '4.3' into 4.4
* 4.3:
  [travis] install from dist except for selected components
2019-09-20 23:40:00 +02:00
Nicolas Grekas
d5e13956da Merge branch '3.4' into 4.3
* 3.4:
  [travis] install from dist except for selected components
2019-09-20 23:36:54 +02:00
Nicolas Grekas
f158d4f0fa minor #33654 [travis] install from dist except for selected components (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[travis] install from dist except for selected components

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

1de84836cf [travis] install from dist except for selected components
2019-09-20 23:34:18 +02:00
Nicolas Grekas
1de84836cf [travis] install from dist except for selected components 2019-09-20 23:28:55 +02:00
Nicolas Grekas
560ed53c42 minor #33653 [travis] checkout previous major and test with patched components on deps=high (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[travis] checkout previous major and test with patched components on deps=high

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

On `deps=high`:
- for the `master` branch, we already checkout the previous one and run tests with patched components as deps
- this PR makes the job on 4.4 checkout 3.4 and run tests with patched components as deps too

Commits
-------

526915a55d [travis] checkout previous major and test with patched components on deps=high
2019-09-20 22:56:53 +02:00
Nicolas Grekas
526915a55d [travis] checkout previous major and test with patched components on deps=high 2019-09-20 22:45:17 +02:00
Nicolas Grekas
27a400281c Merge branch '4.3' into 4.4
* 4.3:
  [Cache] skip igbinary on PHP 7.4.0
2019-09-20 16:40:59 +02:00
Nicolas Grekas
39095759d8 bug #33652 [Cache] skip igbinary on PHP 7.4.0 (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] skip igbinary on PHP 7.4.0

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Our CI currently fails because of that. I'm blacklisting 7.4.0 exactly so that we don't have to maintain these lines, betting on the issue being resolved before 7.4.1 is released.

See https://github.com/igbinary/igbinary/issues/237

Commits
-------

2c0c131142 [Cache] skip igbinary on PHP 7.4.0
2019-09-20 16:40:45 +02:00
Nicolas Grekas
2c0c131142 [Cache] skip igbinary on PHP 7.4.0 2019-09-20 16:26:56 +02:00
Christian Flothmann
012111524b hint to the --parse-tags when parsing tags fails 2019-09-20 16:23:06 +02:00
Nicolas Grekas
e11aead952 cleanup 2019-09-20 13:17:55 +02:00