diff --git a/config/packages/security.yaml b/config/packages/security.yaml index a07d73e..dd76dec 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -37,6 +37,7 @@ security: access_control: - { path: ^/login, roles: PUBLIC_ACCESS } - { path: ^/connect, roles: ROLE_USER } + - { path: ^/health, roles: PUBLIC_ACCESS } # - { path: ^/connect, roles: [IS_AUTHENTICATED_FULLY, ROLE_USER] } when@test: diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 9dc1ff3..3532e99 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -7,6 +7,7 @@ use App\Hydra\Client; use App\Hydra\HydraService; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Routing\Annotation\Route; @@ -30,6 +31,12 @@ class MainController extends AbstractController return $this->hydra->handleLoginRequest($request); } + #[Route('/health', name: 'health')] + public function health(Request $request) + { + return new Response('healthy', 200); + } + #[Route('/connect/login-accept', name: 'app_login_accept')] public function loginAccept(Request $request) {