oidc.py: single-sourced shared module; guest trail consumes the portal's state

- app/oidc.py is now a byte-identical copy of the canonical module
  (ops-docs: scripts/shared/oidc_client.py); this app's identity (logger
  name, session cookie, session salt) is set via oidc.configure() in
  main.py with the app's historical values, so existing sessions survive.
  tests/test_oidc_sync.py pins the copy to the canonical revision — a hand
  edit goes red; changes go through the canonical + sync-oidc-module.sh.
- The guest trail pill consumes the portal-served `state` (the single
  invited-vs-active derivation, tested in the portal) with the old
  status-only payload fallback kept; dashboard-guests-harness.js asserts
  both shapes through the real page JS.
This commit is contained in:
inference-bot committed 2026-11-11 05:21:31 +00:00
1 parent 1e6e9e481c
commit 622982a371
4 files changed
+184 -13

No files matched your search

+12 -3
View File
@@ -26,6 +26,13 @@ from fastapi.responses import HTMLResponse, RedirectResponse, JSONResponse
from app import oidc
# The oidc module is SHARED (byte-identical copy of the canonical
# ops-docs: scripts/shared/oidc_client.py — see tests/test_oidc_sync.py);
# this app's identity (logger name, session cookie, session salt) is set
# here. The cookie name and salt are the app's historical values, so
# existing sessions survive the consolidation.
oidc.configure("member-dashboard", "member_oidc_session", "member-dashboard-oidc-session")
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("member-dashboard")
@@ -1035,9 +1042,11 @@ function renderGuests(d) {
$('guest-trail').innerHTML = trail.map(t => {
const who = t.name ? escapeHtml(t.name) + ' · ' + escapeHtml(t.recipient) : escapeHtml(t.recipient);
const when = t.decided_at ? 'Decided ' + fmtDay(t.decided_at) : 'Sent ' + fmtDay(t.created_at);
// `state` carries the portal's derived display state — 'invited' while the
// guest has not accepted their setup invite (never 'active' before that).
// Older payloads carry status only; fall back to it.
// `state` carries the portal's derived display state — the SINGLE
// derivation lives in the portal (tested there) and this page derives
// nothing: 'invited' while the guest has not accepted their setup invite
// (never 'active' before that), else the ledger status. Older payloads
// carry status only; fall back to it.
return '<div class="guest-row">' +
'<div><div class="guest-who">' + who + '</div>' +
'<div class="guest-meta">' + when + '</div></div>' +