From 98a7ea3ccb7faa9f6d1d9989ca610e84ca63baad Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 18 Jul 2025 10:27:39 +0200 Subject: [PATCH] [FrameworkBundle][SecurityBundle] Remove autowiring aliases for `RateLimiterFactory`; use `RateLimiterFactoryInterface` instead --- UPGRADE-8.0.md | 2 ++ src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md | 1 + .../DependencyInjection/FrameworkExtension.php | 10 +--------- src/Symfony/Bundle/SecurityBundle/CHANGELOG.md | 1 + .../Security/Factory/LoginThrottlingFactory.php | 10 +--------- 5 files changed, 6 insertions(+), 18 deletions(-) diff --git a/UPGRADE-8.0.md b/UPGRADE-8.0.md index c97b020152745..00927d63a0840 100644 --- a/UPGRADE-8.0.md +++ b/UPGRADE-8.0.md @@ -209,6 +209,7 @@ FrameworkBundle * Make `ConfigBuilderCacheWarmer` class `final` * Make `TranslationsCacheWarmer` class `final` * Make `ValidatorCacheWarmer` class `final` + * Remove autowiring aliases for `RateLimiterFactory`; use `RateLimiterFactoryInterface` instead HttpFoundation -------------- @@ -443,6 +444,7 @@ SecurityBundle + algorithms: ['RS256'] + keyset: 'https://example.com/.well-known/jwks.json' ``` + * Remove autowiring aliases for `RateLimiterFactory`; use `RateLimiterFactoryInterface` instead Serializer ---------- diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index 352781a2a3fb8..e8386b8c40e94 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -13,6 +13,7 @@ CHANGELOG * Make `ConfigBuilderCacheWarmer` class `final` * Make `TranslationsCacheWarmer` class `final` * Make `ValidatorCacheWarmer` class `final` + * Remove autowiring aliases for `RateLimiterFactory`; use `RateLimiterFactoryInterface` instead 7.4 --- diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 57bf9da210c01..3cab6729336a6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -3296,15 +3296,7 @@ private function registerRateLimiterConfiguration(array $config, ContainerBuilde $limiterConfig['id'] = $name; $limiter->replaceArgument(0, $limiterConfig); - $factoryAlias = $container->registerAliasForArgument($limiterId, RateLimiterFactory::class, $name.'.limiter'); - - if (interface_exists(RateLimiterFactoryInterface::class)) { - $container->registerAliasForArgument($limiterId, RateLimiterFactoryInterface::class, $name.'.limiter', $name); - - $factoryAlias->setDeprecated('symfony/framework-bundle', '7.3', 'The "%alias_id%" autowiring alias is deprecated and will be removed in 8.0, use "RateLimiterFactoryInterface" instead.'); - $container->getAlias(\sprintf('.%s $%s.limiter', RateLimiterFactory::class, $name)) - ->setDeprecated('symfony/framework-bundle', '7.3', 'The "%alias_id%" autowiring alias is deprecated and will be removed in 8.0, use "RateLimiterFactoryInterface" instead.'); - } + $container->registerAliasForArgument($limiterId, RateLimiterFactoryInterface::class, $name.'.limiter', $name); } if ($compoundLimiters && !class_exists(CompoundRateLimiterFactory::class)) { diff --git a/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md b/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md index 7e7f634ce00ec..c8be539fee514 100644 --- a/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md @@ -8,6 +8,7 @@ CHANGELOG * Remove the deprecated `algorithm` and `key` options from the OIDC token handler configuration, use `algorithms` and `keyset` instead * Remove `LazyFirewallContext::__invoke()` * Make `ExpressionCacheWarmer` class `final` + * Remove autowiring aliases for `RateLimiterFactory`; use `RateLimiterFactoryInterface` instead 7.4 --- diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/LoginThrottlingFactory.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/LoginThrottlingFactory.php index b27a2483bfe49..7ef3e0661a6ff 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/LoginThrottlingFactory.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/LoginThrottlingFactory.php @@ -117,14 +117,6 @@ private function registerRateLimiter(ContainerBuilder $container, string $name, $limiterConfig['id'] = $name; $limiter->replaceArgument(0, $limiterConfig); - $factoryAlias = $container->registerAliasForArgument($limiterId, RateLimiterFactory::class, $name.'.limiter'); - - if (interface_exists(RateLimiterFactoryInterface::class)) { - $container->registerAliasForArgument($limiterId, RateLimiterFactoryInterface::class, $name.'.limiter', $name); - - $factoryAlias->setDeprecated('symfony/security-bundle', '7.4', 'The "%alias_id%" autowiring alias is deprecated and will be removed in 8.0, use "RateLimiterFactoryInterface" instead.'); - $container->getAlias(\sprintf('.%s $%s.limiter', RateLimiterFactory::class, $name)) - ->setDeprecated('symfony/security-bundle', '7.4', 'The "%alias_id%" autowiring alias is deprecated and will be removed in 8.0, use "RateLimiterFactoryInterface" instead.'); - } + $container->registerAliasForArgument($limiterId, RateLimiterFactoryInterface::class, $name.'.limiter', $name); } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy