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

@@ -128,6 +128,7 @@ public static class DependencyInjection
services.AddScoped<ICurrentAccessContext, CurrentAccessContext>();
services.AddScoped<ICapabilityAccessEvaluator, CapabilityAccessEvaluator>();
services.AddScoped<IOperationAuditService, OperationAuditService>();
services.AddSingleton<IBackgroundJobDispatcher, NullBackgroundJobDispatcher>();
services.AddScoped<IBackgroundJobService, BackgroundJobService>();
services.AddScoped<ICommerceService, CommerceService>();
services.AddScoped<ICommerceAdminService, CommerceAdminService>();
@@ -209,6 +210,12 @@ public static class DependencyInjection
consumer.UseMessageRetry(retry => retry.Intervals(
TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(15)));
});
registration.AddConsumer<BackgroundJobRequestedConsumer>(consumer =>
{
consumer.ConcurrentMessageLimit = 1;
consumer.UseMessageRetry(retry => retry.Intervals(
TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(15)));
});
registration.AddConfigureEndpointsCallback((context, _, endpoint) =>
{
endpoint.PrefetchCount = 1;
@@ -228,6 +235,7 @@ public static class DependencyInjection
});
});
services.AddScoped<ISecurityEventPublisher, MassTransitSecurityEventPublisher>();
services.AddScoped<IBackgroundJobDispatcher, MassTransitBackgroundJobDispatcher>();
return services;
}
}