This is an automated email from the ASF dual-hosted git repository.
lizhimins pushed a commit to branch rocketmq-studio
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git
The following commit(s) were added to refs/heads/rocketmq-studio by this push:
new 96af74093 docs: document the auth status and password endpoints (#5686)
96af74093 is described below
commit 96af74093ed9f42c76a7d2211fae1aa7314b5548
Author: Apulupie <[email protected]>
AuthorDate: Mon Oct 19 20:01:40 2026 +0800
docs: document the auth status and password endpoints (#5686)
Verified against `rocketmq-studio` at 420a506c2 before merging: the defect
is still present on the
current trunk and the change merges cleanly.
Merged as-is (squash); no maintainer edits were needed.
Locally verified: targeted suites green on the integration branch; a full
backend and frontend
build plus test pass runs on the trunk once this batch lands.
---
docs/api-spec.md | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/docs/api-spec.md b/docs/api-spec.md
index 6dc750a57..9abf4d1aa 100644
--- a/docs/api-spec.md
+++ b/docs/api-spec.md
@@ -160,6 +160,8 @@
| 116 | POST | `/api/liteTopic/extendTTL` | 调整 LiteTopic TTL |
| 117 | GET | `/api/liteTopic/quota` | LiteTopic 配额 |
| 118 | GET | `/api/liteTopic/capability` | LiteTopic 能力检查 |
+| 119 | GET | `/api/auth/status` | 登录策略与当前用户 |
+| 120 | POST | `/api/auth/password` | 修改当前用户密码 |
## 通用响应格式
@@ -241,6 +243,45 @@ POST /api/auth/logout
**Response `data`:** `null`
+### 1.3 获取登录策略与当前用户
+
+```
+GET /api/auth/status
+```
+
+无需认证即可调用:未登录时 `authenticated` 为 `false`、`user` 为 `null`,调用方据此决定是否显示登录页。
+
+**Response `data`:** `AuthStatus`
+
+| 字段 | 类型 | 说明 |
+|------|------|------|
+| `loginRequired` | `boolean` | 是否要求登录:`studio.auth.login-required`
或通用设置中的开关任一开启即为 `true` |
+| `authenticated` | `boolean` | 当前会话是否已认证 |
+| `user` | `object \| null` | 已认证时的用户信息,否则为 `null` |
+| `user.userId` | `number` | 用户 ID(数据库主键);配置引导用户(未落库)为空 |
+| `user.username` | `string` | 用户名 |
+| `user.admin` | `boolean` | 是否管理员 |
+
+响应带 `Cache-Control: no-store`。
+
+### 1.4 修改当前用户密码
+
+```
+POST /api/auth/password
+```
+
+**Request Body:**
+
+| 字段 | 类型 | 必填 | 说明 |
+|------|------|------|------|
+| `currentPassword` | `string` | 是 | 当前密码 |
+| `newPassword` | `string` | 是 | 新密码,长度 8–256 |
+
+**Response `data`:** `null`
+
+需要已认证会话(否则返回 `401`);用户管理未初始化时返回 `503`。修改成功后该用户的全部会话都会被
+吊销(包括发起请求的会话),后续请求返回 `401`,需要重新登录。
+
---
## 2. 监控面板 Dashboard