feat(configmanager): add runtime config validation using Infrastructure validators

Enable ConfigManager to validate runtime configuration (SecureStore secrets,
connection strings, LDAP) using the same validators as the Host application.
Adds AddInfrastructureValidators() extension for shared validator registration.
This commit is contained in:
Joseph Doherty
2026-01-21 18:31:42 -05:00
parent e5fe2f06e9
commit 6642c83cdb
11 changed files with 792 additions and 8 deletions
@@ -18,6 +18,7 @@ public class MainWindowViewModelTests
private readonly IDialogService _dialogService;
private readonly ISecureStoreManager _secureStoreManager;
private readonly IClipboardService _clipboardService;
private readonly IRuntimeConfigValidationService _runtimeValidationService;
private readonly ILogger<MainWindowViewModel> _logger;
public MainWindowViewModelTests()
@@ -30,6 +31,7 @@ public class MainWindowViewModelTests
_dialogService = Substitute.For<IDialogService>();
_secureStoreManager = Substitute.For<ISecureStoreManager>();
_clipboardService = Substitute.For<IClipboardService>();
_runtimeValidationService = Substitute.For<IRuntimeConfigValidationService>();
_logger = Substitute.For<ILogger<MainWindowViewModel>>();
_validationService.ValidateAppSettings(Arg.Any<ConfigModel>())
@@ -159,7 +161,7 @@ public class MainWindowViewModelTests
}
[Fact]
public void SelectingPipelineNode_LoadsPipelineFormViewModel()
public void SelectingPipelineNode_LoadsPipelineEditorViewModel()
{
// Arrange
var config = new ConfigModel();
@@ -185,10 +187,10 @@ public class MainWindowViewModelTests
sut.SelectedNode = pipelineNode;
// Assert
sut.SelectedFormViewModel.ShouldBeOfType<PipelineFormViewModel>();
var pipelineForm = (PipelineFormViewModel)sut.SelectedFormViewModel!;
pipelineForm.Name.ShouldBe("WorkOrders");
pipelineForm.Connection.ShouldBe("jde");
sut.SelectedFormViewModel.ShouldBeOfType<PipelineEditorViewModel>();
var pipelineEditor = (PipelineEditorViewModel)sut.SelectedFormViewModel!;
pipelineEditor.Name.ShouldBe("WorkOrders");
pipelineEditor.Source.Connection.ShouldBe("jde");
}
[Fact]
@@ -318,6 +320,7 @@ public class MainWindowViewModelTests
_dialogService,
_secureStoreManager,
_clipboardService,
_runtimeValidationService,
_logger);
}
}