imports:
    - { resource: security.php }

framework:
    secret:          secret
    test: ~
    router:          { resource: "%kernel.root_dir%/../App/routing.yml" }
    session:
        handler_id:  ~
        storage_id: session.storage.mock_file
        name: MOCKSESSID
    translator: ~
    form:
        enabled: true
    csrf_protection: ~

monolog:
    handlers:
        main:
            type:  stream
            path:  "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug

security:
    encoders:
        HWI\Bundle\OAuthBundle\Tests\Fixtures\FOSUser: sha512
    providers:
        HWI\Bundle\OAuthBundle\Tests\App\UserProvider:
            id: HWI\Bundle\OAuthBundle\Tests\App\UserProvider

    firewalls:
        login_area:
            pattern: ^/(login$|connect|login_hwi)
            anonymous: true
            context: hwi_context
        secured_area:
            pattern: ^/
            oauth:
                resource_owners:
                    google: "/check-login/google"
                login_path: /login
                use_forward: false
                failure_path: /login
                oauth_user_provider:
                    service: HWI\Bundle\OAuthBundle\Tests\App\UserProvider
                provider: HWI\Bundle\OAuthBundle\Tests\App\UserProvider
            context: hwi_context
    access_control:
        - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }

services:
    _defaults:
        autowire: true
        autoconfigure: true

    HWI\Bundle\OAuthBundle\Tests\App\Controller\HomeController:
        tags:
            - controller.service_arguments

    HWI\Bundle\OAuthBundle\Tests\App\UserProvider: ~

    Psr\Http\Client\ClientInterface:
        public: true
        synthetic: true

    Http\Message\MessageFactory\GuzzleMessageFactory:

doctrine:
    dbal:
        url: 'sqlite:///:memory:'
    orm:
        entity_managers:
            default:
                auto_mapping: true
                mappings:
                    App:
                        is_bundle: false
                        type: annotation
                        dir: '%kernel.project_dir%/../Fixtures'
                        prefix: 'HWI\Bundle\OAuthBundle\Tests\Fixtures'
                        alias: HWI\Bundle\OAuthBundle\Tests\Fixtures

hwi_oauth:
    connect: ~
    fosub:
        properties:
            google: googleId
    http:
        client: Psr\Http\Client\ClientInterface
        message_factory: Http\Message\MessageFactory\GuzzleMessageFactory
    firewall_names:
        - secured_area

    resource_owners:
        google:
            type:                google
            client_id:           'google_client_id'
            client_secret:       'google_client_secret'
            scope:               "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"

fos_user:
    db_driver: orm
    user_class: HWI\Bundle\OAuthBundle\Tests\Fixtures\FOSUser
    firewall_name: secured_area
    from_email:
        address: "test@example.com"
        sender_name: "test@example.com"
    service:
        mailer: 'fos_user.mailer.noop'

twig:
    strict_variables: '%kernel.debug%'
    exception_controller: ~
    paths:
        '%kernel.project_dir%/templates': 'Acme'
