security_debug.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\DependencyInjection\Loader\Configurator;
  11. use Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener;
  12. use Symfony\Bundle\SecurityBundle\EventListener\VoteListener;
  13. use Symfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager;
  14. return static function (ContainerConfigurator $container) {
  15. $container->services()
  16. ->set('debug.security.access.decision_manager', TraceableAccessDecisionManager::class)
  17. ->decorate('security.access.decision_manager')
  18. ->args([
  19. service('debug.security.access.decision_manager.inner'),
  20. ])
  21. ->set('debug.security.voter.vote_listener', VoteListener::class)
  22. ->args([
  23. service('debug.security.access.decision_manager'),
  24. ])
  25. ->tag('kernel.event_subscriber')
  26. ->set('debug.security.firewall', TraceableFirewallListener::class)
  27. ->args([
  28. service('security.firewall.map'),
  29. service('event_dispatcher'),
  30. service('security.logout_url_generator'),
  31. ])
  32. ->tag('kernel.event_subscriber')
  33. ->alias('security.firewall', 'debug.security.firewall')
  34. ;
  35. };