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

    providers:
        app_user_provider:
            id: App\Infrastructure\Auth\SymfonyUserProvider

    firewalls:
        dev:
            pattern: ^/(_profiler|_wdt|assets|build)/
            security: false

        back_public:
            pattern: ^/back/auth/
            stateless: true
            security: false

        # Firewall back-office admin — JWT stateless
        back:
            pattern: ^/back/
            stateless: true
            jwt: ~

        # Firewall API — JWT stateless
        api:
            pattern: ^/api/
            stateless: true
            jwt: ~

    access_control:
        # Routes publiques back (login + verify 2fa)
        - { path: ^/back/auth, roles: PUBLIC_ACCESS }
        # Toutes les autres routes back → superadmin uniquement
        - { path: ^/back, roles: ROLE_SUPER_ADMIN }

        # Routes publiques API (login + register)
        - { path: ^/api/auth, roles: PUBLIC_ACCESS }
        # Toutes les autres routes API → connecté
        - { path: ^/api, roles: ROLE_USER }

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