feat(server-impl): refactoring resources JAX-RS, corrections AuditService/SyncService/UserService, ajout entites Sync et scripts Docker
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,17 +4,19 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.quarkus.jackson.ObjectMapperCustomizer;
|
||||
import jakarta.inject.Singleton;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Configuration Jackson pour ignorer les propriétés inconnues
|
||||
* Nécessaire pour la compatibilité avec les versions récentes de Keycloak
|
||||
* Configure Jackson globally to ignore unknown JSON properties.
|
||||
* This is required for forward compatibility with newer Keycloak versions (e.g. cpuInfo field).
|
||||
*/
|
||||
@Singleton
|
||||
@Slf4j
|
||||
public class JacksonConfig implements ObjectMapperCustomizer {
|
||||
|
||||
@Override
|
||||
public void customize(ObjectMapper objectMapper) {
|
||||
// Ignorer les propriétés inconnues pour compatibilité Keycloak
|
||||
log.info("### LIONS: Applying Jackson configuration for Keycloak compatibility ###");
|
||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package dev.lions.user.manager.config;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.quarkus.jackson.ObjectMapperCustomizer;
|
||||
import jakarta.inject.Singleton;
|
||||
import org.keycloak.representations.idm.RealmRepresentation;
|
||||
import org.keycloak.representations.idm.UserRepresentation;
|
||||
import org.keycloak.representations.idm.RoleRepresentation;
|
||||
|
||||
/**
|
||||
* Customizer pour Jackson afin d'ignorer les propriétés inconnues dans les
|
||||
* représentations Keycloak.
|
||||
* Cela évite les erreurs de désérialisation (comme bruteForceStrategy) lorsque
|
||||
* le serveur Keycloak
|
||||
* est plus récent que les bibliothèques clients.
|
||||
*/
|
||||
@Singleton
|
||||
public class KeycloakJacksonCustomizer implements ObjectMapperCustomizer {
|
||||
|
||||
@Override
|
||||
public void customize(ObjectMapper objectMapper) {
|
||||
// En plus de la configuration globale, on force les Mix-ins pour les classes
|
||||
// Keycloak critiques
|
||||
objectMapper.addMixIn(RealmRepresentation.class, IgnoreUnknownMixin.class);
|
||||
objectMapper.addMixIn(UserRepresentation.class, IgnoreUnknownMixin.class);
|
||||
objectMapper.addMixIn(RoleRepresentation.class, IgnoreUnknownMixin.class);
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
abstract static class IgnoreUnknownMixin {
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package dev.lions.user.manager.config;
|
||||
|
||||
import io.quarkus.arc.profile.IfBuildProfile;
|
||||
import io.quarkus.runtime.StartupEvent;
|
||||
import jakarta.enterprise.event.Observes;
|
||||
import jakarta.inject.Inject;
|
||||
@@ -21,6 +22,7 @@ import java.util.*;
|
||||
* S'exécute au démarrage de l'application en mode dev
|
||||
*/
|
||||
@Singleton
|
||||
@IfBuildProfile("dev")
|
||||
@Slf4j
|
||||
public class KeycloakTestUserConfig {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user