Commit Graph

49796 Commits

Author SHA1 Message Date
Alexander M. Turek
7ccc2e1f28 [HttpClient] Support for cURL handler objects. 2020-06-24 10:43:17 +02:00
Fabien Potencier
19668b2a75 bug #37383 [VarDumper] Support for cURL handler objects (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] Support for cURL handler objects

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

Commits
-------

39c1a6373b [VarDumper] Support for cURL handler objects.
2020-06-24 10:40:29 +02:00
Fabien Potencier
aeb0946df0 bug #37395 add .body wrapper element (Nemo64)
This PR was merged into the 4.4 branch.

Discussion
----------

add .body wrapper element

This change makes the notification email responsive.

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

There was a wrapper missing from the foundation template.
This wrapper applies all `table.body table.container` styles from the foundation stylesheet
including font's and the responsive rules that were missing.

Commits
-------

5b74bbd288 add .body wrapper element
2020-06-24 10:39:13 +02:00
Fabien Potencier
98acf1cbbd bug #37400 [HttpClient] unset activity list when creating CurlResponse (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] unset activity list when creating CurlResponse

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

This might fix an error that looks like a race condition.
I've seen it, and @Toflar too, but we're unable to reproduce.

> Argument 2 passed to Symfony\Component\HttpClient\Chunk\DataChunk::__construct() must be of the type string, null given

This patch tentatively empties activity lists. If the issue is related to the PHP engine reusing resource ids, this will fix it. Otherwise, we'll know we'll have to look elsewhere.

> looking at https://github.com/symfony/http-client/blob/4.4/Response/ResponseTrait.php#L363 I don’t really see how this can happen other than inflate_add() returning null

> $response->inflate is true before becoming a resource; there must be a race condition in the curl client that ends up listing a data chunk before a FirstChunk in the activity list, which would explain why inflate_add is given a non-resource (`true`).

Commits
-------

b249f00519 [HttpClient] unset activity list when creating CurlResponse
2020-06-24 10:38:05 +02:00
Christian Flothmann
bfe1631edd use dashes instead of underscores for XML attributes 2020-06-24 10:36:02 +02:00
Fabien Potencier
5855d112b7 [Notifier] Return SentMessage from the Notifier message handler 2020-06-24 08:23:54 +02:00
Nicolas Grekas
b249f00519 [HttpClient] unset activity list when creating CurlResponse 2020-06-23 20:33:34 +02:00
Robin Chalas
968bd0ffec Fixed typo in test name 2020-06-23 14:31:34 +02:00
Nicolas Grekas
dd81e32ec1 [HttpFoundation] add HeaderUtils::parseQuery(): it does the same as parse_str() but preserves dots in variable names 2020-06-23 13:46:20 +02:00
Fabien Potencier
51a1820dee bug #37396 [DI] Fix call to sprintf in ServicesConfigurator::stack() (dunglas)
This PR was merged into the 5.1 branch.

Discussion
----------

[DI] Fix call to sprintf in ServicesConfigurator::stack()

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

This PR fixes a faulty call to `sprintf()` and prevents the following error:

```
Warning: sprintf(): Too few arguments in /Users/dunglas/workspace/activity-pub/vendor/symfony/dependency-injection/Loader/Configurator/ServicesConfigurator.php on line 154

Fatal error: Uncaught Error: Wrong parameters for Symfony\Component\DependencyInjection\Exception\InvalidArgumentException([string $message [, long $code [, Throwable $previous = NULL]]]) in /Users/dunglas/workspace/activity-pub/vendor/symfony/dependency-injection/Loader/Configurator/ServicesConfigurator.php:154 Stack trace: #0 /Users/dunglas/workspace/activity-pub/vendor/symfony/dependency-injection/Loader/Configurator/ServicesConfigurator.php(154): Exception->__construct('', 1, 'api_platform.js...') #1 /Users/dunglas/workspace/activity-pub/src/Bundle/Resources/config/services.php(12): Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator->stack('api_platform.js...', Array) #2 /Users/dunglas/workspace/activity-pub/vendor/symfony/dependency-injection/Loader/PhpFileLoader.php(50): Symfony\Component\DependencyInjection\Loader\ProtectedPhpFileLoader::Symfony\Component\DependencyInjection\Loader\Configurator\{closure}(Object(Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurat in /Users/dunglas/workspace/activity-pub/vendor/symfony/dependency-injection/Loader/Configurator/ServicesConfigurator.php on line 154
```

Commits
-------

