v2.9.0: 设置新增 ZITADEL 统一登录(OIDC Authorization Code+PKCE,身份主键 (issuer,subject),JIT 建号即管理员,docs/12);账号密码 tab 支持修改用户名(验密+重签会话);新增 docs/API.md 全量 API 文档;迁移 0006(oidc_identities/oidc_states)
This commit is contained in:
+30
-2
@@ -34,6 +34,12 @@ const check = (step: string, ok: boolean, note?: string) => {
|
||||
await page.goto(`${BASE}/login`, { waitUntil: "domcontentloaded" });
|
||||
await page.waitForSelector("input[placeholder='用户名']", { timeout: 8000 });
|
||||
check("登录页渲染(含 LOGO/表单)", (await page.title()).includes("WmailHub"));
|
||||
// 统一登录未启用时(v2.9.0):登录页不显示 ZITADEL 按钮;/auth/status 可探测
|
||||
await page.waitForTimeout(400); // 等 /auth/status 探测返回
|
||||
check(
|
||||
"登录页 ZITADEL 按钮按启用状态显示(默认关闭不显示)",
|
||||
(await page.locator("button:has-text('ZITADEL 统一登录')").count()) === 0,
|
||||
);
|
||||
await page.screenshot({ path: `${SHOT_DIR}/01-login.png` });
|
||||
|
||||
// 2. 登录 admin/admin
|
||||
@@ -101,8 +107,8 @@ await page.click(".ant-dropdown .ant-dropdown-menu-item:has-text('设置')");
|
||||
await page.waitForSelector(".ant-modal:has-text('全局 Webhook')", { timeout: 8000 });
|
||||
const tabLabels = await page.locator(".ant-modal .ant-tabs-tab").allInnerTexts();
|
||||
check(
|
||||
"设置模态窗口经头像下拉打开(全局 Webhook / Cloudflare 接入 / 账号密码 三 tab)",
|
||||
tabLabels.length === 3 && tabLabels.some((t) => t.includes("Cloudflare 接入")),
|
||||
"设置模态窗口经头像下拉打开(全局 Webhook / Cloudflare 接入 / ZITADEL 统一登录 / 账号密码 四 tab)",
|
||||
tabLabels.length === 4 && tabLabels.some((t) => t.includes("Cloudflare 接入")) && tabLabels.some((t) => t.includes("ZITADEL 统一登录")),
|
||||
tabLabels.join(" | "),
|
||||
);
|
||||
await page.screenshot({ path: `${SHOT_DIR}/09-settings-webhook.png` });
|
||||
@@ -115,6 +121,28 @@ const redirectText =
|
||||
(await page.locator(".ant-modal .mono").filter({ hasText: "/api/oauth/cloudflare/callback" }).first().textContent()) ?? "";
|
||||
check("Cloudflare 接入 tab 显示授权回调地址", redirectText.includes("/api/oauth/cloudflare/callback"), redirectText.trim());
|
||||
await page.screenshot({ path: `${SHOT_DIR}/09b-settings-cloudflare.png` });
|
||||
|
||||
// ZITADEL 统一登录 tab(v2.9.0):回调地址 /auth/callback + Issuer/Client ID 表单 + 启用/JIT 开关
|
||||
await page.click(".ant-modal .ant-tabs-tab:has-text('ZITADEL 统一登录')");
|
||||
await page.waitForSelector(".ant-modal :text('Issuer')", { timeout: 8000 });
|
||||
const oidcModalText = (await page.locator(".ant-modal").innerText()) ?? "";
|
||||
check(
|
||||
"ZITADEL tab 显示回调地址 /auth/callback 与启用/JIT 开关",
|
||||
oidcModalText.includes("/auth/callback") &&
|
||||
(await page.locator(".ant-modal .ant-switch").count()) === 2 &&
|
||||
oidcModalText.includes("管理员"),
|
||||
oidcModalText.split("\n").slice(0, 6).join(" / "),
|
||||
);
|
||||
await page.screenshot({ path: `${SHOT_DIR}/09c-settings-oidc.png` });
|
||||
|
||||
// 账号密码 tab(v2.9.0):用户名修改表单 + 密码表单
|
||||
await page.click(".ant-modal .ant-tabs-tab:has-text('账号密码')");
|
||||
await page.waitForSelector(".ant-modal :text('新用户名')", { timeout: 8000 });
|
||||
const accountModalText = (await page.locator(".ant-modal").innerText()) ?? "";
|
||||
check(
|
||||
"账号密码 tab 含用户名修改(新用户名 + 当前密码)与密码表单",
|
||||
accountModalText.includes("新用户名") && accountModalText.includes("更新用户名") && accountModalText.includes("更新密码"),
|
||||
);
|
||||
await page.click(".ant-modal .ant-tabs-tab:has-text('全局 Webhook')");
|
||||
await page.waitForSelector(".ant-modal :text('Webhook URL')", { timeout: 8000 });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user