collection-crud/config/packages/security.php
2023-07-21 10:35:15 -04:00

37 lines
993 B
PHP

<?php declare(strict_types=1);
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Config\SecurityConfig;
return static function (ContainerConfigurator $containerConfigurator, SecurityConfig $security): void {
$security->passwordHasher(PasswordAuthenticatedUserInterface::class, 'auto');
$containerConfigurator->extension('security', [
'providers' => [
'users_in_memory' => [
'memory' => NULL],
],
'firewalls' => [
'dev' => [
'pattern' => '^/(_(profiler|wdt)|css|images|js)/',
'security' => FALSE,
],
'main' => [
'lazy' => TRUE,
'provider' => 'users_in_memory',
],
],
'access_control' => NULL,
]);
if ($containerConfigurator->env() === 'test')
{
$security->passwordHasher(PasswordAuthenticatedUserInterface::class, [
'algorithm' => 'auto',
'cost' => 4,
'time_cost' => 3,
'memory_cost' => 10,
]);
}
};