11da9d3c29 [DI] Fix call to sprintf in ServicesConfigurator::stack()
2020-06-23 13:42:51 +02:00
Kévin Dunglas
11da9d3c29
[DI] Fix call to sprintf in ServicesConfigurator::stack() 2020-06-23 12:20:00 +02:00
Marco Pfeiffer
5b74bbd288
add .body wrapper element
This change makes the notification email responsive.
2020-06-23 11:57:07 +02:00
Fabien Potencier
ce8f8a5f18 feature #36611 Add Notifier SentMessage (jeremyFreeAgent)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

Add Notifier SentMessage

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

Like Mailer, Notifier returns now a SentMessage that contains the messageId (returned by the provider in the response). It contains also the body of the response as array to have more info about price, number of sms sent, status and so on.

- [x] apply to bridges

Commits
-------

5a6f0537ec Add Notifier SentMessage
2020-06-23 09:04:53 +02:00
Jérémy Romey
5a6f0537ec Add Notifier SentMessage 2020-06-23 09:04:45 +02:00
YaFou
76a744ad91
[HttpFondation] Change file extension of "audio/mpeg" from "mpga" to "mp3" 2020-06-23 08:52:36 +02:00
Fabien Potencier
a3900af2f0 feature #37357 [FrameworkBundle] allow configuring trusted proxies using semantic configuration (nicolas-grekas)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[FrameworkBundle] allow configuring trusted proxies using semantic configuration

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

