Commit Graph

36672 Commits

Author SHA1 Message Date
Robin Chalas
040d93d5b5 minor add missing loop break 2019-11-09 13:08:24 +01:00
Fabien Potencier
758e266f48 bug #34304 [Security] Fix defining multiple roles per access_control rule (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Fix defining multiple roles per access_control rule

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        |  https://github.com/symfony/symfony-docs/pull/12371 needs to be reverted

#33584 deprecated passing multiple attributes to `AccessDecisionManager::decide()`, but this change must not impact `access_control` as you cannot define multiple rules with the same criteria for request matching (the first match wins).

Commits
-------

338b3dfd9f [Security] Fix defining multiple roles per access_control rule
2019-11-09 12:16:35 +01:00
Fabien Potencier
d688a79b5a feature #34139 [Security] Add migrating encoder configuration (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Add migrating encoder configuration

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

Commits
-------

80955be45d [Security] Add migrating encoder configuration
2019-11-09 12:12:07 +01:00
Robin Chalas
80955be45d [Security] Add migrating encoder configuration 2019-11-09 11:20:37 +01:00
Nicolas Grekas
12a8b6937b [Translator] fix compat with translation-contracts v2 2019-11-09 10:30:00 +01:00
Nicolas Grekas
55559f48b5 [IdentityTranslator] fix compat with translation-contracts v2 2019-11-09 09:49:52 +01:00
Robin Chalas
338b3dfd9f [Security] Fix defining multiple roles per access_control rule 2019-11-09 09:18:51 +01:00
Nicolas Grekas
a20e1ad138 Merge branch '4.3' into 4.4
* 4.3:
  [Workflow] Simplified EventDispatcherMock.
  [Routing] revert the return type for UrlGeneratorInterface::generate to remove null
2019-11-09 09:06:11 +01:00
Fabien Potencier
fd7c676172 minor #34303 [Messenger] Fixed bad event dispatcher mocks (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Fixed bad event dispatcher mocks

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

`EventDispatcherInterface::dispatch()` must return the passed event object. This PR fixes two mocks that violated this contract.

Commits
-------

103930039b [Messenger] Fixed bad event dispatcher mocks.
2019-11-09 07:45:24 +01:00
Fabien Potencier
e4ddc75549 minor #34302 [Workflow] Simplified EventDispatcherMock (derrabus)
This PR was merged into the 4.3 branch.

Discussion
----------

[Workflow] Simplified EventDispatcherMock

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

This PR simplifies the Workflow component's mock implementation of the event dispatcher by implementing the much simpler contracts interface instead of the full-blown component interface.

Commits
-------

5aee181c83 [Workflow] Simplified EventDispatcherMock.
2019-11-09 07:38:43 +01:00
Fabien Potencier
f4c925418b feature #32194 [HttpFoundation] Add a way to anonymize IPs (Seldaek)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Add a way to anonymize IPs

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features --> TODO

This is helpful for GDPR compliance reasons, and it isn't much code saved but it's also good if you don't have to think about how to do it.

Commits
-------

9e62330bc4 [HttpFoundation] Add a way to anonymize IPs
2019-11-09 07:36:01 +01:00
Alexander M. Turek
103930039b [Messenger] Fixed bad event dispatcher mocks. 2019-11-09 00:05:14 +01:00
Nicolas Grekas
9e554cee75 [EventDispatcher] dont allow event-dispatcher-contracts ^2 2019-11-08 23:40:51 +01:00
Alexander M. Turek
5aee181c83 [Workflow] Simplified EventDispatcherMock. 2019-11-08 23:25:20 +01:00
Nicolas Grekas
b148114116 [FrameworkBundle] fix lower dep 2019-11-08 23:04:53 +01:00
Nicolas Grekas
522bd5d99d [DI] fix loading env while env loaders are loaded 2019-11-08 21:45:30 +01:00
Jordi Boggiano
9e62330bc4
[HttpFoundation] Add a way to anonymize IPs 2019-11-08 18:11:01 +01:00
Nicolas Grekas
7c111bdcf3 minor #34290 [DI] Remove LazyString from 4.4, before adding back to the String component (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] Remove LazyString from 4.4, before adding back to the String component

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

In #34190 I'm proposing to move LazyString to the Service contracts, but String might be a better fit actually. Let's remove the class from 4.4 where it's not really needed, and add it back on 5.0 in the String component.

Commits
-------

