feat: audit read API and retention pruning #30

Closed
opened 2026-07-04 15:34:30 +00:00 by a73x · 1 comment
a73x commented 2026-07-04 15:34:30 +00:00 (Migrated from git.a73x.sh)

[claude 2026-07-04] Fixes 22de4ebf (DEF-4). GET /api/v1/audit?limit=N (admin, newest-first, detail as raw JSON, limit capped 1000); store.PruneAudit(olderThan); audit_retention config default 2160h, 0 disables; pruned at startup + daily (shares the housekeeping ticker with the cert nudge). TDD: prune test with controlled timestamps; endpoint test (rows, limit, 401). E2E to follow in the consolidated real-binary pass (mint -> API rows; restart with tiny retention -> old pruned). make ci green.


Migrated from git-collab patche 8de9b58d424be30a889e349bc6a0a094028ce388.

Original author: a73x dev@a73x.sh.

Fixes git-collab issue 22de4ebf

Historical merged patch. The original head and merge commits were not recorded. Forgejo cannot display a pull request without a head commit, so this record is preserved as a closed issue. The original diff is unavailable; no commit was guessed.

Original branches: fix/def4-audit-retention → main.

[claude 2026-07-04] Fixes 22de4ebf (DEF-4). GET /api/v1/audit?limit=N (admin, newest-first, detail as raw JSON, limit capped 1000); store.PruneAudit(olderThan); audit_retention config default 2160h, 0 disables; pruned at startup + daily (shares the housekeeping ticker with the cert nudge). TDD: prune test with controlled timestamps; endpoint test (rows, limit, 401). E2E to follow in the consolidated real-binary pass (mint -> API rows; restart with tiny retention -> old pruned). make ci green. --- Migrated from git-collab patche `8de9b58d424be30a889e349bc6a0a094028ce388`. Original author: a73x <dev@a73x.sh>. Fixes git-collab issue `22de4ebf` **Historical merged patch.** The original head and merge commits were not recorded. Forgejo cannot display a pull request without a head commit, so this record is preserved as a closed issue. The original diff is unavailable; no commit was guessed. Original branches: `fix/def4-audit-retention` → `main`.
a73x commented 2026-07-04 17:55:57 +00:00 (Migrated from git.a73x.sh)

Original review: comment (revision not recorded)

[claude 2026-07-04] Reviewer verdict: approve with changes — all applied: PruneAudit guards olderThan<=0 (store-level contract test), schema comment made honest (incl. the RFC3339 lexicographic invariant), limit reject-not-clamp confirmed + 400-path table test, negative audit_retention rejected at startup. Reviewer verified RawMessage fallback, lexicographic DELETE soundness, admin gating. E2E: real binary — mint -> rows via GET /api/v1/audit (hash prefixes only), 401 unauth, limit=1001 -> 400, backdated row pruned at restart (log + API). Merging per session goal.

**Original review: comment** (revision not recorded) [claude 2026-07-04] Reviewer verdict: approve with changes — all applied: PruneAudit guards olderThan<=0 (store-level contract test), schema comment made honest (incl. the RFC3339 lexicographic invariant), limit reject-not-clamp confirmed + 400-path table test, negative audit_retention rejected at startup. Reviewer verified RawMessage fallback, lexicographic DELETE soundness, admin gating. E2E: real binary — mint -> rows via GET /api/v1/audit (hash prefixes only), 401 unauth, limit=1001 -> 400, backdated row pruned at restart (log + API). Merging per session goal.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
a73x/eitri#30
No description provided.