using System; using System.Collections.Generic; namespace Svrnty.CQRS.Abstractions.Security; /// /// Shared shape for command and query authorization-check contexts. Checks /// receive the request type, the materialized (and validated) request instance, /// a scoped , and a free-form /// dictionary that lets checks in the same pipeline pass signals to each other /// (e.g. a future mobile-attestation check stamping "mobile_attested" for the /// Altcha check to read). /// public abstract class AuthorizationCheckContext { public required IServiceProvider Services { get; init; } public IDictionary Items { get; } = new Dictionary(); } public sealed class CommandAuthorizationCheckContext : AuthorizationCheckContext { public required Type CommandType { get; init; } public required object Command { get; init; } } public sealed class QueryAuthorizationCheckContext : AuthorizationCheckContext { public required Type QueryType { get; init; } public required object Query { get; init; } }