Upgrade recipes: symfony/security-bundle

This commit is contained in:
Julien Fastré 2023-09-06 12:30:32 +02:00
parent f0645d0c45
commit 59625879a8
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 26 additions and 8 deletions

View File

@ -4,7 +4,11 @@ security:
strategy: unanimous strategy: unanimous
allow_if_all_abstain: false allow_if_all_abstain: false
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers enable_authenticator_manager: true
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
password_hashers:
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
providers: providers:
chain_provider: chain_provider:
@ -18,7 +22,6 @@ security:
id: chill.main.user_provider id: chill.main.user_provider
encoders: encoders:
Chill\MainBundle\Entity\User: Chill\MainBundle\Entity\User:
algorithm: bcrypt algorithm: bcrypt
Symfony\Component\Security\Core\User\User: plaintext Symfony\Component\Security\Core\User\User: plaintext
@ -38,13 +41,15 @@ security:
- lexik_jwt_authentication.jwt_token_authenticator - lexik_jwt_authentication.jwt_token_authenticator
default: default:
anonymous: ~ # remove during upgrade from symfony 4 to symfony 5 TODO check this
#anonymous: ~
provider: chain_provider provider: chain_provider
form_login: form_login:
csrf_parameter: _csrf_token csrf_parameter: _csrf_token
csrf_token_id: authenticate csrf_token_id: authenticate
#csrf_provider: security.csrf.token_manager #csrf_provider: security.csrf.token_manager
logout_on_user_change: true # remove during upgrade from symfony 4 to symfony 5 TODO check this
# logout_on_user_change: true
logout: logout:
path: /logout path: /logout
@ -72,3 +77,16 @@ security:
- { path: ^/([a-z]+/)?admin, roles: ROLE_ADMIN } - { path: ^/([a-z]+/)?admin, roles: ROLE_ADMIN }
# other pages, only for regular user (no admin) # other pages, only for regular user (no admin)
- { path: ^/, roles: ROLE_USER } - { path: ^/, roles: ROLE_USER }
when@test:
security:
password_hashers:
# By default, password hashers are resource intensive and take time. This is
# important to generate secure password hashes. In tests however, secure hashes
# are not important, waste resources and increase test times. The following
# reduces the work factor to the lowest possible values.
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
algorithm: auto
cost: 4 # Lowest possible value for bcrypt
time_cost: 3 # Lowest possible value for argon
memory_cost: 10 # Lowest possible value for argon

View File

@ -686,12 +686,12 @@
] ]
}, },
"symfony/security-bundle": { "symfony/security-bundle": {
"version": "4.4", "version": "5.4",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "master", "branch": "main",
"version": "4.4", "version": "5.3",
"ref": "7b4408dc203049666fe23fabed23cbadc6d8440f" "ref": "98f1f2b0d635908c2b40f3675da2d23b1a069d30"
}, },
"files": [ "files": [
"config/packages/security.yaml" "config/packages/security.yaml"