From cc3fb31bf4361cdefc156b82933579f4c302d321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B8=E5=B3=A5?= Date: Fri, 9 Oct 2026 14:56:10 +0800 Subject: [PATCH] update --- src/index.js | 2 +- src/ui/i18n.js | 4 ++-- src/ui/pages.js | 2 +- test/flow.test.mjs | 11 +++++++++++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 323a283..41f91d2 100644 --- a/src/index.js +++ b/src/index.js @@ -210,7 +210,7 @@ export async function handle(request, env, ctx) { const fx = fixtureCount(env, url); if (fx != null) { const f = fixtureIdps(fx); return html(idpsPage({ ...v, idps: f.idps, health: f.health, added: f.added, sort: url.searchParams.get("sort"), fixture: fx }), { nonce: v.nonce }); } const reg = await getRegistry(env); - return html(idpsPage({ ...v, idps: [...reg.idps.values()].filter((i) => i.status !== "disabled"), health: await healthMap(env), added: await addedMap(env), sort: url.searchParams.get("sort") }), { nonce: v.nonce }); + return html(idpsPage({ ...v, idps: [...reg.idps.values()].filter((i) => i.status !== "disabled" || i.override), health: await healthMap(env), added: await addedMap(env), sort: url.searchParams.get("sort") }), { nonce: v.nonce }); } if (p === "/fixture/picker" && fixtureCount(env, url) != null) { const n = fixtureCount(env, url), f = fixtureIdps(n); diff --git a/src/ui/i18n.js b/src/ui/i18n.js index 144e143..8cd9824 100644 --- a/src/ui/i18n.js +++ b/src/ui/i18n.js @@ -84,7 +84,7 @@ const T = { idps_title: "Identity providers", idps_lead: "The identity providers in the registry. Each entry is maintained by its operator through a pull request.", col_name: "Name", col_issuer: "Issuer", col_status: "Status", col_domains: "Email domains", - disabled: "Disabled", + disabled: "Disabled", paused: "Not yet available", status_title: "Status", status_registry: "Registry", status_commit: "Commit", status_synced: "Loaded", status_checked: "Last checked", status_error: "Last error", status_dropped: "Entries not loaded", status_none: "None", @@ -153,7 +153,7 @@ const T = { idps_title: "身份提供方", idps_lead: "登记表中的身份提供方。每个条目由其运营方通过拉取请求维护。", col_name: "名称", col_issuer: "签发方", col_status: "状态", col_domains: "邮箱域名", - disabled: "已停用", + disabled: "已停用", paused: "暂未开放", status_title: "状态", status_registry: "登记表", status_commit: "提交", status_synced: "载入时间", status_checked: "最近检查", status_error: "最近错误", status_dropped: "未载入的条目", status_none: "无", diff --git a/src/ui/pages.js b/src/ui/pages.js index 5da0722..6be5f72 100644 --- a/src/ui/pages.js +++ b/src/ui/pages.js @@ -206,7 +206,7 @@ export function idpsPage({ lang, theme, path = "/idps", idps, health = {}, added return `
  • ${esc(name)}${esc(i.id)} ${esc(host)} -${esc(st === "disabled" ? t(lang, "disabled") : t(lang, "status_" + st))} +${esc(st === "disabled" ? t(lang, i.override ? "paused" : "disabled") : t(lang, "status_" + st))} ${i.protocol === "saml2" ? "SAML" : "OIDC"} ${logoTile(i, lang)}${sub ? `\n${sub}` : ""}
  • `; diff --git a/test/flow.test.mjs b/test/flow.test.mjs index e7bf146..bebb17b 100644 --- a/test/flow.test.mjs +++ b/test/flow.test.mjs @@ -319,3 +319,14 @@ test("logos: the sync downloads, re-checks and serves them with fixed headers; a assert.ok(!list.find((i) => i.id === "other").logo, "the refused logo is dropped from the entry"); } }); + +test("/idps lists an identity provider paused by the operator as not yet available; a retired one stays hidden", async () => { + const h = await setup({ idps: { good: "idp.example.test", off: "off.example.test", wait: "wait.example.test" } }); + h.registry.idps[1].status = "disabled"; + await h.env.DB.prepare("INSERT INTO idp_overrides (idp, disabled, reason, by_sub, at) VALUES ('wait', 1, 'secret pending', 'op', 1)").run(); + const page = await (await h.request("/idps")).text(); + assert.match(page, /IdP wait[\s\S]*Not yet available/); + assert.doesNotMatch(page, /IdP off/); + const r = await login(h, { pk: await pkce(), pick: false }); + assert.doesNotMatch(await r.picker.text(), /IdP wait/, "a paused provider is not offered in the picker"); +});