feat: 敏感操作增加IP维度限流
- RateLimiter 新增 AllowSensitive 方法(1分钟5次,超限封禁5分钟) - 新增 SensitiveRateLimit Gin 中间件 - 改密(PUT /api/settings/password)增加限流保护 - 注销(POST /api/settings/delete-account)增加限流保护 - 签到(POST /api/level/checkin)增加限流保护
This commit is contained in:
@ -21,6 +21,11 @@ const (
|
||||
ipBlockDur = 1 * time.Minute
|
||||
cleanupInterval = 2 * time.Minute
|
||||
maxEntries = 10000
|
||||
|
||||
// 敏感操作限流:改密/注销/签到
|
||||
sensitiveWindow = 1 * time.Minute
|
||||
sensitiveMaxRequests = 5
|
||||
sensitiveBlockDur = 5 * time.Minute
|
||||
)
|
||||
|
||||
// windowState 单个维度的限流状态
|
||||
|
||||
Reference in New Issue
Block a user