发布 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
@@ -864,6 +864,30 @@
}
}
},
"/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": [
@@ -1071,6 +1095,124 @@
}
}
},
"/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": [
@@ -1198,6 +1340,7 @@
"BearerAuth": []
}
],
"description": "删除租户配置及其本地关联任务、快照、回传、告警和 AI 渠道数据,并撤销 Webhook 密钥;不删除 OCI 云端资源。",
"tags": [
"租户配置"
],
@@ -1228,7 +1371,7 @@
"tags": [
"租户 IAM"
],
"summary": "实时查询租户 OCI 审计事件:hours 首查",
"summary": "批式懒加载查询租户 OCI 审计事件",
"parameters": [
{
"type": "integer",
@@ -1236,6 +1379,18 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "续查游标(上次响应原样带回)",
"name": "cursor",
"in": "query"
},
{
"type": "integer",
"description": "单批目标条数,缺省 100,上限 200",
"name": "limit",
"in": "query"
}
],
"responses": {
@@ -1649,6 +1804,37 @@
}
}
},
"/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": [
@@ -1667,6 +1853,12 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -1697,6 +1889,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体",
"name": "body",
@@ -1737,6 +1935,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "idpId",
@@ -1771,6 +1975,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "idpId",
@@ -1817,6 +2027,12 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -1847,6 +2063,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体(见接口说明)",
"name": "body",
@@ -3008,6 +3230,12 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3038,6 +3266,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体(见接口说明)",
"name": "body",
@@ -3077,6 +3311,12 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3109,6 +3349,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "policyId",
@@ -3224,6 +3470,12 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3471,6 +3723,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体(见接口说明)",
"name": "body",
@@ -3511,6 +3769,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "ruleId",
@@ -3544,6 +3808,12 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3828,6 +4098,12 @@
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
}
],
"responses": {
@@ -3858,6 +4134,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"description": "请求体",
"name": "body",
@@ -3898,6 +4180,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -3934,6 +4222,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -3979,6 +4273,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -4051,6 +4351,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -4089,6 +4395,12 @@
"in": "path",
"required": true
},
{
"type": "string",
"description": "身份域 OCID(缺省 Default 域)",
"name": "domainId",
"in": "query"
},
{
"type": "string",
"description": "userId",
@@ -4742,6 +5054,95 @@
}
}
},
"/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": [
@@ -5396,6 +5797,38 @@
}
},
"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": [
@@ -5810,14 +6243,18 @@
],
"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
}
}
},
@@ -5884,6 +6321,44 @@
}
}
},
"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": {