feat(api): implement centralized audit logging#122
Open
David-patrick-chuks wants to merge 1 commit intoMissBlue00:mainfrom
Open
feat(api): implement centralized audit logging#122David-patrick-chuks wants to merge 1 commit intoMissBlue00:mainfrom
David-patrick-chuks wants to merge 1 commit intoMissBlue00:mainfrom
Conversation
|
@David-patrick-chuks is attempting to deploy a commit to the missblue00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@David-patrick-chuks 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
|
@David-patrick-chuks the ci/cd check failed, please resolve |
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
This PR adds a centralized audit logging system to
apps/apito capture a tamper-evident trail of sensitive administrative and financial actions. It supports audit events for authentication, API key changes, payment initiation, redemptions, and webhook configuration changes, while recording the required fields for each entry.Related Issue
Closes #22
Changes
⚙️ Audit Logging System
[ADD]
apps/api/src/audit-log/audit-log.service.tsauth.login,auth.register,api_key.changed,payment.initiated,redemption.created, andwebhook.config_changed.id,merchant_id,event_type,metadata,ip, andtimestamp.previous_hashandentry_hash.[ADD]
apps/api/src/audit-log/interfaces/audit-event.interface.ts[ADD]
apps/api/src/audit-log/interfaces/audit-log.interface.ts🧩 Audit Logging API
[ADD]
apps/api/src/audit-log/audit-log.controller.ts[ADD]
apps/api/src/audit-log/audit-log.module.ts🏗️ Application Wiring
apps/api/src/app.module.tsAuditLogModulein the API application.🔐 Configuration
apps/api/.env.exampleAUDIT_LOG_CHAIN_SECRETfor keyed tamper-evident hashing.🧪 Tests
apps/api/src/audit-log/audit-log.service.spec.tsVerification Results
id,merchant_id,event_type,metadata,ip, andtimestampHow to Test
Screenshots
✅ Audit log tests pass
A screenshot of:
pnpm --filter api test -- --runInBand audit-log.service.spec.ts✅ API build passes
A screenshot of:
✅ Audit log entry can be recorded
A screenshot of:
✅ Audit trail verification works
A screenshot of: