Table of Contents

Interface IControlValidator

Namespace
Excalibur.Compliance
Assembly
Excalibur.Compliance.Abstractions.dll

Interface for individual control validators. Implementations validate specific controls (e.g., encryption, audit logging).

public interface IControlValidator

Properties

SupportedControls

Gets the control identifiers this validator handles.

IReadOnlyList<string> SupportedControls { get; }

Property Value

IReadOnlyList<string>

SupportedCriteria

Gets the Trust Services criteria this validator covers.

IReadOnlyList<TrustServicesCriterion> SupportedCriteria { get; }

Property Value

IReadOnlyList<TrustServicesCriterion>

Methods

GetControlDescription(string)

Gets the control description for the specified control.

ControlDescription? GetControlDescription(string controlId)

Parameters

controlId string

The control identifier.

Returns

ControlDescription

The control description, or null if not found.

RunTestAsync(string, ControlTestParameters, CancellationToken)

Runs a control test with the specified parameters.

Task<ControlTestResult> RunTestAsync(string controlId, ControlTestParameters parameters, CancellationToken cancellationToken)

Parameters

controlId string

The control identifier to test.

parameters ControlTestParameters

Test parameters.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<ControlTestResult>

The test result.

ValidateAsync(string, CancellationToken)

Validates the specified control.

Task<ControlValidationResult> ValidateAsync(string controlId, CancellationToken cancellationToken)

Parameters

controlId string

The control identifier to validate.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<ControlValidationResult>

The validation result.

Remarks

This operation is total: it has no precondition on controlId. An identifier outside SupportedControls is an ordinary input, not a caller error, and MUST produce a result saying the control was not assessed here -- never a thrown exception, and never a verdict about a control this validator did not examine.

This was already the contract every implementation and caller depended on, and it was written down nowhere. An implementor reading only the signature would have been entitled to throw ArgumentException, which breaks the dispatching service -- it forwards whatever identifier it is given -- and the shipped conformance kit, which calls this method with an unsupported identifier and requires a result.

The only exception an implementation may propagate is OperationCanceledException, when cancellationToken is signalled.