<?php
namespace App\Controller;
use App\Manager\ConfigurationManagerInterface;
use Psr\Log\LoggerInterface;
use Swagger\Annotations as SWG;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
class PublicConfigurationController extends AbstractController
{
private LoggerInterface $logger;
public function __construct(LoggerInterface $logger)
{
$this->logger = $logger;
}
/**
* @Route("/api/public/realms", name="get_realm", methods={"Get"})
*
* @SWG\Get(
* path="/api/public/realm",
* tags={"Public"},
* summary="Gets realm according to domain name",
* @SWG\Parameter(
* name="domainName",
* in="query",
* description="Domain name or ""hostname"" (e.g. front.localhost)",
* required=false,
* default="default",
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="OK."
* ),
* @SWG\Response(
* response=409,
* description="Conflict."
* )
* )
*/
public function getRealm(
ConfigurationManagerInterface $configurationManager,
Request $request
): JsonResponse {
return $this->json($configurationManager->getRealm($request->get('domainName')));
}
}