feat(auth): implement decoupled sliding-window rate limiting for login and oauth

This commit is contained in:
ryan
2026-09-02 22:15:21 +08:00
parent 39f02b5d7a
commit 9632604958
23 changed files with 927 additions and 50 deletions
+12 -3
View File
@@ -28,7 +28,8 @@ definitions:
gender:
type: string
id:
type: integer
example: "0"
type: string
is_admin:
type: boolean
location:
@@ -4810,7 +4811,7 @@ paths:
post:
consumes:
- application/json
description: 使用用户名和密码登录,登录成功后建立 Session。若管理员已关闭密码登录功能则返回错误。
description: 使用用户名和密码登录系统,验证通过后建立 Session 并返回用户信息。
parameters:
- description: 登录请求参数
in: body
@@ -4829,11 +4830,15 @@ paths:
description: 用户名或密码错误
schema:
$ref: '#/definitions/response.Any'
"429":
description: 登录尝试过于频繁
schema:
$ref: '#/definitions/response.Any'
"500":
description: 服务内部错误
schema:
$ref: '#/definitions/response.Any'
summary: 用户密码登录
summary: 用户登录
tags:
- user
/api/v1/user/logout:
@@ -4913,6 +4918,10 @@ paths:
description: 参数错误、用户名已存在或注册已关闭
schema:
$ref: '#/definitions/response.Any'
"429":
description: 注册尝试过于频繁
schema:
$ref: '#/definitions/response.Any'
"500":
description: 服务内部错误
schema: