Commit Graph

50573 Commits

Author SHA1 Message Date
Fabien Potencier
afdb97e864 feature #37337 [Security] Configurable execution order for firewall listeners (scheb)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Security] Configurable execution order for firewall listeners

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT
| Doc PR        | n/a

Hello there, I'm the author of `scheb/two-factor-bundle`, which extends Symfony's security layer with two-factor authentication. I've been closely following the recent changes by @wouterj to rework the security layer with "authenticators" (great work!). While I managed to make my bundle work with authenticators, I see some limitations in the security layer that I'd like to address to make such extensions easier to implement.

In #37336 I've submitted a draft to let security factories add their own authentication listeners to the firewall. This PR is intended to address the issue of execution order. If you look at the `Firewall` class

f64f59a9c0/src/Symfony/Component/Security/Http/Firewall.php (L62-L82)

authentication listeners are executed in the order of their creation. Additionally, there's hardcoded logic to execute `Symfony\Component\Security\Http\Firewall\AccessListener` always last and the logout listener second to last. I'd like to have a more flexible approach, to remove the hardcoded order and give authentication listeners the ability to determine their execution order.

I've added an optional interface to provide a priority to sort all registered authenitication listeners. Sorting is done in a compiler pass, so no time is wasted at runtime.

This is a draft, so I'd like to hear your opinion on this :)

Commits
-------

91388e871b Add ability to prioritize firewall listeners
2020-09-02 13:06:53 +02:00
Fabien Potencier
dad4e956c9 minor #38033 Remove unnecessary silence operator (alexpott)
This PR was merged into the 5.2-dev branch.

Discussion
----------

Remove unnecessary silence operator

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

A gobble-all-errors handler was added around the unserialize() call making the @ operator unnecessary.

Commits
-------

03201f0d23 No longer need to silence errors as we're catching them all
2020-09-02 13:03:38 +02:00
Alex Pott
03201f0d23
No longer need to silence errors as we're catching them all 2020-09-02 10:52:53 +01:00
Nicolas Grekas
a64b9449a3 Merge branch '5.1'
* 5.1:
  [HttpClient] Fix deps=low
2020-09-02 10:02:46 +02:00
Nicolas Grekas
6f15fbfe54 Merge branch '4.4' into 5.1
* 4.4:
  [HttpClient] Fix deps=low
2020-09-02 10:02:12 +02:00
Nicolas Grekas
55f451e49c [HttpClient] Fix deps=low 2020-09-02 10:01:15 +02:00
Fabien Potencier
3854b8f8d7 Merge branch '5.1'
* 5.1:
  Remove headers with internal meaning from HttpClient responses
2020-09-02 09:46:15 +02:00
Fabien Potencier
5a0436ff8e Merge branch '4.4' into 5.1
* 4.4:
  Remove headers with internal meaning from HttpClient responses
2020-09-02 09:42:11 +02:00
Fabien Potencier
d9910e0b33 security #cve-2020-15094 Remove headers with internal meaning from HttpClient responses (mpdude)
This PR was merged into the 4.4 branch.
2020-09-02 09:40:48 +02:00
Matthias Pigulla
ba39753291 Remove headers with internal meaning from HttpClient responses 2020-09-02 09:40:10 +02:00
Fabien Potencier
4a10308a54 Merge branch '5.1'
* 5.1:
  Fix undefined index for inconsistent command name definition
2020-09-02 09:07:54 +02:00
Fabien Potencier
286e22354f Merge branch '4.4' into 5.1
* 4.4:
  Fix undefined index for inconsistent command name definition
2020-09-02 09:07:40 +02:00
Fabien Potencier
bca14aa5f8 Merge branch '3.4' into 4.4
* 3.4:
  Fix undefined index for inconsistent command name definition
2020-09-02 09:07:21 +02:00
Fabien Potencier
33cacadaf2 bug #38024 [Console] Fix undefined index for inconsistent command name definition (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Fix undefined index for inconsistent command name definition

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

