feat: rebuild web UI on the shared theta42 app stack; OIDC + local admin auth

The web management UI was a bespoke minimal theme with LDAP-bind login.
Rebuild it to match the SSO Manager and Proxy — same stack, same look/feel,
same auth model. The SSH bridge, audit, metrics, and access logic are
unchanged; this is purely the web layer.

Frontend (mirrors proxy/sso):
- Express + EJS with the shared top.ejs/bottom.ejs shell, Bootstrap 5,
  jQuery, jq-repeat, FontAwesome, Socket.IO, and the shared app-base.js /
  val.js client framework (copied verbatim). Vendor libs served from
  node_modules via /static-modules; app assets via /static.
- Dashboard / Sessions / Audit pages render in the common look/feel,
  loading data through the authenticated /api/* endpoints.

Auth (mirrors proxy):
- OIDC against the SSO (utils/oidc.js + routes/auth.js + models/oidc_state)
  plus a local anti-lockout admin (models/user_redis.js, bootstrapped from
  auth.adminUsers[0] / auth.localAdminPass). AuthToken sessions carry the
  group snapshot; middleware gates the data API on adminGroups or the local
  admin. New config: oidc{} + auth.adminUsers/localAdminPass.
- /api/user/me drives the client login state; "Log in with SSO" hidden when
  oidc.enabled is false.

Verified end to end: local admin login -> token -> /api/user/me isAdmin,
metrics/sessions/audit 200 with token / 401 without / 401 bad password;
static + page shells serve; 26 tests green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-23 20:57:34 -04:00
parent eb8e5b409e
commit aa3b3ed515
38 changed files with 2550 additions and 374 deletions
+25 -3
View File
@@ -7,6 +7,7 @@
module.exports = {
name: 'Jump Host',
logo: '/static/img/theta42.svg',
// LDAP directory the users live in (same directory the SSO manages).
// bindDN needs: read on ou=people (users + sshPublicKey) and ou=groups,
@@ -59,11 +60,32 @@ module.exports = {
port: 3002,
},
// Web UI/API login. Same model as the proxy: OIDC against the SSO for
// normal users, plus a local anti-lockout admin that works even if the SSO
// is unreachable. OIDC endpoints + clientId/clientSecret live in the
// secrets file; enabled:false hides the "Log in with SSO" button.
oidc: {
enabled: false,
issuer: '',
authorizationEndpoint: '',
tokenEndpoint: '',
userinfoEndpoint: '',
clientId: '',
clientSecret: '',
redirectUri: '',
scopes: ['openid', 'profile', 'email', 'groups'],
groupsClaim: 'groups',
usernameClaim: 'preferred_username',
},
auth: {
// LDAP groups whose members may use the web UI/API.
// OIDC group memberships that grant web UI/API admin access.
adminGroups: ['app_sso_admin'],
// Web session lifetime (ms).
sessionTTLms: 12 * 60 * 60 * 1000,
// Local anti-lockout admin: the first name here is bootstrapped as a
// redis-backed user on first boot (password from localAdminPass, or a
// random one printed to the log once). Lets you in even with OIDC down.
adminUsers: ['jumpadmin'],
localAdminPass: '',
},
redis: {