2020-03-14 14:19:16 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-04-12 06:59:10 -05:00
|
|
|
use Laminas\ServiceManager\Proxy\LazyServiceFactory;
|
|
|
|
use Shlinkio\Shlink\Common\Mercure\LcobucciJwtProvider;
|
2022-01-20 13:16:37 -06:00
|
|
|
use Shlinkio\Shlink\Core\Config\EnvVars;
|
2021-04-02 02:46:02 -05:00
|
|
|
use Symfony\Component\Mercure\Hub;
|
|
|
|
use Symfony\Component\Mercure\HubInterface;
|
2020-04-12 06:59:10 -05:00
|
|
|
|
2021-08-07 04:05:20 -05:00
|
|
|
return (static function (): array {
|
2022-04-23 05:44:17 -05:00
|
|
|
$publicUrl = EnvVars::MERCURE_PUBLIC_HUB_URL->loadFromEnv();
|
2021-08-07 04:05:20 -05:00
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'mercure' => [
|
|
|
|
'public_hub_url' => $publicUrl,
|
2022-04-23 05:44:17 -05:00
|
|
|
'internal_hub_url' => EnvVars::MERCURE_INTERNAL_HUB_URL->loadFromEnv($publicUrl),
|
|
|
|
'jwt_secret' => EnvVars::MERCURE_JWT_SECRET->loadFromEnv(),
|
2021-08-07 04:05:20 -05:00
|
|
|
'jwt_issuer' => 'Shlink',
|
2020-04-12 06:59:10 -05:00
|
|
|
],
|
2021-08-07 04:05:20 -05:00
|
|
|
|
|
|
|
'dependencies' => [
|
|
|
|
'delegators' => [
|
|
|
|
LcobucciJwtProvider::class => [
|
|
|
|
LazyServiceFactory::class,
|
|
|
|
],
|
|
|
|
Hub::class => [
|
|
|
|
LazyServiceFactory::class,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'lazy_services' => [
|
|
|
|
'class_map' => [
|
|
|
|
LcobucciJwtProvider::class => LcobucciJwtProvider::class,
|
|
|
|
Hub::class => HubInterface::class,
|
|
|
|
],
|
2020-04-12 06:59:10 -05:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
2021-08-07 04:05:20 -05:00
|
|
|
];
|
|
|
|
})();
|