| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- security:
- #enable_authenticator_manager: true
- password_hashers:
- Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
-
- # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
- role_hierarchy:
- ROLE_ADMIN: [ROLE_USER, ROLE_MODERATEUR]
- ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
- # https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
- providers:
- app_user_provider:
- entity:
- class: App\Entity\User
- property: username
- firewalls:
- dev:
- # Ensure dev tools and static assets are always allowed
- pattern: ^/(_profiler|_wdt|assets|build)/
- security: false
- main:
- user_checker: App\Security\UserChecker
- #guard:
- # authenticators:
- # - App\Security\LoginFormAuthenticator
- remember_me:
- secret: '%kernel.secret%'
- samesite: 'lax'
- form_login:
- login_path: app_login
- check_path: app_login
- enable_csrf: true
- logout:
- path: app_logout
- target: app_login
- #custom_authenticator: App\Security\LoginFormAuthenticator
- #lazy: true
- #provider: users_in_memory
- # 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: true
- # Note: Only the *first* matching rule is applied
- access_control:
- - { path: ^/(login$|register$|motdepasseoublie$|resetpassword/token=|activate/token=|attente$|fichefilm/|$|liste-by/|liste-by_real/|recherche|prochaines-sorties$|p/about$) , roles: PUBLIC_ACCESS }
- - { path: ^/admin, roles: ROLE_ADMIN }
- - { path: ^/genre, roles: ROLE_MODERATEUR }
- - { path: ^/p/edit, roles: ROLE_ADMIN }
- - { path: ^/, roles: IS_AUTHENTICATED_REMEMBERED }
- # - { path: ^/admin, roles: ROLE_ADMIN }
- # - { path: ^/profile, roles: ROLE_USER }
- when@test:
- security:
- password_hashers:
- # Password hashers are resource-intensive by design to ensure security.
- # In tests, it's safe to reduce their cost to improve performance.
- 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
|