Commit ecdd195
committed
feat: add auth/security, migration infra, observability, and conventional DI
Phase 1 - Auth & Security:
- Register JWT Bearer authentication & authorization in WebHost
- Add CORS default policy (AllowAnyOrigin)
- Add SecurityHeadersMiddleware (nosniff, DENY, referrer-policy)
- Add CurrentUserMiddleware bridging ClaimsPrincipal to ICurrentUser
- Add GlobalExceptionMiddleware for non-MVC exception handling
Phase 2 - Multi-DbContext Migration Infrastructure:
- Add MigrationHistoryTableNameResolver for per-DbContext history tables
- Auto-apply MigrationsHistoryTable in SQLite and PostgreSQL providers
- Add ChengYuanDesignTimeDbContextFactory<T> abstract base
- Add ChengYuanSqliteDesignTimeDbContextFactory<T> with config-based connection string
- Create design-time factories for all 6 application DbContexts
Phase 3 - Observability:
- Integrate Serilog with config-based setup and request logging
- Add OpenAPI via AddOpenApi() and MapOpenApi()
- Add appsettings.json and appsettings.Development.json
Phase 4 - Conventional DI (Identity pilot):
- Add ExposeServicesAttribute for multi-interface service exposure
- Apply IScopedService + ExposeServices to UserManager and RoleManager
- Replace manual registrations with AddConventionalServices in Identity
Tests: 365 total (14 new), all passing1 parent df989a7 commit ecdd195
File tree
52 files changed
+4708
-635
lines changed- src
- Applications
- AuditLogging/ChengYuan.AuditLogging.Persistence
- FeatureManagement/ChengYuan.FeatureManagement.Persistence
- Identity
- ChengYuan.Identity.Application
- Managers
- ChengYuan.Identity.Persistence
- PermissionManagement/ChengYuan.PermissionManagement.Persistence
- SettingManagement/ChengYuan.SettingManagement.Persistence
- TenantManagement/ChengYuan.TenantManagement.Persistence
- Framework
- AspNetCore/ChengYuan.HealthChecks
- Core/Runtime/DependencyInjection
- Data
- ChengYuan.Data.PostgreSql
- ChengYuan.Data.Sqlite
- ChengYuan.EntityFrameworkCore
- Hosts
- CliHost
- WebHost
- Composition
- Http
- Security
- tests/ChengYuan.FrameworkKernel.Tests
- Framework
- Core
- Data
- Hosts/WebHost
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
52 files changed
+4708
-635
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
0 commit comments