Commit Graph

53281 Commits

Author SHA1 Message Date
Oskar Stark
4a98eeecdc [Security] [HttpFoundation] Use class const in test 2021-01-22 08:08:23 +01:00
Oskar Stark
b5af0083de Merge branch '5.1' into 5.2
* 5.1:
  [Notifier] [OvhCloud] “Invalid signature” for message with slashes
2021-01-21 20:03:15 +01:00
Oskar Stark
1c9d2c8982 bug #39871 [Notifier] [OvhCloud] “Invalid signature” for message with slashes (OneT0uch)
This PR was squashed before being merged into the 5.1 branch.

Discussion
----------

[Notifier] [OvhCloud] “Invalid signature” for message with slashes

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

Test to show issue of invalid signature when message contains slash.

Commits
-------

9f01fb84b7 [Notifier] [OvhCloud] “Invalid signature” for message with slashes
2021-01-21 20:02:32 +01:00
Théo DELCEY
9f01fb84b7 [Notifier] [OvhCloud] “Invalid signature” for message with slashes 2021-01-21 20:02:19 +01:00
Jérémy Derussé
8b01095933
Randomize CSRF token to harden BREACH attacks 2021-01-21 17:55:18 +01:00
Jérémy Derussé
c1769d1b48
Merge branch '5.1' into 5.2
* 5.1:
  Remove wrong test
  [Uid] Unable to extend Uuid/Ulid and use fromString()
  Fix typo in property name
2021-01-21 17:54:56 +01:00
Jérémy Derussé
7e2ac5ff33
Merge branch '4.4' into 5.1
* 4.4:
  Remove wrong test
  Fix typo in property name
2021-01-21 17:54:24 +01:00
Jérémy Derussé
039fe6ab86
minor #39923 [SecurityBundle] Remove wrong test (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] Remove wrong test

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

This tests, asserts that all links to logout are identical, which is wrong and incompatible with BREACH mitigation #39919

Commits
-------

91c360ec75 Remove wrong test
2021-01-21 17:48:11 +01:00
Christian Flothmann
72a82c3a79 minor #39917 [Uid] split success and failure tests (xabbuh)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Uid] split success and failure tests

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

Commits
-------

ea9624e3be split success and failure tests
2021-01-21 17:02:02 +01:00
Jérémy Derussé
91c360ec75
Remove wrong test 2021-01-21 16:51:17 +01:00
Christian Flothmann
f52ef5dea7 minor #39918 [FrameworkBundle][TwigBundle] slightly clarify command descriptions (xabbuh)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[FrameworkBundle][TwigBundle] slightly clarify command descriptions

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

Commits
-------

55e421fda3 slightly clarify command descriptions
2021-01-21 12:45:19 +01:00
Christian Flothmann
55e421fda3 slightly clarify command descriptions 2021-01-21 12:15:15 +01:00
Christian Flothmann
ea9624e3be split success and failure tests 2021-01-21 11:36:16 +01:00
YaFou
37cc16e3d8
[PropertyInfo] Fix breaking change with has*(arguments...) methods 2021-01-20 22:15:48 +01:00
Jérémy Derussé
cde0ffdc83
Allow relative path to composer cache 2021-01-20 21:19:14 +01:00
YaFou
4f9eedfcf7
[RateLimiter] Fix infinite values with NoLimiter 2021-01-20 21:07:17 +01:00
Nicolas Grekas
0a667273ed bug #39906 [Notifier] Fix HttpClient TransportException handling (mtarld)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Fix HttpClient TransportException handling

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

Right now, when exceptions are coming from HttpClient component, we always assume that there is a response and use it to throw a Notifier's `TransportException`.

But with this approach, `TransportExceptionInterface` and `DecodingExceptionInterface` aren't handled properly because they aren't containing a response at all.

This PR fix the exception handling when such exceptions are thrown.

Commits
-------

bb32beb488 [Notifier] Fix HttpClient TransportException handle
2021-01-20 18:40:12 +01:00
Mathias Arlaud
bb32beb488 [Notifier] Fix HttpClient TransportException handle 2021-01-20 18:29:51 +01:00
Nicolas Grekas
c5140c242b feature #39850 [Uid] Add fromBase58(), fromBase32(), fromRfc4122() and fromBinary() methods (fancyweb)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Uid] Add fromBase58(), fromBase32(), fromRfc4122() and fromBinary() methods

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

