Skip to content

Commit 5f53b3b

Browse files
Switching to directory 7.4
1 parent 197c31e commit 5f53b3b

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
security:
2+
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
3+
password_hashers:
4+
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
5+
6+
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
7+
providers:
8+
users_in_memory: { memory: null }
9+
10+
firewalls:
11+
# Disable security for dev tools and static assets (only needed if access_control is broad):
12+
dev:
13+
# 'assets/' is for AssetMapper, 'build/' for Webpack Encore.
14+
# (Note: no regex delimiters needed; Symfony adds `{}` automatically.)
15+
pattern: ^/(_profiler|_wdt|assets|build)/
16+
security: false
17+
main:
18+
lazy: true
19+
provider: users_in_memory
20+
21+
# Activate different ways to authenticate:
22+
# https://symfony.com/doc/current/security.html#the-firewall
23+
24+
# https://symfony.com/doc/current/security/impersonating_user.html
25+
# switch_user: true
26+
27+
# Note: Only the *first* matching rule is applied
28+
access_control:
29+
# - { path: ^/admin, roles: ROLE_ADMIN }
30+
# - { path: ^/profile, roles: ROLE_USER }
31+
32+
when@test:
33+
security:
34+
password_hashers:
35+
# Password hashers are resource-intensive by design to ensure security.
36+
# In tests, it's safe to reduce their cost to improve performance.
37+
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
38+
algorithm: auto
39+
cost: 4 # Lowest possible value for bcrypt
40+
time_cost: 3 # Lowest possible value for argon
41+
memory_cost: 10 # Lowest possible value for argon
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_security_logout:
2+
resource: security.route_loader.logout
3+
type: service
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"bundles": {
3+
"Symfony\\Bundle\\SecurityBundle\\SecurityBundle": ["all"]
4+
},
5+
"copy-from-recipe": {
6+
"config/": "%CONFIG_DIR%/"
7+
},
8+
"aliases": ["security"],
9+
"conflict": {
10+
"symfony/framework-bundle": "<5.3"
11+
}
12+
}

0 commit comments

Comments
 (0)