nelmio / NelmioSecurityBundle

Adds extra security-related features in your Symfony application
https://symfony.com/bundles/NelmioSecurityBundle/
MIT License
651 stars 85 forks source link

Introduce `DirectiveSetBuilderInterface` to allow runtime modification #348

Open martijnc opened 3 months ago

martijnc commented 3 months ago

This PR introduces the DirectiveSetBuilderInterface and the default implementationConfigurationDirectiveSetBuilder proposed in #347, to allow for runtime modification of the CSP directive sets. The major changes are:

This adds a layer between the configuration (and the directive sets built from it) and ContentSecurityPolicyListener. This layer provides an integration point for application code to modify the directive sets based on the request (e.g., in a controller or a kernel event listener).

Seldaek commented 2 months ago

Sorry but I won't manage to review this one right now, seems solid at first sight but I'd rather give it some more thought.