Skip to main content

Module users

Module users 

Source
Expand description

<store>/users.json — actor identity (lex-tea v3d, #172).

Tightens the v3a–v3c LEX_TEA_USER env var auth: the env var (and the --actor flag) still nominate who took an action, but when users.json exists the nominated name must be in the file. Anonymous overrides aren’t a regression we want. When the file is absent the surfaces fall back to the v3a–v3c “anyone with LEX_TEA_USER” behaviour so existing dev setups keep working.

File schema (deliberately minimal):

{
  "users": [
    {"name": "alice", "role": "human"},
    {"name": "lexbot", "role": "agent"}
  ]
}

role is recorded but not enforced in v3d — it gives later slices a place to gate “only humans can pin” or similar without a schema migration.

Structs§

User
UsersFile

Enums§

UserRole

Functions§

load
Load <root>/users.json. Returns Ok(None) when the file is absent (the v3a–v3c “no auth wired up, use env-var fallback” regime); Ok(Some(_)) when present, even if the user list is empty (an empty file is “auth wired up, nobody allowed”).