feat : add Gitea repositories list endpoint

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-03-13 13:58:09 +01:00
parent 5577884c13
commit 7b1aa22c15
2 changed files with 68 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace App\ApiResource;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\GetCollection;
use App\State\GiteaRepositoryProvider;
use Symfony\Component\Serializer\Attribute\Groups;
#[ApiResource(
operations: [
new GetCollection(
uriTemplate: '/gitea/repositories',
normalizationContext: ['groups' => ['gitea_repo:read']],
provider: GiteaRepositoryProvider::class,
security: "is_granted('ROLE_ADMIN')",
),
],
)]
final class GiteaRepository
{
#[Groups(['gitea_repo:read'])]
public string $fullName = '';
#[Groups(['gitea_repo:read'])]
public string $name = '';
#[Groups(['gitea_repo:read'])]
public string $owner = '';
}