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

Implementation of @CreatedBy and @UpdatedBy #1537

Merged
merged 18 commits into from
Jan 5, 2024
Merged

Conversation

jeremyg484
Copy link
Contributor

Initial implementation of support for identity auditing with Micronaut Data through addition of @CreatedBy and @UpdatedBy annotations.

@jeremyg484 jeremyg484 self-assigned this Dec 14, 2023
@jeremyg484 jeremyg484 marked this pull request as draft December 14, 2023 02:21
@jeremyg484
Copy link
Contributor Author

@sdelamo I still need to add docs, but here is my initial implementation if you'd like to go ahead and take a look. I split it out into its own module due to the Micronaut Data dependencies, but we can move it elsewhere if you prefer.

The implementation is based on some helpful support for similar features from the Micronaut Data runtime module (See the usage of AutoPopulatedEntityEventListener).

I opted to simply use the ConversionService and a default TypeConverter implementation for the mapping of Principal to String - this is easily overridden by the user and would allow for conversion to more complex types if they prefer.

@jeremyg484 jeremyg484 marked this pull request as ready for review December 14, 2023 20:35
@sdelamo sdelamo requested review from graemerocher and removed request for sdelamo December 18, 2023 21:34
@sdelamo
Copy link
Contributor

sdelamo commented Jan 5, 2024

I registered the converter via a TypeConverterRegistrar as recommended here: micronaut-projects/micronaut-core#10315

Copy link

sonarcloud bot commented Jan 5, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

3 New issues
0 Security Hotspots
90.7% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@sdelamo sdelamo merged commit 7ad6d49 into master Jan 5, 2024
17 checks passed
@sdelamo sdelamo deleted the created-by-updated-by-impl branch January 5, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants