mage2tv / magento-cache-clean

A faster drop in replacement for bin/magento cache:clean with file watcher
BSD 3-Clause "New" or "Revised" License
527 stars 61 forks source link

Support csp_whitelist.xml #81

Closed sprankhub closed 4 years ago

sprankhub commented 4 years ago

As of version 2.3.5 / 2.4, Magento has a CSP module. If one wants to add domains to the CSP header, one needs to create / edit a file etc/csp_whitelist.xml. I just did this and found out that this tool does not detect such changes yet. It is necessary to flush the config cache manually after a change to such a file. Maybe a more fine-grained cache clean is possible than a full config cache flush - I did not check this TBH.

Vinai commented 4 years ago

Excellent idea, hope to get a release out soon!

Vinai commented 4 years ago

Note to self: the cache ID is csp_whitelist_config (use with scope prefix $scopeCode . '::csp_whitelist_config').
(Ref. \Magento\Csp\Model\Collector\CspWhitelistXml\Data::__construct)

Q: what are the supported scopes? See https://devdocs.magento.com/guides/v2.4/extension-dev-guide/security/content-security-policies.html

Vinai commented 4 years ago

Implemented in release 1.0.31.

sprankhub commented 4 years ago

You are awesome! Thanks!