From 2176ed23b15b590c1120c440db03dfdb9978a47e Mon Sep 17 00:00:00 2001 From: Judicael Date: Thu, 11 Jun 2020 09:31:33 +0200 Subject: [PATCH 1/3] [Security] Move configuration of collectors to PHP --- .../DependencyInjection/SecurityExtension.php | 2 +- .../Resources/config/collectors.php | 33 +++++++++++++++++++ .../Resources/config/collectors.xml | 20 ----------- 3 files changed, 34 insertions(+), 21 deletions(-) create mode 100644 src/Symfony/Bundle/SecurityBundle/Resources/config/collectors.php delete mode 100644 src/Symfony/Bundle/SecurityBundle/Resources/config/collectors.xml diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index ffdf446171271..d46b47bf5e2a0 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -135,7 +135,7 @@ public function load(array $configs, ContainerBuilder $container) $phpLoader->load('templating_twig.php'); } - $loader->load('collectors.xml'); + $phpLoader->load('collectors.php'); $loader->load('guard.xml'); if ($container->hasParameter('kernel.debug') && $container->getParameter('kernel.debug')) { diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/collectors.php b/src/Symfony/Bundle/SecurityBundle/Resources/config/collectors.php new file mode 100644 index 0000000000000..3619779311ae2 --- /dev/null +++ b/src/Symfony/Bundle/SecurityBundle/Resources/config/collectors.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader\Configurator; + +use Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector; + +return static function (ContainerConfigurator $container) { + $container->services() + ->set('data_collector.security', SecurityDataCollector::class) + ->args([ + service('security.untracked_token_storage'), + service('security.role_hierarchy'), + service('security.logout_url_generator'), + service('security.access.decision_manager'), + service('security.firewall.map'), + service('debug.security.firewall')->nullOnInvalid(), + ]) + ->tag('data_collector', [ + 'template' => '@Security/Collector/security.html.twig', + 'id' => 'security', + 'priority' => 270, + ]) + ; +}; diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/collectors.xml b/src/Symfony/Bundle/SecurityBundle/Resources/config/collectors.xml deleted file mode 100644 index 811c6dfc5cfdc..0000000000000 --- a/src/Symfony/Bundle/SecurityBundle/Resources/config/collectors.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - From 79764a9e859d758fc178402b8991956948de2343 Mon Sep 17 00:00:00 2001 From: Judicael Date: Thu, 11 Jun 2020 12:59:47 +0200 Subject: [PATCH 2/3] [Security] Move configuration of console to PHP --- .../DependencyInjection/SecurityExtension.php | 2 +- .../Resources/config/console.php | 25 +++++++++++++++++++ .../Resources/config/console.xml | 16 ------------ 3 files changed, 26 insertions(+), 17 deletions(-) create mode 100644 src/Symfony/Bundle/SecurityBundle/Resources/config/console.php delete mode 100644 src/Symfony/Bundle/SecurityBundle/Resources/config/console.xml diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index d46b47bf5e2a0..a07b104c0a26b 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -177,7 +177,7 @@ public function load(array $configs, ContainerBuilder $container) } if (class_exists(Application::class)) { - $loader->load('console.xml'); + $phpLoader->load('console.php'); $container->getDefinition('security.command.user_password_encoder')->replaceArgument(1, array_keys($config['encoders'])); } diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/console.php b/src/Symfony/Bundle/SecurityBundle/Resources/config/console.php new file mode 100644 index 0000000000000..a5ea6868a8bb6 --- /dev/null +++ b/src/Symfony/Bundle/SecurityBundle/Resources/config/console.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader\Configurator; + +use Symfony\Bundle\SecurityBundle\Command\UserPasswordEncoderCommand; + +return static function (ContainerConfigurator $container) { + $container->services() + ->set('security.command.user_password_encoder', UserPasswordEncoderCommand::class) + ->args([ + service('security.encoder_factory'), + abstract_arg('encoders user classes'), + ]) + ->tag('console.command', ['command' => 'security:encode-password']) + ; +}; diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/console.xml b/src/Symfony/Bundle/SecurityBundle/Resources/config/console.xml deleted file mode 100644 index 2e28eda8890fa..0000000000000 --- a/src/Symfony/Bundle/SecurityBundle/Resources/config/console.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - From 417636fb615a0cba018407d6ae575e4b83c57642 Mon Sep 17 00:00:00 2001 From: Judicael Date: Thu, 11 Jun 2020 13:14:10 +0200 Subject: [PATCH 3/3] [Security] Move configuration of guard to PHP --- .../DependencyInjection/SecurityExtension.php | 2 +- .../SecurityBundle/Resources/config/guard.php | 51 +++++++++++++++++++ .../SecurityBundle/Resources/config/guard.xml | 47 ----------------- 3 files changed, 52 insertions(+), 48 deletions(-) create mode 100644 src/Symfony/Bundle/SecurityBundle/Resources/config/guard.php delete mode 100644 src/Symfony/Bundle/SecurityBundle/Resources/config/guard.xml diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index a07b104c0a26b..dd80c5c3b163b 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -136,7 +136,7 @@ public function load(array $configs, ContainerBuilder $container) } $phpLoader->load('collectors.php'); - $loader->load('guard.xml'); + $phpLoader->load('guard.php'); if ($container->hasParameter('kernel.debug') && $container->getParameter('kernel.debug')) { $loader->load('security_debug.xml'); diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/guard.php b/src/Symfony/Bundle/SecurityBundle/Resources/config/guard.php new file mode 100644 index 0000000000000..f8b79cb3569d2 --- /dev/null +++ b/src/Symfony/Bundle/SecurityBundle/Resources/config/guard.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader\Configurator; + +use Symfony\Component\Security\Guard\Firewall\GuardAuthenticationListener; +use Symfony\Component\Security\Guard\GuardAuthenticatorHandler; +use Symfony\Component\Security\Guard\Provider\GuardAuthenticationProvider; + +return static function (ContainerConfigurator $container) { + $container->services() + ->set('security.authentication.guard_handler', GuardAuthenticatorHandler::class) + ->args([ + service('security.token_storage'), + service('event_dispatcher')->nullOnInvalid(), + abstract_arg('stateless firewall keys'), + ]) + ->call('setSessionAuthenticationStrategy', [service('security.authentication.session_strategy')]) + + ->alias(GuardAuthenticatorHandler::class, 'security.authentication.guard_handler') + + ->set('security.authentication.provider.guard', GuardAuthenticationProvider::class) + ->abstract() + ->args([ + abstract_arg('Authenticators'), + abstract_arg('User Provider'), + abstract_arg('Provider-shared Key'), + abstract_arg('User Checker'), + service('security.password_encoder'), + ]) + + ->set('security.authentication.listener.guard', GuardAuthenticationListener::class) + ->abstract() + ->args([ + service('security.authentication.guard_handler'), + service('security.authentication.manager'), + abstract_arg('Provider-shared Key'), + abstract_arg('Authenticators'), + service('logger')->nullOnInvalid(), + ]) + ->tag('monolog.logger', ['channel' => 'security']) + ; +}; diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/guard.xml b/src/Symfony/Bundle/SecurityBundle/Resources/config/guard.xml deleted file mode 100644 index c9bb06d179874..0000000000000 --- a/src/Symfony/Bundle/SecurityBundle/Resources/config/guard.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy