Interface IObservableQueryEmissionGuards

Namespace
Cratis.Arc.Queries
Assembly
Cratis.Arc.Core.dll

Defines the system that aggregates all discovered IGuardObservableQueryEmission implementations into a single verdict per observable query emission.

public interface IObservableQueryEmissionGuards
Extension Methods

Properties

HasGuards

Gets a value indicating whether any IGuardObservableQueryEmission implementation exists.

bool HasGuards { get; }

Property Value

bool

Remarks

Emission paths check this before doing any work for a guard, so an application without guards pays nothing per emission — no context is built and no dispatch happens.

Methods

Guard(ObservableQueryEmissionContext)

Asks every discovered guard about an emission and aggregates their verdicts.

Task<ObservableQueryEmissionVerdict> Guard(ObservableQueryEmissionContext context)

Parameters

context ObservableQueryEmissionContext

The ObservableQueryEmissionContext describing the emission.

Returns

Task<ObservableQueryEmissionVerdict>

The most restrictive ObservableQueryEmissionVerdict any guard returned.

Remarks

The aggregate is most-restrictive-wins, and the first DenyAndTerminate short-circuits the remaining guards. A guard that throws is treated as DenyAndTerminate — the failure is logged and never rethrown, because a guard that fails open would leave an application believing it is protected.