Skip to content

feat(admin): add audit-log viewer with filters, pagination, and export (#768) - #780

Merged
dotunv merged 3 commits into
Savitura:mainfrom
ZacLou:feat/admin-audit-log-768
Sep 7, 2026
Merged

feat(admin): add audit-log viewer with filters, pagination, and export (#768)#780
dotunv merged 3 commits into
Savitura:mainfrom
ZacLou:feat/admin-audit-log-768

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Closes #768.

Summary

Adds an admin-facing audit-log API with filtering, pagination, and CSV/JSON export.

Backend changes

  • services/auditService.js: append-only audit logging with metadata sanitization (passwords/tokens/secrets redacted), query builder with actor/action/resourceType/date filters, and CSV/JSON export
  • routes/auditLogs.js: GET /api/admin/audit-logs (list + pagination) and GET /api/admin/audit-logs/export (download)
  • routes/admin.js: mounts audit-logs router under existing /api/admin prefix

Tests

  • auditLogs.test.js: covers listing, action filtering, pagination limits/offset, JSON export, CSV export

Security

  • Sensitive metadata keys (password, secret, token, apiKey, privateKey, seed, mnemonic, otp, totp) are automatically redacted to [REDACTED]
  • No update or delete path exists by design — logs are append-only
  • Route is protected by existing requireAuth + requireRole(admin) middleware

ZacLou and others added 3 commits September 6, 2026 09:08
Savitura#768)

- Add auditService with append-only log writing, metadata sanitization,
  filtering (actor, action, resourceType, date range), pagination, and
  CSV/JSON export
- Add /api/admin/audit-logs route (list) and /api/admin/audit-logs/export
- Mount audit-logs router under existing /api/admin prefix
- Add comprehensive tests for listing, filtering, pagination, and export
- Sensitive fields (password, token, secret, etc.) are redacted from metadata
…tura#757)

- Add creator_refunds table with status tracking (pending/processing/completed/failed)
- Add GET /api/admin/refunds (list with filters and pagination)
- Add POST /api/admin/refunds (create refund request)
- Add PATCH /api/admin/refunds/:id (update status and tx hash)
- Add tests for list, create, and update
- Mount under existing /api/admin prefix
@dotunv
dotunv merged commit c1bebc9 into Savitura:main Sep 7, 2026
1 of 3 checks passed
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.

feat: Admin audit-log viewer with filters and export

2 participants