diff --git a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/statistics/StatisticsResource.java b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/statistics/StatisticsResource.java index 5e399a1ad..9c0565888 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/statistics/StatisticsResource.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/statistics/StatisticsResource.java @@ -1082,8 +1082,17 @@ public Response exportLogs(@QueryParam("dateFrom") String dateFrom, @QueryParam( String userSessionAttributes = doc.getString("user_session_attributes"); JSONObject changedObj = AnonymizationSupport.annonymizeObject(keys, userSessionAttributes); doc.put("user_session_attributes", changedObj.toString()); + + for (String key : keys) { + if (doc.has(key)) { + Object object = doc.get(key); + String hashVal = AnonymizationSupport.hashVal(object.toString()); + doc.put(key, hashVal); + } + } + } - return Response.ok().entity(string).build(); + return Response.ok().entity(allResp.toString()).build(); } else { throw new BadRequestException("Expecting 'dateFrom' and 'dateTo'"); } diff --git a/shared/common/src/main/java/cz/incad/kramerius/gdpr/AnonymizationSupport.java b/shared/common/src/main/java/cz/incad/kramerius/gdpr/AnonymizationSupport.java index b5e218cd8..d30161e0f 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/gdpr/AnonymizationSupport.java +++ b/shared/common/src/main/java/cz/incad/kramerius/gdpr/AnonymizationSupport.java @@ -42,7 +42,8 @@ public class AnonymizationSupport { "remoteAddr", "eduPersonPrincipalName", "email", - "preffered_user_name"); + "preffered_user_name", + "ip_address"); public static JSONObject annonymizeObject(List annonymizationKeys, String line) { JSONObject lineJSONObject = new JSONObject(line);