Commit Graph

52701 Commits

Author SHA1 Message Date
Greg Anderson
8d455dbd0c
[WIP] Implements #24314: Support binary / negatable options, e.g. --foo and --no-foo. 2020-12-27 23:05:29 +01:00
Nicolas Grekas
b3de641fd4 Merge branch '5.2' into 5.x
* 5.2:
  [Security] Fix event propagation for globally registered security events
  Add missing `@return` annotations to fix deprecations on PHP 8
  [ProxyManagerBridge] fix PHP notice, switch to "friendsofphp/proxy-manager-lts"
  allow null values in form helpers
  Add RememberMe Badge to LoginLinkAuthenticator
2020-12-23 16:46:09 +01:00
Nicolas Grekas
b53600d89b Merge branch '5.1' into 5.2
* 5.1:
  [Security] Fix event propagation for globally registered security events
  Add missing `@return` annotations to fix deprecations on PHP 8
  [ProxyManagerBridge] fix PHP notice, switch to "friendsofphp/proxy-manager-lts"
2020-12-23 16:38:30 +01:00
Nicolas Grekas
fb8935eb19 bug #39621 [Security] Fix event propagation for globally registered security events (scheb)
This PR was squashed before being merged into the 5.1 branch.

Discussion
----------

[Security] Fix event propagation for globally registered security events

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

When new authenticator security is enabled, the `AuthenticatorManager` is using its own firewall-specific event dispatcher. To allow security events being listened to on the global level, `RegisterGlobalSecurityEventListenersPass` is there to automatically add globally registered event listeners to the firewall-specific event dispatchers.

`RegisterGlobalSecurityEventListenersPass` contains a list of events that are propagated, but unfortunately this list is incomplete as there are other events in `AuthenticatorManager` that would need too be propagated. So I added the missing (older) security events. These older events may also be registered by their name, rather than the FQN of the class, so I've also added those.

As this is targeting 5.1, I'll file another PR for the `AuthenticationTokenCreatedEvent` that was introduced in 5.2, as soon as this change was merged into 5.x.

On a note, I feel this "whitelist" approach to propagate security events to the global dispatcher isn't that great, because it's prone to error. Additional security events may be added in the future and adding these to `RegisterGlobalSecurityEventListenersPass` can easily be missed. When I added `AuthenticationTokenCreatedEvent` in PR #37359 I wasn't aware of this propagation mechanic existed and also no one reviewing the PR noticed it.

Additional changes:
- Typo fix :)
- The `array_uintersect` in `RegisterGlobalSecurityEventListenersPassTest` wasn't implemented correctly *

\* That function's behavior is really odd and easy to be used in the wrong way. The callback function isn't intended to return true/false for matching items, but return -1/0/1 like sorting functions. The tests seemingly only worked by chance as returning true/false is doing pretty much the opposite of what the callback function is supposed to do.

Commits
-------

1675864032 [Security] Fix event propagation for globally registered security events
2020-12-23 16:38:06 +01:00
Christian Scheb
1675864032 [Security] Fix event propagation for globally registered security events 2020-12-23 16:37:46 +01:00
Nicolas Grekas
c1cb43e2c2 Merge branch '4.4' into 5.1
* 4.4:
  Add missing `@return` annotations to fix deprecations on PHP 8
  [ProxyManagerBridge] fix PHP notice, switch to "friendsofphp/proxy-manager-lts"
2020-12-23 16:26:14 +01:00
Nicolas Grekas
8b3c1a1edf minor #39614 Add missing @return annotations to fix deprecations on PHP 8 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

Add missing `@return` annotations to fix deprecations on PHP 8

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

Commits
-------

3ffe5573e9 Add missing `@return` annotations to fix deprecations on PHP 8
2020-12-23 16:21:09 +01:00
Nicolas Grekas
3ffe5573e9 Add missing @return annotations to fix deprecations on PHP 8 2020-12-23 16:11:26 +01:00
Nicolas Grekas
80c5aeb6a2 bug #39603 [TwigBridge] allow null values in form helpers (xabbuh)
This PR was merged into the 5.2 branch.

Discussion
----------

[TwigBridge] allow null values in form helpers

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

Commits
-------

f908047c6b allow null values in form helpers
2020-12-23 15:54:41 +01:00
Nicolas Grekas
64cc4d8e7a bug #39610 [ProxyManagerBridge] fix PHP notice, switch to "friendsofphp/proxy-manager-lts" (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ProxyManagerBridge] fix PHP notice, switch to "friendsofphp/proxy-manager-lts"

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

