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
+16 -3
View File
@@ -5702,7 +5702,7 @@ const docTemplate = `{
},
"/api/v1/user/login": {
"post": {
"description": "使用用户名和密码登录,登录成功后建立 Session。若管理员已关闭密码登录功能则返回错误。",
"description": "使用用户名和密码登录系统,验证通过后建立 Session 并返回用户信息。",
"consumes": [
"application/json"
],
@@ -5712,7 +5712,7 @@ const docTemplate = `{
"tags": [
"user"
],
"summary": "用户密码登录",
"summary": "用户登录",
"parameters": [
{
"description": "登录请求参数",
@@ -5737,6 +5737,12 @@ const docTemplate = `{
"$ref": "#/definitions/response.Any"
}
},
"429": {
"description": "登录尝试过于频繁",
"schema": {
"$ref": "#/definitions/response.Any"
}
},
"500": {
"description": "服务内部错误",
"schema": {
@@ -5872,6 +5878,12 @@ const docTemplate = `{
"$ref": "#/definitions/response.Any"
}
},
"429": {
"description": "注册尝试过于频繁",
"schema": {
"$ref": "#/definitions/response.Any"
}
},
"500": {
"description": "服务内部错误",
"schema": {
@@ -6081,7 +6093,8 @@ const docTemplate = `{
"type": "string"
},
"id": {
"type": "integer"
"type": "string",
"example": "0"
},
"is_admin": {
"type": "boolean"