Skip to content

feat: add per-endpoint audit logs for /api/audit mutations (closes #878) - #1000

Merged
greatest0fallt1me merged 3 commits into
CalloraOrg:mainfrom
Kaycee276:fix-878-audit-logs
Jul 29, 2026
Merged

feat: add per-endpoint audit logs for /api/audit mutations (closes #878)#1000
greatest0fallt1me merged 3 commits into
CalloraOrg:mainfrom
Kaycee276:fix-878-audit-logs

Conversation

@Kaycee276

Copy link
Copy Markdown
Contributor

closes #878

Description

This PR resolves the GrantFox FWC26 campaign backend issue (#878) by introducing the /api/audit router. State-changing mutations on this endpoint now securely and reliably persist audit rows.

Changes

  • Implemented src/routes/audit.ts providing CRUD mutations for audit configuration.
  • Added auditService.record() calls to capture (actor, action, before/after) snapshots on every mutation.
  • Best-effort audit logging: failing to write the audit log gracefully falls back to structured logging without crashing the user request.
  • Mounted the router to /api/audit inside src/routes/index.ts.
  • Implemented comprehensive Jest tests in src/routes/audit.test.ts to guarantee stability and verify >90% coverage for changed lines.

Verification

  • npm run test verifies the correct behavior.
  • Lint and styles adhere to codebase standards.
  • Validation checks boundary input securely.

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Kaycee276 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@greatest0fallt1me
greatest0fallt1me merged commit e6924f4 into CalloraOrg:main Jul 29, 2026
1 check passed
@greatest0fallt1me

Copy link
Copy Markdown
Contributor

LGTM ✅ green CI, clean work — merging!

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 per-endpoint audit log for /api/audit mutations [b#013]

2 participants