feat: implement robust audit logging system for all admin actions (#495) - #558
Merged
Abdulazeem-code merged 2 commits intoAug 27, 2026
Merged
Conversation
|
@Kaizer4show is attempting to deploy a commit to the Abdulazeem's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Kaizer4show 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! 🚀 |
Owner
|
FIXED FAILED CHECKS |
…into feat/admin-audit-logging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Implements an immutable audit logging system for all admin actions. It introduces an
AuditLogtable in Prisma, an asynchronous Express middleware that intercepts mutating requests (POST, PUT, DELETE, PATCH), redacts sensitive data (passwords, tokens, keys, signatures), and captures request metadata (action, method, IP, user ID, status code).Related Issue
Closes #495
Changes
Database Schema & Prisma Client
stellar-payment-platform/prisma/schema.prismaAuditLogmodel with indexing oncreatedAt,userId, andaction.stellar-payment-platform/prismaClient.jsauditLogin fallback mock client for test environments.Middleware & Redaction
stellar-payment-platform/src/middleware/auditLog.jscreateAuditLogMiddlewareandauditLogMiddlewareto intercept mutating admin requests asynchronously onres.on('finish').password,secret,apiKey,token,signature,privateKey,seed, etc.).Admin Routes
stellar-payment-platform/src/routes/v1/adminRoutes.jsauditLogMiddlewareto intercept all mutating requests under/admin.GET /admin/audit-logsendpoint for admin audit log inspection.Documentation & Tests
README.mdGET /admin/audit-logsendpoint.stellar-payment-platform/tests/audit-log.test.jsGET /admin/audit-logs.Verification Results
AuditLogmodel inschema.prismaand generated Prisma clientauditLogMiddlewareintercepts all mutating methods (POST,PUT,DELETE,PATCH)password,apiKey,secret,token, etc.)