Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
4f3bc896ef
1 changed files with 1 additions and 14 deletions
|
|
@ -1,8 +1,5 @@
|
|||
package ru.micord.ervu.audit.service.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
|
|
@ -32,8 +29,6 @@ import ru.micord.ervu.util.NetworkUtils;
|
|||
@Conditional(AuditEnabledCondition.class)
|
||||
public class BaseAuditService implements AuditService {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(BaseAuditService.class);
|
||||
private static final List<String> IP_HEADERS =
|
||||
Arrays.asList("X-Forwarded-For", "WL-Proxy-Client-IP", "HTTP_CLIENT_IP", "HTTP_X_FORWARDED_FOR");
|
||||
|
||||
|
||||
private final AuditKafkaPublisher auditPublisher;
|
||||
|
|
@ -89,12 +84,6 @@ public class BaseAuditService implements AuditService {
|
|||
LOGGER.info("Thread {} - server host name {} got in {} ms", Thread.currentThread().getId(), serverHostName,
|
||||
System.currentTimeMillis() - startTime);
|
||||
|
||||
startTime = System.currentTimeMillis();
|
||||
String clientHostName = NetworkUtils.getHostName(clientIp);
|
||||
LOGGER.info("Thread {} - client host name {} got in {} ms", Thread.currentThread().getId(), clientHostName,
|
||||
System.currentTimeMillis() - startTime);
|
||||
startTime = System.currentTimeMillis();
|
||||
|
||||
AuditAuthorizationEvent event = new AuditAuthorizationEvent(
|
||||
personModel.getPrnsId(),
|
||||
DateUtils.getClientTimeFromRequest(request),
|
||||
|
|
@ -107,14 +96,12 @@ public class BaseAuditService implements AuditService {
|
|||
serverIp,
|
||||
serverHostName,
|
||||
clientIp,
|
||||
clientHostName
|
||||
clientIp
|
||||
);
|
||||
String message = convertToMessage(event);
|
||||
auditPublisher.publishEvent(authorizationTopic, message);
|
||||
LOGGER.info("Thread {} - event published in {} ms", Thread.currentThread().getId(),
|
||||
System.currentTimeMillis() - startTime);
|
||||
|
||||
IP_HEADERS.forEach(header -> LOGGER.info("Data from header: {} - {}", header, request.getHeader(header)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue