81174[TASK] Streamline providing CSP mutations
Commit message
Review
-
Code review CR +2 Done
- Benjamin Franzke +2
- Andreas Kienast +1
-
Verified V +2 Done
- Benjamin Franzke +2
- Andreas Kienast +1
- core-ci +1 CI
Issues 1
Files 4
- typo3/sysext/core/Classes/Security/ContentSecurityPolicy/MutationRepository.php3new+147 −0
- typo3/sysext/core/Classes/Security/ContentSecurityPolicy/PolicyProvider.php4+5 −66
- typo3/sysext/core/Configuration/Services.yaml2+4 −2
- typo3/sysext/core/Tests/Functional/Security/ContentSecurityPolicy/PolicyProviderTest.php+0 −2
Review log 1719
-
Oliver Hader uploaded patch set 1 09/22/23, 10:31
-
Oliver Hader wrote 09/22/23, 10:32
Topic set to csp -
core-ci voted on patch set 1 V +1 09/22/23, 10:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47078
-
Oliver Hader commented on patch set 1 09/25/23, 12:48
This change is ready for review. -
Benjamin Franzke commented on patch set 1 09/25/23, 13:20
PolicyProvider.php:56Why is `$resolved` `false` and when would we use `true`. (Seems like `$resolved = true` is currently unused) I would have expected `$resolved = true` to be used here, as "resolutions" were done previously via `resolutionRepository->findByScope`?Services.yaml:433`public: true` can (and thus should) be dropped here -
Oliver Hader commented on patch set 1 09/25/23, 13:26
PolicyProvider.php:56Reply`$resolved = true` is the default when invoking `findByScope()` - however, I'd be fine with making that explicit here.Services.yaml:433ReplyOk -
Oliver Hader commented on patch set 1 09/25/23, 13:34
PolicyProvider.php:56ReplyThe remaining `false` refers to `iterator_to_array(..., $preserve_keys = false)` - since the keys of the `Map` returned by `findByScope` are objects (`MutationOrigin`) - but here for creating the CSP header, only `MutationCollection[]` is relevant. -
Andreas Kienast commented on patch set 1 09/26/23, 08:12
MutationRepository.php:85According to PhpStorm: > [EA] Parameter/variable is overridden, but is never used or appears outside of the scope. But since `provideScopeInResolvedMutations()` returns a `Map`, I'm not sure whether this is a false positive. The same goes for the remaining `$target[xx]` assignments. -
Oliver Hader commented on patch set 1 09/26/23, 08:52
MutationRepository.php:85ReplyIt's a false positive. The EA plugin is not capable of resolving this - even with a standard `\ArrayObject` the EA plugin complains and fails those references -
Andreas Kienast commented on patch set 1 09/26/23, 09:00
MutationRepository.php:85ReplyThanks for clarifying this. -
Andreas Kienast voted on patch set 1 CR +1 09/26/23, 09:14
-
Oliver Hader uploaded patch set 2
CR +1V +110/18/23, 13:25 -
Oliver Hader commented on patch set 2 10/18/23, 13:25
PolicyProvider.php:56ReplyDone -
Andreas Kienast voted on patch set 2 CR +1 10/18/23, 13:28
-
core-ci voted on patch set 2 V +1 10/18/23, 13:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47908
-
Benjamin Franzke voted on patch set 2 V +1 CR +1 10/19/23, 08:22
-
Andreas Kienast voted on patch set 2 V +1 10/19/23, 08:39
-
Benjamin Franzke voted on patch set 2 V +2 CR +2 10/19/23, 12:19
-
Benjamin Franzke merged patch set 3 10/19/23, 12:33