6 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
15c79a055f Merge pull request #1122 from evan188199-tech/codex/feat-device-credentials
# Conflicts:
#	deeptutor/api/routers/auth.py
#	tests/multi_user/conftest.py
2026-08-31 20:33:29 +08:00
XZH
b0ff5f18b7 feat(learner): add revocable device login credentials (#1116) 2026-08-30 16:59:36 -07:00
XZH
3f62d85997 feat(learner): add guardian authorization 2026-08-30 07:07:29 -07:00
Souptik Chakraborty
a5879735b7 fix: Keep env-bootstrapped admin usable and unpromoted (#851)
The identity store had two bugs that combined into a lockout for
deployments whose admin comes from auth.json rather than /register.

load_users() returned the bootstrap admin only when the store was empty,
so writing the first real account dropped it and the operator's login
started returning 401. save_user() then decided first-admin promotion
from load_users() called with no env arguments, an env-blind view, so
with an empty store the first account an admin created from /admin/users
was silently promoted to admin even though that endpoint documents
role="user". Together: create one student account, the student is the
only admin, the operator is locked out.

load_users() now merges the bootstrap admin whenever it is configured; a
stored record with the same username still wins, so the account can be
adopted into the store. The merge stays in memory because no write path
passes the env arguments, so a rotation of auth.json is never shadowed by
a stale persisted hash. save_user() counts a configured bootstrap admin
as an existing account, except when saving that same username, which is
an adoption and keeps the admin role.

The genuinely-empty deployment is unchanged: with no bootstrap
credentials the first /register user is still promoted. A username
configured with an empty hash cannot authenticate and so does not count,
which matters because that is the shipped default.

Fixes #849
2026-08-16 19:07:52 +08:00
Bingxi Zhao (Frank)
46093e5e2b update msg 2026-06-11 20:03:34 +08:00
Bingxi Zhao (Frank)
2c4769a96f prepare v1.3.8 release
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-08 02:36:24 +08:00