diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index ff26312582..3c5a975933 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -832,10 +832,6 @@ class FrameworkExtension extends Extension $definitionDefinition->addArgument($transitions); $definitionDefinition->addArgument($initialMarking); $definitionDefinition->addArgument(new Reference(sprintf('%s.metadata_store', $workflowId))); - $definitionDefinition->addTag('workflow.definition', [ - 'name' => $name, - 'type' => $type, - ]); // Create MarkingStore if (isset($workflow['marking_store']['type'])) { diff --git a/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php b/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php index 3a80e6433b..45447f50e8 100644 --- a/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php +++ b/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php @@ -44,8 +44,9 @@ class SecurityDataCollector extends DataCollector implements LateDataCollectorIn private $firewallMap; private $firewall; private $hasVarDumper; + private $authenticatorManagerEnabled; - public function __construct(TokenStorageInterface $tokenStorage = null, RoleHierarchyInterface $roleHierarchy = null, LogoutUrlGenerator $logoutUrlGenerator = null, AccessDecisionManagerInterface $accessDecisionManager = null, FirewallMapInterface $firewallMap = null, TraceableFirewallListener $firewall = null) + public function __construct(TokenStorageInterface $tokenStorage = null, RoleHierarchyInterface $roleHierarchy = null, LogoutUrlGenerator $logoutUrlGenerator = null, AccessDecisionManagerInterface $accessDecisionManager = null, FirewallMapInterface $firewallMap = null, TraceableFirewallListener $firewall = null, bool $authenticatorManagerEnabled = false) { $this->tokenStorage = $tokenStorage; $this->roleHierarchy = $roleHierarchy; @@ -54,6 +55,7 @@ class SecurityDataCollector extends DataCollector implements LateDataCollectorIn $this->firewallMap = $firewallMap; $this->firewall = $firewall; $this->hasVarDumper = class_exists(ClassStub::class); + $this->authenticatorManagerEnabled = $authenticatorManagerEnabled; } /** @@ -207,6 +209,8 @@ class SecurityDataCollector extends DataCollector implements LateDataCollectorIn if ($this->firewall) { $this->data['listeners'] = $this->firewall->getWrappedListeners(); } + + $this->data['authenticator_manager_enabled'] = $this->authenticatorManagerEnabled; } /** @@ -392,4 +396,9 @@ class SecurityDataCollector extends DataCollector implements LateDataCollectorIn { return 'security'; } + + public function isAuthenticatorManagerEnabled(): bool + { + return $this->data['authenticator_manager_enabled']; + } } diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index a6948efae7..1a58734794 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -142,6 +142,8 @@ class SecurityExtension extends Extension implements PrependExtensionInterface $loader->load('collectors.php'); $loader->load('guard.php'); + $container->getDefinition('data_collector.security')->addArgument($this->authenticatorManagerEnabled); + if ($container->hasParameter('kernel.debug') && $container->getParameter('kernel.debug')) { $loader->load('security_debug.php'); } diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator_login_link.php b/src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator_login_link.php index ba04bbadad..9a46a0926d 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator_login_link.php +++ b/src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator_login_link.php @@ -66,13 +66,5 @@ return static function (ContainerConfigurator $container) { service('request_stack'), ]) ->alias(LoginLinkHandlerInterface::class, 'security.authenticator.firewall_aware_login_link_handler') - - ->set('security.authenticator.entity_login_link_user_handler', EntityLoginLinkUserHandler::class) - ->abstract() - ->args([ - service('doctrine'), - abstract_arg('user entity class name'), - ]) - ->deprecate('symfony/security-bundle', '5.3', 'The "%service_id%" service is deprecated, use the new authenticator system instead.') ; }; diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig index 6b0819513f..9f69abcaf2 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -159,10 +159,12 @@ {{ include('@WebProfiler/Icon/' ~ (collector.firewall.stateless ? 'yes' : 'no') ~ '.svg') }} Stateless + {% if collector.authenticatorManagerEnabled == false %}
{{ include('@WebProfiler/Icon/' ~ (collector.firewall.allows_anonymous ? 'yes' : 'no') ~ '.svg') }} Allows anonymous
+ {% endif %} {% if collector.firewall.security_enabled %} diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php index 428564020d..855b9fcb18 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php @@ -71,6 +71,7 @@ class SecurityDataCollectorTest extends TestCase $this->assertCount(0, $collector->getInheritedRoles()); $this->assertEmpty($collector->getUser()); $this->assertNull($collector->getFirewall()); + $this->assertFalse($collector->isAuthenticatorManagerEnabled()); } /** @dataProvider provideRoles */ @@ -93,6 +94,7 @@ class SecurityDataCollectorTest extends TestCase $this->assertSame($normalizedRoles, $collector->getRoles()->getValue(true)); $this->assertSame($inheritedRoles, $collector->getInheritedRoles()->getValue(true)); $this->assertSame('hhamon', $collector->getUser()); + $this->assertFalse($collector->isAuthenticatorManagerEnabled()); } public function testCollectSwitchUserToken() @@ -132,7 +134,7 @@ class SecurityDataCollectorTest extends TestCase ->with($request) ->willReturn($firewallConfig); - $collector = new SecurityDataCollector(null, null, null, null, $firewallMap, new TraceableFirewallListener($firewallMap, new EventDispatcher(), new LogoutUrlGenerator())); + $collector = new SecurityDataCollector(null, null, null, null, $firewallMap, new TraceableFirewallListener($firewallMap, new EventDispatcher(), new LogoutUrlGenerator()), true); $collector->collect($request, new Response()); $collector->lateCollect(); $collected = $collector->getFirewall(); @@ -149,6 +151,7 @@ class SecurityDataCollectorTest extends TestCase $this->assertSame($firewallConfig->getAccessDeniedUrl(), $collected['access_denied_url']); $this->assertSame($firewallConfig->getUserChecker(), $collected['user_checker']); $this->assertSame($firewallConfig->getListeners(), $collected['listeners']->getValue()); + $this->assertTrue($collector->isAuthenticatorManagerEnabled()); } public function testGetFirewallReturnsNull() diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.zh_CN.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.zh_CN.xlf index ce9d6fd224..6c4934ed86 100644 --- a/src/Symfony/Component/Security/Core/Resources/translations/security.zh_CN.xlf +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.zh_CN.xlf @@ -70,6 +70,14 @@ Invalid or expired login link. 失效或过期的登入链接。 + + Too many failed login attempts, please try again in %minutes% minute. + 登入失败的次数过多,请在%minutes%分钟后再试。 + + + Too many failed login attempts, please try again in %minutes% minutes. + 登入失败的次数过多,请在%minutes%分钟后再试。 + diff --git a/src/Symfony/Component/Security/Core/Resources/translations/security.zh_TW.xlf b/src/Symfony/Component/Security/Core/Resources/translations/security.zh_TW.xlf index 8631047318..fd30587938 100644 --- a/src/Symfony/Component/Security/Core/Resources/translations/security.zh_TW.xlf +++ b/src/Symfony/Component/Security/Core/Resources/translations/security.zh_TW.xlf @@ -70,6 +70,14 @@ Invalid or expired login link. 失效或過期的登入鏈接。 + + Too many failed login attempts, please try again in %minutes% minute. + 登錄失敗的次數過多,請在%minutes%分鐘後再試。 + + + Too many failed login attempts, please try again in %minutes% minutes. + 登錄失敗的次數過多,請在%minutes%分鐘後再試。 + diff --git a/src/Symfony/Component/Security/Http/Authenticator/InteractiveAuthenticatorInterface.php b/src/Symfony/Component/Security/Http/Authenticator/InteractiveAuthenticatorInterface.php index 7f26d82606..71b6ade28d 100644 --- a/src/Symfony/Component/Security/Http/Authenticator/InteractiveAuthenticatorInterface.php +++ b/src/Symfony/Component/Security/Http/Authenticator/InteractiveAuthenticatorInterface.php @@ -17,7 +17,7 @@ namespace Symfony\Component\Security\Http\Authenticator; * * Interactive login requires explicit user action (e.g. a login * form or HTTP basic authentication). Implementing this interface - * will dispatcher the InteractiveLoginEvent upon successful login. + * will dispatch the InteractiveLoginEvent upon successful login. * * @author Wouter de Jong */