Anomalies corrigées :
- MudPopoverProvider manquant dans les layouts → circuit Blazor mourait sur
l'ouverture de menus/popovers (dashboard jamais rendu après login)
- AddIdentity redéfinissait le schéma par défaut sur Identity.Application
alors que /_auth/signin signait avec Cookies → cookie posé mais jamais
validé, tout rechargement de page redirigeait vers /login. Forçage du
schéma par défaut sur Cookies + schémas JwtBearer explicites sur les
endpoints API d'AuthController et SettingsController
- Policy 'AdminUsers' utilisée par register-admin mais jamais enregistrée
→ 500 à l'appel. Ajoutée (RequireRole Admin)
- HeimdallAuthStateProvider ne lisait que le sessionStorage navigateur :
pendant le prerender SSR, HttpContext.User (cookie) n'était pas utilisé
→ pages protégées redirigées vers /login. Fallback cookie ajouté
- SameOriginHttpMessageHandler : résolution de l'origine via
IServerAddressesFeature quand IHttpContextAccessor est null (circuit
Blazor post-hydratation) au lieu de heimdall.local → DNS cassé
- UpdateUserValidator rejetait le thème 'Auto' (défaut de l'UI) → 400
à l'édition. Accepte désormais auto (case-insensitive)
Tests :
- E2E Playwright complets (login/logout/register/user management) : 33/33
- Integration (Testcontainers PostgreSQL) : 120/120 (valeur 'bool' du
valueType, bootstrap admin via /register auto-admin, header X-API-Key,
/proc/meminfo optionnel pour les LXC restreints)
- Exécution E2E séquentielle (xunit.runner.json) pour éliminer le flakiness
- TestHelpers.CreateAdminClientAsync: bootstrap via register normal
(first user = admin) + active les flags public-registration et
admin-registration.enabled
- JwtService.GetUserIdFromExpiredToken: utilise GetJwtRefreshKey()
(methode appelee avec refresh tokens, signes avec Jwt:RefreshKey)
- AuthDataServiceTests.RevokeRefreshTokenAsync_StoresToken:
utilise SHA256 hash (nouveau comportement ExtractJti fallback)
#14: Remplacé le guard environment (Testing/Development) par:
- [Authorize(Policy = "AdminUsers")] sur l'endpoint
- Feature flag auth.admin-registration.enabled en DB (default: absent = disabled)
- Suppression de la dependance IWebHostEnvironment du controller
- Test mis a jour: bootstrap via register normal, puis flag, puis RegisterAdmin
Create Heimdall.TestCommon project with a single PostgreSqlContainerFixture
shared by both Infrastructure and Integration tests. This prevents Docker
resource conflicts from starting two PostgreSQL containers and ensures
both test suites connect to the same database instance.
- Move shared fixture to tests/Heimdall.TestCommon
- Remove duplicate fixtures from each test project
- Keep test isolation (truncation) and FK fix from previous commit
- Revert DATABASE_URL env var check (Testcontainers works in CI)
Three issues fixed:
- Camera.AssignAgent(Guid.Empty) violated FK constraint; changed to
nullable Guid? and pass null on camera release
- Test fixtures now check DATABASE_URL env var first, falling back to
Testcontainers locally (CI has no Docker socket)
- Added database truncation before each test via IAsyncLifetime to
prevent shared state between test methods (InMemory was fresh per test,
real PostgreSQL persists data)
- Supprime InMemory de tous les .csproj (Infrastructure, Domain.Tests, IntegrationTests)\n- Supprime le branchement Database:Provider=InMemory de DependencyInjection.cs\n (plus que du PostgreSQL natif)\n- Infrastructure.Tests: CameraAssignment + CameraEvent tests -> Testcontainers\n- PostgreSqlContainerFixture ajoute aux Infrastructure.Tests\n- appsettings.Testing.json: retire Database:Provider et Hangfire:Enabled\n- 4 tests echouent encore: bugs pre-existants masques par InMemory\n (FK non respectees, donnees de test erronees)\n\nTests: 222/226 passed (4 pre-existants lies aux FK)
- Ajoute Testcontainers.PostgreSql v4.13.0\n- PostgreSqlContainerFixture: collection fixture xUnit avec postgres:17-alpine\n- HeimdallWebApplicationFactory: accepte connectionString pour vrai PostgreSQL\n- PostgresTestBase: classe de base pour tous les tests integration\n- Ajoute [Collection("Postgres")] aux 9 classes de test\n- Database:MigrateOnStartup active quand PostgreSQL est utilise\n- Programme le Hangfire (skip en test via isTesting)\n\nAvant: InMemory (pas de contraintes, comportement different)\nApres: Vrai PostgreSQL dans un container temporaire\n\nTests: 226/226 passed (61 integration avec vrai PostgreSQL)
- Add InternalsVisibleTo for Heimdall.Api.Tests and
Heimdall.IntegrationTests in Web.csproj
- Add partial class Program for WebApplicationFactory<Program>
- Pass builder.Environment.EnvironmentName instead of env var
so AddInfrastructure correctly detects Testing environment
- Skip DATABASE_URL check, Hangfire setup, migrations, and
recurring jobs when environment is Testing
- Update test project references from Heimdall.Api to Heimdall.Web
Adds S3-compatible snapshot storage (Alarik) with AWS Signature V4,
upload, thumbnail, and delete operations. Backfills Phase 2 & 3 with
27 new tests covering camera assignment strategies, event CRUD with
filtering, snapshot attachment, and API contract validation.
- SnapshotService with S3 REST API via HttpClient + SigV4 signing
- 10 unit tests for CameraAssignmentService (assign, release, failover, history)
- 9 unit tests for CameraEventService (create, query, filter, delete, snapshot)
- 8 integration tests for AssignmentsController + EventsController
- SnapshotService registration with 5-min timeout HTTP client
Manual camera configuration does not scale beyond a few devices.
Automated discovery is needed to support deployments with 50+
cameras across heterogeneous protocols (ONVIF, mDNS, HTTP, ARP).
Phase 1 introduces 5 network probe services, a stream tester, an
orchestrating discovery service with IP+MAC deduplication, 11 REST
endpoints, a pre-verification endpoint, 57 tests, and DI registration.
- Fix: InMemory database name now unique per test factory instance
(was using process-wide env var, now per-host config via UseSetting)
- Refactor: all integration tests use shared TestHelpers.CreateAdminClientAsync
- New: register-admin endpoint (test/dev only) creates Admin users directly
- New: TestHelpers.cs with extension method for admin client creation
- Cleanup: removed bootstrap template files, old Counter/Weather pages
- Cleanup: simplified app.css with MudBlazor-only styles
- Seed: demo admin + demo site created in Development mode
- Site detail: generate registration token with copy/paste docker-compose snippet
- Docker snippet: pre-filled with token + agent hostname, ready to copy
- Agents integration tests: register with valid token, heartbeat with API key,
invalid token rejection (3 new tests)
- TokenResult DTO for API client
- IJSRuntime clipboard copy for docker-compose snippet