2016-07-19 18:07:59 +03:00
|
|
|
<?php
|
2017-10-12 11:13:20 +03:00
|
|
|
declare(strict_types=1);
|
2017-07-22 15:20:40 +03:00
|
|
|
|
|
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
use Shlinkio\Shlink\Core\Options\AppOptions;
|
|
|
|
use Shlinkio\Shlink\Core\Service;
|
2016-07-19 18:07:59 +03:00
|
|
|
use Shlinkio\Shlink\Rest\Action;
|
2016-08-07 20:13:40 +03:00
|
|
|
use Shlinkio\Shlink\Rest\Authentication\JWTService;
|
2016-07-19 18:07:59 +03:00
|
|
|
use Shlinkio\Shlink\Rest\Middleware;
|
2017-07-22 15:20:40 +03:00
|
|
|
use Shlinkio\Shlink\Rest\Service\ApiKeyService;
|
|
|
|
use Zend\I18n\Translator\Translator;
|
|
|
|
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
2016-07-19 18:07:59 +03:00
|
|
|
use Zend\ServiceManager\Factory\InvokableFactory;
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
2016-07-31 17:30:05 +03:00
|
|
|
'dependencies' => [
|
2016-07-19 18:07:59 +03:00
|
|
|
'factories' => [
|
2017-07-22 15:20:40 +03:00
|
|
|
JWTService::class => ConfigAbstractFactory::class,
|
|
|
|
ApiKeyService::class => ConfigAbstractFactory::class,
|
|
|
|
|
|
|
|
Action\AuthenticateAction::class => ConfigAbstractFactory::class,
|
2018-05-03 18:59:28 +03:00
|
|
|
Action\ShortCode\CreateShortCodeAction::class => ConfigAbstractFactory::class,
|
2018-05-03 14:21:43 +03:00
|
|
|
Action\ShortCode\SingleStepCreateShortCodeAction::class => ConfigAbstractFactory::class,
|
2018-05-03 19:00:32 +03:00
|
|
|
Action\ShortCode\EditShortCodeAction::class => ConfigAbstractFactory::class,
|
2018-05-03 19:02:45 +03:00
|
|
|
Action\ShortCode\ResolveUrlAction::class => ConfigAbstractFactory::class,
|
2018-05-03 19:04:00 +03:00
|
|
|
Action\Visit\GetVisitsAction::class => ConfigAbstractFactory::class,
|
2018-05-03 19:01:57 +03:00
|
|
|
Action\ShortCode\ListShortCodesAction::class => ConfigAbstractFactory::class,
|
2018-05-03 19:03:10 +03:00
|
|
|
Action\ShortCode\EditShortCodeTagsAction::class => ConfigAbstractFactory::class,
|
2017-07-22 15:20:40 +03:00
|
|
|
Action\Tag\ListTagsAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\Tag\DeleteTagsAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\Tag\CreateTagsAction::class => ConfigAbstractFactory::class,
|
|
|
|
Action\Tag\UpdateTagAction::class => ConfigAbstractFactory::class,
|
|
|
|
|
|
|
|
Middleware\BodyParserMiddleware::class => InvokableFactory::class,
|
2016-07-19 18:07:59 +03:00
|
|
|
Middleware\CrossDomainMiddleware::class => InvokableFactory::class,
|
2016-10-22 19:46:53 +03:00
|
|
|
Middleware\PathVersionMiddleware::class => InvokableFactory::class,
|
2017-07-22 15:20:40 +03:00
|
|
|
Middleware\CheckAuthenticationMiddleware::class => ConfigAbstractFactory::class,
|
2018-05-03 19:26:31 +03:00
|
|
|
Middleware\ShortCode\CreateShortCodeContentNegotiationMiddleware::class => InvokableFactory::class,
|
2017-07-22 15:20:40 +03:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
ConfigAbstractFactory::class => [
|
|
|
|
JWTService::class => [AppOptions::class],
|
|
|
|
ApiKeyService::class => ['em'],
|
|
|
|
|
|
|
|
Action\AuthenticateAction::class => [ApiKeyService::class, JWTService::class, 'translator', 'Logger_Shlink'],
|
2018-05-03 18:59:28 +03:00
|
|
|
Action\ShortCode\CreateShortCodeAction::class => [
|
2017-07-22 15:20:40 +03:00
|
|
|
Service\UrlShortener::class,
|
|
|
|
'translator',
|
|
|
|
'config.url_shortener.domain',
|
2017-10-12 11:13:20 +03:00
|
|
|
'Logger_Shlink',
|
2016-07-19 18:07:59 +03:00
|
|
|
],
|
2018-05-03 14:21:43 +03:00
|
|
|
Action\ShortCode\SingleStepCreateShortCodeAction::class => [
|
|
|
|
Service\UrlShortener::class,
|
|
|
|
'translator',
|
|
|
|
ApiKeyService::class,
|
|
|
|
'config.url_shortener.domain',
|
|
|
|
'Logger_Shlink',
|
|
|
|
],
|
2018-05-03 19:00:32 +03:00
|
|
|
Action\ShortCode\EditShortCodeAction::class => [Service\ShortUrlService::class, 'translator', 'Logger_Shlink',],
|
2018-05-03 19:02:45 +03:00
|
|
|
Action\ShortCode\ResolveUrlAction::class => [Service\UrlShortener::class, 'translator'],
|
2018-05-03 19:04:00 +03:00
|
|
|
Action\Visit\GetVisitsAction::class => [Service\VisitsTracker::class, 'translator', 'Logger_Shlink'],
|
2018-08-11 00:14:45 +03:00
|
|
|
Action\ShortCode\ListShortCodesAction::class => [
|
|
|
|
Service\ShortUrlService::class,
|
|
|
|
'translator',
|
|
|
|
'config.url_shortener.domain',
|
|
|
|
'Logger_Shlink',
|
|
|
|
],
|
2018-05-03 19:05:16 +03:00
|
|
|
Action\ShortCode\EditShortCodeTagsAction::class => [
|
|
|
|
Service\ShortUrlService::class,
|
|
|
|
'translator',
|
|
|
|
'Logger_Shlink',
|
|
|
|
],
|
2017-07-22 15:20:40 +03:00
|
|
|
Action\Tag\ListTagsAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
|
|
|
|
Action\Tag\DeleteTagsAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
|
|
|
|
Action\Tag\CreateTagsAction::class => [Service\Tag\TagService::class, LoggerInterface::class],
|
|
|
|
Action\Tag\UpdateTagAction::class => [Service\Tag\TagService::class, Translator::class, LoggerInterface::class],
|
|
|
|
|
2018-05-01 19:35:12 +03:00
|
|
|
Middleware\CheckAuthenticationMiddleware::class => [
|
|
|
|
JWTService::class,
|
|
|
|
'translator',
|
|
|
|
'config.auth.routes_whitelist',
|
|
|
|
'Logger_Shlink',
|
|
|
|
],
|
2016-07-19 18:07:59 +03:00
|
|
|
],
|
|
|
|
|
|
|
|
];
|