schranz-php-recipes / symfony-recipes-php

Provides https://github.com/symfony/recipes as PHP instead of YAML configs.
MIT License
13 stars 3 forks source link

Update recipes 2023-10-16 #56

Closed symfony-php-recipes-bot closed 1 year ago

symfony-php-recipes-bot commented 1 year ago
Q A
License MIT

The Symfony Recipes changed with version . This PR contains the new definition for recipes.

github-actions[bot] commented 1 year ago

Thanks for the PR 😍

How to test these changes in your application

  1. Define the SYMFONY_ENDPOINT environment variable:

    # On Unix-like (BSD, Linux and macOS)
    export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/schranz-php-recipes/symfony-recipes-php/flex/pull-56/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/schranz-php-recipes/symfony-recipes-php/flex/pull-56/index.json
  2. Install the package(s) related to this recipe:

    composer req 'symfony/flex:^1.16'
    composer req 'symfony/security-bundle:^6.4'
  3. Don't forget to unset the SYMFONY_ENDPOINT environment variable when done:

    # On Unix-like (BSD, Linux and macOS)
    unset SYMFONY_ENDPOINT
    # On Windows
    SET SYMFONY_ENDPOINT=

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. I'm going keep this comment up to date with any updates of the attached patch.

symfony/security-bundle

3.3 vs 4.4 ```diff diff --git a/symfony/security-bundle/3.3/config/packages/security.php b/symfony/security-bundle/4.4/config/packages/security.php index 27ef8c5..28ac2a4 100644 --- a/symfony/security-bundle/3.3/config/packages/security.php +++ b/symfony/security-bundle/4.4/config/packages/security.php @@ -17,7 +17,7 @@ return static function (ContainerConfigurator $containerConfigurator): void { 'security' => false, ], 'main' => [ - 'anonymous' => true, + 'anonymous' => 'lazy', 'provider' => 'users_in_memory', ], ], ```
4.4 vs 5.1 ```diff diff --git a/symfony/security-bundle/4.4/config/packages/security.php b/symfony/security-bundle/5.1/config/packages/security.php index 28ac2a4..390afdb 100644 --- a/symfony/security-bundle/4.4/config/packages/security.php +++ b/symfony/security-bundle/5.1/config/packages/security.php @@ -17,7 +17,8 @@ return static function (ContainerConfigurator $containerConfigurator): void { 'security' => false, ], 'main' => [ - 'anonymous' => 'lazy', + 'anonymous' => true, + 'lazy' => true, 'provider' => 'users_in_memory', ], ], ```
5.1 vs 5.3 ```diff diff --git a/symfony/security-bundle/5.1/config/packages/security.php b/symfony/security-bundle/5.3/config/packages/security.php index 390afdb..b576f30 100644 --- a/symfony/security-bundle/5.1/config/packages/security.php +++ b/symfony/security-bundle/5.3/config/packages/security.php @@ -6,6 +6,10 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura return static function (ContainerConfigurator $containerConfigurator): void { $containerConfigurator->extension('security', [ + 'enable_authenticator_manager' => true, + 'password_hashers' => [ + 'Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface' => 'auto', + ], 'providers' => [ 'users_in_memory' => [ 'memory' => null, @@ -17,11 +21,22 @@ return static function (ContainerConfigurator $containerConfigurator): void { 'security' => false, ], 'main' => [ - 'anonymous' => true, 'lazy' => true, 'provider' => 'users_in_memory', ], ], 'access_control' => null, ]); + if ($containerConfigurator->env() === 'test') { + $containerConfigurator->extension('security', [ + 'password_hashers' => [ + 'Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface' => [ + 'algorithm' => 'auto', + 'cost' => 4, + 'time_cost' => 3, + 'memory_cost' => 10, + ], + ], + ]); + } }; diff --git a/symfony/security-bundle/5.1/manifest.json b/symfony/security-bundle/5.3/manifest.json index 5d8527e..4a48e0c 100644 --- a/symfony/security-bundle/5.1/manifest.json +++ b/symfony/security-bundle/5.3/manifest.json @@ -5,5 +5,8 @@ "copy-from-recipe": { "config/": "%CONFIG_DIR%/" }, - "aliases": ["security"] + "aliases": ["security"], + "conflict": { + "symfony/framework-bundle": "<5.3" + } } ```
5.3 vs 6.0 ```diff diff --git a/symfony/security-bundle/5.3/config/packages/security.php b/symfony/security-bundle/6.0/config/packages/security.php index b576f30..858c544 100644 --- a/symfony/security-bundle/5.3/config/packages/security.php +++ b/symfony/security-bundle/6.0/config/packages/security.php @@ -6,7 +6,6 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura return static function (ContainerConfigurator $containerConfigurator): void { $containerConfigurator->extension('security', [ - 'enable_authenticator_manager' => true, 'password_hashers' => [ 'Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface' => 'auto', ], ```
6.0 vs 6.4 ```diff diff --git a/symfony/security-bundle/6.4/config/routes/security.php b/symfony/security-bundle/6.4/config/routes/security.php new file mode 100644 index 0000000..cd2c44f --- /dev/null +++ b/symfony/security-bundle/6.4/config/routes/security.php @@ -0,0 +1,9 @@ +import('security.route_loader.logout', 'service'); +}; ```