parameters:
    nelmio_security.nonce_generator.number_of_bytes: 16

services:
    nelmio_security.ua_parser:
        class: Nelmio\SecurityBundle\UserAgent\UserAgentParser
        public: false

    nelmio_security.ua_parser.ua_php:
        class: Nelmio\SecurityBundle\UserAgent\UAFamilyParser\UAFamilyParser
        public: true
        arguments: ['@nelmio_security.ua_parser.ua_php.provider']

    nelmio_security.ua_parser.ua_php.provider:
        class: UAParser\Parser
        public: false
        factory: [UAParser\Parser, create]

    nelmio_security.policy_manager:
        public: false
        class: Nelmio\SecurityBundle\ContentSecurityPolicy\PolicyManager

    nelmio_security.csp_listener:
        class: Nelmio\SecurityBundle\EventListener\ContentSecurityPolicyListener
        tags:
            - { name: kernel.event_subscriber }

    nelmio_security.csp_report.filter:
        public: false
        class: Nelmio\SecurityBundle\ContentSecurityPolicy\Violation\Filter\Filter

    nelmio_security.csp_report.filter.noise_detector_schemes:
        public: false
        class: Nelmio\SecurityBundle\ContentSecurityPolicy\Violation\Filter\SchemesNoiseDetector

    nelmio_security.csp_report.filter.noise_detector_domains_regex:
        public: false
        class: Nelmio\SecurityBundle\ContentSecurityPolicy\Violation\Filter\DomainsRegexNoiseDetector

    nelmio_security.csp_report.filter.noise_detector_domains:
        public: false
        class: Nelmio\SecurityBundle\ContentSecurityPolicy\Violation\Filter\DomainsNoiseDetector

    nelmio_security.csp_report.filter.noise_detector_custom_rules:
        public: false
        class: Nelmio\SecurityBundle\ContentSecurityPolicy\Violation\Filter\CustomRulesNoiseDetector
        arguments: [[]]

    nelmio_security.csp_report.filter.noise_detector_injected_scripts:
        public: false
        class: Nelmio\SecurityBundle\ContentSecurityPolicy\Violation\Filter\InjectedScriptsNoiseDetector

    nelmio_security.csp_report.filter.noise_detector_browser_bugs:
        public: false
        class: Nelmio\SecurityBundle\ContentSecurityPolicy\Violation\Filter\BrowserBugsNoiseDetector
        arguments: ['@nelmio_security.ua_parser.ua_php.provider']

    nelmio_security.csp_report.log_formatter:
        class: Nelmio\SecurityBundle\ContentSecurityPolicy\Violation\Log\LogFormatter

    nelmio_security.csp_report.logger:
        class: Nelmio\SecurityBundle\ContentSecurityPolicy\Violation\Log\Logger
        arguments: ['@logger', '@nelmio_security.csp_report.log_formatter', '%nelmio_security.csp.report_log_level%']

    nelmio_security.csp_reporter_controller:
        public: true
        class: Nelmio\SecurityBundle\Controller\ContentSecurityPolicyController
        arguments: ['@nelmio_security.csp_report.logger', '@event_dispatcher', '@nelmio_security.csp_report.filter']

    nelmio_security.nonce_generator:
        class: Nelmio\SecurityBundle\ContentSecurityPolicy\NonceGenerator
        arguments: ["%nelmio_security.nonce_generator.number_of_bytes%"]

    nelmio_security.sha_computer:
        class: Nelmio\SecurityBundle\ContentSecurityPolicy\ShaComputer
        arguments: ["%nelmio_security.csp.hash_algorithm%"]

    nelmio_security.twig_extension:
        public: false
        class: Nelmio\SecurityBundle\Twig\NelmioCSPTwigExtension
        arguments: ['@nelmio_security.csp_listener', '@nelmio_security.sha_computer']
        tags:
            - { name: "twig.extension" }
