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<DistributedRateLimitResult> ConsumeAsync(
        IReadOnlyCollection<DistributedRateLimitBucket> buckets,
        CancellationToken cancellationToken = default);

    Task<bool> PingAsync(CancellationToken cancellationToken = default);
}
