Skip to content

Commit

Permalink
Issue #1046
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-stastny committed Sep 16, 2024
1 parent f857e53 commit c5462d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public class AnonymizationSupport {
"remoteAddr",
"eduPersonPrincipalName",
"email",
"preffered_user_name");
"preffered_user_name",
"ip_address");

public static JSONObject annonymizeObject(List<String> annonymizationKeys, String line) {
JSONObject lineJSONObject = new JSONObject(line);
Expand Down

0 comments on commit c5462d9

Please sign in to comment.