b1a3ee76ac [DI] Remove LazyString from 4.4, before adding back to the String component
2019-11-08 17:26:52 +01:00
Nicolas Grekas
f459fd01a2 Merge branch '4.3' into 4.4
* 4.3:
  [DI] fix locators with numeric keys
  Fix error when we use VO for the marking property
2019-11-08 17:24:33 +01:00
Nicolas Grekas
bc726f7d50 bug #34294 [Workflow] Fix error when we use ValueObject for the marking property (FabienSalles)
This PR was merged into the 4.3 branch.

Discussion
----------

[Workflow] Fix error when we use ValueObject for the marking property

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #28203 #22031
| License       | MIT

Fix Illegal offset type in `MethodMarkingStore` class when we use Value Object for
the marking property.

Now, we can avoid to use only a string an we can have a Subject class with a Value Object like this :
```php
final class State
{
    public const DRAFT = 'draft';
    public const REVIEWED = 'reviewed';
    public const REJECTED = 'rejected';
    public const PUBLISHED = 'published';

     /** @var string */
    private $state;

    public function __construct(string $state)
    {
        // some validation
        $this->state = $state;
    }

    public function __toString()
     {
         return $this->state;
    }

    public static function Draft()
     {
         return new self(self::DRAFT);
     }
    ...
}

final class Subject
{
    private $marking;

    public function __construct(State $marking = null)
    {
        $this->marking = $marking;
    }

    public function getMarking()
    {
        return $this->marking;
    }

    public function setMarking($marking)
    {
        $this->marking = $marking instanceof State ? $marking : new State($marking);
    }

```

Commits
-------

6570d5cbe2 Fix error when we use VO for the marking property
2019-11-08 17:23:33 +01:00
Nicolas Grekas
618aec6abe Merge branch '3.4' into 4.3
* 3.4:
  [DI] fix locators with numeric keys
2019-11-08 17:22:27 +01:00
Nicolas Grekas
dad4344793 [DI] fix locators with numeric keys 2019-11-08 17:18:30 +01:00
Nicolas Grekas
97577aea66 feature #34252 [Console] Add support for NO_COLOR env var (Seldaek)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Add support for NO_COLOR env var

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

Adds support for https://no-color.org/ - ideally this would be considered a bugfix and added to older releases IMO, but submitting as new feature for now.

cc @johnstevenson

Commits
-------

c1b0a8e956 Add support for NO_COLOR env var
2019-11-08 17:06:42 +01:00
Jordi Boggiano
c1b0a8e956
Add support for NO_COLOR env var 2019-11-08 16:59:14 +01:00
Nicolas Grekas
ba2148fff3 [DI][FrameworkBundle] add EnvVarLoaderInterface - remove SecretEnvVarProcessor 2019-11-08 15:47:02 +01:00
FabienSalles
6570d5cbe2 Fix error when we use VO for the marking property
Fix Illegal offset type when we use ValueObject instead of string for
the marking property #28203 #22031
2019-11-08 12:45:38 +01:00
Nicolas Grekas
b1a3ee76ac [DI] Remove LazyString from 4.4, before adding back to the String component 2019-11-08 11:42:01 +01:00
Nicolas Grekas
585c0df909 feature #31310 [DependencyInjection] Added option ignore_errors: not_found for imported config files (pulzarraider)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Added option `ignore_errors: not_found` for imported config files

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | symfony/symfony-docs#11647

If someone want to add optional config file. The only available choice was to add `ignore_errors: true` option

e.g.
```
imports:
    - { resource: parameters.yml, ignore_errors: true }
```

But this will hide all errors in imported file. We ran in many situations that broke our Symfony applications because we had a typo in this imported files.

This PR introduce new possible value `not_found` for `ignore_errors` option. It can be used for optional config files like the `ignore_errors: true`, but it will ignore only the file non-existence, not the possible syntax errors inside.

Usage:
```
imports:
    - { resource: parameters.yml, ignore_errors: not_found}
```

Commits
-------

e0ee01c10d [DependencyInjection] Added option `ignore_errors: not_found` while importing config files
2019-11-08 09:53:35 +01:00
Nicolas Grekas
7a8b85cc67 bug #34285 [FrameworkBundle] fix SodiumVault after stof review (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] fix SodiumVault after stof review

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

As spotted by @stof in https://github.com/symfony/symfony/pull/34275#pullrequestreview-313355834

Commits
-------

