Skip to content

feat(audit): append-only audit log for state-changing payments operations (#549) - #561

Open
ZacLou wants to merge 1 commit into
Agentpay-Org:mainfrom
ZacLou:feat/audit-log-549
Open

feat(audit): append-only audit log for state-changing payments operations (#549)#561
ZacLou wants to merge 1 commit into
Agentpay-Org:mainfrom
ZacLou:feat/audit-log-549

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 5, 2026

Copy link
Copy Markdown

Closes #549.

Adds an AuditLog class that records every state-changing payment operation with actor, action, target, before/after summary, and timestamp. Entries are append-only and immutable.

Changes

  • New src/auditLog.ts: AuditLog with append(), queryByTarget(), queryByActor(), and redactSecrets() for PII/secrets removal.
  • InMemoryChargeStore: accepts an optional AuditLog and records charge.create entries automatically.
  • New endpoints: GET /api/v1/charges/:chargeId/audit for target history, GET /api/v1/audit?actor=... for actor-scoped queries with pagination.
  • Tests: cover mutation logging, read exclusion, target/actor queries, pagination, secret redaction, and ordering.

@ZacLou
ZacLou force-pushed the feat/audit-log-549 branch from 58f1109 to f5cdab1 Compare September 7, 2026 05:09
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.

append-only audit log for state-changing payments operations

1 participant