Skip to content

Write auditing: record api.entry_written (who-changed-what) - #2

Merged
DanMat merged 2 commits into
mainfrom
feat/write-audit
Aug 17, 2026
Merged

DanMat merged 2 commits into
mainfrom
feat/write-audit

Conversation

@DanMat

@DanMat DanMat commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Consumes core's api.entry_written (Write API Slice 3) so the audit log records who changed what over the API — the acting token, the collection, and the entry (slug) — not just failures.

  • Migration 002_audit_target adds a target column (the entry slug).
  • AuditRecorder maps write payloads (collectionresource, slugtarget) alongside the failure shape.
  • AuditView gains a Target column, an Entry written label, and a writes count in the 24h summary.

Tests: recorder maps a write; view renders one with its target; the boundary test asserts the entry_written listener + both migrations register. This makes api-advanced a consumer of the write-audit event.

🤖 Generated with Claude Code

DanMat and others added 2 commits August 17, 2026 05:44
Listens to core's api.entry_written (Slice 3) and records each create/update/
delete over the API — the acting token, the collection (resource) and the entry
(target = slug) — so the audit log is a full who-changed-what trail, not just
failures.

- migration 002_audit_target adds a `target` column (the entry slug).
- AuditRecorder maps a write payload (collection -> resource, slug -> target) as
  well as the failure shape; INSERT writes target.
- AuditView gains a Target column, an "Entry written" label, and a writes count
  in the 24h summary.

Tests: recorder maps a write; view renders a write with its target; boundary test
asserts the entry_written listener + both migrations register.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DanMat
DanMat merged commit 8c1cbc7 into main Aug 17, 2026
2 checks passed
@DanMat
DanMat deleted the feat/write-audit branch August 17, 2026 09:46
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.

1 participant