security:
    password_hashers:
        Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'

    providers:
        app_agent_provider:
            entity:
                class: App\Entity\Agent
                property: email

    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt)|css|images|js)/
            security: false
        main:
            lazy: true
            provider: app_agent_provider
            form_login:
                login_path: app_login
                check_path: app_login
                default_target_path: app_dashboard
                username_parameter: _username
                password_parameter: _password
                enable_csrf: true
            logout:
                path: app_logout
                target: app_login
                enable_csrf: true
            remember_me:
                secret: '%kernel.secret%'
                lifetime: 604800
                secure: true
                httponly: true
                samesite: lax
            login_throttling:
                max_attempts: 5
                interval: '15 minutes'

    access_control:
        - { path: ^/login, roles: PUBLIC_ACCESS }
        - { path: ^/planning/client, roles: ROLE_ADMIN }
        - { path: ^/planning/entry/new, roles: ROLE_ADMIN }
        - { path: ^/agent, roles: ROLE_ADMIN }
        - { path: ^/client, roles: ROLE_ADMIN }
        - { path: ^/site, roles: ROLE_ADMIN }
        - { path: ^/contact, roles: ROLE_ADMIN }
        - { path: ^/email, roles: ROLE_ADMIN }
        - { path: ^/agency, roles: ROLE_ADMIN }
        - { path: ^/admin, roles: ROLE_ADMIN }
        - { path: ^/, roles: ROLE_USER }

when@test:
    security:
        password_hashers:
            Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
                algorithm: auto
                cost: 4
                time_cost: 3
                memory_cost: 10
