IA-939 : add activity log, session management, and profile photo endpoint
Summary
This MR introduces three main features to the user management service: activity history tracking, active session management, and a dedicated admin profile photo update endpoint.
Changes
New Features
-
Activity Log: Track user actions (password change, 2FA toggle,
photo update, profile edit) via
UserStatusHistoryentries, exposed throughGET /users/activity-log -
Session Management: Register, list, and revoke active user sessions
with Keycloak integration, exposed through:
GET /users/sessionsDELETE /users/sessions/{tokenId}DELETE /users/sessions/others
-
Admin Profile Photo Endpoint: Dedicated
PUT /admins/current-user/photoendpoint to handle photo upload/delete and visibility separately from profile info update
Modified Files
-
UserServiceImpl— added activity logging inchangePasswordandsaveTwoFactorPreference -
AdminServiceImpl— added activity logging inupdateAdminandupdateCurrentAdmin, addedupdateCurrentAdminPhotoimplementation -
AdminController— addedPUT /current-user/photoendpoint -
ApiPaths— addedCURRENT_USER_PHOTO,ACTIVITY_LOG,SESSIONSconstants
New Files
-
HistoryService/HistoryServiceImpl/HistoryController UserSessionRepository-
UserStatusHistoryRepository(updated with custom query) -
UserActivityResponse/UserSessionResponse -
UserSessionentity