Commit Graph

105 Commits

Author SHA1 Message Date
Jérémy Derussé a46cff26c6
Fix CS in changelogs 2020-12-10 17:34:26 +01:00
Matthew Smeets d019d38220 Reference the correct interface in the RegistryInterface deprecation in upgrade notes 2020-10-15 20:55:38 +02:00
Yonel Ceruto 429605b213 add note about HTTP status code change 2019-12-23 10:53:34 -05:00
Quentin CURTET a3d90bece1 Docs - Update debug section of UPGRADE guides for 4.4 and 5.0 versions. 2019-12-18 22:36:53 +01:00
Maxime Steinhausser 00b46fa72e [Validation][FrameworkBundle] Allow EnableAutoMapping to work without auto-mapping namespaces 2019-12-17 09:15:02 +01:00
Fabien Potencier 4d11bca474 bug #34627 [Security/Http] call auth listeners/guards eagerly when they "support" the request (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security/Http] call auth listeners/guards eagerly when they "support" the request

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

This fixes the form authenticator linked to #34614.
Since laziness is here to provide compatibility with HTTP caching, it should be disabled when the request cannot be cached.

Tests don't pass yet, but I'm on the path to something here.

The PR now introduces a new `AbstractListener` that splits the handling logic in two:
- `supports(Request): ?bool` is always called eagerly and tells whether the listener matches the request for an earger call or a lazy call
- `authenticate(RequestEvent)` does the rest of the job when `supports()` allows so - lazily or not depending on the return value of `supports()`.

Of course, this remains compatible with non-lazy logics, see `AbstractListener::__invoke()`.

Commits
-------

b20ebe6b90 [Security/Http] call auth listeners/guards eagerly when they "support" the request
2019-11-30 10:56:08 +01:00
Nicolas Grekas b20ebe6b90 [Security/Http] call auth listeners/guards eagerly when they "support" the request 2019-11-30 10:49:41 +01:00
Nicolas Grekas 60aea22193 minor #34519 improve upgrade instructions for twig.exception_controller configuration (bendavies)
This PR was merged into the 4.4 branch.

Discussion
----------

improve upgrade instructions for twig.exception_controller configuration

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

This improves the upgrade instructions for the deprecated configuration of `twig.exception_controller`.

Or would it be better to make the default `null` on 4.4?
a8a9e69488/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php (L41)

Commits
-------

bdc68fd894 improve upgrade instructions for twig.exception_controller configuration
2019-11-28 13:22:13 +01:00
Ben Davies bdc68fd894 improve upgrade instructions for twig.exception_controller configuration 2019-11-28 11:45:34 +00:00
Nicolas Grekas 8d22819443 minor #34582 [HttpFoundation] Update CHANGELOG for PdoSessionHandler BC BREAK in 4.4 (tseho)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Update CHANGELOG for PdoSessionHandler BC BREAK in 4.4

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

As explained in https://github.com/symfony/symfony/issues/34491, there was a BC BREAK between 4.3 and 4.4, when using `PdoSessionHandler` with MySQL, where the column `sess_lifetime` was modified from `MEDIUMINT` to `INTEGER UNSIGNED`.

This PR updates `UPGRADE-4.4.md` with a suggested query for updating the database accordingly.

Commits
-------

eda4d68f7d [HttpFoundation] Update CHANGELOG for PdoSessionHandler BC BREAK in 4.4
2019-11-28 12:41:55 +01:00
Quentin Favrie eda4d68f7d [HttpFoundation] Update CHANGELOG for PdoSessionHandler BC BREAK in 4.4 2019-11-28 12:41:49 +01:00
Lynn 78ff806b77 has_roles should be is_granted in upgrade files 2019-11-25 15:04:18 +01:00
Mickaël db9754d9fc [Mailer] Add UPGRADE entries about Envelope and MessageEvent 2019-11-24 19:12:58 +01:00
Maxime Steinhausser abcf63aaa8 [Mailer] Add UPGRADE entry about the null transport DSN 2019-11-14 15:24:33 +01:00
Yonel Ceruto d1bf1cada4 [ErrorHandler] help finish the PR 2019-11-12 10:04:13 +01:00
Nicolas Grekas 6c9157bbc2 [ErrorHandler] merge and remove the ErrorRenderer component 2019-11-10 18:54:30 +01:00
Nicolas Grekas 6f67f0e0c0 [HttpKernel] make ExceptionEvent able to propagate any throwable 2019-11-10 10:37:33 +01:00
Thomas Calvet af021248bf [DoctrineBridge] Reopen DoctrineDataCollector to extensibility 2019-11-06 14:58:24 +01:00
Tobias Schultze 201f159303 [Messenger] use events consistently in worker 2019-11-05 18:28:25 +01:00
Thomas Calvet abef506e89 Deprecate things that prevent \Throwable from bubbling down 2019-11-05 18:23:20 +01:00
Nicolas Grekas 13dd18c8a6 feature #31587 [Routing][Config] Allow patterns of resources to be excluded from config loading (tristanbes)
This PR was merged into the 4.4 branch.

Discussion
----------

[Routing][Config] Allow patterns of resources to be excluded from config loading

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #31516
| License       | MIT
| Doc PR        | not yet

The PR will fix the following RFC: #31516

Like resource loading for services, this PR offers a way to exclude patterns of resources like:

```yml
// config/routes/annotations.yaml
controllers:
    resource: ../../src/Controller/*
    type: annotation
    exclude: '../src/Controller/{DebugEmailController}.php'
```

All the annotation routes inside `Controller/` will be loaded in this example except all the one present inside the `Controller/DebugEmailController.php`

Commits
-------

332ff8811c [Routing][Config] Allow patterns of resources to be excluded from config loading
2019-11-04 11:53:20 +01:00
Tobias Schultze d7e0f98cd0 [Messenger] extract worker logic to listener and sent messages for retry
and failure directly to transport instead of redispatching on the bus
2019-10-31 15:47:36 +01:00
Robin Chalas 81b9c3c682 [DI] Fix "!tagged" related upgrade/changelog notes 2019-10-29 21:21:43 +01:00
Jérémy Derussé 2db24cf582
Add missing lock connection string in FrameworkExtension 2019-10-29 14:34:12 +01:00
Tristan Bessoussa 332ff8811c [Routing][Config] Allow patterns of resources to be excluded from config loading 2019-10-24 13:56:35 +02:00
Nicolas Grekas 8e16143256 [FrameworkBundle] Dont reset the test container but the real one instead 2019-10-23 09:54:59 +02:00
Nicolas Grekas fdb9181d67 Remove legacy changelog lines 2019-10-15 15:33:13 +02:00
Yonel Ceruto 928363c408 Keeping backward compatibility with legacy FlattenException usage 2019-10-09 19:29:06 -04:00
David Maicher d4ab35cfab [Validator] add notice in UPGRADE file for new Range constraint option 2019-10-07 09:03:17 +02:00
Jan Schädlich 98c4f6a06c [Console] Command::execute() should always return int - deprecate returning null
- added deprecation message for non-int return value in Command::execute()
- fixed all core commands to return proper int values
- added proper return type-hint to Command::execute() method in all core Commands
2019-10-02 16:44:58 +02:00
Pierre du Plessis b4de582c18
Add note about deprecating the XmlEncoder::TYPE_CASE_ATTRIBUTES constant in the upgrade guide 2019-10-02 11:08:22 +02:00
M. Vondano f3406338e6 [Console] Deprecate abbreviating hidden command names using Application->find() 2019-09-28 17:00:54 +02:00
Amrouche Hamza e169e1a4d5 [FrameworkBundle] WebTestCase KernelBrowser::getContainer null return type 2019-09-27 12:05:31 +02:00
Fabien Potencier db5cf1a83e bug #33350 [DI] scope singly-implemented interfaces detection by file (daniel-iwaniec, nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] scope singly-implemented interfaces detection by file

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

[DependencyInjection] fixed handling singly implemented interfaces when importing multiple resources

for example:
```yaml
App\Adapter\:
    resource: '../src/Adapter/*'
App\Port\:
    resource: '../src/Port/*'
```

this configuration wont create service for interface (in other words singly implemented interface wont be autowired) and this chage fixes it

**Also** this will prevent false positives - for example if I had one implementation in \App\Port namespace and another in \App\Adapter then interface service would still be registered

but that could potentially break exisitng code not aware of this bug

Commits
-------

c1f39709ff [DI] add FileLoader::registerAliasesForSinglyImplementedInterfaces()
bec38900d8 [DI] scope singly-implemented interfaces detection by file
2019-09-25 21:03:45 +02:00
Fabien Potencier 3c7172d81e feature #33584 [Security] Deprecate isGranted()/decide() on more than one attribute (wouterj)
This PR was squashed before being merged into the 4.4 branch (closes #33584).

Discussion
----------

[Security] Deprecate isGranted()/decide() on more than one attribute

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

While I expect it not be used much, it is currently possible to call `isGranted()` on more than one attribute:

```php
if ($this->authorizationChecker->isGranted(['ROLE_USER', 'ROLE_ADMIN'])) {
    // ...
}
```

Supporting this includes a couple of problems/questions:

- It is not clear whether this is `OR` or `AND`;
- In fact, this is left over to the voter to decide upon. So it can vary for each voter and writers of new voters need to consider this (otherwise, you get issues like https://github.com/LeaseWeb/LswSecureControllerBundle/issues/4 );
- It promotes to vote over roles instead of actions.

I think we can do better. In the past, we've created all tooling for this to be self-explaining and easier:

```php
// ExpressionLanguage component (also includes other functions, like `is_granted('EDIT')`)
if ($this->authorizationChecker->isGranted("has_role('ROLE_USER') or has_role('ROLE_ADMIN')")) {
    // ...
}

// calling it multiple times in PHP (may reduce performance)
if ($this->authorizationChecker->isGranted('ROLE_USER')
    || $this->authorizationChecker->isGranted('ROLE_ADMIN')
) {
    // ...
}

// or by using Role Hierarchy, if a user really wants to vote on roles
```

This PR deprecates passing more than one attribute to `isGranted()` and `decide()` to remove this confusing bit in Security usage.

Backwards compatiblity help
---

I need some help in how to approach changing the `VoterInterface::vote(TokenInterface $token, $subject, array $attributes)` method in a backwards compatible way. Removing `array` breaks all Voters, so does changing it to `string` and removed the parameter all together.

Commits
-------

c64b0beffb [Security] Deprecate isGranted()/decide() on more than one attribute
2019-09-24 17:21:06 +02:00
Wouter J c64b0beffb [Security] Deprecate isGranted()/decide() on more than one attribute 2019-09-24 17:21:01 +02:00
Grégoire Pineau e767bb1b42 Revert \"feature #33507 [WebProfiler] Deprecated intercept_redirects in 4.4 (dorumd)\" 2019-09-23 17:45:34 +02:00
Dorel Mardari 514c736924 [WebProfiler] Deprecated intercept_redirects in 4.4 2019-09-16 21:21:02 +02:00
Nicolas Grekas c1f39709ff [DI] add FileLoader::registerAliasesForSinglyImplementedInterfaces() 2019-09-07 23:26:04 +02:00
Yonel Ceruto 586f299ebd deprecated not passing dash symbol (-) to STDIN commands 2019-09-07 09:00:46 -04:00
Alexander M. Turek 0b08040459 [Validator] Deprecated CacheInterface in favor of PSR-6. 2019-09-05 14:29:38 +02:00
Yonel Ceruto b79532ab0e Add ErrorController to preview and render errors 2019-09-02 17:02:21 -04:00
Fabien Potencier 545d38a037 feature #33319 Allow configuring class names through methods instead of class parameters in Doctrine extensions (alcaeus)
This PR was merged into the 4.4 branch.

Discussion
----------

Allow configuring class names through methods instead of class parameters in Doctrine extensions

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

While removing class parameters for DoctrineBundle 2.0 (see https://github.com/doctrine/DoctrineBundle/issues/630), I noticed that the DoctrineExtension still requires them. This PR adds a new method that keeps legacy behaviour, but will dropped in Symfony 5. Extending classes (mainly DoctrineBundle and DoctrineMongoDBBundle) must implement this method themselves to return the appropriate class names instead of declaring them as class parameters in their service configuration. I'll create a separate for the master branch to make this method abstract in 5.0.

The cache driver class names are not being replaced in this PR, as we're dropping support for `doctrine/cache` in DoctrineBundle 2.0. A separate PR will be created to handle those deprecations and to clean up the code.

Commits
-------

b53d8ccfc1 [DoctrineBridge] Allow configuring class names through methods instead of class parameters
2019-08-27 09:59:14 +02:00
Andreas Braun b53d8ccfc1
[DoctrineBridge] Allow configuring class names through methods instead of class parameters 2019-08-27 09:49:29 +02:00
Alexander M. Turek a0ca3afeca Deprecate returning non-boolean values from checkCredentials(). 2019-08-23 20:43:33 +02:00
Nicolas Grekas f499083f78 feature #33258 [HttpKernel] deprecate global dir to load resources from (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] deprecate global dir to load resources from

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #31915   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        |

Replaces #31958

Here two example deprecations by adding files in the deprecated locations:
```
Overwriting the resource "@AcmeBundle/Resources/config/routing.yaml" with "/vagrant/src/Resources/AcmeBundle/config/routing.yaml" is deprecated since Symfony 4.4 and will be removed in 5.0.
Loading the file "foobar.yaml" from the global resource directory "/vagrant/src" is deprecated since Symfony 4.4 and will be removed in 5.0.
```

Commits
-------

aa82566f76 [HttpKernel] deprecate global dir to load resources from
2019-08-21 17:04:54 +02:00
Fabien Potencier 7046cac7f6 feature #33272 [Translation] deprecate support for null locales (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Translation] deprecate support for null locales

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

e6b6a9d33a deprecate support for null locales
2019-08-21 12:12:17 +02:00
Christian Flothmann e6b6a9d33a deprecate support for null locales 2019-08-21 10:16:47 +02:00
Fabien Potencier eb7d74e6c5 [Mime] Remove NamedAddress 2019-08-21 09:13:01 +02:00
Tobias Schultze aa82566f76 [HttpKernel] deprecate global dir to load resources from 2019-08-21 00:57:10 +02:00