a594599078 [FrameworkBundle] fix SodiumVault after stof review
2019-11-08 09:34:16 +01:00
Nicolas Grekas
8aaa8c5fc6 Merge branch '4.3' into 4.4
* 4.3:
  [DI] Dont cache classes with missing parents
  [HttpClient] Fix a crash when calling CurlHttpClient::__destruct()
  [Validator] Add the missing translations for the Hebrew (\"he\") locale and fix 2 typos
  [FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change
2019-11-08 09:33:02 +01:00
Nicolas Grekas
a1fc280bf2 Merge branch '3.4' into 4.3
* 3.4:
  [DI] Dont cache classes with missing parents
  [Validator] Add the missing translations for the Hebrew (\"he\") locale and fix 2 typos
2019-11-08 09:31:27 +01:00
Nicolas Grekas
1606430cfd [DI] Dont cache classes with missing parents 2019-11-08 09:28:59 +01:00
Kévin Dunglas
d2c5ffda52 [HttpClient] Fix a crash when calling CurlHttpClient::__destruct() 2019-11-08 09:23:45 +01:00
Thomas Calvet
da454db947 Unallow symfony/http-kernel ^5.0 2019-11-07 18:22:59 +01:00
Nicolas Grekas
a594599078 [FrameworkBundle] fix SodiumVault after stof review 2019-11-07 17:20:24 +01:00
Peter Schultz
e98731aabf [HttpClient] allow arbitrary JSON values in requests
Allow arbitrary values in the "json" request option. Previously values were
limitated to arrays and objects of type JsonSerializable. This doesn't account
for scalar values and classes with public properties (which don't need to
implement JsonSerializable), all of which are perfectly acceptable arguments to
json_encode.
2019-11-07 13:44:51 +01:00
Andrej Hudec
e0ee01c10d [DependencyInjection] Added option ignore_errors: not_found while importing config files 2019-11-07 12:06:31 +01:00
Nicolas Grekas
326284ae95 [FrameworkBundle] allow using secrets when the sodium ext is missing 2019-11-07 08:50:00 +01:00
Fabien Potencier
4056baf0f4 bug #34129 [FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change

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

The cache file name needs to depend on the scanned directories list. Otherwise, when a new directory is added, even if the container is rebuilt and the `FWB Translator` gets the new scanned directories list, the cached catalogue name is still the same and is resolved accordingly.

An alternative would be to make the `Translation Translator` `getCatalogueCachePath()` method and `fallbackLocales` `@internal` and `protected` to just override everything in the `FWB Translator`. The `cacheVary` argument has the benefit to be reusable by all the `Translation` component users.

Note that there is a negative minor performance impact that increases when the list of scanned directories grows.

Commits
-------

6cbee0944c [FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change
2019-11-07 00:21:49 +01:00
Yonel Ceruto
ba07cda358 minor #34249 [TwigBridge] Fix switch-custom changelog entry (ogizanagi)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBridge] Fix switch-custom changelog entry

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Relates to #33954
| License       | MIT
| Doc PR        | N/A

As it doesn't really mention `switch-custom` is a css class.

Commits
-------

b03b7f4 [TwigBridge] Fix switch-custom changelog entry
2019-11-06 12:55:14 -05:00
Nicolas Grekas
403fdf4a59 Skip validation of services that make the CI fail 2019-11-06 17:48:56 +01:00
Nicolas Grekas
a1155ea6e2 Merge branch '4.3' into 4.4
* 4.3:
  [Serializer] Use context to compute MetadataAwareNameConverter cache
2019-11-06 17:13:44 +01:00
Anto
0ac5346bf5
[Serializer] Use context to compute MetadataAwareNameConverter cache 2019-11-06 17:10:14 +01:00
Thomas Calvet
d25b60961f [VarDumper] Mark StubCaster as @final 2019-11-06 17:06:09 +01:00
Nicolas Grekas
ca398df11f [DoctrineBridge] conflict with validator < 4.4 2019-11-06 16:07:32 +01:00
Nicolas Grekas
50633f2579 fix typo (bis) 2019-11-06 15:43:50 +01:00
Nicolas Grekas
9641215656 fix typo 2019-11-06 15:42:57 +01:00
Nicolas Grekas
4c401ebdd6 [HttpKernel] backport FC compat code 2019-11-06 15:42:08 +01:00
Nicolas Grekas
bd7da14243 minor #34261 [DoctrineBridge] fix min version of http-kernel (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] fix min version of http-kernel

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

Required after #34257 and #34230

Commits
-------

69ba86ba66 [DoctrineBridge] fix min version of http-kernel
2019-11-06 15:29:25 +01:00
Nicolas Grekas
69ba86ba66 [DoctrineBridge] fix min version of http-kernel 2019-11-06 15:26:48 +01:00