Skip to main content

Module admin

Module admin 

Source
Expand description

Managing people and the agents that report for them.

Everything here is behind a session (ADR 0007) and a role. Two rules shape the routes, both settled before they were written (ADR 0008):

  • A manager reads, an administrator writes. Until departments exist there is nothing to scope a manager’s authority to, and handing out the power to issue agent tokens company-wide - with no audit log yet to notice
    • is not a default worth shipping.
  • A token is shown once. The server keeps its SHA-256 and nothing else, so an issued token that was not written down is replaced, not recovered.

Structs§

AgentRow
An agent as the admin screens list it. Never the token.
IssuedAgent
The one response that carries a token, and the only time it exists.
NewAgent
NewUser
PasswordChange
Changes one’s own password.
UserPatch
A change to an existing person. Every field is optional; absent means “leave it alone” rather than “clear it”.
UserRow
A person as the admin screens list them.

Functions§

change_own_password
create_agent
Issues an agent token, shown once.
create_user
Creates a person.
list_agents
Lists someone’s agents, revoked ones included - a withdrawn token is part of the record of what happened.
list_users
Lists everyone. The one route a manager may call.
revoke_agent
Withdraws an agent’s token. The row stays, so its uploads keep an owner.
update_user
Changes a person: their name, role, password, or whether they are active.