Skip to main content

Module action_tools

Module action_tools 

Source
Expand description

The confirm-and-execute primitive: a client tool whose confirmed answer runs a privileged mutation on the server instead of only rendering data the client already had.

ClientChatbotTool cannot carry this: its parse_response/output are synchronous and get no PgConnection, no ApplicationConfiguration and no proof of who is acting. ConfirmableActionTool is the one place that threads those in, so every action tool gets the same confirm-parsing, exactly-once guard, transaction handling and audit write instead of a hand-rolled copy each.

Modules§

edit_user_account
generate_password_reset_link
reset_exercises
update_certificate
update_cheating_status

Structs§

ActionAuditFields
What the audit row records about a confirmed action, beyond who ran it and what tool it was.
ConfirmAnswer
The one answer shape every action tool accepts.
ExecutedAction
What executing a confirmed action produced.

Traits§

ConfirmableActionTool
A client tool whose confirmed answer performs a privileged mutation on the server.

Functions§

display_field_matches
Unicode-aware case-insensitive equality for a model-supplied display field against its current database value. eq_ignore_ascii_case would reject a match for cased letters outside ASCII (e.g. Finnish å/Ö) that differ only in case, spuriously refusing a genuine match.
verify_display_field
Re-verifies a model-supplied display field against actual, per ConfirmableActionTool::execute’s contract: refuses with a descriptive error naming field_name and rerun_tool instead of mutating on a mismatch.