added auditing on allow-merge-account

This commit is contained in:
Sofia Papacharalampous 2024-06-11 16:12:49 +03:00
parent ce3277edb7
commit c46efc3c12
2 changed files with 6 additions and 1 deletions

View File

@ -103,6 +103,7 @@ public class AuditableAction {
public static final EventId User_RemoveCredentialRequest = new EventId(11012, "User_RemoveCredentialRequest"); public static final EventId User_RemoveCredentialRequest = new EventId(11012, "User_RemoveCredentialRequest");
public static final EventId User_RemoveCredentialConfirm = new EventId(11013, "User_RemoveCredentialConfirm"); public static final EventId User_RemoveCredentialConfirm = new EventId(11013, "User_RemoveCredentialConfirm");
public static final EventId User_DmpAssociatedQuery = new EventId(11014, "User_DmpAssociatedQuery"); public static final EventId User_DmpAssociatedQuery = new EventId(11014, "User_DmpAssociatedQuery");
public static final EventId User_AllowMergeAccount = new EventId(11015, "User_AllowMergeAccount");
public static final EventId Tenant_Query = new EventId(12000, "Tenant_Query"); public static final EventId Tenant_Query = new EventId(12000, "Tenant_Query");
public static final EventId Tenant_Lookup = new EventId(12001, "Tenant_Lookup"); public static final EventId Tenant_Lookup = new EventId(12001, "Tenant_Lookup");

View File

@ -299,7 +299,11 @@ public class UserController {
@GetMapping("mine/allow-merge-account/token/{token}") @GetMapping("mine/allow-merge-account/token/{token}")
public Boolean getUserTokenPermission(@PathVariable("token") String token) throws InvalidApplicationException, IOException { public Boolean getUserTokenPermission(@PathVariable("token") String token) throws InvalidApplicationException, IOException {
logger.debug(new MapLogEntry("confirm merge account to user").And("token", token)); logger.debug(new MapLogEntry("allow merge account to user").And("token", token));
this.auditService.track(AuditableAction.User_AllowMergeAccount, Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>("token", token)
));
return this.userTypeService.doesTokenBelongToLoggedInUser(token); return this.userTypeService.doesTokenBelongToLoggedInUser(token);
} }