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

    providers:
        app_user_provider:
            entity:
                class: App\Entity\User
                property: email

    firewalls:
        dev:
            pattern: ^/(_profiler|_wdt|assets|build)/
            security: false
        
        login:
            pattern: ^/api/auth/(login|register)$
            stateless: true
            security: false

        api:
            pattern: ^/api
            stateless: true
            provider: app_user_provider
            jwt: ~

        main:
            lazy: true
            provider: app_user_provider

    access_control:
        # Public endpoints
        - { path: ^/api/auth, roles: PUBLIC_ACCESS }
        - { path: ^/api/games, roles: PUBLIC_ACCESS }
        - { path: ^/api/purchase, roles: PUBLIC_ACCESS }
        # Admin endpoints
        - { path: ^/api/admin, roles: ROLE_ADMIN }
        # Editor endpoints
        - { path: ^/api/editor, roles: ROLE_EDITOR }
        # User endpoints - require login
        - { path: ^/api/user, roles: IS_AUTHENTICATED_FULLY }
        # Any other API requires authentication
        - { path: ^/api, roles: IS_AUTHENTICATED_FULLY }

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