Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DMP-4381: Automatically update createdBy and lastModifiedBy when persisting entities to the database #2308

Merged
merged 36 commits into from
Jan 17, 2025

Conversation

Ben-Edwards-cgi
Copy link
Contributor

Links

Jira

Change description

Git Diff Summary

This Git Diff introduces enhancements to the authentication and entity management components of the application. Key changes include the addition of auditing capabilities for tracking user account interactions in the AuthenticationConfiguration, CreatedBaseEntity, and CreatedModifiedBaseEntity classes.

Highlights

  • AuthenticationConfiguration Updates:

    • Added an AuditorAware<UserAccountEntity> bean to provide information about the currently authenticated user.
    • Introduced error handling for retrieving user accounts.
  • Entity Changes:

    • In CreatedBaseEntity, added @CreatedBy annotation to the createdBy field to track the user who created the entity.
    • In CreatedModifiedBaseEntity, added @LastModifiedBy annotation to the lastModifiedBy field to track the user who last modified the entity.

These modifications enhance the tracking of user interactions with entities, improving the auditing capability of the application.

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[X] No

Copy link
Contributor

@chrisbellingham-hmcts chrisbellingham-hmcts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if this PR should also include removal of any code that explicitly sets the createdBy and lastModifiedBy values in our various services/components, such that this new mechanism gets used?

@Ben-Edwards-cgi Ben-Edwards-cgi enabled auto-merge (squash) January 17, 2025 14:41
@Ben-Edwards-cgi Ben-Edwards-cgi merged commit 7c6694e into master Jan 17, 2025
10 checks passed
@Ben-Edwards-cgi Ben-Edwards-cgi deleted the DMP-4381 branch January 17, 2025 16:39
jackmaloney pushed a commit that referenced this pull request Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants