Merge branch '5.2' into 5.x
* 5.2: [SecurityBundle] add missing type-hint [SecurityBundle] Remove invalid unused service [Security] [DataCollector] Remove allows anonymous information in datacollector [Workflow] Remove dead call to `Defnition#addTag()` add chinese translation
This commit is contained in:
commit
5ad6f6934b
@ -832,10 +832,6 @@ class FrameworkExtension extends Extension
|
|||||||
$definitionDefinition->addArgument($transitions);
|
$definitionDefinition->addArgument($transitions);
|
||||||
$definitionDefinition->addArgument($initialMarking);
|
$definitionDefinition->addArgument($initialMarking);
|
||||||
$definitionDefinition->addArgument(new Reference(sprintf('%s.metadata_store', $workflowId)));
|
$definitionDefinition->addArgument(new Reference(sprintf('%s.metadata_store', $workflowId)));
|
||||||
$definitionDefinition->addTag('workflow.definition', [
|
|
||||||
'name' => $name,
|
|
||||||
'type' => $type,
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Create MarkingStore
|
// Create MarkingStore
|
||||||
if (isset($workflow['marking_store']['type'])) {
|
if (isset($workflow['marking_store']['type'])) {
|
||||||
|
@ -44,8 +44,9 @@ class SecurityDataCollector extends DataCollector implements LateDataCollectorIn
|
|||||||
private $firewallMap;
|
private $firewallMap;
|
||||||
private $firewall;
|
private $firewall;
|
||||||
private $hasVarDumper;
|
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->tokenStorage = $tokenStorage;
|
||||||
$this->roleHierarchy = $roleHierarchy;
|
$this->roleHierarchy = $roleHierarchy;
|
||||||
@ -54,6 +55,7 @@ class SecurityDataCollector extends DataCollector implements LateDataCollectorIn
|
|||||||
$this->firewallMap = $firewallMap;
|
$this->firewallMap = $firewallMap;
|
||||||
$this->firewall = $firewall;
|
$this->firewall = $firewall;
|
||||||
$this->hasVarDumper = class_exists(ClassStub::class);
|
$this->hasVarDumper = class_exists(ClassStub::class);
|
||||||
|
$this->authenticatorManagerEnabled = $authenticatorManagerEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -207,6 +209,8 @@ class SecurityDataCollector extends DataCollector implements LateDataCollectorIn
|
|||||||
if ($this->firewall) {
|
if ($this->firewall) {
|
||||||
$this->data['listeners'] = $this->firewall->getWrappedListeners();
|
$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';
|
return 'security';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isAuthenticatorManagerEnabled(): bool
|
||||||
|
{
|
||||||
|
return $this->data['authenticator_manager_enabled'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,6 +142,8 @@ class SecurityExtension extends Extension implements PrependExtensionInterface
|
|||||||
$loader->load('collectors.php');
|
$loader->load('collectors.php');
|
||||||
$loader->load('guard.php');
|
$loader->load('guard.php');
|
||||||
|
|
||||||
|
$container->getDefinition('data_collector.security')->addArgument($this->authenticatorManagerEnabled);
|
||||||
|
|
||||||
if ($container->hasParameter('kernel.debug') && $container->getParameter('kernel.debug')) {
|
if ($container->hasParameter('kernel.debug') && $container->getParameter('kernel.debug')) {
|
||||||
$loader->load('security_debug.php');
|
$loader->load('security_debug.php');
|
||||||
}
|
}
|
||||||
|
@ -66,13 +66,5 @@ return static function (ContainerConfigurator $container) {
|
|||||||
service('request_stack'),
|
service('request_stack'),
|
||||||
])
|
])
|
||||||
->alias(LoginLinkHandlerInterface::class, 'security.authenticator.firewall_aware_login_link_handler')
|
->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.')
|
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
@ -159,10 +159,12 @@
|
|||||||
<span class="value">{{ include('@WebProfiler/Icon/' ~ (collector.firewall.stateless ? 'yes' : 'no') ~ '.svg') }}</span>
|
<span class="value">{{ include('@WebProfiler/Icon/' ~ (collector.firewall.stateless ? 'yes' : 'no') ~ '.svg') }}</span>
|
||||||
<span class="label">Stateless</span>
|
<span class="label">Stateless</span>
|
||||||
</div>
|
</div>
|
||||||
|
{% if collector.authenticatorManagerEnabled == false %}
|
||||||
<div class="metric">
|
<div class="metric">
|
||||||
<span class="value">{{ include('@WebProfiler/Icon/' ~ (collector.firewall.allows_anonymous ? 'yes' : 'no') ~ '.svg') }}</span>
|
<span class="value">{{ include('@WebProfiler/Icon/' ~ (collector.firewall.allows_anonymous ? 'yes' : 'no') ~ '.svg') }}</span>
|
||||||
<span class="label">Allows anonymous</span>
|
<span class="label">Allows anonymous</span>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if collector.firewall.security_enabled %}
|
{% if collector.firewall.security_enabled %}
|
||||||
|
@ -71,6 +71,7 @@ class SecurityDataCollectorTest extends TestCase
|
|||||||
$this->assertCount(0, $collector->getInheritedRoles());
|
$this->assertCount(0, $collector->getInheritedRoles());
|
||||||
$this->assertEmpty($collector->getUser());
|
$this->assertEmpty($collector->getUser());
|
||||||
$this->assertNull($collector->getFirewall());
|
$this->assertNull($collector->getFirewall());
|
||||||
|
$this->assertFalse($collector->isAuthenticatorManagerEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @dataProvider provideRoles */
|
/** @dataProvider provideRoles */
|
||||||
@ -93,6 +94,7 @@ class SecurityDataCollectorTest extends TestCase
|
|||||||
$this->assertSame($normalizedRoles, $collector->getRoles()->getValue(true));
|
$this->assertSame($normalizedRoles, $collector->getRoles()->getValue(true));
|
||||||
$this->assertSame($inheritedRoles, $collector->getInheritedRoles()->getValue(true));
|
$this->assertSame($inheritedRoles, $collector->getInheritedRoles()->getValue(true));
|
||||||
$this->assertSame('hhamon', $collector->getUser());
|
$this->assertSame('hhamon', $collector->getUser());
|
||||||
|
$this->assertFalse($collector->isAuthenticatorManagerEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCollectSwitchUserToken()
|
public function testCollectSwitchUserToken()
|
||||||
@ -132,7 +134,7 @@ class SecurityDataCollectorTest extends TestCase
|
|||||||
->with($request)
|
->with($request)
|
||||||
->willReturn($firewallConfig);
|
->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->collect($request, new Response());
|
||||||
$collector->lateCollect();
|
$collector->lateCollect();
|
||||||
$collected = $collector->getFirewall();
|
$collected = $collector->getFirewall();
|
||||||
@ -149,6 +151,7 @@ class SecurityDataCollectorTest extends TestCase
|
|||||||
$this->assertSame($firewallConfig->getAccessDeniedUrl(), $collected['access_denied_url']);
|
$this->assertSame($firewallConfig->getAccessDeniedUrl(), $collected['access_denied_url']);
|
||||||
$this->assertSame($firewallConfig->getUserChecker(), $collected['user_checker']);
|
$this->assertSame($firewallConfig->getUserChecker(), $collected['user_checker']);
|
||||||
$this->assertSame($firewallConfig->getListeners(), $collected['listeners']->getValue());
|
$this->assertSame($firewallConfig->getListeners(), $collected['listeners']->getValue());
|
||||||
|
$this->assertTrue($collector->isAuthenticatorManagerEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetFirewallReturnsNull()
|
public function testGetFirewallReturnsNull()
|
||||||
|
@ -70,6 +70,14 @@
|
|||||||
<source>Invalid or expired login link.</source>
|
<source>Invalid or expired login link.</source>
|
||||||
<target>失效或过期的登入链接。</target>
|
<target>失效或过期的登入链接。</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="19">
|
||||||
|
<source>Too many failed login attempts, please try again in %minutes% minute.</source>
|
||||||
|
<target>登入失败的次数过多,请在%minutes%分钟后再试。</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="20">
|
||||||
|
<source>Too many failed login attempts, please try again in %minutes% minutes.</source>
|
||||||
|
<target>登入失败的次数过多,请在%minutes%分钟后再试。</target>
|
||||||
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
@ -70,6 +70,14 @@
|
|||||||
<source>Invalid or expired login link.</source>
|
<source>Invalid or expired login link.</source>
|
||||||
<target>失效或過期的登入鏈接。</target>
|
<target>失效或過期的登入鏈接。</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="19">
|
||||||
|
<source>Too many failed login attempts, please try again in %minutes% minute.</source>
|
||||||
|
<target>登錄失敗的次數過多,請在%minutes%分鐘後再試。</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="20">
|
||||||
|
<source>Too many failed login attempts, please try again in %minutes% minutes.</source>
|
||||||
|
<target>登錄失敗的次數過多,請在%minutes%分鐘後再試。</target>
|
||||||
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
@ -17,7 +17,7 @@ namespace Symfony\Component\Security\Http\Authenticator;
|
|||||||
*
|
*
|
||||||
* Interactive login requires explicit user action (e.g. a login
|
* Interactive login requires explicit user action (e.g. a login
|
||||||
* form or HTTP basic authentication). Implementing this interface
|
* 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 <wouter@wouterj.nl>
|
* @author Wouter de Jong <wouter@wouterj.nl>
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user