Review main Merged

89491[FEATURE] Introduce Sudo-Mode Events

Oliver Hader CR +2 V +2 Hard +321 −16 updated 05/27/25, 13:23

Commit message

Two new PSR-14 events are introduced:

* `SudoModeRequiredEvent` is triggered before showing
  thе sudo-mode verification dialog
* `SudoModeVerifyEvent` is triggered before actually
  verifying the submitted password

These allow to decide during runtime how to deal with
step-up authentication processes.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • Benjamin Franzke +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Oliver Hader +2
    • Benjamin Franzke +1
    • Andreas Kienast +1
    • core-ci +1 CI

Issues 1

Files 11

Review log 3443

Show 1318 earlier messages
  1. Oliver Hader uploaded patch set 1 05/20/25, 18:45

  2. core-ci voted on patch set 1 V -1 05/20/25, 19:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79254

  3. Oliver Hader commented on patch set 1 05/21/25, 06:59

    Forgot the event class...
  4. Oliver Hader uploaded patch set 2 V -1 05/21/25, 06:59

  5. core-ci voted on patch set 2 V -1 05/21/25, 07:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79273

  6. Torben Hansen commented on patch set 2 05/21/25, 08:04

    BeforeVerificationRequiredEvent.php:31

    I think we can use Constructor Property Promotion here.
  7. Oliver Hader uploaded patch set 3 V -1 05/22/25, 18:11

  8. Oliver Hader commented on patch set 3 05/22/25, 18:13

    BeforeVerificationRequiredEvent.php:31 Reply

    Done
  9. core-ci voted on patch set 3 V +1 05/22/25, 18:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79387

  10. Oliver Hader commented on patch set 4 V +1 05/25/25, 07:30

    Published edit on patch set 3.
  11. core-ci voted on patch set 4 V +1 05/25/25, 07:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79455

  12. Garvin Hicking commented on patch set 4 05/25/25, 18:37

    What do you think about a more verbose name like "BeforeAuthenticationVerificationEvent" or something like that, to indicate what is being verified? First I thought it could be related to FAL or configuration integrity...?
  13. Georg Ringer commented on patch set 4 05/25/25, 18:39

    Feature-106743-IntroduceBeforeVerificationRequiredEvent.rst:31

    IMO an empty line required below

    Feature-106743-IntroduceBeforeVerificationRequiredEvent.rst:45

    should we use the attribute even though in 12.4 this is not available? or at least we need to take care about that in the backport then
  14. Garvin Hicking commented on patch set 4 05/25/25, 18:48

    Reply

    (or "BeforeStepUoVerification", "BeforeSudoAuthentication"?)
  15. Oliver Hader uploaded patch set 5 V +1 05/26/25, 09:17

  16. Oliver Hader commented on patch set 5 05/26/25, 09:19

    Reply

    It's `BeforeStepUpAuthenticationEvent` now - I hope the scope is clearer now.

    Feature-106743-IntroduceBeforeVerificationRequiredEvent.rst:31 Reply

    Done

    Feature-106743-IntroduceBeforeVerificationRequiredEvent.rst:45 Reply

    Thx for that hint. I've dropped the PHP attribute and added an example for `Services.yaml`
  17. core-ci voted on patch set 5 V -1 05/26/25, 09:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79475

  18. Oliver Hader commented on patch set 5 CR -1 05/26/25, 10:37

    I feel like an additional event in `\TYPO3\CMS\Backend\Security\SudoMode\PasswordVerification` is missing to actually do custom step-up verifications...
  1. Oliver Hader uploaded patch set 6 CR -1 V -1 05/26/25, 12:51

  2. core-ci voted on patch set 6 V -1 05/26/25, 12:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79490

  3. Oliver Hader uploaded patch set 7 V -1 05/26/25, 13:26

  4. core-ci voted on patch set 7 V +1 05/26/25, 13:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79493

  5. Simon Schaufelberger commented on patch set 7 05/26/25, 16:25

    Feature-106743-IntroduceSudoModeEvents.rst:91

    list is very old and should be changed to []
  6. Oliver Hader uploaded patch set 8 V +1 05/26/25, 19:19

  7. Oliver Hader commented on patch set 8 05/26/25, 19:20

    Feature-106743-IntroduceSudoModeEvents.rst:91 Reply

    Done
  8. Oliver Hader commented on patch set 8 05/26/25, 19:20

    Reply

    Done
  9. core-ci voted on patch set 8 V +1 05/26/25, 19:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79514

  10. Simon Schaufelberger wrote 05/26/25, 20:22

    Removed cc Simon Schaufelberger.
  11. Benjamin Franzke voted on patch set 8 CR +1 V +1 05/27/25, 05:10

  12. Torben Hansen voted on patch set 8 CR +1 05/27/25, 06:19

  13. Oli Bartsch commented on patch set 8 05/27/25, 09:53

    SudoModeVerifiedEvent.php:26

    Are there any benefits in using additional getter methods instead of just using public properties? Same for the other event.
  14. Benjamin Franzke commented on patch set 8 05/27/25, 10:43

    SudoModeVerifiedEvent.php:26 Reply

    I guess there is no reason but consistency. I think we had this topic a few times and some mergers (do not remember who) argued we should stick with getters (unfortunately I can not find a source/link) in events for consistency. and yes, we already have exceptions and I prefer public properties as well, but I personally don't mind if someone adds code with getters at the moment…

    SudoModeVerifiedEvent.php:28

    Should we tag this with the attribute `\SensitiveParameter`?
  15. Oli Bartsch commented on patch set 8 05/27/25, 11:02

    SudoModeVerifiedEvent.php:26 Reply

    Acknowledged
  16. Benjamin Franzke commented on patch set 8 05/27/25, 11:18

    SudoModeController.php:161

    "Verified" implies it already happened, but it didn't yet. Shouldn't we name this `SudoModeVerifyEvent`?

    SudoModeVerifiedEvent.php:28 Reply

    nvm, does not help if the event object is passed as argument to another function.
  17. Benjamin Franzke uploaded patch set 9 CR +1 V +1 05/27/25, 11:48

  18. Benjamin Franzke commented on patch set 9 05/27/25, 11:48

    SudoModeController.php:161 Reply

    Done
  19. core-ci voted on patch set 9 V +1 05/27/25, 11:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79561

  20. Oliver Hader commented on patch set 9 05/27/25, 12:08

    SudoModeController.php:161 Reply

    `Verify` is better, thanks for adjusting
  21. Andreas Kienast commented on patch set 9 05/27/25, 13:03

    Feature-106743-IntroduceSudoModeEvents.rst:88

    Should this be `continue` as we're in a loop handling multiple subjects? Or is it required that all subjects match the conditions?

    Feature-106743-IntroduceSudoModeEvents.rst:95

    Same applies here.
  22. Oliver Hader commented on patch set 9 05/27/25, 13:09

    Feature-106743-IntroduceSudoModeEvents.rst:88 Reply

    `return` is expected in this example - stop at the first occurrence of something that cannot be handled

    Feature-106743-IntroduceSudoModeEvents.rst:95 Reply

    Same as above. If there is one table, that is not `be_users`, this event listener is not supposed to take any decision on all subject of the given claim.
  23. Andreas Kienast voted on patch set 9 CR +1 V +1 05/27/25, 13:12

  24. Oliver Hader voted on patch set 9 CR +2 V +2 05/27/25, 13:22

  25. Oliver Hader merged patch set 10 05/27/25, 13:23