Skip to content

Admin portal audit#80

Merged
victor-cuevas merged 2 commits intofeat/admin-portalfrom
feat/admin-audit
Apr 17, 2026
Merged

Admin portal audit#80
victor-cuevas merged 2 commits intofeat/admin-portalfrom
feat/admin-audit

Conversation

@victor-cuevas
Copy link
Copy Markdown
Contributor

No description provided.

@victor-cuevas victor-cuevas force-pushed the feat/admin-auth branch 2 times, most recently from b2b68b4 to 4b32ce1 Compare April 13, 2026 13:58
Base automatically changed from feat/admin-auth to feat/admin-portal April 16, 2026 11:12
@victor-cuevas victor-cuevas marked this pull request as ready for review April 16, 2026 11:15
…anup

Add audit logging to the admin portal:

- Store layer: InsertAuditEntry, ListAuditEntries (paginated, filtered
  by user/action/instance/date range, FTS5 full-text search on detail),
  DeleteAuditEntriesBefore for retention cleanup
- Migration v2: FTS5 virtual table with insert/delete/update triggers
  for automatic index sync
- REST API: GET /api/audit with query params (user, action, instance_id,
  from, to, q, page, per_page) capped at 100 per page
- Write-on-action: instance create/update/delete, login, logout, and
  password change all produce audit entries with contextual detail
- Retention cleanup: background goroutine runs immediately on startup
  then daily, configurable via audit.retention_days (default 90, 0 to
  keep forever)
Filterable, paginated audit log table with debounced FTS5 search,
action type dropdown, and date range pickers. Extracts logic into
pure functions (utils/audit.js) and composable (useAuditLog.js).

- Date filters use local-timezone boundaries, not UTC
- Stale response guard discards out-of-order fetches
- 25 utility + 11 composable tests (165 total passing)
Comment thread admin/api/audit.go
@victor-cuevas victor-cuevas merged commit 8de6e45 into feat/admin-portal Apr 17, 2026
13 checks passed
@victor-cuevas victor-cuevas deleted the feat/admin-audit branch April 17, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants