Skip to main content

Module users

Module users 

Source
Expand description

Operator management for the web admin: create, list, re-password, set the privilege tier, enable, disable, delete, and the password check the login path runs.

The operation layer, not a front end: no printing, no HTTP, no terminal. src/cli/webadmin.rs and crates/admin/src/webadmin/handlers/session.rs both dispatch here, which is what keeps the password policy, the duplicate check and the rehash-on-login identical between them.

Enums§

AuthOutcome
The result of checking a username and password.
UserDeleteOutcome
What confirm_delete_user did.
UserError
Why creating or re-passwording an operator failed.

Functions§

authenticate
Checks a username and password, re-hashing the stored digest if it was written under parameters this build has moved past.
change_own_password
Changes an operator’s own password, keeping the session that requested it alive and revoking every other one.
confirm_delete_user
delete_user, asking first and naming what goes with it.
create_user
Creates an operator at role, or at AdminRole::Admin when none is named.
delete_user
Deletes an operator, cascading to their sessions. false when there was no such user.
list_users
One page of the operators, oldest first, plus the total the table holds.
operators_without_a_contact
How many operators have no contact_email on file.
revoke_sessions
Revokes every session one operator holds, without touching the account. None when there is no such user.
set_contact_email
Sets (Some) or clears (None / empty / whitespace) the address an operator receives security notifications at. Some is validated as a mailbox — the same parse acme_proxy_jobs::notify::email does before it sends — so a malformed address is refused here rather than becoming a permanent delivery failure later. Not a credential: sessions are left alone.
set_password
Replaces an operator’s password and revokes every session they hold.
set_role
Sets an operator’s privilege tier and revokes every session they hold.
set_status
Moves an operator between active and disabled.
valid_username
Whether a normalized username is one the web admin can address.