Skip to content

v2.3.0 — Session rotation + Admin Sessions tab

Choose a tag to compare

@vurulkan vurulkan released this 02 Oct 09:57
· 47 commits to main since this release

v2.3.0 — Session rotation + Admin Sessions tab (M4-B3 phase 1)

Admins can now see every token this backend has issued and revoke any one of
them. Change-password automatically kills every live session for the affected
user — so a stolen token can't survive a password reset.

Highlights

  • Admin → Sessions: new tab lists every session (user, status, IP, UA,
    issued / last-used / expires times) with an "Only active" toggle. Per-row
    Revoke or Revoke all for user, both with confirmation. Your own
    session is tagged "this is you".
  • Password rotation kills tokens: change-password now revokes every
    session belonging to the user, including the browser that initiated the
    change. The UI falls back to the login screen on the next request.
  • Browser kept open longer than it should be? Click revoke in Admin, and
    the next request from that browser gets a 401.

Internals

  • JWT remains the primary auth artifact. A new session_tokens table pins each
    issued token by its jti and holds the revocation flag. AuthMiddleware
    consults the table on every request and fails open on DB errors — a
    storage blip can only degrade admin control, never log everyone out.
  • last_used_at writes are throttled in-memory (30s per jti), so AuthMiddleware
    never serializes an UPDATE behind SQLite's single writer.
  • Pre-tracking JWTs (issued before this upgrade and still in flight) are
    honoured until their natural expiry — rolling upgrades don't kick anyone
    out of a live tab.
  • New endpoints (admin only): GET /api/admin/sessions[?activeOnly=1&userId=…],
    DELETE /api/admin/sessions/{id},
    POST /api/admin/users/{id}/revoke-sessions. Audit actions:
    session.revoke, session.revoke_all.

Upgrade

docker pull ghcr.io/vurulkan/kubernetes-openconsole:2.3.0
docker rm -f openconsole && \
  docker run -d --name openconsole -p 8080:8080 -e DATA_PATH=/tmp/app.db \
    ghcr.io/vurulkan/kubernetes-openconsole:2.3.0

The migration adds session_tokens and two indexes. It is idempotent and
touches no existing rows. Already-issued JWTs stay valid until they expire.

Rollback

docker pull ghcr.io/vurulkan/kubernetes-openconsole:2.1.4
docker rm -f openconsole && docker run -d --name openconsole -p 8080:8080 \
  -e DATA_PATH=/tmp/app.db ghcr.io/vurulkan/kubernetes-openconsole:2.1.4

The session_tokens table stays in the DB after rollback (unused). No cleanup
required.