Skip to content

IA-939 : add activity log, session management, and profile photo endpoint

khadija.elbachouri a demandé de fusionner feature/IA-939 vers develop

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 UserStatusHistory entries, exposed through GET /users/activity-log
  • Session Management: Register, list, and revoke active user sessions with Keycloak integration, exposed through:
    • GET /users/sessions
    • DELETE /users/sessions/{tokenId}
    • DELETE /users/sessions/others
  • Admin Profile Photo Endpoint: Dedicated PUT /admins/current-user/photo endpoint to handle photo upload/delete and visibility separately from profile info update

Modified Files

  • UserServiceImpl — added activity logging in changePassword and saveTwoFactorPreference
  • AdminServiceImpl — added activity logging in updateAdmin and updateCurrentAdmin, added updateCurrentAdminPhoto implementation
  • AdminController — added PUT /current-user/photo endpoint
  • ApiPaths — added CURRENT_USER_PHOTO, ACTIVITY_LOG, SESSIONS constants

New Files

  • HistoryService / HistoryServiceImpl / HistoryController
  • UserSessionRepository
  • UserStatusHistoryRepository (updated with custom query)
  • UserActivityResponse / UserSessionResponse
  • UserSession entity

Rapports de requête de fusion