services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: false

  TYPO3\CMS\Backend\:
    resource: '../Classes/*'

  backend.middlewares:
    class: ArrayObject
    factory: ['@TYPO3\CMS\Core\Http\MiddlewareStackResolver', 'resolve']
    arguments: ['backend']
    public: true

  TYPO3\CMS\Backend\Clipboard\Clipboard:
    shared: false
    public: true

  TYPO3\CMS\Backend\ContextMenu\ItemProviders\ItemProvidersRegistry:
    arguments:
      - !tagged_iterator backend.contextmenu.itemprovider

  # ModuleTemplate instantiated using factory.
  TYPO3\CMS\Backend\Template\ModuleTemplate: ~

  # Not a service, not injectable
  TYPO3\CMS\Backend\Module\ModuleInterface: ~

  # Breadcrumb component with providers
  TYPO3\CMS\Backend\Template\Components\Breadcrumb:
    arguments:
      $providers: !tagged_iterator backend.breadcrumb.provider

  # Auto-tag breadcrumb providers
  _instanceof:
    TYPO3\CMS\Backend\Breadcrumb\BreadcrumbProviderInterface:
      tags: ['backend.breadcrumb.provider']

  TYPO3\CMS\Backend\Search\LiveSearch\SearchProviderRegistry:
    arguments:
      - !tagged_iterator livesearch.provider

  TYPO3\CMS\Backend\Search\LiveSearch\DatabaseRecordProvider:
    tags:
      - { name: 'livesearch.provider', priority: 50 }

  TYPO3\CMS\Backend\Search\LiveSearch\PageRecordProvider:
    tags:
      - { name: 'livesearch.provider', priority: 60 }

  # Localization handler registry
  TYPO3\CMS\Backend\Localization\LocalizationHandlerRegistry:
    arguments:
      - !tagged_iterator backend.localization.handler

  TYPO3\CMS\Backend\ElementBrowser\DatabaseBrowser:
    shared: false

  TYPO3\CMS\Backend\ElementBrowser\ElementBrowserRegistry:
    arguments:
      - !tagged_iterator recordlist.elementbrowser

  # Toolbar registry
  TYPO3\CMS\Backend\Toolbar\ToolbarItemsRegistry:
    arguments:
      - !tagged_iterator backend.toolbar.item

  backendPasswordRecovery.rateLimiterFactory:
    class: TYPO3\CMS\Core\RateLimiter\RateLimiterFactory
    arguments:
      $config:
        id: 'backend-password-recovery'
        policy: 'sliding_window'
        limit: 3
        interval: '30 minutes'

  TYPO3\CMS\Backend\Authentication\PasswordReset:
    arguments:
      $rateLimiterFactory: '@backendPasswordRecovery.rateLimiterFactory'
