Commit Graph
4 Commits
Author SHA1 Message Date
Arnaud Dartois 45ce41ce7e fix(deps): CVE bloquantes Trivy — AutoMapper 16.1.1, OpenApi 10.0.11, Newtonsoft 13, SQLitePCLRaw 2.1.13 (#128)
## Contexte
Trivy (bloquant) détecte 4 CVE HIGH dans les images PR. Ces vulnérabilités sont dans la base du projet (pas liées aux PR #117/#118) → PR dédiée.

## Changements
- **AutoMapper 13.0.1 → 16.1.1** (CVE-2026-32933) : AddAutoMapper passe par cfg.AddMaps(assembly) (v16 : plus de surcharge Assembly) ; MapperConfiguration des tests → constructeur 2 args (NullLoggerFactory.Instance).
- **Microsoft.AspNetCore.OpenApi 10.0.8 → 10.0.11** (CVE-2026-49451) : tire Microsoft.OpenApi 2.7.5.
- **Newtonsoft.Json 13.0.1** en référence directe (CVE-2024-21907, transitif 11.0.1 forcé).
- **SQLitePCLRaw.bundle_e_sqlite3 2.1.13** en référence directe (CVE-2025-6965, transitif 2.1.11 forcé).

## Tickets liés
Fixes #127

## Résultats des tests
- dotnet build Heimdall.slnx -c Release : 0 erreur, 0 warning
- Application.Tests (Mapping + NotificationHandler) : 22/22
- Infrastructure.Tests (NotificationServiceTests, Testcontainers) : 10/10

## SonarQube
À valider sur la CI (gate bloquant).

## CVE
Corrigées par les bumps ci-dessus (à confirmer par Trivy sur le run).

## Checklist
- [x] PR par ticket
- [x] Build + tests locaux verts
- [ ] CI verte (Trivy sans HIGH/CRITICAL)
- [ ] Sonar gate OK

Reviewed-on: https://forgejo.tordais.cc/nonobis/Heimdall/pulls/128
2026-08-15 09:11:25 +02:00
Arnaud Dartois 649af93f56 feat(cqrs): add MediatR, AutoMapper and pipeline infrastructure
- Add MediatR 12.5.0, AutoMapper 13.0.1 packages
- Create ValidationBehavior (FluentValidation pipeline)
- Create LoggingBehavior (structured logging pipeline)
- Create MappingProfile with IMapFrom<T> convention
- Make ServiceResult properties public for pipeline use
- Update Application DI with MediatR + AutoMapper registration
2026-07-22 19:31:51 +00:00
Arnaud Dartois ba968a5f23 fix(security): harden Docker, CSRF, EventsHub scoping, secret logging, tests
- Docker: remove default passwords from prod compose (required env vars)
- CSRF: validate antiforgery tokens on /_auth/signin and /_auth/signout
- EventsHub: broadcast to site-scoped Group() instead of Clients.All
- SettingsController: redact secret values in logs
- Create SetAgentSettingValidator + UpdateAppSettingValidator classes
- Replace 3 placeholder test projects with meaningful tests
- Remove FluentValidation auto-validation (incompatible with .NET 10)
2026-07-19 20:53:48 +00:00
Arnaud Dartois b217c932e8 feat(mvp): implement MVP multi-site platform
Complete MVP implementation (Étape 1) covering:
- Domain: primitives (Entity<TId>, ValueObject), 10 entities, 6 enums
- EF Core: AppDbContext + Identity, 8 EntityTypeConfigurations, audit/soft-delete interceptors, initial migration
- Application: service interfaces, DTOs, FluentValidation, ServiceResult pattern
- Security: Identity + JWT + API Key multi-auth, role-based permissions, constant-time key validation
- API: Auth/Sites/Agents controllers with explicit auth scheme policies
- Workers: Hangfire PostgreSQL setup with schema isolation, HeartbeatMonitorJob
- Agent: registration service + 30s heartbeat loop
- Docker: multi-stage Dockerfiles for central + agent, docker-compose.yml
- CI/CD: GitHub Actions pipeline with build+test and Docker build
- Tests: 13 domain tests (Site, Agent, Camera entities)

Architecture decisions per deliberation council:
- API Key via AuthenticationHandler<T> (not middleware)
- Explicit [Authorize(AuthenticationSchemes)] on all endpoints
- Event/Recording/Person/Vehicle deferred from initial migration
- Hangfire compatible with .NET 10 (v1.8.17)
2026-07-16 20:53:56 +00:00