ebs/config/packages/security.yaml
Sarahshr 20251f6caf
Feat/adhesion payante front (#716)
* list only user groups with enabled services in create and edit service forms

* feat: add platform membership payment (wip)

* WIP

* revert mollie api key

* remove all option for visibility in services forms

* add quit platform membership

* remove quit platform feature

* fix good route name for payment

* fix review

* fix review 2
2024-10-08 09:48:47 +02:00

67 lines
2.7 KiB
YAML

security:
# 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:
# used to reload user from session & other features (e.g. switch_user)
app_user_provider:
entity:
class: App\Entity\User
property: email
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
lazy: true
provider: app_user_provider
# checkers are in src/Security/Checker
user_checker: security.user_checker.chain.main
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#the-firewall
# https://symfony.com/doc/current/security/impersonating_user.html
switch_user:
parameter: _switch_user
form_login:
login_path: app_login
check_path: app_login
enable_csrf: true
default_target_path: app_user_my_account
# https://symfony.com/doc/current/security.html#logging-out
logout:
path: app_logout
target: app_login
entry_point: App\Security\EntryPoint\AuthenticationEntryPoint
login_throttling:
max_attempts: 2
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
- { path: ^/admin, roles: [ROLE_ADMIN, ROLE_GROUP_ADMIN] }
# to synchronize with MyAccountAction
- { path: ^/en/my-account, roles: MEMBERSHIP_PAID }
- { path: ^/fr/mon-compte, roles: MEMBERSHIP_PAID }
role_hierarchy:
ROLE_ADMIN: [ROLE_USER, ROLE_ALLOWED_TO_SWITCH, ROLE_GROUP_ADMIN]
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