Skip to content

Commit 701db81

Browse files
committed
feat: add unit tests, WebHost wiring, Notifications, Idempotency, HTTP Resilience, quality fixes
Unit Tests (62 new, 344 total): - EventBus, ExceptionHandling, StringEncryption, Specifications - DataSeeder, ConnectionStrings, GlobalFeatureManager, SimpleStateChecker - DistributedLocking, BackgroundJobs, TextTemplating - Emailing, SMS, ObjectMapping, Notifications - AspNetCore (ApiResponse, IdempotentAttribute) WebHost Integration Wiring: - Wire 10 framework modules into WebHostFrameworkCompositionModule - Add MVC filters (Validation, ResultWrapper, ExceptionFilter, Idempotency) - Add health check endpoints (/healthz) New Capabilities: - Notifications: INotificationSender, INotificationChannel, NullNotificationChannel - Idempotency: [Idempotent] attribute + IdempotencyFilter with IDistributedCache - HTTP Resilience: AddChengYuanResilience() wrapping MS.Extensions.Http.Resilience Quality Fixes: - Security: path traversal fix in FileSystemBlobProvider - Bug: fragile reflection in BackgroundJobExecutionWorker - Add null guards to 10+ public API boundaries - SMS: AddSingleton -> TryAddSingleton - Seal EntityNotFoundException
1 parent 6178cde commit 701db81

324 files changed

Lines changed: 8224 additions & 602 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ChengYuan.slnx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<Project Path="src/Framework/Caching/ChengYuan.Caching.Abstractions/ChengYuan.Caching.Abstractions.csproj" />
99
<Project Path="src/Framework/Caching/ChengYuan.Caching.Runtime/ChengYuan.Caching.Runtime.csproj" />
1010
<Project Path="src/Framework/Caching/ChengYuan.Caching.Memory/ChengYuan.Caching.Memory.csproj" />
11+
<Project Path="src/Framework/Caching/ChengYuan.Caching.StackExchangeRedis/ChengYuan.Caching.StackExchangeRedis.csproj" />
1112
<Project Path="src/Framework/Outbox/ChengYuan.Outbox.Abstractions/ChengYuan.Outbox.Abstractions.csproj" />
1213
<Project Path="src/Framework/Outbox/ChengYuan.Outbox.Runtime/ChengYuan.Outbox.Runtime.csproj" />
1314
<Project Path="src/Framework/Outbox/ChengYuan.Outbox.Persistence/ChengYuan.Outbox.Persistence.csproj" />
@@ -24,6 +25,35 @@
2425
<Project Path="src/Framework/Features/ChengYuan.Features.Runtime/ChengYuan.Features.Runtime.csproj" />
2526
<Project Path="src/Framework/Settings/ChengYuan.Settings.Abstractions/ChengYuan.Settings.Abstractions.csproj" />
2627
<Project Path="src/Framework/Settings/ChengYuan.Settings.Runtime/ChengYuan.Settings.Runtime.csproj" />
28+
<Project Path="src/Framework/EventBus/ChengYuan.EventBus.Abstractions/ChengYuan.EventBus.Abstractions.csproj" />
29+
<Project Path="src/Framework/EventBus/ChengYuan.EventBus.Runtime/ChengYuan.EventBus.Runtime.csproj" />
30+
<Project Path="src/Framework/ExceptionHandling/ChengYuan.ExceptionHandling.Abstractions/ChengYuan.ExceptionHandling.Abstractions.csproj" />
31+
<Project Path="src/Framework/ExceptionHandling/ChengYuan.ExceptionHandling.Runtime/ChengYuan.ExceptionHandling.Runtime.csproj" />
32+
<Project Path="src/Framework/BackgroundWorkers/ChengYuan.BackgroundWorkers.Abstractions/ChengYuan.BackgroundWorkers.Abstractions.csproj" />
33+
<Project Path="src/Framework/BackgroundWorkers/ChengYuan.BackgroundWorkers.Runtime/ChengYuan.BackgroundWorkers.Runtime.csproj" />
34+
<Project Path="src/Framework/DistributedLocking/ChengYuan.DistributedLocking.Abstractions/ChengYuan.DistributedLocking.Abstractions.csproj" />
35+
<Project Path="src/Framework/DistributedLocking/ChengYuan.DistributedLocking.Runtime/ChengYuan.DistributedLocking.Runtime.csproj" />
36+
<Project Path="src/Framework/BackgroundJobs/ChengYuan.BackgroundJobs.Abstractions/ChengYuan.BackgroundJobs.Abstractions.csproj" />
37+
<Project Path="src/Framework/BackgroundJobs/ChengYuan.BackgroundJobs.Runtime/ChengYuan.BackgroundJobs.Runtime.csproj" />
38+
<Project Path="src/Framework/BlobStoring/ChengYuan.BlobStoring.Abstractions/ChengYuan.BlobStoring.Abstractions.csproj" />
39+
<Project Path="src/Framework/BlobStoring/ChengYuan.BlobStoring.Runtime/ChengYuan.BlobStoring.Runtime.csproj" />
40+
<Project Path="src/Framework/Emailing/ChengYuan.Emailing.Abstractions/ChengYuan.Emailing.Abstractions.csproj" />
41+
<Project Path="src/Framework/Emailing/ChengYuan.Emailing.Runtime/ChengYuan.Emailing.Runtime.csproj" />
42+
<Project Path="src/Framework/ObjectMapping/ChengYuan.ObjectMapping.Abstractions/ChengYuan.ObjectMapping.Abstractions.csproj" />
43+
<Project Path="src/Framework/ObjectMapping/ChengYuan.ObjectMapping.Runtime/ChengYuan.ObjectMapping.Runtime.csproj" />
44+
<Project Path="src/Framework/TextTemplating/ChengYuan.TextTemplating.Abstractions/ChengYuan.TextTemplating.Abstractions.csproj" />
45+
<Project Path="src/Framework/TextTemplating/ChengYuan.TextTemplating.Runtime/ChengYuan.TextTemplating.Runtime.csproj" />
46+
<Project Path="src/Framework/Sms/ChengYuan.Sms.Abstractions/ChengYuan.Sms.Abstractions.csproj" />
47+
<Project Path="src/Framework/Sms/ChengYuan.Sms.Runtime/ChengYuan.Sms.Runtime.csproj" />
48+
<Project Path="src/Framework/VirtualFileSystem/ChengYuan.VirtualFileSystem.Abstractions/ChengYuan.VirtualFileSystem.Abstractions.csproj" />
49+
<Project Path="src/Framework/VirtualFileSystem/ChengYuan.VirtualFileSystem.Runtime/ChengYuan.VirtualFileSystem.Runtime.csproj" />
50+
<Project Path="src/Framework/Interceptors/ChengYuan.Interceptors.Abstractions/ChengYuan.Interceptors.Abstractions.csproj" />
51+
<Project Path="src/Framework/Interceptors/ChengYuan.Interceptors.Runtime/ChengYuan.Interceptors.Runtime.csproj" />
52+
<Project Path="src/Framework/AspNetCore/ChengYuan.AspNetCore/ChengYuan.AspNetCore.csproj" />
53+
<Project Path="src/Framework/AspNetCore/ChengYuan.HealthChecks/ChengYuan.HealthChecks.csproj" />
54+
<Project Path="src/Framework/Notifications/ChengYuan.Notifications.Abstractions/ChengYuan.Notifications.Abstractions.csproj" />
55+
<Project Path="src/Framework/Notifications/ChengYuan.Notifications.Runtime/ChengYuan.Notifications.Runtime.csproj" />
56+
<Project Path="src/Framework/HttpResilience/ChengYuan.HttpResilience/ChengYuan.HttpResilience.csproj" />
2757
</Folder>
2858
<Folder Name="/src/Applications/">
2959
<Project Path="src/Applications/AuditLogging/ChengYuan.AuditLogging.Contracts/ChengYuan.AuditLogging.Contracts.csproj" />

