implement user activity audit logging and enhance Swagger documentati…#496
Closed
feyishola wants to merge 2 commits intoPulsefy:mainfrom
Closed
implement user activity audit logging and enhance Swagger documentati…#496feyishola wants to merge 2 commits intoPulsefy:mainfrom
feyishola wants to merge 2 commits intoPulsefy:mainfrom
Conversation
…on Add AuditLog entity
|
@feyishola 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! 🚀 |
Contributor
|
Please fix workflow |
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.
…on Add AuditLog entity
Summary
Describe what changed and why.
Linked Issue
Closes #
Type of Change
Validation
Documentation
Checklist
feat/,fix/, ordocs/Description
This PR implements a comprehensive audit logging system to track sensitive user actions for security and support purposes, and completes the Swagger API documentation.
Features Added
New AuditLog entity storing: user ID, action type, timestamp, IP address, user agent, metadata, and status
AuditService providing methods to log actions and query audit logs with filtering/pagination
AuditController with endpoints:
GET /audit/logs - Query all audit logs (admin/support)
GET /audit/my-activity - Get current user's activity
GET /audit/my-activity/recent - Get recent activity for current user
LOGIN / LOGIN_FAILED - Email/password and Stellar wallet authentication
LOGOUT - Single device and all devices logout
PROFILE_UPDATE - User profile changes
ACCOUNT_LINK / ACCOUNT_UNLINK - Stellar account management
Added comprehensive Swagger decorators to ProfileResponseDto
Verified all existing controllers and DTOs have proper Swagger documentation
Files Changed
New: src/audit/ module (entity, DTOs, service, controller, module)
Modified: src/app.module.ts, src/auth/auth.module.ts, src/auth/auth.controller.ts
Modified: src/users/users.module.ts, src/users/users.controller.ts, src/users/dto/profile-response.dto.ts
Modified: src/users/users.controller.spec.ts (updated tests)
Testing
All 130 tests pass
Build completes successfully
Manual verification of audit log creation on login/logout/profile update
closes #490
closes #492