2018-05-01 11:35:12 -05:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Shlinkio\Shlink\Rest;
|
|
|
|
|
2018-09-28 15:08:01 -05:00
|
|
|
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
|
|
|
|
2018-05-01 11:35:12 -05:00
|
|
|
return [
|
|
|
|
|
|
|
|
'auth' => [
|
|
|
|
'routes_whitelist' => [
|
|
|
|
Action\AuthenticateAction::class,
|
2018-09-20 12:55:24 -05:00
|
|
|
Action\ShortUrl\SingleStepCreateShortUrlAction::class,
|
2018-05-01 11:35:12 -05:00
|
|
|
],
|
2018-09-28 15:08:01 -05: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 01:16:40 -05:00
|
|
|
Authentication\RequestToHttpAuthPlugin::class => ConfigAbstractFactory::class,
|
2018-09-28 15:08:01 -05:00
|
|
|
|
|
|
|
Middleware\AuthenticationMiddleware::class => ConfigAbstractFactory::class,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
ConfigAbstractFactory::class => [
|
|
|
|
Authentication\Plugin\AuthorizationHeaderPlugin::class => [Authentication\JWTService::class, 'translator'],
|
2018-09-29 01:34:47 -05:00
|
|
|
Authentication\Plugin\ApiKeyHeaderPlugin::class => [Service\ApiKeyService::class, 'translator'],
|
2018-09-28 15:08:01 -05:00
|
|
|
|
2018-09-29 01:16:40 -05:00
|
|
|
Authentication\RequestToHttpAuthPlugin::class => [Authentication\AuthenticationPluginManager::class],
|
|
|
|
|
2018-09-28 15:08:01 -05:00
|
|
|
Middleware\AuthenticationMiddleware::class => [
|
2018-09-29 01:16:40 -05:00
|
|
|
Authentication\RequestToHttpAuthPlugin::class,
|
2018-09-28 15:08:01 -05:00
|
|
|
'translator',
|
|
|
|
'config.auth.routes_whitelist',
|
|
|
|
'Logger_Shlink',
|
|
|
|
],
|
2018-05-01 11:35:12 -05:00
|
|
|
],
|
|
|
|
|
|
|
|
];
|