namespace Tiku.Application.Security; public sealed record DistributedRateLimitBucket(string Key, int PermitLimit, TimeSpan Window); public sealed record DistributedRateLimitResult(bool Allowed, TimeSpan? RetryAfter = null); public interface IRedisSecurityStore { bool IsConfigured { get; } Task ConsumeAsync( IReadOnlyCollection buckets, CancellationToken cancellationToken = default); Task PingAsync(CancellationToken cancellationToken = default); Task SetInvalidationVersionAsync( string realm, Guid? tenantId, Guid? userId, long version, CancellationToken cancellationToken = default); }