On top of the improved DX this should provide, this PR (and #37351) will allow [removing the corresponding lines](https://github.com/symfony/recipes/pull/790) from `index.php` & recipes.

Using values:
```yaml
framework:
    trusted_proxies: '127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16'
#or
    trusted_proxies: '%env(TRUSTED_PROXIES)%'
```

`trusted_headers` is similar but is an array of headers to trust.
```yaml
framework:
    # that's the defaults already
    trusted_headers: ['x-forwarded-all', '!x-forwarded-host', '!x-forwarded-prefix']
```

Commits
-------

af9dd52752 [FrameworkBundle] allow configuring trusted proxies using semantic configuration
2020-06-23 06:59:37 +02:00
Fabien Potencier
b83d250c53 bug #37368 [Security] Resolve event bubbling of logout + new events in a compiler pass (wouterj)
This PR was merged into the 5.1 branch.

Discussion
----------

[Security] Resolve event bubbling of logout + new events in a compiler pass

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

This PR proposes to create a compiler pass that registers listeners on the main `event_dispatcher` on the firewall-specific event dispatcher during compile time. This allows to still specify listener priorities while listening on a bubbled-up event (instead of a fix moment where the event bubbling occurs). It probably also improves performance, as it doesn't use duplicated event dispatching logic to provide event bubbling.

Nothing changes on the user side. I proposed this as a bugfix, as it fixes the bug mentioned in #37292 (not being able to use listener priorities). I did remove a class, which was introduced in 5.1 and is very internal. I think it's safe, but we can also keep it and remove in master.

Commits
-------

f962c26061 Resolve event bubbling logic in a compiler pass
2020-06-23 06:57:21 +02:00
Fabien Potencier
24dde11557 minor #37380 [FrameworkBundle] changed configuration file for workflow from XML to PHP (lyrixx)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[FrameworkBundle] changed configuration file for workflow from XML to PHP

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

Commits
-------

2f1b72d7d0 [FrameworkBundle] changed configuration file for workflow from XML to PHP
2020-06-22 17:01:31 +02:00
Alexander M. Turek
39c1a6373b [VarDumper] Support for cURL handler objects. 2020-06-22 16:59:03 +02:00
Fabien Potencier
030b10ca0d bug #36304 Check whether path is file in DataPart::fromPath() (freiondrej)
This PR was submitted for the 5.0 branch but it was squashed and merged into the 4.4 branch instead.

Discussion
----------

Check whether path is file in DataPart::fromPath()

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no

Method `getBody()` uses stream_get_contents() to retrieve the body, however it fails to do so when the stream is a directory.

Commits
-------

9e3670e140 Check whether path is file in DataPart::fromPath()
2020-06-22 16:55:16 +02:00
Ondřej Frei
9e3670e140 Check whether path is file in DataPart::fromPath() 2020-06-22 16:55:08 +02:00
Grégoire Pineau
2f1b72d7d0 [FrameworkBundle] changed configuration file for workflow from XML to PHP 2020-06-22 16:26:03 +02:00
Fabien Potencier
b3a313cd35 feature #37373 [DI] deprecate Definition/Alias::setPrivate() (nicolas-grekas)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[DI] deprecate Definition/Alias::setPrivate()

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

Right now, there is a very subtle difference between `setPublic()` and `setPrivate()` that dates back to the FC/BC layer we created to turn services private by default.

We kept this difference to help third party bundles provide support for a wide range of versions of Symfony, but since 5.2 will be released at the same time as 3.4 will enter EOM, we should remove this behavior and deprecate `setPrivate()` to signal the change.

This is what this PR does.

Commits
-------

1bea690f4d [DI] deprecate Definition/Alias::setPrivate()
2020-06-22 14:41:31 +02:00
Nicolas Grekas
af9dd52752 [FrameworkBundle] allow configuring trusted proxies using semantic configuration 2020-06-22 14:34:19 +02:00
Fabien Potencier
33c6766117 minor #37376 [DI][FrameworkBundle] Remove "whitelist" occurrences (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI][FrameworkBundle] Remove "whitelist" occurrences

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

Commits
-------

12ab96ec9b [DI][FrameworkBundle] Remove whitelist occurrences
2020-06-22 13:34:12 +02:00
Fabien Potencier
2c9e9cd0c2 feature #37351 [FrameworkBundle] allow enabling the HTTP cache using semantic configuration (nicolas-grekas)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[FrameworkBundle] allow enabling the HTTP cache using semantic configuration

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

Right now, using the HTTP cache requires tweaking the `public/index.php` file [as explained in the doc](https://symfony.com/doc/current/http_cache.html).

This PR removes this requirement by allowing one to do this instead:
```yaml
framework:
    http_cache: true
```

Commits
-------

56b993ac2e [FrameworkBundle] allow enabling the HTTP cache using semantic configuration
2020-06-22 12:54:50 +02:00
Robin Chalas
12ab96ec9b [DI][FrameworkBundle] Remove whitelist occurrences 2020-06-22 11:57:22 +02:00
Robin Chalas
5597871b75 feature #37306 [Messenger] added support for Amazon SQS QueueUrl as DSN (starred-gijs)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Messenger] added support for Amazon SQS QueueUrl as DSN

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #37305
| License       | MIT
| Doc PR        | N/A

This will allow to use an Amazon SQS QueueUrl as transport DSN

Commits
-------

13554b0fae [Messenger] added support for Amazon SQS QueueUrl as DSN
2020-06-22 11:29:54 +02:00
Gijs van Lammeren
13554b0fae [Messenger] added support for Amazon SQS QueueUrl as DSN 2020-06-22 11:19:58 +02:00
Nicolas Grekas
1bea690f4d [DI] deprecate Definition/Alias::setPrivate() 2020-06-22 10:12:56 +02:00
Fabien Potencier
3aa7426ec2 minor #37372 Avoid accessibility errors on symfony web debug toolbar (alexander-schranz)
This PR was merged into the 3.4 branch.

Discussion
----------

Avoid accessibility errors on symfony web debug toolbar

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | symfony/symfony-docs#...

When for example using the [axe](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd) to test the website for accessibility. Axe will fail because a div element without a role or a parent [landmark](https://www.w3.org/TR/wai-aria-practices/examples/landmarks/HTML5.html) is rendered. To avoid this errors I think we should define it as a specific region.

Commits
-------

223b405168 Avoid accessibility errors on debug toolbar
2020-06-22 10:10:20 +02:00
Nicolas Grekas
abae49d572 Merge branch '5.1'
* 5.1:
  Relax tests to unlock change on master
  [DI] fix dumping deprecated private aliases
  [DI] fix typo in Preloader
  Fix UserCheckerListener registration with custom user checkers
  [Messenger] fixed queue_name option amazon sqs connection
2020-06-22 10:00:49 +02:00
Nicolas Grekas
0878dd4ac0 Merge branch '5.0' into 5.1
* 5.0:
  Relax tests to unlock change on master
  [DI] fix dumping deprecated private aliases
  [DI] fix typo in Preloader
2020-06-22 09:53:17 +02:00
Nicolas Grekas
cf68c1d810 Merge branch '4.4' into 5.0
* 4.4:
  Relax tests to unlock change on master
  [DI] fix dumping deprecated private aliases
  [DI] fix typo in Preloader
2020-06-22 09:53:10 +02:00
Nicolas Grekas
a9ffbf4ccf Merge branch '3.4' into 4.4
* 3.4:
  Relax tests to unlock change on master
2020-06-22 09:52:44 +02:00
Nicolas Grekas
484dcbd682 minor #37375 Relax tests to unlock change on master (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Relax tests to unlock change on master

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

Required to make #37373 green.
Doesn't change any outcome.

Commits
-------

afe596e16a Relax tests to unlock change on master
2020-06-22 09:50:22 +02:00
Nicolas Grekas
afe596e16a Relax tests to unlock change on master 2020-06-22 09:47:42 +02:00
Tristan Pouliquen
eec12ecd23 Use the driverConnection executeUpdate method 2020-06-22 09:47:17 +02:00
Tobias Schultze
da55768d76 minor #37257 [FrameworkBundle] changed configuration file for messenger from xml to php (hyoa)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[FrameworkBundle] changed configuration file for messenger from xml to php

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |  https://github.com/symfony/symfony/issues/37186
| License       | MIT

Use `messenger.php` instead of `messenger.xml` and `messenger_debug.php` instead of `messenger_debug.php`

Commits
-------

571a49873e [FrameworkBundle] changed configuration file for messenger from xml to php
2020-06-21 20:26:56 +02:00
Fabien Potencier
9cff4e1188 Add missing CHANGELOG 2020-06-21 19:32:04 +02:00
Jules Matsounga
571a49873e [FrameworkBundle] changed configuration file for messenger from xml to php 2020-06-21 19:25:58 +02:00
Alexander Schranz
223b405168
Avoid accessibility errors on debug toolbar 2020-06-21 18:44:56 +02:00
Tobias Schultze
efbf840715 minor #37208 [FrameworkBundle] convert config/serializer.xml to php (mamontovdmitriy, Tobion)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[FrameworkBundle] convert config/serializer.xml to php

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Part of #37186
| License       | MIT

Hello!

This PR contains a new configuration file `serializer.php` instead of `serializer.xml`.

Commits
-------

62e9788599 make priority integers & fix test checking definition to be private
25df2de0a6 [FrameworkBundle] convert config/serializer.xml to php
2020-06-21 18:28:46 +02:00
Nicolas Grekas
90f6e11ee8 [DI] fix dumping deprecated private aliases 2020-06-21 18:08:20 +02:00
Tobias Schultze
62e9788599 make priority integers & fix test checking definition to be private 2020-06-21 17:56:24 +02:00
Dmitriy Mamontov
25df2de0a6 [FrameworkBundle] convert config/serializer.xml to php 2020-06-21 17:56:24 +02:00
Nicolas Grekas
1f224763f4 [DI] fix typo in Preloader 2020-06-21 16:44:07 +02:00
Wouter de Jong
f962c26061 Resolve event bubbling logic in a compiler pass
* This removes duplicate event dispatching logic on event bubbling, which
  probably improves performance.
* It allows to still specify listener priorities while listening on a
  bubbled-up event (instead of a fix moment where the event bubbling occurs)
2020-06-21 01:27:36 +02:00
Fabien Potencier
0fa01aeda1 feature #37336 [Security] Let security factories add firewall listeners (scheb)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Security] Let security factories add 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.

With the new authenticator-based security system, it is no longer possible to add a authentication listener to the firewall. The only way to do it is a dirty compiler pass, which extends the argument on the `security.firewall.map.context.[firewallName]` service (like I do in: ed2ce9804b/src/bundle/DependencyInjection/Compiler/AccessListenerCompilerPass.php). This is quite ugly and hacky, so I believe there should be an easier and clean way to add firewall-level listeners. This PR adds an interface, which may be implemented by security factories and lets them add additional listeners to the firewall.

Why would you want to do that? There are certain use-cases that require extra logic to handle a request within the firewall. For example in my bundle, I need to handle the intermediate state between login and the completion of two-factor authentication. So ideally, I'm able to execute some code from the firewall right before `Symfony\Component\Security\Http\Firewall\AccessListener`. In the old security system, I could handle this in my authentication listener, which I had to implement anyways. With the new authenticator-based system this option is gone. In the ideal world, I could add a firewall listener and tell it to execute between `LogoutListener` and `AccessListener`.

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

There's another issue, regarding the order of execution, which I'm addressing with #37337.

Commits
-------

0a4fcea8db Add interface to let security factories add their own firewall listeners
2020-06-20 17:05:14 +02:00
Fabien Potencier
3267e8e66f feature #37318 [Security] Add attributes on Passport (fabpot)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Security] Add attributes on Passport

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- 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 #", if any -->
| License       | MIT
| Doc PR        | not yet

see https://github.com/symfonycorp/connect/pull/95
/cc @wouterj

Commits
-------

440ada3c5f [Security] Add attributes on Passport
2020-06-20 17:04:28 +02:00