[TASK] Track CSP nonce consumption
The new `ConsumableValue` class has been added, which is capable of tracking how often a value has been used for any kind of output. This way, it can be determined whether the nonce value would be required at all. This patch is a preparation for handling dynamic nonce values in cached scenarios during the frontend rendering process. Other occurrences of `$properties['nonce']` in `PageRenderer` were without any specific functionality and just have been simplified. Resolves: #100691 Releases: main Change-Id: I7e200ba27d0e6f8d4dc3a20fc1ba333f398936ed Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78776 Tested-by:core-ci <typo3@b13.com> Tested-by:
Oliver Hader <oliver.hader@typo3.org> Reviewed-by:
Oliver Hader <oliver.hader@typo3.org> Reviewed-by:
Andreas Fernandez <a.fernandez@scripting-base.de> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch>
Showing
- typo3/sysext/backend/Classes/Middleware/ContentSecurityPolicyHeaders.php 2 additions, 1 deletion...ckend/Classes/Middleware/ContentSecurityPolicyHeaders.php
- typo3/sysext/core/Classes/Domain/ConsumableString.php 53 additions, 0 deletionstypo3/sysext/core/Classes/Domain/ConsumableString.php
- typo3/sysext/core/Classes/Http/Security/ReferrerEnforcer.php 3 additions, 3 deletionstypo3/sysext/core/Classes/Http/Security/ReferrerEnforcer.php
- typo3/sysext/core/Classes/Page/ImportMap.php 3 additions, 2 deletionstypo3/sysext/core/Classes/Page/ImportMap.php
- typo3/sysext/core/Classes/Page/JavaScriptRenderer.php 4 additions, 3 deletionstypo3/sysext/core/Classes/Page/JavaScriptRenderer.php
- typo3/sysext/core/Classes/Page/PageRenderer.php 19 additions, 15 deletionstypo3/sysext/core/Classes/Page/PageRenderer.php
- typo3/sysext/core/Tests/Unit/Http/Security/ReferrerEnforcerTest.php 2 additions, 1 deletion...xt/core/Tests/Unit/Http/Security/ReferrerEnforcerTest.php
- typo3/sysext/core/Tests/Unit/Page/ImportMapTest.php 10 additions, 9 deletionstypo3/sysext/core/Tests/Unit/Page/ImportMapTest.php
- typo3/sysext/core/Tests/Unit/Page/PageRendererTest.php 4 additions, 1 deletiontypo3/sysext/core/Tests/Unit/Page/PageRendererTest.php
- typo3/sysext/frontend/Classes/Middleware/ContentSecurityPolicyHeaders.php 2 additions, 1 deletion...ntend/Classes/Middleware/ContentSecurityPolicyHeaders.php
Please register or sign in to comment