auth.config.php 855 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare(strict_types=1);
  3. namespace Shlinkio\Shlink\Rest;
  4. use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
  5. return [
  6. 'auth' => [
  7. 'routes_without_api_key' => [
  8. Action\HealthAction::class,
  9. ConfigProvider::UNVERSIONED_HEALTH_ENDPOINT_NAME,
  10. ],
  11. 'routes_with_query_api_key' => [
  12. Action\ShortUrl\SingleStepCreateShortUrlAction::class,
  13. ],
  14. ],
  15. 'dependencies' => [
  16. 'factories' => [
  17. Middleware\AuthenticationMiddleware::class => ConfigAbstractFactory::class,
  18. ],
  19. ],
  20. ConfigAbstractFactory::class => [
  21. Middleware\AuthenticationMiddleware::class => [
  22. Service\ApiKeyService::class,
  23. 'config.auth.routes_without_api_key',
  24. 'config.auth.routes_with_query_api_key',
  25. ],
  26. ],
  27. ];