Commit Graph

45114 Commits

Author SHA1 Message Date
Fabien Potencier ec2afb7b43 minor #33697 [Security] remove deprecated code paths (xabbuh)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[Security] remove deprecated code paths

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

Commits
-------

2b6ce01a98 remove deprecated code paths
2019-09-25 15:24:54 +02:00
Christian Flothmann 2b6ce01a98 remove deprecated code paths 2019-09-25 10:10:24 +02:00
Nicolas Grekas 906aad95e6 Merge branch '4.4'
* 4.4:
  [Routing] fix bad fix
2019-09-24 18:23:35 +02:00
Nicolas Grekas 373469b53f Merge branch '4.3' into 4.4
* 4.3:
  [Routing] fix bad fix
2019-09-24 18:23:28 +02:00
Nicolas Grekas 3ab7d57659 Merge branch '3.4' into 4.3
* 3.4:
  [Routing] fix bad fix
2019-09-24 18:23:04 +02:00
Nicolas Grekas 04fe347df9 [Routing] fix bad fix 2019-09-24 18:22:08 +02:00
Nicolas Grekas 2d877b1804 Merge branch '4.4'
* 4.4:
  [Security/Http] fix typo in deprecation message
  [Security] Deprecate isGranted()/decide() on more than one attribute
  Fixed a minor typo in the UPGRADE to 5.0 guide
  Various tweaks 3.4
  Various tweaks 4.3
  [Security] Make stateful firewalls turn responses private only when needed
  [PhpUnit] Fix usleep mock return value
  Revert \"feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)\"
  [TwigBundle] typo
  [TwigBundle] fix test case
  [Lock] use Predis\ClientInterface instead of Predis\Client
  Allow Twig 3
  Minor tweaks
  Fix version typo in deprecation notice
  [Form][SubmitType] Add "validate" option
  hint to the --parse-tags when parsing tags fails
  Make legacy "wrong" RFC2047 encoding apply only to one header
2019-09-24 18:05:28 +02:00
Nicolas Grekas 51a2cb6e3c Merge branch '4.3' into 4.4
* 4.3:
  [Security/Http] fix typo in deprecation message
  Various tweaks 3.4
  Various tweaks 4.3
  [PhpUnit] Fix usleep mock return value
  [Lock] use Predis\ClientInterface instead of Predis\Client
  Fix version typo in deprecation notice
  Make legacy "wrong" RFC2047 encoding apply only to one header
2019-09-24 17:57:39 +02:00
Nicolas Grekas 1ccc970469 minor #33690 [Security/Http] fix typo in deprecation message (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Security/Http] fix typo in deprecation message

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

spotted by @stof in #33676

Commits
-------

e70057aed4 [Security/Http] fix typo in deprecation message
2019-09-24 17:54:42 +02:00
Nicolas Grekas 7031e83a8f Merge branch '3.4' into 4.3
* 3.4:
  Various tweaks 3.4
  [PhpUnit] Fix usleep mock return value
  [Lock] use Predis\ClientInterface instead of Predis\Client
2019-09-24 17:54:14 +02:00
Nicolas Grekas e70057aed4 [Security/Http] fix typo in deprecation message 2019-09-24 17:43:44 +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
Fabien Potencier 7c04a82a47 bug #33675 [PhpUnit] Fix usleep mock return value (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnit] Fix usleep mock return value

| Q             | A
| ------------- | ---
| Branch?       | 3.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

`usleep` does not return anything.

Commits
-------

8198d93c5b [PhpUnit] Fix usleep mock return value
2019-09-24 07:30:09 +02:00
Fabien Potencier d273ee8bd0 minor #33677 Various tweaks 3.4 (fabpot)
This PR was squashed before being merged into the 3.4 branch (closes #33677).

Discussion
----------

Various tweaks 3.4

| Q             | A
| ------------- | ---
| Branch?       | 3.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
-------

47cb83a6ec Various tweaks 3.4
2019-09-24 07:29:37 +02:00
Fabien Potencier 47cb83a6ec Various tweaks 3.4 2019-09-24 07:29:29 +02:00
Fabien Potencier 926f286000 minor #33678 Various tweaks 4.3 (fabpot)
This PR was squashed before being merged into the 4.3 branch (closes #33678).

Discussion
----------

Various tweaks 4.3

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| 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
-------

7596f99a12 Various tweaks 4.3
2019-09-24 07:27:48 +02:00
Fabien Potencier 7596f99a12 Various tweaks 4.3 2019-09-24 07:27:42 +02:00
Nicolas Grekas 20df3a125c [Security] Make stateful firewalls turn responses private only when needed 2019-09-23 21:34:59 +02:00
Fabien Potencier 8198d93c5b [PhpUnit] Fix usleep mock return value 2019-09-23 21:21:37 +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 acca7ad939 minor #33641 Make legacy "wrong" RFC2047 encoding apply only to one header (terjebraten-certua)
This PR was merged into the 4.3 branch.

Discussion
----------

Make legacy "wrong" RFC2047 encoding apply only to one header

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

It says in a comment in the code that "We have to go against RFC 2183/2231 in some areas for interoperability". But I would like that to be the exception and not the rule. As the code was, all parameterized headers except from "Content-Disposition" was not encoded according to RFC 2231.

This change is to make it so that the exception (to not follow the RFC) is for the header "Content-Type" only, and all other parameterized headers will follow the rule of RFC 2231.

The code kind of worked before, because in emails we generally only have two parameterized headers; "Content-Disposition" and "Content-Type". But I think it is a good thing that if another  parameterized header would happen to be added, by default it should follow the rule of the RFC and not by default be an exception.

Commits
-------

3817a8b036 Make legacy "wrong" RFC2047 encoding apply only to one header
2019-09-23 16:42:16 +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
Fabien Potencier 35b670112c minor #33666 [Lock] use Predis\ClientInterface instead of Predis\Client (seferov)
This PR was squashed before being merged into the 3.4 branch (closes #33666).

Discussion
----------

[Lock] use Predis\ClientInterface instead of Predis\Client

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT

`\Predis\ClientInterface` can be used instead of `\Predis\Client` for RedisStore.

Commits
-------

5c01f0a7e5 [Lock] use Predis\ClientInterface instead of Predis\Client
2019-09-23 16:31:32 +02:00
Farhad Safarov 5c01f0a7e5 [Lock] use Predis\ClientInterface instead of Predis\Client 2019-09-23 16:31:27 +02:00
Fabien Potencier b472ee2045 minor #33668 Fix version typo in deprecation notice (teohhanhui)
This PR was merged into the 4.3 branch.

Discussion
----------

Fix version typo in deprecation notice

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

https://github.com/symfony/symfony/pull/28865 was merged into 4.3

Commits
-------

bd13271016 Fix version typo in deprecation notice
2019-09-23 16:30:32 +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 242f24427d Merge branch '4.4'
* 4.4:
  [travis] fix typo
  [travis] more CI fixes
2019-09-23 15:12:49 +02: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 80841851a7 Merge branch '4.4'
* 4.4:
  [Twig] Remove deprecated tag usage
2019-09-23 12:19:26 +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 e23c7283fe Merge branch '4.4'
* 4.4:
  [travis] fix CI
2019-09-23 12:17:27 +02:00
Nicolas Grekas 2d274b3fac Merge branch '4.3' into 4.4
* 4.3:
  [travis] fix CI
2019-09-23 12:16:47 +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