|
40 | 40 | import java.util.List;
|
41 | 41 | import java.util.Set;
|
42 | 42 | import java.util.UUID;
|
43 |
| -import java.util.function.Function; |
44 | 43 |
|
45 | 44 | @Path("/auditlog")
|
46 | 45 | public class AuditLogResource {
|
@@ -93,23 +92,6 @@ public List<AuditEventDto> getAllEvents(@QueryParam("startDate") Instant startDa
|
93 | 92 | return auditEventRepo.findAllInPeriod(startDate, endDate, type, paginationId, order.equals("asc"), pageSize).map(AuditEventDto::fromEntity).toList();
|
94 | 93 | }
|
95 | 94 |
|
96 |
| - @GET |
97 |
| - @Path("/last-vault-key-retrieve") |
98 |
| - @RolesAllowed("admin") |
99 |
| - @Produces(MediaType.APPLICATION_JSON) |
100 |
| - @Operation(summary = "list last vault key retrieve auditlog entry by device id", description = "list last vault key retrieve auditlog entry by device id") |
101 |
| - @Parameter(name = "deviceIds", description = "list of deviceIds", in = ParameterIn.QUERY) |
102 |
| - @APIResponse(responseCode = "200", description = "Body contains list of events") |
103 |
| - @APIResponse(responseCode = "402", description = "Community license used or license expired") |
104 |
| - @APIResponse(responseCode = "403", description = "requesting user does not have admin role") |
105 |
| - public List<VaultKeyRetrievedEventDto> lastVaultKeyRetrieve(@QueryParam("deviceIds") List<String> deviceIds) { |
106 |
| - if (!license.isSet() || license.isExpired()) { |
107 |
| - throw new PaymentRequiredException("Community license used or license expired"); |
108 |
| - } |
109 |
| - Function<VaultKeyRetrievedEvent, VaultKeyRetrievedEventDto> mapper = e -> new VaultKeyRetrievedEventDto(e.getId(), e.getTimestamp(), e.getType(), e.getRetrievedBy(), e.getVaultId(), e.getResult(), e.getIpAddress(), e.getDeviceId()); |
110 |
| - return auditEventRepo.findLastVaultKeyRetrieve(deviceIds).map(mapper).toList(); |
111 |
| - } |
112 |
| - |
113 | 95 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
|
114 | 96 | @JsonSubTypes({ //
|
115 | 97 | @JsonSubTypes.Type(value = DeviceRegisteredEventDto.class, name = DeviceRegisteredEvent.TYPE), //
|
|
0 commit comments