2018-05-01 18:35:12 +02:00
|
|
|
<?php
|
2019-10-05 17:26:10 +02:00
|
|
|
|
2018-05-01 18:35:12 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Shlinkio\Shlink\Rest;
|
|
|
|
|
2018-09-28 22:08:01 +02:00
|
|
|
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
|
|
|
|
2018-05-01 18:35:12 +02:00
|
|
|
return [
|
|
|
|
|
|
|
|
'auth' => [
|
|
|
|
'routes_whitelist' => [
|
|
|
|
Action\AuthenticateAction::class,
|
2018-12-23 10:18:38 +01:00
|
|
|
Action\HealthAction::class,
|
2018-09-20 19:55:24 +02:00
|
|
|
Action\ShortUrl\SingleStepCreateShortUrlAction::class,
|
2018-05-01 18:35:12 +02:00
|
|
|
],
|
2018-09-28 22:08:01 +02:00
|
|
|
|
|
|
|
'plugins' => [
|
|
|
|
'factories' => [
|
|
|
|
Authentication\Plugin\ApiKeyHeaderPlugin::class => ConfigAbstractFactory::class,
|
|
|
|
Authentication\Plugin\AuthorizationHeaderPlugin::class => ConfigAbstractFactory::class,
|
|
|
|
],
|
|
|
|
'aliases' => [
|
|
|
|
Authentication\Plugin\ApiKeyHeaderPlugin::HEADER_NAME =>
|
|
|
|
Authentication\Plugin\ApiKeyHeaderPlugin::class,
|
|
|
|
Authentication\Plugin\AuthorizationHeaderPlugin::HEADER_NAME =>
|
|
|
|
Authentication\Plugin\AuthorizationHeaderPlugin::class,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
'dependencies' => [
|
|
|
|
'factories' => [
|
|
|
|
Authentication\AuthenticationPluginManager::class =>
|
|
|
|
Authentication\AuthenticationPluginManagerFactory::class,
|
2018-09-29 08:16:40 +02:00
|
|
|
Authentication\RequestToHttpAuthPlugin::class => ConfigAbstractFactory::class,
|
2018-09-28 22:08:01 +02:00
|
|
|
|
|
|
|
Middleware\AuthenticationMiddleware::class => ConfigAbstractFactory::class,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
ConfigAbstractFactory::class => [
|
2018-11-18 16:28:04 +01:00
|
|
|
Authentication\Plugin\AuthorizationHeaderPlugin::class => [Authentication\JWTService::class],
|
|
|
|
Authentication\Plugin\ApiKeyHeaderPlugin::class => [Service\ApiKeyService::class],
|
2018-09-28 22:08:01 +02:00
|
|
|
|
2018-09-29 08:16:40 +02:00
|
|
|
Authentication\RequestToHttpAuthPlugin::class => [Authentication\AuthenticationPluginManager::class],
|
|
|
|
|
2018-09-28 22:08:01 +02:00
|
|
|
Middleware\AuthenticationMiddleware::class => [
|
2018-09-29 08:16:40 +02:00
|
|
|
Authentication\RequestToHttpAuthPlugin::class,
|
2018-09-28 22:08:01 +02:00
|
|
|
'config.auth.routes_whitelist',
|
|
|
|
],
|
2018-05-01 18:35:12 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
];
|