Skip to content

Latest commit

 

History

History
119 lines (85 loc) · 1.59 KB

File metadata and controls

119 lines (85 loc) · 1.59 KB

审计与管理接口 /audit / /admin

返回总入口:返回接口文档首页

审计与用户管理 /audit

GET /audit/

分页查询审计日志。

鉴权:Root

查询参数:

  • page
  • size
  • user
  • action
  • from(RFC3339)
  • to(RFC3339)

响应:

{
  "total": 100,
  "page": 1,
  "size": 50,
  "items": []
}

POST /audit/

写入预览时长等审计预览数据。

鉴权:已登录

请求体:

{"path": "/home/alice/a.txt", "duration_ms": 1234, "type": "preview"}

响应:通常为 204 No Content

GET /audit/user/

列出用户。

鉴权:Root

响应:用户数组。

POST /audit/user/

创建用户。

鉴权:Root

请求体:

{"username": "alice", "password": "secret", "role": "user"}

响应:201 Created,返回用户对象。

PUT /audit/user/:id

更新用户角色或密码。

鉴权:Root

请求体:

{"role": "admin", "password": "newpass"}

响应:

{"ok": true}

DELETE /audit/user/:id

删除用户。

鉴权:Root

响应:

{"ok": true}

DELETE /audit/user/:id/otp

重置目标用户 OTP,并撤销其会话。

鉴权:Root

响应:

{"ok": true}

DELETE /audit/user/:id/email

清空目标用户邮箱,并撤销其会话。

鉴权:Root

响应:

{"ok": true}

管理接口 /admin

GET /admin/oss/cors-check

生成 OSS CORS 检测所需的临时 PUT / DELETE URL。

鉴权:Root

响应:

{
  "put_url": "https://...",
  "delete_url": "https://..."
}