Files
myep-team/config/packages/security.yaml
T

63 lines
2.4 KiB
YAML

security:
password_hashers:
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
providers:
bpn_user_provider:
entity:
class: App\Entity\User
property: email
# The sibling websites post as this one; it exists in configuration only. An API caller
# must never be a row in the user table, where it would be a login to the UI as well.
api_user_provider:
memory:
users:
api: { roles: [ ROLE_API ] }
n8n: { roles: [ ROLE_API_PLACEMENTS ] }
role_hierarchy:
ROLE_TEAM_ADMIN: [ ROLE_ADMINISTRATIVE ]
ROLE_MANAGER: [ ROLE_ADMINISTRATIVE ]
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
# Stateless and key-authenticated: a machine posts here inside a visitor's form
# submission on another site, so there is no session, no login form and no redirect.
# Must stay above "main", whose pattern is ^/.
api:
pattern: ^/api
stateless: true
provider: api_user_provider
access_token:
token_handler: App\Security\AccessToken\ApiKeyTokenHandler
token_extractors:
- App\Security\AccessToken\ApiKeyExtractor
main:
lazy: true
provider: bpn_user_provider
custom_authenticators:
- App\Security\MyEpAuthenticator
- App\Security\BpnAuthenticator
user_checker: App\Security\UserChecker
switch_user:
role: CAN_IMPERSONATE
logout:
path: app_security_logout
target: app_security_login
access_control:
# The firewall authenticates, the controller requires ROLE_API
- { path: '^/api', roles: PUBLIC_ACCESS, requires_channel: https }
- { path: '^/_uploader', roles: ROLE_USER, requires_channel: https }
- { path: '^/', roles: PUBLIC_ACCESS, requires_channel: https }
when@test:
security:
password_hashers:
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