Commits
-------

c01ec7d462 [Uid] Add fromBase58(), fromBase32(), fromRfc4122() and fromBinary()
2021-01-20 18:24:50 +01:00
Nicolas Grekas
64c8a55212 bug #39900 [Uid] Unable to extend Uuid/Ulid and use fromString() (OskarStark)
This PR was squashed before being merged into the 5.1 branch.

Discussion
----------

[Uid] Unable to extend Uuid/Ulid and use fromString()

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

Before:
```php
CustomUuid::fromString(...) // returns `Uuid`
```

After:
```php
CustomUuid::fromString(...) // returns `CustomUuid`
```

same for `Ulid` class.

cc @fancyweb

Commits
-------

824777938d [Uid] Unable to extend Uuid/Ulid and use fromString()
2021-01-20 18:20:03 +01:00
Oskar Stark
824777938d [Uid] Unable to extend Uuid/Ulid and use fromString() 2021-01-20 18:19:46 +01:00
Robin Chalas
dc9db1e66f feature #39904 [Console] add option --short to the list command (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Console] add option `--short` to the `list` command

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

This PR is a follow up of https://github.com/symfony/symfony/pull/39851, triggered by @wouterj's comment at https://github.com/symfony/symfony/pull/39851#pullrequestreview-572147186.

This new option should enable creating fast shell auto-completion, by allowing the `list` command to run fast.

Commits
-------

81d5728f4a [Console] add option `--short` to the `list` command
2021-01-20 17:38:21 +01:00
Robin Chalas
64398da6cd minor #39898 [MonologBridge] Typo in consoleFormatterOptions property name (HypeMC)
This PR was merged into the 4.4 branch.

Discussion
----------

[MonologBridge] Typo in consoleFormatterOptions property name

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

Fixes a typo in the property name, see also https://github.com/symfony/monolog-bundle/pull/384

Commits
-------

a70b71b50e Fix typo in property name
2021-01-20 15:57:49 +01:00
Thomas Calvet
c01ec7d462 [Uid] Add fromBase58(), fromBase32(), fromRfc4122() and fromBinary() 2021-01-20 15:45:19 +01:00
Nicolas Grekas
81d5728f4a [Console] add option --short to the list command 2021-01-20 14:27:30 +01:00
Robin Chalas
6b9fa0be67 minor #39903 [FrameworkBundle] do not fail when MercureBundle is not installed (xabbuh)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[FrameworkBundle] do not fail when MercureBundle is not installed

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

Commits
-------

8cdbdcb1c9 do not fail when MercureBundle is not installed
2021-01-20 14:04:20 +01:00
Nicolas Grekas
4cb45fe834 feature #39851 [Console] enable describing commands in ways that make the list command lazy (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Console] enable describing commands in ways that make the `list` command lazy

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

This PR improves the way one can describe a command so that the `list` command can be made lazy:
- when provided using the `$defaultName` property or the `console.command` tag, the name of a command is now exploded using the `|` character. The first name in the list defines the name of the command, the other ones its aliases. When the first name is the empty string, the second name is used instead, and the command is declared as hidden.
- a new `$defaultDescription` static property and a new `description` tag attribute allow for defining the commands' description while registering them.

Together, this is enough to make the `list` command lazy, because this command only accesses each command's name, aliases, hidden-status, and description.

On the implementation side, this PR adds a `LazyCommand` class that proxies regular commands to make them lazy for the target purpose.

This PR will enable support for attributes for configuring a command name+description+etc.
e.g. using the concepts in #39804:
`#[CommandAutoTag(name: 'foo:bar', desc: 'boo', hidden: true)]#`

The attribute could very well split the `hidden` and `aliases` settings apart - while the underlying code and pre-PHP8 apps would use the compact form, because dealing with many static properties + methods would be a maintenance pain imho.

Commits
-------

