using System.Threading; using System.Threading.Tasks; namespace Svrnty.CQRS.Abstractions.Security; /// /// Cross-cutting authorization check that runs alongside (not in place of) the /// consumer's . Multiple /// implementations may be registered; the framework resolves them as /// IEnumerable<ICommandAuthorizationCheck> and runs each in /// registration order. AND semantics — any non- /// short-circuits the pipeline. /// /// /// Use this seam for self-applying, attribute-driven checks shipped by /// framework modules (proof-of-work, mobile attestation, rate-limit gates, /// IP allow-lists). The check is responsible for inspecting /// attributes and /// no-op'ing (return ) when it /// doesn't apply. /// public interface ICommandAuthorizationCheck { Task CheckAsync( CommandAuthorizationCheckContext context, CancellationToken cancellationToken = default); }