feat(options): eager startup validation for central-component options (Transport, SiteCallAudit, DeploymentManager) (arch-review 08 §1.5)
Claude-Session: https://claude.ai/code/session_01MtdgwpEeCUn6cUA5f1LMPj
This commit is contained in:
@@ -22,7 +22,14 @@ public static class ServiceCollectionExtensions
|
||||
public static IServiceCollection AddTransport(this IServiceCollection services)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(services);
|
||||
services.AddOptions<TransportOptions>().BindConfiguration(OptionsSection);
|
||||
// Eager startup validation (arch-review 08 §1.5): ValidateOnStart makes a
|
||||
// bad ScadaBridge:Transport section — a zero/negative cap, or (critically)
|
||||
// a Pbkdf2Iterations below the security floor that would silently weaken
|
||||
// bundle key derivation — fail fast at boot with a clear, key-naming
|
||||
// message instead of surfacing deep inside the import pipeline.
|
||||
services.AddOptions<TransportOptions>().BindConfiguration(OptionsSection).ValidateOnStart();
|
||||
services.TryAddEnumerable(
|
||||
ServiceDescriptor.Singleton<IValidateOptions<TransportOptions>, TransportOptionsValidator>());
|
||||
services.TryAddSingleton(TimeProvider.System);
|
||||
|
||||
// Pipeline building blocks: stateless services live as singletons; the
|
||||
|
||||
Reference in New Issue
Block a user