feat: wave 4 — team features (users, sessions, audit, bootstrap token) - #23
Merged
Conversation
Wave 4.1 — Per-user accounts (closes #13) - UserStore manages /data/users.json with PBKDF2 password hashing - Multi-user mode activates when users.json exists; single-password mode fully preserved when it doesn't (solo-safe, backward compatible) - Roles: admin (full access) and user (read-only dashboard + proxied UI) - /manage/users endpoint for listing; POST /manage/users/add and /remove - Login form shows username field in multi-user mode - Per-user Basic auth for opencode attach in multi-user mode Wave 4.2 — Server-side session store + revocation (closes #14) - SessionStore manages /data/sessions.jsonl with create/lookup/revoke - Multi-user mode uses opaque session IDs backed by the store - Single-password mode keeps the stateless HMAC cookie (backward compat) - /manage/sessions endpoint lists active sessions - POST /manage/sessions/revoke and /manage/sessions/revoke-all - Session expiry and revocation properly enforced Wave 4.3 — Audit log (closes #15) - AuditLog appends to /data/audit.jsonl (survives restart on volume) - Records: login success/failure, restart, key rotate/revalidate, reconfigure, session revoke, user add/remove - /manage/audit endpoint with pagination + filtering (?user=, ?action=) - All management actions now write audit entries Wave 4.4 — Optional BOOTSTRAP_TOKEN for first-run (closes #16) - If BOOTSTRAP_TOKEN env var is set, first-run /setup requires it - Prevents the public-domain race where first visitor owns the config - If unset, first-run is open as before (zero-config template preserved) - Token field shown on the first-run form only when token is set Tests: 9 new test cases. 128 total, all passing. Lint + format clean.
wra-sol
force-pushed
the
feat/wave-4-team-features
branch
from
June 29, 2026 03:28
ee668cc to
0660416
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wave 4 of the opencode manager improvement plan. Four slices, one PR. All opt-in: single-password mode is fully preserved when
/data/users.jsondoesn't exist.4.1 — Per-user accounts (closes #13)
UserStoremanages/data/users.jsonwith PBKDF2-HMAC-SHA256 password hashing (stdlib, portable — no bcrypt dependency). Multi-user mode activates whenusers.jsonexists; single-password mode is fully preserved when it doesn't. Roles:admin(full access) anduser(read-only dashboard + proxied UI). Login form shows a username field in multi-user mode. Per-user Basic auth works foropencode attach.4.2 — Server-side session store + revocation (closes #14)
SessionStoremanages/data/sessions.jsonlwith create/lookup/revoke. Multi-user mode uses opaque session IDs backed by the store; single-password mode keeps the stateless HMAC cookie./manage/sessionslists active sessions;POST /manage/sessions/revokeand/manage/sessions/revoke-allfor revocation.4.3 — Audit log (closes #15)
AuditLogappends to/data/audit.jsonl(survives restart on volume). Records: login success/failure, restart, key rotate/revalidate, reconfigure, session revoke, user add/remove./manage/auditendpoint with pagination + filtering (?user=,?action=).4.4 — Optional BOOTSTRAP_TOKEN (closes #16)
If
BOOTSTRAP_TOKENenv var is set, first-run/setuprequires it — prevents the public-domain race where the first visitor owns the config. If unset, first-run is open as before (zero-config template preserved).Tests
9 new test cases: password hashing, user CRUD, session store, audit log, multi-user mode preservation, bootstrap token, management endpoints. 128 total tests pass. Lint + format clean.