Commit Graph

47862 Commits

Author SHA1 Message Date
Fabien Potencier
6c042661e2 minor #35901 [Validator] add German translation (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] add German translation

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

Commits
-------

9d837ecb34 add German translation
2020-02-29 10:08:42 +01:00
Fabien Potencier
e4104b6411 minor #35903 [Validator] add Vietnamese translation (jschaedl)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] add Vietnamese translation

| Q             | A
| ------------- | ---
| Branch?       | 3.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       |  <!-- prefix each issue number with "Fix #", if any -->
| 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 master.
-->

Commits
-------

c16d153522 [Validator] Add missing vietnamese translations
2020-02-29 10:07:39 +01:00
Jan Schädlich
c16d153522 [Validator] Add missing vietnamese translations 2020-02-29 09:57:15 +01:00
arai
90104a919d [Validator] add Japanese translation 2020-02-29 09:37:39 +09:00
Christian Flothmann
9d837ecb34 add German translation 2020-02-28 15:30:03 +01:00
Christian Flothmann
45a033d67b add missing Messenger options to XML schema definition 2020-02-28 14:15:16 +01:00
Wouter de Jong
3c8d316f65 Added ROLE_PREVIOUS_ADMIN deprecation to UPGRADE guide 2020-02-28 12:20:28 +01:00
Ahmed TAILOULOUTE
4d695b380d [ExpressionLanguage] Fixed exception message 2020-02-28 11:19:56 +01:00
Nicolas Grekas
5ffb96452f minor #35861 [DomCrawler][Form] Fix PHPDoc on get & offsetGet (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[DomCrawler][Form] Fix PHPDoc on get & offsetGet

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

`FormFieldRegistry::get()` returns mixed. For example, it can return an array when the field is a collection.

Commits
-------

f8735cc47b [DomCrawler][Form] Fix PHPDoc on get & offsetGet
2020-02-27 11:19:42 +01:00
Nicolas Grekas
dd8f580eda minor #35877 [Validator][ConstraintValidator] Update wrong PRETTY_DATE doc (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator][ConstraintValidator] Update wrong PRETTY_DATE doc

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

That is really minor but the current doc is not up to date with the real behavior.

Commits
-------

491fc5c24d [Validator][ConstraintValidator] Update wrong PRETTY_DATE doc
2020-02-27 11:12:24 +01:00
Nicolas Grekas
421c7f8fcd minor #35872 Optimize HttpClient when body is iterable (jderusse)
This PR was merged into the 5.1-dev branch.

Discussion
----------

Optimize HttpClient when body is iterable

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

Small optimization on HttpClient by avoiding calling Reflection when body is a known Traversable.

Commits
-------

03b7743ff5 Optimize HttpClient when body is iterable
2020-02-27 11:09:40 +01:00
Fabien Potencier
15297b1409 minor #35880 [5.0] Remove some unused variables (fancyweb)
This PR was merged into the 5.0 branch.

Discussion
----------

[5.0] Remove some unused variables

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

Some cleanup.

Commits
-------

1f953e42f2 [5.0] Remove some unused variables
2020-02-27 07:04:32 +01:00
Jérémy Derussé
03b7743ff5
Optimize HttpClient when body is iterable 2020-02-27 00:20:25 +01:00
Thomas Calvet
1f953e42f2 [5.0] Remove some unused variables 2020-02-26 23:30:10 +01:00
Thomas Calvet
491fc5c24d [Validator][ConstraintValidator] Update wrong PRETTY_DATE doc 2020-02-26 21:34:36 +01:00
Thomas Calvet
f8735cc47b [DomCrawler][Form] Fix PHPDoc on get & offsetGet 2020-02-26 18:12:32 +01:00
Nicolas Grekas
da0e2f94bb bug #35870 [ErrorHandler] fix parsing static return type on interface method annotation (alekitto)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] fix parsing static return type on interface method annotation

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

As suggested in the issue, the regex has been adapted to capture the return type, then it will be checked while determining if the method to be implemented should be static or just returns an instance of `static`.

Commits
-------

55734a297f [ErrorHandler] fix parsing static return type on interface method annotation (fix #35836)
2020-02-26 17:55:50 +01:00
Mathias Arlaud
2da68bae8f [Routing] Add stateless route attribute 2020-02-26 15:20:07 +01:00
Alessandro Chitolina
55734a297f
[ErrorHandler] fix parsing static return type on interface method annotation (fix #35836) 2020-02-26 12:45:31 +01:00
Fabien Potencier
7995fed10b feature #35732 [FrameworkBundle][HttpKernel] Add session usage reporting in stateless mode (mtarld)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle][HttpKernel] Add session usage reporting in stateless mode

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

https://github.com/orgs/symfony/projects/1#card-30506005

Provide a `@Stateless` annotation that forbid session usage for annotated controllers (or classes).

## Implementations
**v1**
- ~~New session proxy that allows session to be marked as disabled~~
- ~~New default route attribute: `_stateless` (automatically set by `@Stateless`)~~
- ~~On kernel controller event, if `_stateless` is `true`, session is marked as disabled~~
- ~~Session listener is able to check if the session is disabled and prevent its creation~~

**v2**
- New default route attribute: `_stateless` (automatically set by `@Stateless`)
- On kernel response, check the session usage and if session was used when `_stateless` attribute is set to `true`: Either throw an exception (debug enabled) or log a warning (debug disabled)

Commits
-------

bc48db2424 [FrameworkBundle][HttpFoundation] Add `_stateless`
2020-02-26 11:40:28 +01:00
Robin Chalas
dca77c42ec Merge branch '5.0'
* 5.0:
  [Security] Allow switching to another user when already switched
2020-02-26 11:32:20 +01:00
Robin Chalas
4206b4dc4a Merge branch '4.4' into 5.0
* 4.4:
  [Security] Allow switching to another user when already switched
2020-02-26 11:31:10 +01:00
Robin Chalas
3057c68b93 Merge branch '3.4' into 4.4
* 3.4:
  [Security] Allow switching to another user when already switched
2020-02-26 11:27:30 +01:00
Mathias Arlaud
bc48db2424 [FrameworkBundle][HttpFoundation] Add _stateless 2020-02-26 11:16:11 +01:00
Nicolas Grekas
6f95125a09 bug #35839 [Security] Allow switching to another user when already switched (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] Allow switching to another user when already switched

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

Commits
-------

0353077083 [Security] Allow switching to another user when already switched
2020-02-26 10:44:17 +01:00
Robin Chalas
0353077083 [Security] Allow switching to another user when already switched 2020-02-26 04:23:24 +01:00
Nicolas Grekas
d0e5593b1f Merge branch '5.0'
* 5.0:
  [FrameworkBundle] Fix test
2020-02-25 15:44:02 +01:00
Nicolas Grekas
cd355dff07 Merge branch '4.4' into 5.0
* 4.4:
  [FrameworkBundle] Fix test
2020-02-25 15:39:06 +01:00
Nicolas Grekas
1b377a86db Merge branch '3.4' into 4.4
* 3.4:
  [FrameworkBundle] Fix test
2020-02-25 15:33:04 +01:00
Nicolas Grekas
159ef1bf1d [FrameworkBundle] Fix test 2020-02-25 15:31:47 +01:00
Nicolas Grekas
c56cf2da5d Merge branch '5.0'
* 5.0:
  minor #35833 [FrameworkBundle] Add missing items in the unused tag pass whitelist (fabpot)
  [HttpClient][DX] Add URL context to JsonException messages
  [Routing] Improve localized routes performances
  [4.4][DoctrineBridge] Use new Types::* constants and support new json type
  [Validator] Add missing translations
  [Notifier] Dispatch message event in null transport
  [Messenger] Use Doctrine DBAL new Types::* constants
2020-02-25 15:29:12 +01:00
Nicolas Grekas
11097a5aa6 Merge branch '4.4' into 5.0
* 4.4:
  minor #35833 [FrameworkBundle] Add missing items in the unused tag pass whitelist (fabpot)
  [HttpClient][DX] Add URL context to JsonException messages
  [Routing] Improve localized routes performances
  [4.4][DoctrineBridge] Use new Types::* constants and support new json type
  [Validator] Add missing translations
  [Messenger] Use Doctrine DBAL new Types::* constants
2020-02-25 15:24:11 +01:00
Nicolas Grekas
1107548146 Merge branch '3.4' into 4.4
* 3.4:
  minor #35833 [FrameworkBundle] Add missing items in the unused tag pass whitelist (fabpot)
  [Validator] Add missing translations
2020-02-25 15:19:32 +01:00
Nicolas Grekas
b515bc9a97 minor #35833 [FrameworkBundle] Add missing items in the unused tag pass whitelist (fabpot)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] Add missing items in the unused tag pass whitelist

| Q             | A
| ------------- | ---
| Branch?       | master
| 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 #", if any -->
| License       | MIT
| Doc PR        | n/a

We have some missing tags in the whitelist. I've added a script that adds the missing ones, and added a test to avoid forgetting about updating the whitelist.

Commits
-------

d1bcc0fc5e [FrameworkBundle] Add a script that checks for missing items in the unused tag whitelist
2020-02-25 15:18:39 +01:00
Nicolas Grekas
cad3f10cdb minor #35822 [HttpClient][DX] Add URL context to JsonException messages (GromNaN)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpClient][DX] Add URL context to JsonException messages

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/35762#issuecomment-589770016
| License       | MIT
| Doc PR        | N/A

In order to help when debugging incorrect JSON responses, this PR adds the requested URL to the error message.

Before: `Syntax Error`
After: `JSON error: Syntax error, from "https://example.com/file.json".`
See the 2nd commit for full diff in new unit tests

Commits
-------

06539173e7 [HttpClient][DX] Add URL context to JsonException messages
2020-02-25 14:55:46 +01:00
Jérôme TAMARELLE
06539173e7 [HttpClient][DX] Add URL context to JsonException messages 2020-02-25 14:55:11 +01:00
Nicolas Grekas
7b89d1b004 feature #35815 [Validator] Allow Sequentially constraints on classes + target guards (ogizanagi)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Validator] Allow Sequentially constraints on classes + target guards

| 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        | todo in https://github.com/symfony/symfony-docs/pull/13206 if not merged yet

There is no reason to limit this constraint to properties, so let's add classes as targets.

Additionally, let's ensure embedded constraints matches allowed targets too.

Commits
-------

1e02a96286 [Validator] Allow Sequentially constraints on classes
2020-02-25 14:41:21 +01:00
Nicolas Grekas
d297231c56 minor #35833 [FrameworkBundle] Add missing items in the unused tag pass whitelist (fabpot)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] Add missing items in the unused tag pass whitelist

| Q             | A
| ------------- | ---
| Branch?       | master
| 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 #", if any -->
| License       | MIT
| Doc PR        | n/a

We have some missing tags in the whitelist. I've added a script that adds the missing ones, and added a test to avoid forgetting about updating the whitelist.

Commits
-------

d1bcc0fc5e [FrameworkBundle] Add a script that checks for missing items in the unused tag whitelist
2020-02-25 14:09:27 +01:00
Fabien Potencier
d1bcc0fc5e [FrameworkBundle] Add a script that checks for missing items in the unused tag whitelist 2020-02-25 14:08:07 +01:00
Fabien Potencier
8a678f6679 minor #35819 [Messenger] Use Doctrine DBAL new Types::* constants (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Use Doctrine DBAL new Types::* constants

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

Commits
-------

f1fb1597ff [Messenger] Use Doctrine DBAL new Types::* constants
2020-02-25 14:05:06 +01:00
Fabien Potencier
53df70e374 feature #35747 [Routing][FrameworkBundle] Allow using env() in route conditions (atailouloute)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Routing][FrameworkBundle] Allow using env() in route conditions

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

This is a second implementation of #35727, it overcomes the limitation mentioned by nicolas in (https://github.com/symfony/symfony/pull/35727#issuecomment-586413390)

The goal of this feature is to be able to use env variables in Route conditions

```php
/**
 * @Route("/only-for-dev", condition="env('APP_ENV') === 'dev'")
 */
public function __invoke()
{
   echo "This will be executed only when APP_ENV = dev";
}
```
it supports also env processors/ loaders
```php
/**
 * @Route("/only-for-dev", condition="env('trim:APP_ENV') === 'dev'")
 */
````

**TODOs:**
- [x] Complete unit tests

Commits
-------

b5744601bf [Routing][FrameworkBundle] Allow using env() in route conditions
2020-02-25 14:01:25 +01:00
Ahmed TAILOULOUTE
b5744601bf [Routing][FrameworkBundle] Allow using env() in route conditions 2020-02-25 14:01:02 +01:00
Fabien Potencier
8867f57a44 feature #35857 [Routing] deprecate RouteCompiler::REGEX_DELIMITER (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Routing] deprecate RouteCompiler::REGEX_DELIMITER

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

This should be mostly internal cleanup.

Commits
-------

21b8a64446 [Routing] deprecate RouteCompiler::REGEX_DELIMITER
2020-02-25 13:53:07 +01:00
Fabien Potencier
28a249f2e5 feature #35804 [HttpFoundation] Added MarshallingSessionHandler (atailouloute)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpFoundation] Added MarshallingSessionHandler

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

Added `MarshallingSessionHandler`, a decorator for session handlers which uses the cache marshaller in order to encrypt session data.

(This is an alternative solution to #35643)

To use it, we can simply decorate the session marshaller, after that all session data will be encrypted

```yaml
Symfony\Component\Cache\Marshaller\SodiumMarshaller:
    decorates: 'session.marshaller'
    arguments:
        - ['%env(file:resolve:SODIUM_DECRYPTION_FILE)%']
        - '@Symfony\Component\Cache\Marshaller\SodiumMarshaller.inner'
```

TODO:
- [x] unit tests

Commits
-------

155d980aea [HttpFoundation][Cache] Added MarshallingSessionHandler
2020-02-25 13:51:34 +01:00
Fabien Potencier
82db995908 feature #35858 [Security] Deprecated ROLE_PREVIOUS_ADMIN (wouterj)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Security] Deprecated ROLE_PREVIOUS_ADMIN

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

`ROLE_PREVIOUS_ADMIN` is added to the token roles if the session is an impersonation. Since https://github.com/symfony/symfony/pull/31189 we have the `IS_IMPERSONATOR` attribute which can be used for the same reason. I propose to deprecate the `ROLE_PREVIOUS_ADMIN`:

* This is not what roles are for ([resulting in hacking this exception in `AbstractToken`](https://github.com/symfony/symfony/blob/5.0/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php#L275-L277))
* The role isn't very descriptive
* I don't like having 2 ways of doing exactly the same thing
* While every application with impersonation enabled probably needs to be updated, the update is as simple as replacing `ROLE_PREVIOUS_ADMIN` with `IS_IMPERSONATOR`: `find ./ -type f -exec sed -i 's/ROLE_PREVIOUS_ADMIN/IS_IMPERSONATOR/g' {} +`

---

I'm a bit unsure on how to deprecate this role, but I think having it in `RoleVoter` is probably the safest (`isGranted()` and variants + `AccessDecisionManager#decide()` all use this voter to check if the token has this role).

Commits
-------

dce55f352a Deprecated ROLE_PREVIOUS_ADMIN
2020-02-25 13:48:58 +01:00
Nicolas Grekas
ef95f2ecbc minor #35855 [Routing] Improve localized routes performances (mtarld)
This PR was merged into the 4.4 branch.

Discussion
----------

[Routing] Improve localized routes performances

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| License       | MIT

Implementation of the following idea: https://github.com/symfony/symfony/pull/35735#pullrequestreview-360525593

Improve route matching performances by turning dynamic routes with fixed `_locale` to actual static routes.

Commits
-------

8e9eafe18b [Routing] Improve localized routes performances
2020-02-25 13:47:10 +01:00
Fabien Potencier
88b96abe04 bug #35851 [4.4][DoctrineBridge] Use new Types::* constants and support new json types (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[4.4][DoctrineBridge] Use new Types::* constants and support new json types

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/35817#issuecomment-590419754
| License       | MIT
| Doc PR        | -

Commits
-------

ddf33535d0 [4.4][DoctrineBridge] Use new Types::* constants and support new json type
2020-02-25 13:46:09 +01:00
Fabien Potencier
a4c0bfacee minor #35854 [Security] Use new IS_* attributes in the expression language functions (wouterj)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Security] Use new IS_* attributes in the expression language functions

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

#31189 has been merged which introduces some new attributes (`IS_ANONYMOUS` & friends). We can now modify the code behind the `is_*()` expression language functions to use these new attributes. This avoids any possibility of having them out of sync.

In case you - just like me - are interested why `isGranted("IS_AUTHENTICATED_FULLY")` wasn't used before: These functions were implemented without `auth_checker` being available. The auth checker  variable was introduced in 4.2 by #27305, so now we can use this.

Commits
-------

3f0c599289 Use new IS_* attributes in the expression language functions
2020-02-25 13:43:42 +01:00
Mathias Arlaud
8e9eafe18b [Routing] Improve localized routes performances 2020-02-25 13:41:09 +01:00
Wouter de Jong
dce55f352a Deprecated ROLE_PREVIOUS_ADMIN 2020-02-25 13:38:33 +01:00