feat(security): complete capability messaging workflows

This commit is contained in:
2026-07-29 11:21:15 +08:00
parent df88fa19cb
commit 5c4de4b282
35 changed files with 19544 additions and 89 deletions

View File

@@ -16,10 +16,20 @@ public sealed class SystemScopeAuditTests
await Assert.ThrowsAsync<ArgumentException>(() => executionScope.ExecuteAsync(
new SystemScopeRequest(null, SystemScopeCallerType.Worker, "worker", "", "job-1"),
(_, _) => Task.CompletedTask));
await Assert.ThrowsAsync<ArgumentException>(() => executionScope.ExecuteAsync(
new SystemScopeRequest(null, SystemScopeCallerType.Worker, "worker", "missing target", "job-2"),
(_, _) => Task.CompletedTask));
var correlationId = Guid.NewGuid().ToString("N");
var tenantId = Guid.NewGuid();
await factory.SeedAsync(new Tenant
{
Id = tenantId,
Slug = tenantId.ToString("N"),
Name = "System Scope Tenant"
});
await executionScope.ExecuteAsync(
new SystemScopeRequest(null, SystemScopeCallerType.Worker, "background-worker", "test audit", correlationId),
new SystemScopeRequest(tenantId, SystemScopeCallerType.Worker, "background-worker", "test audit", correlationId),
(_, _) => Task.CompletedTask);
using var verification = factory.CreateSystemScope("Verify execution scope audit");