feat: integrated OAuth2 server

This commit is contained in:
Björn Fromme
2025-04-24 20:28:27 +02:00
parent c418ae6399
commit adbfb49c11
84 changed files with 2542 additions and 312 deletions
+5 -3
View File
@@ -7,15 +7,17 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
#[Route('/api')]
#[IsGranted('ROLE_OAUTH2_API')]
class PickupController extends AbstractController
{
public function __construct(private readonly PickupLoader $xmlLoader)
{
}
#[Route('/pickups', name: 'api_pickup_all')]
#[Route('/pickups', name: 'api_pickups_all')]
public function index(): JsonResponse
{
$pickups = $this->xmlLoader->loadAll();
@@ -23,11 +25,11 @@ class PickupController extends AbstractController
return $this->json($pickups, Response::HTTP_OK, [], ['groups' => 'api:list']);
}
#[Route('/pickups/{id}', name: 'api_pickup_single')]
#[Route('/pickups/{id}', name: 'api_pickups_single')]
public function single(int $id): JsonResponse
{
$pickup = $this->xmlLoader->loadById($id);
return $this->json($pickup, Response::HTTP_OK, [], ['groups' => 'api:list']);
}
}
}