Skip to main content

Module audit

Module audit 

Source
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§

AdminAction
LogEntry

Enums§

ActionType
AuditEvent
Typed representation of every audit action_type the framework emits for authority + identity + recovery actions.

Functions§

ensure_table
Ensure the rustio_admin_actions table and its indexes exist. Idempotent. Depends on rustio_users existing first.
for_object
All actions for one (model, object_id), newest first.
recent
Fetch the most recent limit admin 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.