Migration modular monolith DDD (0.1 → 3.3) #17

Merged
matthieu merged 99 commits from integration/modular-monolith-0.1-1.3 into develop 2026-06-23 13:50:43 +00:00
Showing only changes of commit a547fd38c2 - Show all commits
@@ -12,6 +12,7 @@ use App\Module\Core\Domain\Entity\User;
use App\Module\ProjectManagement\Domain\Entity\Project;
use DateTimeImmutable;
use Doctrine\ORM\EntityManagerInterface;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
@@ -45,6 +46,34 @@ final class ClientTicketApiTest extends WebTestCase
self::assertResponseStatusCodeSame(403);
}
/**
* Regression guard for the post-migration security review: internal
* endpoints that were only behind IS_AUTHENTICATED_FULLY (or had no
* security) must reject a pure ROLE_CLIENT.
*/
#[DataProvider('internalEndpointsForbiddenToClients')]
public function testClientUserIsWalledOffFromInternalEndpoints(string $uri): void
{
$client = self::createClient();
$this->loginClient($client, 'client-liot');
$client->request('GET', $uri);
self::assertResponseStatusCodeSame(403);
}
/** @return iterable<string, array{string}> */
public static function internalEndpointsForbiddenToClients(): iterable
{
yield 'users directory' => ['/api/users'];
yield 'smb share browse' => ['/api/share/browse'];
yield 'smb share status' => ['/api/share/status'];
yield 'bookstack links' => ['/api/tasks/1/bookstack/links'];
}
public function testClientUserCanListOwnClientTickets(): void
{
$client = self::createClient();