8a1a1b8171 [Console] enable describing commands in ways that make the `list` command lazy
2021-01-20 13:56:01 +01:00
Christian Flothmann
8cdbdcb1c9 do not fail when MercureBundle is not installed 2021-01-20 13:37:13 +01:00
Oskar Stark
4818b282f7 feature #39838 [Notifier] Add Gitter Bridge (christingruber)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Add Gitter Bridge

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

Adds a notifier bridge for https://gitter.im the API documentation https://developer.gitter.im/docs/rest-api.

Commits
-------

d033677dfd Add symfony/gitter-notifier bridge
2021-01-20 12:53:29 +01:00
Nicolas Grekas
8a1a1b8171 [Console] enable describing commands in ways that make the list command lazy 2021-01-20 12:45:16 +01:00
Christin Gruber
d033677dfd Add symfony/gitter-notifier bridge 2021-01-20 11:40:49 +01:00
Oskar Stark
c6100bc386 feature #39342 [Notifier] Add mercure bridge (mtarld)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Add mercure bridge

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

Add a Notifier bridge for Mercure.
In this PR, Mercure is considered as a chatter (I'm still wondering if it's the most appropriate type).

The first approach for the DSN is `mercure://jwtToken@host:port/hubPath?topic=/foo/1&secure=false` with:
- `topic` optional (defaults to `null`)
- `secure` optional (defaults to `true`)

I'm not sure about the current way to deal with http/https. Maybe we can just replace the `mercure` scheme by `http|https`?

The notification representation is following [Activity Streams](https://www.w3.org/TR/activitystreams-core/#jsonld)

#SymfonyHackday

Commits
-------

19c6544f42 [Notifier] Add mercure bridge
2021-01-20 07:45:33 +01:00
HypeMC
a70b71b50e Fix typo in property name 2021-01-20 03:37:58 +01:00
Alexander M. Turek
d91278a68f Merge branch '5.2' into 5.x
* 5.2:
  [HttpFoundation] Drop int return type from parseFilesize()
  Added $translator->addLoader()
  bug symfony/symfony#39878 [doctrine-bridge] Add username to UserNameNotFoundException
  [Uid] Clarify the format returned by getTime()
  fix spelling
  Add check for constant in Curl client
  Revert #38614, add assert to avoid regression
  Fix container injection with TypedReference
  Fix problem when SYMFONY_PHPUNIT_VERSION is empty string value
  Update PHP CS Fixer config to v2.18
2021-01-19 22:04:23 +01:00
Alexander M. Turek
31dcefe779 Merge branch '5.1' into 5.2
* 5.1:
  [HttpFoundation] Drop int return type from parseFilesize()
  Added $translator->addLoader()
  bug symfony/symfony#39878 [doctrine-bridge] Add username to UserNameNotFoundException
  [Uid] Clarify the format returned by getTime()
  fix spelling
  Add check for constant in Curl client
  Revert #38614, add assert to avoid regression
  Fix container injection with TypedReference
  Fix problem when SYMFONY_PHPUNIT_VERSION is empty string value
  Update PHP CS Fixer config to v2.18
2021-01-19 22:00:40 +01:00
Alexander M. Turek
c639531fe4 Merge branch '4.4' into 5.1
* 4.4:
  [HttpFoundation] Drop int return type from parseFilesize()
  Added $translator->addLoader()
  bug symfony/symfony#39878 [doctrine-bridge] Add username to UserNameNotFoundException
  fix spelling
  Add check for constant in Curl client
  Revert #38614, add assert to avoid regression
  Fix problem when SYMFONY_PHPUNIT_VERSION is empty string value
  Update PHP CS Fixer config to v2.18
2021-01-19 21:48:35 +01:00
Alexander M. Turek
35c19c876b bug #39880 [DoctrineBridge] Add username to UserNameNotFoundException (qurben)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] Add username to UserNameNotFoundException

| 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       | Fix #39878  <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | <!-- required for new features -->
<!--
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/releases):
 - 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 5.x.
-->

Adds username to UserNameNotFoundException when thrown from EntityUserProvider.

In other places there are no tests for this and I am not sure if the current setup even allows asserting if exceptions contain fields, besides the default ones.

Commits
-------

