Files
tiku-backend.net/Tiku.Api/Options/ApiRateLimitOptions.cs
xiong c497a3ca8d
Some checks failed
ci / release-gate (push) Has been cancelled
清理代码
2026-08-03 12:31:39 +08:00

16 lines
417 B
C#

using System.ComponentModel.DataAnnotations;
namespace Tiku.Api.Options;
public sealed class ApiRateLimitOptions
{
public const string SectionName = "RateLimiting";
public bool Enabled { get; set; } = true;
[Range(1, 100_000)] public int PermitLimit { get; set; } = 600;
[Range(1, 86_400)] public int WindowSeconds { get; set; } = 60;
[Range(0, 10_000)] public int QueueLimit { get; set; }
}