5 Commits

Author SHA1 Message Date
polaris-smart
85c6cad6b2 feat(auth): admit "teacher" and "student" role values in the single role whitelist
Extend the role vocabulary admitted by the single source of truth
(VALID_ROLES + normalize_role + the Role literal) that #1556 introduced.
Authorization stays least-privilege: only "admin" elevates, defaults are
unchanged, unknown values still degrade to "user", and the diff is fully
revertible one line per value. Capability wiring for the new roles stays
deployment policy; "parent" is deliberately out of scope.

Tests: parametrized passthrough over the four documented roles, set_role
round-trip for the new values, non-elevation assertions, and a "parent"
negative control proving the whitelist decides.
2026-09-24 08:19:39 +08:00
Hermes
3f621d403a refactor(auth): converge all role whitelists on normalize_role, add set_role tests
- models.py: add VALID_ROLES + normalize_role as the single source of truth
- identity.py: route _canonical_record/_migrate_legacy_users/load_users/set_role through normalize_role
- context.py: token payload role mapping via normalize_role
- services/auth.py + api/routers/auth.py: set_role guards validate against VALID_ROLES
- tests/multi_user/test_role_normalization.py: 16 tests, first set_role coverage in repo

Zero behavior change: legal roles pass through; unknown values keep the
same least-privilege degrade path; only guard error strings derived from
sorted(VALID_ROLES) differ.
2026-09-23 01:21:17 +08:00
XZH
8ea83989a6 feat(learner): add server-enforced account presets (#1111) 2026-08-30 06:47:11 -07:00
Ilia Avdeev
7901368bb2 feat: user profile page with avatar (icons + image upload) 2026-06-14 17:43:13 +02: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