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:
Joseph Doherty
2026-07-10 06:52:07 -04:00
parent fc918d4679
commit 6bf9dfb3c5
12 changed files with 436 additions and 4 deletions
@@ -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