Skip to content

[Backend] JWT-protected admin dispute resolve/reject endpoints are not audit-logged #13

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

The API-key admin mutations (check-defaults, reindex, webhooks) attach auditLog, but the JWT-protected dispute endpoints POST /disputes/:disputeId/resolve and /disputes/:disputeId/reject in src/routes/adminRoutes.ts have no auditLog even though they change loan default status.

Acceptance criteria

  • Attach the auditLog middleware to the dispute resolve and reject routes
  • Ensure the acting admin identity (JWT publicKey) is recorded
  • Confirm sensitive fields stay redacted by the existing sanitizer
  • Add a test asserting an audit_logs row is written for a resolve action

Files to touch

  • src/routes/adminRoutes.ts
  • src/middleware/auditLog.ts
  • src/controllers/adminDisputeController.ts

Out of scope

  • Audit log retention policy
  • Audit log query UI

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't workingenhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions