custom/plugins/SwagPlatformSecurity/src/Resources/config/services.php line 61

Open in your IDE?
  1. <?php
  2. use Doctrine\DBAL\Connection;
  3. use GuzzleHttp\Client;
  4. use Shopware\Core\Content\ProductExport\Validator\XmlValidator;
  5. use Shopware\Core\Framework\Adapter\Cache\CacheIdLoader;
  6. use Shopware\Core\Framework\DataAbstractionLayer\Search\RequestCriteriaBuilder;
  7. use Shopware\Core\System\SalesChannel\Context\SalesChannelContextPersister;
  8. use Shopware\Core\System\SalesChannel\Context\SalesChannelContextService;
  9. use Swag\Security\Api\ConfigController;
  10. use Swag\Security\Api\SecurityController;
  11. use Swag\Security\Components\State;
  12. use Swag\Security\Fixes\NEXT10905\XmlValidatorDecorator;
  13. use Swag\Security\Fixes\NEXT14482\ApiCriteriaValidator;
  14. use Swag\Security\Fixes\NEXT14533\PaymentService;
  15. use Swag\Security\Subscriber\AdminSecurityFixesProvider;
  16. use Swag\Security\Subscriber\TwigStateProvider;
  17. use Symfony\Component\DependencyInjection\ContainerInterface;
  18. use Symfony\Component\DependencyInjection\Definition;
  19. use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
  20. use Symfony\Component\DependencyInjection\Reference;
  21. use function Symfony\Component\DependencyInjection\Loader\Configurator\ref;
  22. return static function (ContainerConfigurator $container) {
  23.     $container->services()
  24.         ->set(State::class)
  25.             ->args([
  26.                 '%SwagPlatformSecurity.availableFixes%',
  27.                 '%SwagPlatformSecurity.activeFixes%'
  28.             ])
  29.         ->set(SecurityController::class)
  30.             ->public()
  31.             ->args([
  32.                 new Reference(State::class),
  33.                 new Reference('plugin.repository'),
  34.                 '%kernel.cache_dir%',
  35.                 new Definition(Client::class),
  36.                 new Reference(CacheIdLoader::class),
  37.             ])
  38.         ->set(ConfigController::class)
  39.             ->public()
  40.             ->args([
  41.                 new Reference(Connection::class),
  42.                 new Reference('user.repository'),
  43.             ])
  44.         ->set(AdminSecurityFixesProvider::class)
  45.             ->public()
  46.             ->args([
  47.                 new Reference(State::class),
  48.             ])
  49.             ->tag('kernel.event_listener')
  50.         ->set(TwigStateProvider::class)
  51.             ->public()
  52.             ->args([
  53.                 new Reference(State::class),
  54.             ])
  55.             ->tag('kernel.event_listener')
  56.         ->set(XmlValidatorDecorator::class)
  57.             ->public()
  58.             ->decorate(XmlValidator::class, null0ContainerInterface::IGNORE_ON_INVALID_REFERENCE)
  59.             ->args([ref(XmlValidatorDecorator::class . '.inner')])
  60.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT10905\SecurityFix::class])
  61.         ->set(ApiCriteriaValidator::class)
  62.             ->public()
  63.             ->decorate(RequestCriteriaBuilder::class, null0ContainerInterface::IGNORE_ON_INVALID_REFERENCE)
  64.             ->args([ref(ApiCriteriaValidator::class . '.inner')])
  65.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT14482\SecurityFix::class])
  66.         ->set(PaymentService::class)
  67.             ->public()
  68.             ->decorate(\Shopware\Core\Checkout\Payment\PaymentService::class, null0ContainerInterface::IGNORE_ON_INVALID_REFERENCE)
  69.             ->args([
  70.                 ref('order.repository'),
  71.                 ref(SalesChannelContextService::class),
  72.                 ref(SalesChannelContextPersister::class),
  73.                 ref(PaymentService::class . '.inner')
  74.             ])
  75.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT14533\SecurityFix::class])
  76.     ;
  77.     // Fixes
  78.     $container->services()
  79.         ->set(Swag\Security\Fixes\NEXT9241\SecurityFix::class)
  80.             ->tag('kernel.event_subscriber')
  81.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT9241\SecurityFix::class])
  82.         ->set(Swag\Security\Fixes\NEXT9240\SecurityFix::class)
  83.             ->tag('kernel.event_subscriber')
  84.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT9240\SecurityFix::class])
  85.         ->set(Swag\Security\Fixes\NEXT9242\SecurityFix::class)
  86.             ->tag('kernel.event_subscriber')
  87.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT9242\SecurityFix::class])
  88.         ->set(Swag\Security\Fixes\NEXT9243\SecurityFix::class)
  89.             ->tag('kernel.event_subscriber')
  90.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT9243\SecurityFix::class])
  91.         ->set(Swag\Security\Fixes\NEXT9569\SecurityFix::class)
  92.             ->tag('kernel.event_subscriber')
  93.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT9569\SecurityFix::class])
  94.         ->set(Swag\Security\Fixes\NEXT10909\SecurityFix::class)
  95.             ->args(['%kernel.environment%'])
  96.             ->tag('kernel.event_subscriber')
  97.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT10909\SecurityFix::class])
  98.         ->set(Swag\Security\Fixes\NEXT10905\SecurityFix::class)
  99.             ->args(['%kernel.environment%'])
  100.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT10905\SecurityFix::class])
  101.         ->set(Swag\Security\Fixes\NEXT12230\SecurityFix::class)
  102.             ->args(['%kernel.environment%'])
  103.             ->tag('kernel.event_subscriber')
  104.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT12230\SecurityFix::class])
  105.         ->set(Swag\Security\Fixes\NEXT9689\SecurityFix::class)
  106.             ->args(['%kernel.environment%'])
  107.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT9689\SecurityFix::class])
  108.         ->set(Swag\Security\Fixes\NEXT12359\SecurityFix::class)
  109.             ->tag('kernel.event_subscriber')
  110.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT12359\SecurityFix::class])
  111.         ->set(Swag\Security\Fixes\NEXT13371\SecurityFix::class)
  112.             ->args([new Reference(\Shopware\Core\Framework\DataAbstractionLayer\DefinitionInstanceRegistry::class)])
  113.             ->tag('kernel.event_subscriber')
  114.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT13371\SecurityFix::class])
  115.         ->set(Swag\Security\Fixes\NEXT13247\SecurityFix::class)
  116.             ->tag('kernel.event_subscriber')
  117.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT13247\SecurityFix::class])
  118.         ->set(Swag\Security\Fixes\NEXT12824\SecurityFix::class)
  119.             ->tag('kernel.event_subscriber')
  120.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT12824\SecurityFix::class])
  121.         ->set(Swag\Security\Fixes\NEXT13664\SecurityFix::class)
  122.             ->args([new Reference(\Symfony\Component\HttpFoundation\RequestStack::class)])
  123.             ->tag('kernel.event_subscriber')
  124.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT13664\SecurityFix::class])
  125.         ->set(Swag\Security\Fixes\NEXT13896\SecurityFix::class)
  126.             ->tag('kernel.event_subscriber')
  127.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT13896\SecurityFix::class])
  128.         ->set(Swag\Security\Fixes\NEXT14482\SecurityFix::class)
  129.             ->args(['%kernel.environment%'])
  130.             ->tag('kernel.event_subscriber')
  131.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT14482\SecurityFix::class])
  132.         ->set(Swag\Security\Fixes\NEXT14533\SecurityFix::class)
  133.             ->args([
  134.                 new Reference(SalesChannelContextService::class),
  135.                 new Reference('order.repository'),
  136.                 new Reference(SalesChannelContextPersister::class)
  137.             ])
  138.             ->tag('kernel.event_subscriber')
  139.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT14533\SecurityFix::class])
  140.         ->set(Swag\Security\Fixes\NEXT15183\SecurityFix::class)
  141.             ->args([
  142.                 new Reference('order.repository'),
  143.             ])
  144.             ->tag('kernel.event_subscriber')
  145.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT15183\SecurityFix::class])
  146.         ->set(Swag\Security\Fixes\NEXT14744\SecurityFix::class)
  147.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT14744\SecurityFix::class])
  148.         ->set(Swag\Security\Fixes\NEXT14871\SecurityFix::class)
  149.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT14871\SecurityFix::class])
  150.         ->set(Swag\Security\Fixes\NEXT14883\SecurityFix::class)
  151.             ->tag('kernel.event_subscriber')
  152.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT14883\SecurityFix::class])
  153.         ->set(Swag\Security\Fixes\NEXT15669\SecurityFix::class)
  154.             ->tag('kernel.event_subscriber')
  155.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT15669\SecurityFix::class])
  156.         ->set(Swag\Security\Fixes\NEXT15673\SecurityFix::class)
  157.             ->decorate(\Shopware\Core\Content\Media\File\FileUrlValidatorInterface::class, null0ContainerInterface::IGNORE_ON_INVALID_REFERENCE)
  158.             ->args([ref(Swag\Security\Fixes\NEXT15673\SecurityFix::class . '.inner')])
  159.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT15673\SecurityFix::class])
  160.         ->set(Swag\Security\Fixes\NEXT15681\SecurityFix::class)
  161.             ->args([
  162.                 new Reference('product_review.repository'),
  163.             ])
  164.             ->tag('kernel.event_subscriber')
  165.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT15681\SecurityFix::class])
  166.         ->set(Swag\Security\Fixes\NEXT16429\SecurityFix::class)
  167.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT16429\SecurityFix::class])
  168.         ->set(Swag\Security\Fixes\NEXT16429\ProductSalesChannelRepositoryDecorator::class)
  169.             ->decorate('sales_channel.product.repository'null0ContainerInterface::IGNORE_ON_INVALID_REFERENCE)
  170.             ->args([
  171.                 new Reference(Swag\Security\Fixes\NEXT16429\ProductSalesChannelRepositoryDecorator::class . '.inner'),
  172.             ])
  173.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT16429\SecurityFix::class])
  174.         ->set(Swag\Security\Fixes\NEXT15675\SecurityFix::class)
  175.             ->args([
  176.                 new Reference('import_export_file.repository'),
  177.                 new Reference('event_dispatcher'),
  178.             ])
  179.             ->tag('kernel.event_subscriber')
  180.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT15675\SecurityFix::class])
  181.         ->set(\Swag\Security\Fixes\NEXT15675\PrepareDownloadController::class)
  182.             ->public(true)
  183.             ->args([
  184.                 new Reference('import_export_file.repository'),
  185.                 new Reference(State::class),
  186.             ])
  187.         ->set(\Swag\Security\Fixes\NEXT17527\RequestTransformerFixer::class)
  188.             ->public(true)
  189.             ->decorate(\Shopware\Core\Framework\Routing\RequestTransformerInterface::class)
  190.             ->args([new Reference(\Swag\Security\Fixes\NEXT17527\RequestTransformerFixer::class . '.inner')])
  191.              ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT17527\SecurityFix::class])
  192.         ->set(Swag\Security\Fixes\NEXT19276\SecurityFix::class)
  193.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT19276\SecurityFix::class])
  194.         ->set(Swag\Security\Fixes\NEXT19820\SecurityFix::class)
  195.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT19820\SecurityFix::class])
  196.         ->set(Swag\Security\Fixes\NEXT20309\SecurityFix::class)
  197.             ->args([new Reference('service_container')])
  198.             ->tag('kernel.event_subscriber')
  199.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT20309\SecurityFix::class])
  200.         ->set(Swag\Security\Fixes\NEXT20348\SecurityFix::class)
  201.             ->tag('swag.security.fix', ['ticket' => Swag\Security\Fixes\NEXT20348\SecurityFix::class])
  202.         ->set(\Swag\Security\Fixes\NEXT20305\SecurityFix::class)
  203.             ->tag('swag.security.fix', ['ticket' => \Swag\Security\Fixes\NEXT20305\SecurityFix::class])
  204.             ->tag('kernel.event_subscriber')
  205.         ->set(\Swag\Security\Fixes\NEXT21078\SecurityFix::class)
  206.             ->tag('swag.security.fix', ['ticket' => \Swag\Security\Fixes\NEXT21078\SecurityFix::class])
  207.             ->tag('kernel.event_subscriber')
  208.         ->set(\Swag\Security\Fixes\NEXT21034\SecurityFix::class)
  209.             ->tag('swag.security.fix', ['ticket' => \Swag\Security\Fixes\NEXT21034\SecurityFix::class])
  210.     ;
  211. };