I submitted the fix for #39089 on the origin library at https://github.com/Ocramius/ProxyManager/pull/646.

Because of the [versioning policy](6d45615155/version-support.md (dependency-upgrades)) in use at the origin library, this fix won't be available for PHP < 7.4.

We usually resort to monkey-patching to workaround the policy and still ship the fix for 4.4 (which supports PHP >= 7.1).

This time, and as explained in https://github.com/Ocramius/ProxyManager/issues/630, I propose to delegate the fix to [friendsofphp/proxy-manager-lts](https://github.com/FriendsOfPHP/proxy-manager-lts/). It already embeds the fix and a few others that allow us to remove most of the monkey-patching we had to accumulate over time.

Commits
-------

389f5304c7 [ProxyManagerBridge] fix PHP notice, switch to "friendsofphp/proxy-manager-lts"
2020-12-23 15:36:40 +01:00
Robin Chalas
14a3730afa minor #39618 [Notifier] Remove @experimental annotations (jderusse)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Remove @experimental annotations

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/14735

Commits
-------

b66368a9e2 Remove @experimental annotations
2020-12-23 11:10:19 +01:00
Jérémy Derussé
b66368a9e2
Remove @experimental annotations 2020-12-23 09:55:12 +01:00
Alexander M. Turek
9e56c00f9c bug #39584 [Security] Add RememberMe Badge to LoginLinkAuthenticator (jderusse)
This PR was merged into the 5.2 branch.

Discussion
----------

[Security] Add RememberMe Badge to LoginLinkAuthenticator

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

I'm replacing a custom home-made magic link authenticator by the Symfony one, and I missed this behavior. I had to use a EventListener to add the badge to the passeport.

I'm not sure, if the badge were missing on purpose /cc @weaverryan @wouterj

Commits
-------

d38fc4d678 Add RememberMe Badge to LoginLinkAuthenticator
2020-12-22 20:03:33 +01:00
Robin Chalas
af433355c1 minor #39571 [Notifier] Fix component version constraint in bridges (chalasr)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Fix component version constraint in bridges

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | np
| Tickets       | -
| License       | MIT
| Doc PR        | -

Composer does not resolve `~5.3.0` to 5.x-dev with `--prefer-lowest` actually.

Commits
-------

bcdd5da849 [Notifier] Fix component version constraint in bridges
2020-12-22 17:30:01 +01:00
Nicolas Grekas
389f5304c7 [ProxyManagerBridge] fix PHP notice, switch to "friendsofphp/proxy-manager-lts" 2020-12-22 17:08:05 +01:00
Alexander M. Turek
c3fafbdc80 Merge branch '5.2' into 5.x
* 5.2:
  Fix tests
  [Notifier] [DX] Abstract test cases
  [Notifier] [Discord] Use sprintf for exception message
2020-12-22 16:49:23 +01:00
Alexander M. Turek
2a3708ef74 Fix tests 2020-12-22 15:53:22 +01:00
Alexander M. Turek
3c753e6eff Merge branch '5.1' into 5.2
* 5.1:
  [Notifier] [DX] Abstract test cases
  [Intl] Update the ICU data to 68.2
2020-12-22 15:40:43 +01:00
Alexander M. Turek
1ee1659601 minor #39495 [Notifier] [DX] Abstract test cases (OskarStark)
This PR was squashed before being merged into the 5.1 branch.

Discussion
----------

[Notifier] [DX] Abstract test cases

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

This PR

* [x] adds a new _abstract_ `TransportTestCase`
* [x] adds a new _abstract_ `TransportFactoryTestCase` (code is mainly taken from the `Mailer/TransportFactoryTestCase`)

We have a lot of code duplication in the notifier bridges

### Todos
* [x] check if we want this
* [x]  I would want to use Dsn strings (like already used in the notifier bridge tests) instead of objects for the providers, what do you think? For me it is more readably
* [x] update all bridges
* [x] Bump notifier to `~5.1.10`

### Questions
* [x] is it Ok to consider this a bugfix and merge into `5.1`?
* [x] shall I prefix the abstract test cases with `Abstract` ? As we did the same for Mailer, I would say no

@symfony/mergers have to change ^5.2 into ^5.2.1

Commits
-------

79379b71f4 [Notifier] [DX] Abstract test cases
2020-12-22 15:13:56 +01:00
Oskar Stark
79379b71f4 [Notifier] [DX] Abstract test cases 2020-12-22 15:13:46 +01:00
Robin Chalas
bcdd5da849 [Notifier] Fix component version constraint in bridges 2020-12-22 15:06:05 +01:00
Alexander M. Turek
3501e14747 minor #39604 [DomCrawler] mark some methods as internal (xabbuh)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DomCrawler] mark some methods as internal

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #18465
| License       | MIT
| Doc PR        |

Commits
-------

b8f742d68b mark some methods as internal
2020-12-22 14:48:34 +01:00
Robin Chalas
096f42dc95 minor #39589 [Notifier] [Discord] Use sprintf for exception message (OskarStark)
This PR was merged into the 5.2 branch.

Discussion
----------

[Notifier] [Discord] Use sprintf for exception message

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

Commits
-------

d9eb1a1f6e [Notifier] [Discord] Use sprintf for exception message
2020-12-22 14:26:12 +01:00
Alexander M. Turek
3163ff3393 Merge branch '5.2' into 5.x
* 5.2:
  [Notifier] add "symfony/polyfill-mbstring" as dep of the Discord bridge
  [Intl] Update the ICU data to 68.2
2020-12-22 13:48:56 +01:00
Alexander M. Turek
6515a31210 Merge branch '5.1' into 5.2
* 5.1:
  [Intl] Update the ICU data to 68.2
2020-12-22 13:46:48 +01:00
Alexander M. Turek
c900018758 Merge branch '4.4' into 5.1
* 4.4:
  [Intl] Update the ICU data to 68.2
2020-12-22 13:16:28 +01:00
Christian Flothmann
b8f742d68b mark some methods as internal 2020-12-22 09:36:18 +01:00
Christian Flothmann
f908047c6b allow null values in form helpers 2020-12-22 09:11:35 +01:00
Oskar Stark
d9eb1a1f6e [Notifier] [Discord] Use sprintf for exception message 2020-12-22 08:30:35 +01:00
Alexander M. Turek
18927fe54a minor #39573 [Intl] Update the ICU data to 68.2 (jakzal)
This PR was merged into the 4.4 branch.

Discussion
----------

[Intl] Update the ICU data to 68.2

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

Commits
-------

4573965f74 [Intl] Update the ICU data to 68.2
2020-12-21 17:14:24 +01:00
Alexander M. Turek
d499cac462 minor #39576 [Notifier] add "symfony/polyfill-mbstring" as dep of the Discord bridge (nicolas-grekas)
This PR was merged into the 5.2 branch.

Discussion
----------

[Notifier] add "symfony/polyfill-mbstring" as dep of the Discord bridge

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

Commits
-------

e61f0c50fa [Notifier] add "symfony/polyfill-mbstring" as dep of the Discord bridge
2020-12-21 16:41:57 +01:00
Alexander M. Turek
f2b98b4f7f minor #39559 [Notifier] Bump conflict rules for all notifier bridges (derrabus)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Bump conflict rules for all notifier bridges

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

Commits
-------

fed253bf08 [Notifier] Bump conflict rules for all notifier bridges.
2020-12-21 16:40:13 +01:00
Alexander M. Turek
bcad75f188 Merge branch '5.2' into 5.x
* 5.2:
  Supports empty path for slack DSN
  [SecurityBundle] Fix transient test
  Bump Symfony version to 5.2.2
  Update VERSION for 5.2.1
  Update CHANGELOG for 5.2.1
  Bump Symfony version to 5.1.11
  [Notifier] GoogleChat/FreeMobile: Declare incompatibility with 5.3.
  Update VERSION for 5.1.10
  Update CHANGELOG for 5.1.10
  Bump Symfony version to 4.4.19
  Update VERSION for 4.4.18
  Update CONTRIBUTORS for 4.4.18
  Update CHANGELOG for 4.4.18
  [Serializer] Fix DenormalizableInterface::denormalize() return type declaration in docblock
2020-12-21 16:35:11 +01:00
Alexander M. Turek
7bc051f260 Merge branch '5.1' into 5.2
* 5.1:
  Bump Symfony version to 5.1.11
  Update VERSION for 5.1.10
  Update CHANGELOG for 5.1.10
  Bump Symfony version to 4.4.19
  Update VERSION for 4.4.18
  Update CONTRIBUTORS for 4.4.18
  Update CHANGELOG for 4.4.18
  [Serializer] Fix DenormalizableInterface::denormalize() return type declaration in docblock
2020-12-21 16:33:14 +01:00
Alexander M. Turek
74b132fca2 Merge branch '4.4' into 5.1
* 4.4:
  Bump Symfony version to 4.4.19
  Update VERSION for 4.4.18
  Update CONTRIBUTORS for 4.4.18
  Update CHANGELOG for 4.4.18
  [Serializer] Fix DenormalizableInterface::denormalize() return type declaration in docblock
2020-12-21 16:29:43 +01:00
Robin Chalas
4c9e663678 bug #39586 Supports empty path for slack DSN (odolbeau)
This PR was merged into the 5.2 branch.

Discussion
----------

Supports empty path for slack DSN

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

It's actually not possible to use a Slack DSN inspired by [the documentation](https://symfony.com/doc/current/notifier.html#chat-channel), ie: `slack://TOKEN@default?channel=CHANNEL` cause the path is null (must be `/`).

This PR allows to not specify a path.

Commits
-------

f8a95b3965 Supports empty path for slack DSN
2020-12-21 13:31:13 +01:00
Jérémy Derussé
d38fc4d678
Add RememberMe Badge to LoginLinkAuthenticator 2020-12-21 09:54:09 +01:00
Olivier Dolbeau
f8a95b3965 Supports empty path for slack DSN 2020-12-21 09:54:05 +01:00
Robin Chalas
c4ddafb655 minor #39565 [Notifier] GoogleChat/FreeMobile: Declare incompatibility with 5.3 (derrabus)
This PR was merged into the 5.2 branch.

Discussion
----------

[Notifier] GoogleChat/FreeMobile: Declare incompatibility with 5.3

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

I missed two bridges. 😓  @nicolas-grekas

Commits
-------

b9eca9fcc9 [Notifier] GoogleChat/FreeMobile: Declare incompatibility with 5.3.
2020-12-20 15:19:17 +01:00
Alexander M. Turek
8f7a8d345a minor #39561 [Serializer] Fix DenormalizableInterface::denormalize() return type declaration in docblock (jeroennoten)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer] Fix DenormalizableInterface::denormalize() return type declaration in docblock

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

DenormalizableInterface::denormalize() should not return anything, so the `@return` declaration should be removed. If you look at the usage in `CustomNormalizer::denormalize()`, it becomes clear that this method shouldn't return anything:
```php
    public function denormalize($data, $type, $format = null, array $context = [])
    {
        $object = $this->extractObjectToPopulate($type, $context) ?: new $type();
        $object->denormalize($this->serializer, $data, $format, $context);

        return $object;
    }
```

Commits
-------

00c90aed51 [Serializer] Fix DenormalizableInterface::denormalize() return type declaration in docblock
2020-12-20 14:32:21 +01:00
Nicolas Grekas
e61f0c50fa [Notifier] add "symfony/polyfill-mbstring" as dep of the Discord bridge 2020-12-19 15:24:47 +01:00
Jakub Zalas
4573965f74
[Intl] Update the ICU data to 68.2 2020-12-19 12:57:32 +01:00
Robin Chalas
f44bdd3c8b minor #39572 [SecurityBundle] Fix transient test (chalasr)
This PR was merged into the 5.2 branch.

Discussion
----------

[SecurityBundle] Fix transient test

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

See e.g. https://travis-ci.com/github/symfony/symfony/jobs/462408658#L4961

Commits
-------

fd27c4dd97 [SecurityBundle] Fix transient test
2020-12-19 11:53:24 +01:00
Robin Chalas
fd27c4dd97 [SecurityBundle] Fix transient test 2020-12-19 11:10:19 +01:00
Fabien Potencier
ba849c0d21 Bump Symfony version to 5.2.2 2020-12-18 15:09:16 +01:00
Fabien Potencier
649fa3f8cd
Merge pull request #39564 from fabpot/release-5.2.1
released v5.2.1
2020-12-18 14:49:55 +01:00
Fabien Potencier
8c76f4b2fc Update VERSION for 5.2.1 2020-12-18 14:49:39 +01:00
Fabien Potencier
78132fe29b Update CHANGELOG for 5.2.1 2020-12-18 14:49:30 +01:00
Fabien Potencier
a969b99417 Bump Symfony version to 5.1.11 2020-12-18 14:48:52 +01:00
Alexander M. Turek
b9eca9fcc9 [Notifier] GoogleChat/FreeMobile: Declare incompatibility with 5.3. 2020-12-18 14:47:30 +01:00