ee5b51af78 bug symfony/symfony#39878 [doctrine-bridge] Add username to UserNameNotFoundException
2021-01-19 21:45:16 +01:00
Alexander M. Turek
6c01479a93 minor #39895 [Translator] Added $translator->addLoader() to README example (Ser5)
This PR was merged into the 4.4 branch.

Discussion
----------

[Translator] Added $translator->addLoader() to README example

For the example to work it needs the line with $translator->addLoader().
Fixed it for request at https://github.com/symfony/symfony/issues/39854#issuecomment-762283989

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| 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 -->
<!--
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/releases):
 - 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 5.x.
-->

Commits
-------

ba29d2a2f0 Added $translator->addLoader()
2021-01-19 21:42:38 +01:00
Nicolas Grekas
3257d4c2ed bug #39633 [HttpFoundation] Drop int return type from parseFilesize() (LukeTowers)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Drop int return type from parseFilesize()

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- 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       | Fix [octobercms/october#5410](https://github.com/octobercms/october/issues/5410)
| License       | MIT
| Doc PR        |

Related: #34516, #34508, 93685026b0, https://github.com/octobercms/october/issues/5410

Commits
-------

a1b31f840c [HttpFoundation] Drop int return type from parseFilesize()
2021-01-19 18:19:33 +01:00
Luke Towers
a1b31f840c [HttpFoundation] Drop int return type from parseFilesize() 2021-01-19 18:19:22 +01:00
Ser5
ba29d2a2f0
Added $translator->addLoader()
For the example to work it needs the line with $translator->addLoader().
Fixed it for request at https://github.com/symfony/symfony/issues/39854#issuecomment-762283989
2021-01-19 21:09:23 +05:00
Jérémy Derussé
2c8368f592
minor #39892 [Uid] Clarify the format returned by getTime() (fancyweb)
This PR was merged into the 5.1 branch.

Discussion
----------

[Uid] Clarify the format returned by getTime()

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

I think adding a comment to explain the returned format is useful here, especially for uuid since their "normal" epoch is not the unix epoch.

Commits
-------

c14c7376bd [Uid] Clarify the format returned by getTime()
2021-01-19 15:45:30 +01:00
Gerben Oolbekkink
ee5b51af78 bug symfony/symfony#39878 [doctrine-bridge] Add username to UserNameNotFoundException 2021-01-19 15:42:58 +01:00
Christian Flothmann
b8e76de57d feature #39863 [Form][Uid] Add UlidType and UuidType form types (Gemorroj)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Form][Uid] Add UlidType and UuidType form types

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

Commits
-------

c84746bc1f add UlidType and UuidType form types
2021-01-19 14:51:27 +01:00
Alexander M. Turek
732bd84a8d minor #39868 Update PHP CS Fixer config to v2.18 (keradus)
This PR was merged into the 4.4 branch.

Discussion
----------

Update PHP CS Fixer config to v2.18

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| 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 -->
<!--
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/releases):
 - 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 5.x.
-->

Commits
-------

734361bb0e Update PHP CS Fixer config to v2.18
2021-01-19 13:34:00 +01:00
Alexander M. Turek
960a108b4a minor #39891 [Validator] fix spelling (ben29)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] fix spelling

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #38744
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->
<!--
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/releases):
 - 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 5.x.
-->

Commits
-------

c488ff0089 fix spelling
2021-01-19 13:28:57 +01:00
Thomas Calvet
c14c7376bd [Uid] Clarify the format returned by getTime() 2021-01-19 13:23:40 +01:00
Ben Hakim
c488ff0089
fix spelling 2021-01-19 14:17:53 +02:00
Nicolas Grekas
49889c961a feature #39806 [DependencyInjection] Add a remove() method to the PHP configurator (dunglas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DependencyInjection] Add a remove() method to the PHP configurator

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| License       | MIT
| Doc PR        | todo

This especially useful in the `configureContainer()` method of the kernel. It allows to not use a compiler pass to remove some services (for instance, in test mode).

Commits
-------

dcf75fab3e [DependencyInjection] Add a remove() method to the PHP configurator
2021-01-19 12:08:15 +01:00
Kévin Dunglas
dcf75fab3e [DependencyInjection] Add a remove() method to the PHP configurator 2021-01-19 12:06:00 +01:00