Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/ui/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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: "无",
Expand Down
2 changes: 1 addition & 1 deletion src/ui/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export function idpsPage({ lang, theme, path = "/idps", idps, health = {}, added
return `<li class="idrow" id="idp-${esc(i.id)}" data-q="${esc(searchText(i))}" data-name="${esc(norm(name))}" data-added="${added[i.id] || 0}" data-rank="${rank[st]}">
<span class="main"><span class="nm" title="${esc(name)}">${esc(name)}</span><span class="idt">${esc(i.id)}</span></span>
<span class="host" title="${esc(host)}">${esc(host)}</span>
<span class="st"><span class="dot ${st === "disabled" ? "unknown" : st}"></span>${esc(st === "disabled" ? t(lang, "disabled") : t(lang, "status_" + st))}</span>
<span class="st"><span class="dot ${st === "disabled" ? "unknown" : st}"></span>${esc(st === "disabled" ? t(lang, i.override ? "paused" : "disabled") : t(lang, "status_" + st))}</span>
<span class="badge proto">${i.protocol === "saml2" ? "SAML" : "OIDC"}</span>
${logoTile(i, lang)}${sub ? `\n<span class="sub">${sub}</span>` : ""}
</li>`;
Expand Down
11 changes: 11 additions & 0 deletions test/flow.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
Loading