Repository navigation
feat(backend): implement credential audit logging - #125
Merged
Josie123-Dev merged 1 commit intoJul 22, 2026
Merged
Conversation
Implement comprehensive, tamper-evident audit logging for all credential operations (issuance, verification, revocation, updates, deletion). - AuditLog entity with HMAC hash-chaining so any post-hoc modification of a historical record is detectable - AuditInterceptor + @Audit decorator for automatic, boilerplate-free capture around credential handlers; wired into the identity and verification controllers - Admin-only query interface with filtering, pagination, integrity verification and JSON/CSV export - Background retention worker enforcing a configurable retention policy - Unit tests covering hash-chaining, tamper detection, filtered query, retention and export
|
@kris-nana is attempting to deploy a commit to the Josie's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Closes #50
What changed
Adds a comprehensive, tamper-evident credential audit logging system to the backend (
src/audit/).AuditLogentity capturing timestamp, actor, operation type (issued/revoked/verified/updated/deleted/shared/accessed), target credential id, client IP, status and non-sensitive metadata.AuditInterceptor+@Audit()decorator — credential handlers emit audit records with no per-handler boilerplate. Wired into the identity and verification controllers.GET /audit-logs/verify.GET /audit-logs) with filtering (actor, operation type, status, target, date range) and pagination.GET /audit-logs/export?format=json|csv) for compliance review.AuditRetentionService) purges entries older than a configurable window; also triggerable viaPOST /audit-logs/retention/sweep.Acceptance criteria
How to test
Unit tests cover hash-chaining, tamper detection, filtered query, retention and export.
Configuration
New env vars (see
backend/.env.example):AUDIT_HMAC_SECRET,ADMIN_WALLETS,AUDIT_RETENTION_DAYS,AUDIT_RETENTION_SWEEP_HOURS,AUDIT_RETENTION_ENABLED.See
backend/docs/AUDIT_LOGGING.mdfor full documentation.