6642c83cdb
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.
41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
namespace JdeScoping.ConfigManager.Services;
|
|
|
|
/// <summary>
|
|
/// Result of runtime configuration validation.
|
|
/// </summary>
|
|
public class RuntimeValidationResult
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the name of the validator that produced this result.
|
|
/// </summary>
|
|
public string ValidatorName { get; init; } = "";
|
|
|
|
/// <summary>
|
|
/// Gets whether validation passed (no errors).
|
|
/// </summary>
|
|
public bool IsValid => Errors.Count == 0;
|
|
|
|
/// <summary>
|
|
/// Gets the list of validation errors.
|
|
/// </summary>
|
|
public List<string> Errors { get; } = [];
|
|
|
|
/// <summary>
|
|
/// Gets the list of validation warnings.
|
|
/// </summary>
|
|
public List<string> Warnings { get; } = [];
|
|
}
|
|
|
|
/// <summary>
|
|
/// Service for validating runtime configuration using Infrastructure validators.
|
|
/// </summary>
|
|
public interface IRuntimeConfigValidationService
|
|
{
|
|
/// <summary>
|
|
/// Validates the configuration in the specified folder using Infrastructure validators.
|
|
/// </summary>
|
|
/// <param name="configFolderPath">Path to the configuration folder.</param>
|
|
/// <returns>List of validation results from each validator.</returns>
|
|
List<RuntimeValidationResult> ValidateRuntimeConfig(string configFolderPath);
|
|
}
|