Review main Merged

92971[FEATURE] Unify RateLimiterFactory as single entry point for rate limiting

Benni Mack CR +2 V +2 Hard +411 −134 updated 02/28/26, 15:27

Commit message

Refactor TYPO3's RateLimiterFactory to serve as the central entry point
for all rate limiting, replacing the previous pattern where backend/
felogin password recovery and extbase each created Symfony factories
directly.

The factory now implements Symfony's RateLimiterFactoryInterface for
interchangeability and provides:

- create(): Interface method using pre-configured constructor config
- createLimiter(): General-purpose method for dynamic/ad-hoc configs
- createRequestBasedLimiter(): Convenience method using client IP from
  the PSR-7 request as limiter key
- Admin overrides via $GLOBALS['TYPO3_CONF_VARS']['SYS']['rateLimiter']
  to tune any rate limiter by its ID without code changes

The intermediate RateLimitService in Extbase has been removed. The
ActionController now uses the factory directly, and the RateLimit
attribute provides its own getConfiguration() method.

Login limiter IDs change from SHA1 hashes to human-readable values
(e.g. "login-be"). Existing cached state expires naturally.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
    • Torben Hansen +1
  • Verified V +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
    • Torben Hansen +1
    • core-ci +1 CI

Issues 1

Files 17

Review log 1926

Show 1 earlier messages
  1. Benni Mack uploaded patch set 1 02/24/26, 09:24

  1. Benni Mack marked it ready for review 02/24/26, 09:26

  2. core-ci voted on patch set 1 V -1 02/24/26, 09:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96688

  3. Georg Ringer commented on patch set 1 02/24/26, 09:49

    Feature-109080-UnifiedRateLimiterFactoryWithAdminOverrides.rst:46

    can we remove the prefix "typo3-" - I see no reason in it, otherwise we would need to prefix all keys ^^
  4. Torben Hansen commented on patch set 1 02/24/26, 13:35

    ActionController.php:108

    I get an exception here: `Cannot redeclare non-readonly property TYPO3\CMS\Extbase\Mvc\Controller\ActionController::$rateLimiterFactory as readonly TYPO3\CMS\FrontendLogin\Controller\PasswordRecoveryController::$rateLimiterFactory` I think we need a union type `RateLimiterFactoryInterface|RateLimiterFactory` here, because ext:felogin uses constructor injection and injects `RateLimiterFactoryInterface` for the property.
  5. Torben Hansen commented on patch set 1 02/24/26, 13:37

    PasswordRecoveryController.php:58

    Must not be `readonly`.
  6. Benni Mack uploaded patch set 2 V -1 02/25/26, 22:52

  7. core-ci voted on patch set 2 V -1 02/25/26, 23:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96859

  8. Benni Mack uploaded patch set 3 V -1 02/26/26, 17:40

  9. Benni Mack commented on patch set 3 02/26/26, 17:43

    Feature-109080-UnifiedRateLimiterFactoryWithAdminOverrides.rst:46 Reply

    Done
  10. core-ci voted on patch set 3 V -1 02/26/26, 17:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96935

  11. Benni Mack uploaded patch set 4 V -1 02/27/26, 19:20

  12. Benni Mack commented on patch set 4 02/27/26, 19:20

    ActionController.php:108 Reply

    Done

    PasswordRecoveryController.php:58 Reply

    Done
  13. core-ci voted on patch set 4 V -1 02/27/26, 19:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96992

  14. Garvin Hicking commented on patch set 4 02/27/26, 21:11

    Feature-109080-UnifiedRateLimiterFactoryWithAdminOverrides.rst:55

    We should have an example so that its clear the FQCN is needed (leading slash yes or no?), and the full method name like "indexAction" and not just "index". Also that everything is lowercases: Btw. How about replacing backslashes with dashes? Example reads a bit off and can have backslash-escaping issues. ```suggestion * :php:`extbase-<Controller>::<actionMethod>` — Extbase :php:`#[RateLimit]` actions. All lower-case. Example: `extbase-\\myvendor\\myextension\\classes\\controller\\mycontroller::createaction`. ```
  15. Torben Hansen uploaded patch set 5 V -1 02/28/26, 13:45

  16. Torben Hansen uploaded patch set 6 02/28/26, 13:46

  17. Torben Hansen commented on patch set 6 02/28/26, 13:48

    Feature-109080-UnifiedRateLimiterFactoryWithAdminOverrides.rst:55 Reply

    Done. I also replaced the two colons with one dash.
  18. Torben Hansen uploaded patch set 7 02/28/26, 13:56

  19. core-ci voted on patch set 5 V -1 02/28/26, 14:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97026

  20. core-ci voted on patch set 7 V +1 02/28/26, 14:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97028

  21. core-ci voted on patch set 6 V -1 02/28/26, 14:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97027

  22. Torben Hansen voted on patch set 7 CR +1 V +1 02/28/26, 14:12

  23. Garvin Hicking voted on patch set 7 CR +1 V +1 02/28/26, 15:21

  24. Benni Mack commented on patch set 7 CR +2 V +2 02/28/26, 15:27

    Thank you for finishing this!
  25. Benni Mack merged patch set 8 02/28/26, 15:27