发布 0.1.0:通知渠道、告警规则、令牌版本与安全加固
CI / test (push) Successful in 30s
Release / release (push) Successful in 49s

This commit is contained in:
Wang Defa
2026-07-10 17:38:34 +08:00
parent 4af6a0ca92
commit dbba1f4905
78 changed files with 6898 additions and 551 deletions
+479 -4
View File
@@ -871,6 +871,30 @@ const docTemplate = `{
}
}
},
"/api/v1/auth/revoke-sessions": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"认证"
],
"summary": "撤销全部会话",
"responses": {
"200": {
"description": "新 token 与 expiresAt",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/v1/auth/totp": {
"get": {
"security": [
@@ -1078,6 +1102,124 @@ const docTemplate = `{
}
}
},
"/api/v1/log-events/alert-rules": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"任务与日志回传"
],
"summary": "告警规则列表",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"任务与日志回传"
],
"summary": "创建告警规则",
"parameters": [
{
"description": "请求体",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_api.alertRuleRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/log-events/alert-rules/{ruleId}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"任务与日志回传"
],
"summary": "更新告警规则",
"parameters": [
{
"type": "integer",
"description": "规则 ID",
"name": "ruleId",
"in": "path",
"required": true
},
{
"description": "请求体",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_api.alertRuleRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"任务与日志回传"
],
"summary": "删除告警规则",
"parameters": [
{
"type": "integer",
"description": "规则 ID",
"name": "ruleId",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "无内容"
}
}
}
},
"/api/v1/oci-configs": {
"get": {
"security": [
@@ -1205,6 +1347,7 @@ const docTemplate = `{
"BearerAuth": []
}
],
"description": "删除租户配置及其本地关联任务、快照、回传、告警和 AI 渠道数据,并撤销 Webhook 密钥;不删除 OCI 云端资源。",
"tags": [
"租户配置"
],
@@ -1235,7 +1378,7 @@ const docTemplate = `{
"tags": [
"租户 IAM"
],
"summary": "实时查询租户 OCI 审计事件:hours 首查",
"summary": "批式懒加载查询租户 OCI 审计事件",
"parameters": [
{
"type": "integer",
@@ -1243,6 +1386,18 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "续查游标(上次响应原样带回)",
"name": "cursor",
"in": "query"
},
{
"type": "integer",
"description": "单批目标条数,缺省 100,上限 200",
"name": "limit",
"in": "query"
}
],
"responses": {
@@ -1656,6 +1811,37 @@ const docTemplate = `{
}
}
},
"/api/v1/oci-configs/{id}/domains": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"租户 IAM"
],
"summary": "租户身份域列表",
"parameters": [
{
"type": "integer",
"description": "配置 ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/oci-configs/{id}/identity-providers": {
"get": {
"security": [
@@ -1674,6 +1860,12 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -1704,6 +1896,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体",
"name": "body",
@@ -1744,6 +1942,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "idpId",
@@ -1778,6 +1982,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "idpId",
@@ -1824,6 +2034,12 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -1854,6 +2070,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体(见接口说明)",
"name": "body",
@@ -3015,6 +3237,12 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3045,6 +3273,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体(见接口说明)",
"name": "body",
@@ -3084,6 +3318,12 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3116,6 +3356,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "policyId",
@@ -3231,6 +3477,12 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3478,6 +3730,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体(见接口说明)",
"name": "body",
@@ -3518,6 +3776,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "ruleId",
@@ -3551,6 +3815,12 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3835,6 +4105,12 @@ const docTemplate = `{
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3865,6 +4141,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体",
"name": "body",
@@ -3905,6 +4187,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -3941,6 +4229,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -3986,6 +4280,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -4058,6 +4358,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -4096,6 +4402,12 @@ const docTemplate = `{
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -4749,6 +5061,95 @@ const docTemplate = `{
}
}
},
"/api/v1/settings/notify-channels": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"设置"
],
"summary": "返回全部通知渠道的脱敏视图",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/settings/notify-channels/{type}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"设置"
],
"summary": "保存单渠道配置并返回全渠道最新视图",
"parameters": [
{
"type": "string",
"description": "渠道类型(webhook/ntfy/bark/smtp)",
"name": "type",
"in": "path",
"required": true
},
{
"description": "请求体",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_api.updateNotifyChannelRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/api/v1/settings/notify-channels/{type}/test": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"tags": [
"设置"
],
"summary": "向指定渠道发送测试消息",
"parameters": [
{
"type": "string",
"description": "渠道类型(webhook/ntfy/bark/smtp)",
"name": "type",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "无内容"
}
}
}
},
"/api/v1/settings/notify-events": {
"get": {
"security": [
@@ -5403,6 +5804,38 @@ const docTemplate = `{
}
},
"definitions": {
"internal_api.alertRuleRequest": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"eventTypes": {
"type": "string"
},
"name": {
"type": "string"
},
"ociConfigId": {
"type": "integer"
},
"resourceMatch": {
"type": "string"
},
"sourceIpMode": {
"type": "string"
},
"sourceIps": {
"type": "string"
},
"threshold": {
"type": "integer"
},
"windowMinutes": {
"type": "integer"
}
}
},
"internal_api.attachBootVolumeRequest": {
"type": "object",
"required": [
@@ -5817,14 +6250,18 @@ const docTemplate = `{
],
"properties": {
"password": {
"type": "string"
"type": "string",
"maxLength": 128
},
"totpCode": {
"description": "两步验证码;账号已启用 TOTP 时必填,缺失返回 428",
"type": "string"
"type": "string",
"maxLength": 8
},
"username": {
"type": "string"
"description": "字段长度上限防超长输入撑爆登录守卫与 bcrypt(S-03)",
"type": "string",
"maxLength": 64
}
}
},
@@ -5891,6 +6328,44 @@ const docTemplate = `{
}
}
},
"internal_api.updateNotifyChannelRequest": {
"type": "object",
"properties": {
"bodyTemplate": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"from": {
"type": "string"
},
"host": {
"type": "string"
},
"port": {
"type": "integer"
},
"secret": {
"type": "string"
},
"server": {
"type": "string"
},
"to": {
"type": "string"
},
"topic": {
"type": "string"
},
"url": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"internal_api.updateSecurityListRequest": {
"type": "object",
"properties": {