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
Added REST API logging #476
Conversation
d5eaa34
to
8fd46b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a lot of knowledge in the field but it seems to me that the md5 is not very secure and it might be better to use BCryptPasswordEncoder provided by Spring Security to encode passwords.
There is few sonar issues to fix too.
@Column(name = "email", nullable = true, updatable = false) | ||
@Getter | ||
@Setter | ||
private String emai; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "email" would be better ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DOH! Fixed.
...-rest-api/src/main/java/org/comixedproject/authentication/ComiXedAuthenticationProvider.java
Show resolved
Hide resolved
comixed-rest-api/src/main/java/org/comixedproject/authentication/ComiXedUserDetailsService.java
Show resolved
Hide resolved
comixed-rest-api/src/main/java/org/comixedproject/authentication/ComiXedUserDetailsService.java
Outdated
Show resolved
Hide resolved
response.setResult(new GetTaskAuditLogResponse()); | ||
response.getResult().setEntries(entries); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set the result then get the result to set entries seems strange for me.
Wouldn't it be more understandable to do it like this:
try {
final List entries = this.taskService.getAuditLogEntriesAfter(cutoff);
GetTaskAuditLogResponse taskAuditLogResponse = new GetTaskAuditLogResponse();
taskAuditLogResponse.setEntries(entries);
if (!entries.isEmpty()) {
taskAuditLogResponse.setLatest(entries.get(entries.size() - 1).getStartTime());
}
response.setResult(taskAuditLogResponse);
response.setSuccess(true);
comixed-rest-api/src/main/java/org/comixedproject/authentication/AuthenticationConstants.java
Outdated
Show resolved
Hide resolved
6e96e05
to
df634f4
Compare
I have merged #479 before this PR. There are now some conflicts to be solved... |
* Added a caching request wrapper so the content can be re-read. * Added additional unit tests.
df634f4
to
3aecd73
Compare
SonarCloud Quality Gate failed. 0 Bugs |
I agreed about MD5 vs BCrypt. Can you open that suggestion in a separate ticket? This story was solely meant to provide the REST audit logging. |
Status
READY
Migrations
YES
Description
Wraps annotated REST APIs and logs their runtime, request and response content, and any exceptions.