The issue happens when the command name is set via construct/setName() and is routed via a command loader under a different name, which causes `Application::get(): Command` to return null (return type violation) with a notice. This makes it throws a proper CommandNotFoundException as expected.

Commits
-------

d59140e857 Fix undefined index for inconsistent command name definition
2020-09-02 07:48:39 +02:00
Fabien Potencier
9d7a8f39a9 Fix CS 2020-09-02 07:46:17 +02:00
Fabien Potencier
4753e4d712 feature #33850 [Serializer] fix denormalization of basic property-types in XML and CSV (mkrauser)
This PR was submitted for the 3.4 branch but it was squashed and merged into the 5.2-dev branch instead.

Discussion
----------

[Serializer] fix denormalization of basic property-types in XML and CSV

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

Like I explained in the Issue, the serializer cannot de-serialize non-string basic properties (int, float, bool). This PR add's some logic to cast to the expected types.

Similar logic is already present in the [XmlUtils](https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Config/Util/XmlUtils.php#L215)-Class of the Config-Component

Commits
-------

3824dafffb [Serializer] fix denormalization of basic property-types in XML and CSV
2020-09-02 07:44:29 +02:00
Matthias Krauser
3824dafffb [Serializer] fix denormalization of basic property-types in XML and CSV 2020-09-02 07:44:16 +02:00
Nicolas Grekas
78eca9607a Merge branch '5.1'
* 5.1:
  [DI] fix inlining of non-shared services
2020-09-01 20:07:47 +02:00
Nicolas Grekas
117317c8e3 Merge branch '4.4' into 5.1
* 4.4:
  [DI] fix inlining of non-shared services
2020-09-01 20:07:16 +02:00
Robin Chalas
d59140e857 Fix undefined index for inconsistent command name definition 2020-09-01 20:06:56 +02:00
Nicolas Grekas
804f194d9d bug #38023 [DI] fix inlining of non-shared services (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] fix inlining of non-shared services

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

Commits
-------

380cb10587 [DI] fix inlining of non-shared services
2020-09-01 20:02:38 +02:00
Nicolas Grekas
380cb10587 [DI] fix inlining of non-shared services 2020-09-01 19:42:15 +02:00
Fabien Potencier
a060635b97 feature #38017 [PHPUnitBridge] deprecations not disabled anymore when disabled=0 (l-vo)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[PHPUnitBridge] deprecations not disabled anymore when disabled=0

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

According to the [docs](https://symfony.com/doc/current/components/phpunit_bridge.html#disabling-the-deprecation-helper), `disabled=1` turns off deprecations mode on phpunit-bridge. It's not totally true since deprecations are disabled as soon as `disabled` key is present in `SYMFONY_DEPRECATIONS_HELPER`. So if `disabled=0` deprecations are still disabled.

Instead of updating the doc, this PR suggest to make `disabled` behavior consistent with `verbose` behavior, so:
- `disabled` => deprecations disabled
- `disabled=0` => deprecations enabled
- `disabled=1` => deprecations disabled

Commits
-------

6908e3d156 [PHPUnitBridge] deprecations not enabled anymore when disabled=0
2020-09-01 18:27:52 +02:00
Fabien Potencier
dc63d712ab feature #33381 [Form] dispatch submit events for disabled forms too (xabbuh)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Form] dispatch submit events for disabled forms too

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27217
| License       | MIT
| Doc PR        |

TODO:

- [ ] add a test case covering the validation use case

Commits
-------

6da42ae2d1 dispatch submit events for disabled forms too
2020-09-01 18:26:17 +02:00
Laurent VOULLEMIER
6908e3d156 [PHPUnitBridge] deprecations not enabled anymore when disabled=0
Allow to pass 0 or 1 to "disabled" to be consistent with "verbose" key behavior
2020-09-01 15:29:20 +02:00
Christian Flothmann
59ae592909 Merge branch '5.1' into master
* 5.1:
  Missed AbstractArgument
  swallow deprecations
2020-09-01 15:18:17 +02:00
Christian Flothmann
b7cd4c7d4e Merge branch '4.4' into 5.1
* 4.4:
  swallow deprecations
2020-09-01 15:16:17 +02:00
Fabien Potencier
692fa7a5c1 bug #38022 Missed AbstractArgument (a-menshchikov)
This PR was merged into the 5.1 branch.

Discussion
----------

Missed AbstractArgument

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

Missed in 5.1

Commits
-------

b5a47dac52 Missed AbstractArgument
2020-09-01 14:38:02 +02:00
Fabien Potencier
b73ee65c04 Merge branch '5.1'
* 5.1:
  stop using the deprecated at() PHPUnit matcher
2020-09-01 14:25:43 +02:00
Fabien Potencier
3061bfeb48 minor #37874 stop using the deprecated at() PHPUnit matcher (xabbuh)
This PR was merged into the 5.1 branch.

Discussion
----------

stop using the deprecated at() PHPUnit matcher

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

Commits
-------

e36e73b9cf stop using the deprecated at() PHPUnit matcher
2020-09-01 14:25:21 +02:00
Christian Flothmann
6da42ae2d1 dispatch submit events for disabled forms too 2020-09-01 14:24:09 +02:00
Zmey
b5a47dac52
Missed AbstractArgument 2020-09-01 15:23:56 +03:00
Fabien Potencier
8ec0e588c3 bug #38020 [PhpUnitBridge] swallow deprecations (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] swallow deprecations

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

Commits
-------

f0067c106c swallow deprecations
2020-09-01 12:08:42 +02:00
Christian Flothmann
f0067c106c swallow deprecations 2020-09-01 11:34:43 +02:00
Fabien Potencier
ccfc4ba269 feature #35338 Added support for using the "{{ label }}" placeholder in constraint messages (a-menshchikov)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

Added support for using the "{{ label }}" placeholder in constraint messages

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

- [ ] Add docs PR

Commits
-------

0d9f44235c Added support for using the "{{ label }}" placeholder in constraint messages
2020-09-01 09:49:57 +02:00
Zmey
0d9f44235c Added support for using the "{{ label }}" placeholder in constraint messages 2020-09-01 09:49:48 +02:00
Fabien Potencier
32b82b88eb Fix bad merge 2020-09-01 08:13:06 +02:00
Fabien Potencier
f765cb2900 Merge branch '5.1'
* 5.1:
  [Mailer] Fixed 'verify_peer' option in mailer DSN being ignored
  [Cache] Psr16Cache does not handle Proxy cache items
  [Serializer] fixed fix encoding of cache keys with anonymous classes
  Fix symfony/amazon-mailer constraint
  [Validator] Fix PhpUnitBridge version constraint.
  Bump Symfony version to 5.1.5
  Update VERSION for 5.1.4
  Update CHANGELOG for 5.1.4
  Bump Symfony version to 4.4.13
  Update VERSION for 4.4.12
  Update CHANGELOG for 4.4.12
  Bump Symfony version to 3.4.45
  Update VERSION for 3.4.44
  Update CONTRIBUTORS for 3.4.44
  Update CHANGELOG for 3.4.44
2020-09-01 07:57:52 +02:00
Fabien Potencier
509247b8ff Merge branch '4.4' into 5.1
* 4.4:
  [Cache] Psr16Cache does not handle Proxy cache items
  [Serializer] fixed fix encoding of cache keys with anonymous classes
  Bump Symfony version to 4.4.13
  Update VERSION for 4.4.12
  Update CHANGELOG for 4.4.12
  Bump Symfony version to 3.4.45
  Update VERSION for 3.4.44
  Update CONTRIBUTORS for 3.4.44
  Update CHANGELOG for 3.4.44
2020-09-01 07:52:18 +02:00
Fabien Potencier
ae37887485 Merge branch '3.4' into 4.4
* 3.4:
  Bump Symfony version to 3.4.45
  Update VERSION for 3.4.44
  Update CONTRIBUTORS for 3.4.44
  Update CHANGELOG for 3.4.44
2020-09-01 07:50:54 +02:00
Fabien Potencier
0d990449b3 bug #37961 [Mailer] Fixed 'verify_peer' option in mailer DSN being ignored (SnakePin)
This PR was squashed before being merged into the 5.1 branch.

Discussion
----------

[Mailer] Fixed 'verify_peer' option in mailer DSN being ignored

| Q             | A
| ------------- | ---
| Branch?       | 5.1 <!-- see below -->
| 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 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | N/A <!-- required for new features -->

The mailer DSN option 'verify_peer' was being ignored because `$dsn->getOption('verify_peer', true)` was returning a string and thus NOT operator on it was always resulting in false. I propose changing the line where it is used with a `filter_var` call with the `FILTER_VALIDATE_BOOLEAN` as the filter parameter to overcome this issue.

Commits
-------

1c789e87aa [Mailer] Fixed 'verify_peer' option in mailer DSN being ignored
2020-08-31 21:53:05 +02:00
SnakePin
1c789e87aa [Mailer] Fixed 'verify_peer' option in mailer DSN being ignored 2020-08-31 21:52:58 +02:00
Nicolas Grekas
6bebe86d5a bug #38010 [Cache] Psr16Cache does not handle Proxy cache items (alex-dev)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] Psr16Cache does not handle Proxy cache items

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

Add test for Psr16Cache along with a ProxyAdapter

Commits
-------

e525fa1055 [Cache] Psr16Cache does not handle Proxy cache items
2020-08-31 18:53:24 +02:00
Alexandre Parent
e525fa1055 [Cache] Psr16Cache does not handle Proxy cache items 2020-08-31 18:52:20 +02:00
Nicolas Grekas
141ce4c78c minor #38012 [Semaphore] Fix branch-alias (jderusse)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Semaphore] Fix branch-alias

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

branch-alias should be `5.2` instead of `5.1`

Commits
-------

91a2256716 Fix semaphore branch-alias
2020-08-31 18:22:01 +02:00
Jérémy Derussé
91a2256716
Fix semaphore branch-alias 2020-08-31 18:13:25 +02:00
Nicolas Grekas
93459a93bd bug #37937 [Serializer] fixed fix encoding of cache keys with anonymous classes (michaelzangerle)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Serializer] fixed fix encoding of cache keys with anonymous classes

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

Commits
-------

3a4675359d [Serializer] fixed fix encoding of cache keys with anonymous classes
2020-08-31 18:04:23 +02:00
Michael Zangerle
3a4675359d [Serializer] fixed fix encoding of cache keys with anonymous classes 2020-08-31 18:03:52 +02:00
Fabien Potencier
d6468a9634 feature #34790 [Console] Remove restriction for choices to be strings (LordZardeck, YaFou, ogizanagi)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Console] Remove restriction for choices to be strings

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #34789
| License       | MIT

When using choice, selected answers are forced into strings, preventing us from using complex values such as a class with a custom __toString. This is a problem, as I need the ability to present the user with a list of display strings to choose from, but need the ID associated with that display string in order to do anything useful.

Commits
-------

d276cc9ca3 [Console] Cast associative choices questions keys to string
a0223088a0 [Console] Add tests for removing restriction for choices to be strings
3349d3ce89 Remove restriction for choices to be strings
2020-08-31 17:31:17 +02:00
Maxime Steinhausser
d276cc9ca3 [Console] Cast associative choices questions keys to string
to prevent inconsistency when choosing by key (getting a string as result) or by value (getting an int as result)
2020-08-31 17:06:49 +02:00