Skip to content

feat: add audit logging to tenant and destination CRUD#847

Open
alexluong wants to merge 1 commit intomainfrom
feat/audit-log-entity-crud
Open

feat: add audit logging to tenant and destination CRUD#847
alexluong wants to merge 1 commit intomainfrom
feat/audit-log-entity-crud

Conversation

@alexluong
Copy link
Copy Markdown
Collaborator

Summary

  • Adds logger.Audit() calls to all tenant and destination mutation handlers (create, update, delete, enable, disable)
  • Adds test suite using zap/zaptest/observer to verify audit log emission and field correctness
  • Includes a no-op test confirming disable on an already-disabled destination does not emit

Closes #235

Coverage

All production mutation paths are now audited:

  • API handlers (this PR): tenant upsert/delete, destination create/update/delete/enable/disable
  • Alert monitor (already covered): automatic destination disable on consecutive failures

Test plan

  • go test ./internal/apirouter/... -run TestAuditLog — all 9 cases pass
  • Full ./internal/apirouter/... suite passes
  • Verify audit logs appear in structured JSON output with AUDIT_LOG=true

🤖 Generated with Claude Code

Closes #235

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Add audit log to entity CRUD

2 participants