<?php
use Psr\Container\ContainerInterface;

return [
    Incoviba\Middleware\Authentication::class => function(ContainerInterface $container) {
        return new Incoviba\Middleware\Authentication(
            $container->get(Psr\Http\Message\ResponseFactoryInterface::class),
            $container->get(Incoviba\Service\Login::class),
            $container->get('loginLogger'),
            $container->get(Incoviba\Common\Alias\View::class),
            implode('/', [$container->get('APP_URL'), 'login'])
        );
    },
    Incoviba\Middleware\API::class => function(ContainerInterface $container) {
        return new Incoviba\Middleware\API(
            $container->get(Psr\Http\Message\ResponseFactoryInterface::class),
            $container->get(Psr\Log\LoggerInterface::class),
            $container->get(Incoviba\Service\API::class),
            $container->get(Incoviba\Service\Login::class),
            $container->get('permittedPaths'),
            $container->get('simplePaths'),
            $container->get('API_KEY')
        );
    }
];
