Skip to content

Commit ee02083

Browse files
alamiraultnicolas-grekas
authored andcommitted
[SecurityBundle] Remove last usages of tag security.remember_me_aware
1 parent 43faa9b commit ee02083

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

DependencyInjection/Security/Factory/RememberMeFactory.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,6 @@ public function createAuthenticator(ContainerBuilder $container, string $firewal
111111
->replaceArgument(3, $config['name'] ?? $this->options['name'])
112112
;
113113

114-
foreach ($container->findTaggedServiceIds('security.remember_me_aware') as $serviceId => $attributes) {
115-
// register ContextListener
116-
if (str_starts_with($serviceId, 'security.context_listener')) {
117-
continue;
118-
}
119-
120-
throw new \LogicException(sprintf('Symfony Authenticator Security dropped support for the "security.remember_me_aware" tag, service "%s" will no longer work as expected.', $serviceId));
121-
}
122-
123114
return $authenticatorId;
124115
}
125116

DependencyInjection/SecurityExtension.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,10 @@ private function createFirewall(ContainerBuilder $container, string $id, array $
417417
$listeners[] = new Reference('security.channel_listener');
418418

419419
$contextKey = null;
420-
$contextListenerId = null;
421420
// Context serializer listener
422421
if (false === $firewall['stateless']) {
423422
$contextKey = $firewall['context'] ?? $id;
424-
$listeners[] = new Reference($contextListenerId = $this->createContextListener($container, $contextKey, $firewallEventDispatcherId));
423+
$listeners[] = new Reference($this->createContextListener($container, $contextKey, $firewallEventDispatcherId));
425424
$sessionStrategyId = 'security.authentication.session_strategy';
426425

427426
$container
@@ -490,7 +489,7 @@ private function createFirewall(ContainerBuilder $container, string $id, array $
490489

491490
// Authentication listeners
492491
$firewallAuthenticationProviders = [];
493-
[$authListeners, $defaultEntryPoint] = $this->createAuthenticationListeners($container, $id, $firewall, $firewallAuthenticationProviders, $defaultProvider, $providerIds, $configuredEntryPoint, $contextListenerId);
492+
[$authListeners, $defaultEntryPoint] = $this->createAuthenticationListeners($container, $id, $firewall, $firewallAuthenticationProviders, $defaultProvider, $providerIds, $configuredEntryPoint);
494493

495494
// $configuredEntryPoint is resolved into a service ID and stored in $defaultEntryPoint
496495
$configuredEntryPoint = $defaultEntryPoint;
@@ -596,7 +595,7 @@ private function createContextListener(ContainerBuilder $container, string $cont
596595
return $this->contextListeners[$contextKey] = $listenerId;
597596
}
598597

599-
private function createAuthenticationListeners(ContainerBuilder $container, string $id, array $firewall, array &$authenticationProviders, ?string $defaultProvider, array $providerIds, ?string $defaultEntryPoint, string $contextListenerId = null)
598+
private function createAuthenticationListeners(ContainerBuilder $container, string $id, array $firewall, array &$authenticationProviders, ?string $defaultProvider, array $providerIds, ?string $defaultEntryPoint)
600599
{
601600
$listeners = [];
602601
$entryPoints = [];
@@ -605,7 +604,7 @@ private function createAuthenticationListeners(ContainerBuilder $container, stri
605604
$key = str_replace('-', '_', $factory->getKey());
606605

607606
if (isset($firewall[$key])) {
608-
$userProvider = $this->getUserProvider($container, $id, $firewall, $key, $defaultProvider, $providerIds, $contextListenerId);
607+
$userProvider = $this->getUserProvider($container, $id, $firewall, $key, $defaultProvider, $providerIds);
609608

610609
if (!$factory instanceof AuthenticatorFactoryInterface) {
611610
throw new InvalidConfigurationException(sprintf('Authenticator factory "%s" ("%s") must implement "%s".', get_debug_type($factory), $key, AuthenticatorFactoryInterface::class));
@@ -637,7 +636,7 @@ private function createAuthenticationListeners(ContainerBuilder $container, stri
637636
return [$listeners, $defaultEntryPoint];
638637
}
639638

640-
private function getUserProvider(ContainerBuilder $container, string $id, array $firewall, string $factoryKey, ?string $defaultProvider, array $providerIds, ?string $contextListenerId): string
639+
private function getUserProvider(ContainerBuilder $container, string $id, array $firewall, string $factoryKey, ?string $defaultProvider, array $providerIds): string
641640
{
642641
if (isset($firewall[$factoryKey]['provider'])) {
643642
if (!isset($providerIds[$normalizedName = str_replace('-', '_', $firewall[$factoryKey]['provider'])])) {
@@ -647,10 +646,6 @@ private function getUserProvider(ContainerBuilder $container, string $id, array
647646
return $providerIds[$normalizedName];
648647
}
649648

650-
if ('remember_me' === $factoryKey && $contextListenerId) {
651-
$container->getDefinition($contextListenerId)->addTag('security.remember_me_aware', ['id' => $id, 'provider' => 'none']);
652-
}
653-
654649
if ($defaultProvider) {
655650
return $defaultProvider;
656651
}

0 commit comments

Comments
 (0)