Directory.Packages.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@
88
<PackageVersion Include="Nuke.Common" Version="10.1.0" />
99
<!-- Runtime dependencies -->
1010
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.0" />
11+
<PackageVersion Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="10.0.0" />
1112
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
1213
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
14+
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="10.0.0" />
15+
<PackageVersion Include="Microsoft.Extensions.FileProviders.Abstractions" Version="10.0.0" />
16+
<PackageVersion Include="Microsoft.Extensions.FileProviders.Composite" Version="10.0.0" />
17+
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="10.0.0" />
18+
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="10.0.0" />
19+
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.0.0" />
20+
<PackageVersion Include="Cronos" Version="0.8.4" />
1321
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0" />
1422
<PackageVersion Include="Microsoft.Extensions.Options" Version="10.0.0" />
1523
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="10.0.0" />

src/Applications/AuditLogging/ChengYuan.AuditLogging.Persistence/packages.lock.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"chengyuan.entityframeworkcore": {
7070
"type": "Project",
7171
"dependencies": {
72+
"ChengYuan.Auditing.Abstractions": "[0.2.10-local, )",
7273
"ChengYuan.Core": "[0.2.10-local, )",
7374
"Microsoft.EntityFrameworkCore": "[10.0.0, )"
7475
}

src/Applications/FeatureManagement/ChengYuan.FeatureManagement.Persistence/packages.lock.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
"resolved": "10.0.0",
3636
"contentHash": "inRnbpCS0nwO/RuoZIAqxQUuyjaknOOnCEZB55KSMMjRhl0RQDttSmLSGsUJN3RQ3ocf5NDLFd2mOQViHqMK5w=="
3737
},
38+
"chengyuan.auditing.abstractions": {
39+
"type": "Project"
40+
},
3841
"chengyuan.core": {
3942
"type": "Project",
4043
"dependencies": {
@@ -46,6 +49,7 @@
4649
"chengyuan.entityframeworkcore": {
4750
"type": "Project",
4851
"dependencies": {
52+
"ChengYuan.Auditing.Abstractions": "[0.2.10-local, )",
4953
"ChengYuan.Core": "[0.2.10-local, )",
5054
"Microsoft.EntityFrameworkCore": "[10.0.0, )"
5155
}

src/Applications/Identity/ChengYuan.Identity.Persistence/Repositories/EfIdentityRoleRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using ChengYuan.Core.Data;
2-
using ChengYuan.EntityFrameworkCore;
32
using ChengYuan.Core.Timing;
3+
using ChengYuan.EntityFrameworkCore;
44
using Microsoft.EntityFrameworkCore;
55

66
namespace ChengYuan.Identity;

src/Applications/Identity/ChengYuan.Identity.Persistence/Repositories/EfIdentityUserRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using ChengYuan.Core.Data;
2-
using ChengYuan.EntityFrameworkCore;
32
using ChengYuan.Core.Timing;
3+
using ChengYuan.EntityFrameworkCore;
44
using Microsoft.EntityFrameworkCore;
55

66
namespace ChengYuan.Identity;

src/Applications/Identity/ChengYuan.Identity.Persistence/packages.lock.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
"resolved": "10.0.0",
3636
"contentHash": "inRnbpCS0nwO/RuoZIAqxQUuyjaknOOnCEZB55KSMMjRhl0RQDttSmLSGsUJN3RQ3ocf5NDLFd2mOQViHqMK5w=="
3737
},
38+
"chengyuan.auditing.abstractions": {
39+
"type": "Project"
40+
},
3841
"chengyuan.core": {
3942
"type": "Project",
4043
"dependencies": {
@@ -46,6 +49,7 @@
4649
"chengyuan.entityframeworkcore": {
4750
"type": "Project",
4851
"dependencies": {
52+
"ChengYuan.Auditing.Abstractions": "[0.2.10-local, )",
4953
"ChengYuan.Core": "[0.2.10-local, )",
5054
"Microsoft.EntityFrameworkCore": "[10.0.0, )"
5155
}

src/Applications/PermissionManagement/ChengYuan.PermissionManagement.Persistence/packages.lock.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
"resolved": "10.0.0",
3636
"contentHash": "inRnbpCS0nwO/RuoZIAqxQUuyjaknOOnCEZB55KSMMjRhl0RQDttSmLSGsUJN3RQ3ocf5NDLFd2mOQViHqMK5w=="
3737
},
38+
"chengyuan.auditing.abstractions": {
39+
"type": "Project"
40+
},
3841
"chengyuan.authorization.abstractions": {
3942
"type": "Project"
4043
},
@@ -58,6 +61,7 @@
5861
"chengyuan.entityframeworkcore": {
5962
"type": "Project",
6063
"dependencies": {
64+
"ChengYuan.Auditing.Abstractions": "[0.2.10-local, )",
6165
"ChengYuan.Core": "[0.2.10-local, )",
6266
"Microsoft.EntityFrameworkCore": "[10.0.0, )"
6367
}

src/Applications/SettingManagement/ChengYuan.SettingManagement.Persistence/packages.lock.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
"resolved": "10.0.0",
3636
"contentHash": "inRnbpCS0nwO/RuoZIAqxQUuyjaknOOnCEZB55KSMMjRhl0RQDttSmLSGsUJN3RQ3ocf5NDLFd2mOQViHqMK5w=="
3737
},
38+
"chengyuan.auditing.abstractions": {
39+
"type": "Project"
40+
},
3841
"chengyuan.core": {
3942
"type": "Project",
4043
"dependencies": {
@@ -46,6 +49,7 @@
4649
"chengyuan.entityframeworkcore": {
4750
"type": "Project",
4851
"dependencies": {
52+
"ChengYuan.Auditing.Abstractions": "[0.2.10-local, )",
4953
"ChengYuan.Core": "[0.2.10-local, )",
5054
"Microsoft.EntityFrameworkCore": "[10.0.0, )"
5155
}

src/Applications/TenantManagement/ChengYuan.TenantManagement.Application/Stores/TenantResolutionStoreAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ public sealed class TenantResolutionStoreAdapter(ITenantReader reader) : ITenant
2121

2222
private static TenantResolutionRecord Map(TenantRecord record)
2323
=> new(record.Id, record.Name, record.IsActive);
24-
}
24+
}

0 commit comments

Comments
 (0)