76122[TASK] Make FormProtectionFactory injectable - part 1
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Stefan Bürk +1
- Andreas Kienast +1
-
Verified V +2 Done
- Benni Mack +2
- Stefan Bürk +1
- Andreas Kienast +1
- core-ci +1 CI
Issues 1
Files 11
- typo3/sysext/core/Classes/FormProtection/FormProtectionFactory.php17+104 −35
- typo3/sysext/core/Classes/ServiceProvider.php+6 −0
- typo3/sysext/install/Classes/Controller/EnvironmentController.php+3 −9
- typo3/sysext/install/Classes/Controller/InstallerController.php+11 −11
- typo3/sysext/install/Classes/Controller/LoginController.php+6 −2
- typo3/sysext/install/Classes/Controller/MaintenanceController.php+11 −41
- typo3/sysext/install/Classes/Controller/SettingsController.php+7 −7
- typo3/sysext/install/Classes/Controller/UpgradeController.php+6 −6
- typo3/sysext/install/Classes/Middleware/Installer.php+5 −10
- typo3/sysext/install/Classes/Middleware/Maintenance.php+9 −39
- typo3/sysext/install/Classes/ServiceProvider.php+19 −7
Review log 2330
Show 35 earlier messages
-
Benni Mack uploaded patch set 1 10/14/22, 16:01
-
core-ci voted on patch set 1 V -1 10/14/22, 16:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32345
-
Benni Mack uploaded patch set 2 10/14/22, 18:51
-
core-ci voted on patch set 2 V +1 10/14/22, 18:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32347
-
Christian Kuhn commented on patch set 2 10/14/22, 22:00
FormProtectionFactory.php:212making this protected should be added to our list of todos ... "only public to be used in tests" is not acceptable ... and we can change it without being breaking.
-
Benni Mack commented on patch set 2 10/16/22, 17:57
FormProtectionFactory.php:65Replyyou wouldn't be able to create a formProtection in FE mode now for a logged-in backend user. This is actually quite useful to build this for Admin Panel or Workspaces in the future, I thinkFormProtectionFactory.php:212Reply@internal does not harm currently yet, but hopefully FormProtectionFactory will be in really good shape in v13.0 :) -
Benni Mack updated the commit message in patch set 3 10/16/22, 17:58
-
core-ci voted on patch set 3 V +1 10/16/22, 18:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32363
-
Stefan Bürk commented on patch set 3 10/17/22, 02:19
FormProtectionFactory.php:65ReplyGiving this method the "right" name is hard. `createFromRequest()` is not really covering all "cases". "createFromEnforcedTypeOrRequest()" is "more" correct, also not really clear ... and must be "properly" cleared through a docblock comment ?. Not sure, if should be providing two dedicated simple factory methods and leaveing the decision to calling code - what do you think ? Little sidenote, the method docblock description is incomplete --> "Should be used instead of ...???..." -
Oliver Hader commented on patch set 3 10/17/22, 07:18
FormProtectionFactory.php:65ReplyI also have the feeling it should be a bit more explicit, the corresponding controller should know the requirements - in terms of "when using the edit/update action one needs to be logged in with a frontend user". The guess-work is only required for type `default`, which currently uses the "best matching" strategy. Currently there are some calls to `FormProtectionFactory::get()` (implicitly using `default`) which could be more specific, e.g. using `backend` in the cases I know. However, there are still thins like form-protections being using in a Fluid template, where the actual target scope is not known (because it has not been told explicitly by the controller). For instance the HTML templates for `ext:adminpanel` do not know their backend context.FormProtectionFactory.php:171What about adjusting and using `\TYPO3\CMS\Core\Http\ApplicationType` here? -
Benni Mack commented on patch set 3 10/17/22, 08:30
FormProtectionFactory.php:65ReplyHow about we'll go with "createFromRequest" and once we touch the Admin Panel area, we'll add a "createForType" as a second method within the factory? -
Benni Mack uploaded patch set 4 10/17/22, 11:27
-
core-ci voted on patch set 4 V +1 10/17/22, 11:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32386
-
Andreas Kienast commented on patch set 4 CR -1 10/17/22, 11:47
FormProtectionFactory.php:64The method is non-static, so please use $this->FormProtectionFactory.php:75Could am enum be interesting here? -
Benni Mack commented on patch set 4 10/17/22, 13:55
FormProtectionFactory.php:64ReplyDoneFormProtectionFactory.php:75ReplyI use constants for the time being. -
Benni Mack commented on patch set 4 10/17/22, 14:02
FormProtectionFactory.php:75ReplyI think we should do this at a later point. -
Benni Mack commented on patch set 5 10/17/22, 14:02
Published edit on patch set 4. -
Andreas Kienast commented on patch set 5 10/17/22, 14:12
FormProtectionFactory.php:75ReplyAck -
core-ci voted on patch set 5 V +1 10/17/22, 14:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32393
-
Benni Mack commented on patch set 5 10/17/22, 14:42
FormProtectionFactory.php:65Replysolved it as mentionedFormProtectionFactory.php:171Replynot possible right now. ApplicationType itself only exposes isBackend() or isFrontend() -
Benni Mack updated the commit message in patch set 6 10/17/22, 15:25
-
core-ci voted on patch set 6 V +1 10/17/22, 15:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32398
-
Benni Mack rebased onto patch set 7 10/17/22, 15:49
-
core-ci voted on patch set 7 V +1 10/17/22, 16:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32400
-
Andreas Kienast voted on patch set 7 CR +1 10/18/22, 07:41
-
Benni Mack commented on patch set 7 10/18/22, 10:57
FormProtectionFactory.php:212ReplyDone -
Stefan Bürk voted on patch set 7 V +1 CR +1 10/18/22, 10:59
-
Andreas Kienast voted on patch set 7 V +1 10/20/22, 14:06
-
Benni Mack voted on patch set 7 V +2 CR +2 10/20/22, 14:08
-
Benni Mack merged patch set 8 10/20/22, 14:08
FormProtectionFactory.php:65