Expand description
Admin action log — every create / update / delete driven through
the admin writes a row to rustio_admin_actions. The audit trail
powers two user-visible surfaces:
GET /admin/history— project-wide timeline.GET /admin/<model>/<id>/history— per-object history.
§Integrity
record rejects entries that are missing any of user_id,
model_name, or object_id. The caller gets an
Error::Internal so the admin handler can fail loudly rather
than silently losing the audit trail.
Structs§
Enums§
- Action
Type - Audit
Event - Typed representation of every audit
action_typethe framework emits for authority + identity + recovery actions.
Functions§
- ensure_
table - Ensure the
rustio_admin_actionstable and its indexes exist. Idempotent. Depends onrustio_usersexisting first. - for_
object - All actions for one
(model, object_id), newest first. - recent
- Fetch the most recent
limitadmin actions, newest first. - record
- Write one row to the action log. Validates required fields before touching the DB so a broken audit pipeline becomes visible.