fix: resolve actor name from Logto for audit log entries
All checks were successful
CI / build (push) Successful in 50s
CI / docker (push) Successful in 32s

AuditService now looks up username/name/email from Logto Management API
when actorEmail is null, with an in-memory cache to avoid repeated calls.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-10 17:47:43 +02:00
parent 0a1e848ef7
commit 2607ef5dbe
3 changed files with 54 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
package net.siegeln.cameleer.saas.audit;
import net.siegeln.cameleer.saas.identity.LogtoManagementClient;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -20,11 +21,14 @@ class AuditServiceTest {
@Mock
private AuditRepository auditRepository;
@Mock
private LogtoManagementClient logtoClient;
private AuditService auditService;
@BeforeEach
void setUp() {
auditService = new AuditService(auditRepository);
auditService = new AuditService(auditRepository, logtoClient);
}
@Test