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)
This commit is contained in:
1 parent
ad78346ac4
commit
b217c932e8
78 files changed
+5359
-11
No files matched your search
@@ -0,0 +1,77 @@
|
||||
using Heimdall.Domain.Entities;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Heimdall.Infrastructure.Data.Configurations;
|
||||
|
||||
public class AppUserConfiguration : IEntityTypeConfiguration<AppUser>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<AppUser> builder)
|
||||
{
|
||||
builder.ToTable("users");
|
||||
|
||||
builder.Property(u => u.DisplayName)
|
||||
.HasMaxLength(200)
|
||||
.IsRequired();
|
||||
|
||||
builder.Property(u => u.Theme)
|
||||
.HasMaxLength(20)
|
||||
.HasDefaultValue("Auto");
|
||||
|
||||
builder.Property(u => u.Language)
|
||||
.HasMaxLength(10)
|
||||
.HasDefaultValue("fr");
|
||||
|
||||
builder.Property(u => u.CreatedAt)
|
||||
.HasDefaultValueSql("NOW()");
|
||||
}
|
||||
}
|
||||
|
||||
public class AppRoleConfiguration : IEntityTypeConfiguration<AppRole>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<AppRole> builder)
|
||||
{
|
||||
builder.ToTable("roles");
|
||||
}
|
||||
}
|
||||
|
||||
public class IdentityUserRoleConfiguration : IEntityTypeConfiguration<IdentityUserRole<Guid>>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<IdentityUserRole<Guid>> builder)
|
||||
{
|
||||
builder.ToTable("user_roles");
|
||||
}
|
||||
}
|
||||
|
||||
public class IdentityUserClaimConfiguration : IEntityTypeConfiguration<IdentityUserClaim<Guid>>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<IdentityUserClaim<Guid>> builder)
|
||||
{
|
||||
builder.ToTable("user_claims");
|
||||
}
|
||||
}
|
||||
|
||||
public class IdentityUserLoginConfiguration : IEntityTypeConfiguration<IdentityUserLogin<Guid>>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<IdentityUserLogin<Guid>> builder)
|
||||
{
|
||||
builder.ToTable("user_logins");
|
||||
}
|
||||
}
|
||||
|
||||
public class IdentityRoleClaimConfiguration : IEntityTypeConfiguration<IdentityRoleClaim<Guid>>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<IdentityRoleClaim<Guid>> builder)
|
||||
{
|
||||
builder.ToTable("role_claims");
|
||||
}
|
||||
}
|
||||
|
||||
public class IdentityUserTokenConfiguration : IEntityTypeConfiguration<IdentityUserToken<Guid>>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<IdentityUserToken<Guid>> builder)
|
||||
{
|
||||
builder.ToTable("user_tokens");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user