- Ajoute KeycloakRealmSetupService : auto-initialisation des rôles realm (admin, user_manager, user_viewer, role_manager...) et assignation du rôle user_manager au service account unionflow-server au démarrage (idempotent, retries, thread séparé pour ne pas bloquer le démarrage) → Corrige le 403 sur resetPassword / changement de mot de passe premier login - UserResource : étend les @RolesAllowed avec ADMIN/SUPER_ADMIN/USER pour permettre aux appels inter-services unionflow-server d'accéder aux endpoints sans être bloqués par le RBAC LUM ; corrige sendVerificationEmail (retourne Response) - application-dev.properties : service-accounts.user-manager-clients=unionflow-server - application-prod.properties : client-id, credentials.secret, token.audience, auto-setup - application-test.properties : H2 in-memory (plus besoin de Docker pour les tests) - pom.xml : H2 scope test, Jacoco 100% enforcement (exclusions MapStruct/repos/setup), annotation processors MapStruct+Lombok explicites - .gitignore + .env ajouté (.env exclu du commit) - script/docker/.env.example : variables KEYCLOAK_ADMIN_USERNAME/PASSWORD documentées
269 lines
9.5 KiB
XML
269 lines
9.5 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<parent>
|
|
<groupId>dev.lions.user.manager</groupId>
|
|
<artifactId>lions-user-manager-parent</artifactId>
|
|
<version>1.0.0</version>
|
|
</parent>
|
|
|
|
<artifactId>lions-user-manager-server-impl-quarkus</artifactId>
|
|
<packaging>jar</packaging>
|
|
|
|
<name>Lions User Manager - Server Implementation (Quarkus)</name>
|
|
<description>Implémentation serveur: Resources REST, Services, Keycloak Admin Client</description>
|
|
|
|
<repositories>
|
|
<repository>
|
|
<id>gitea-lionsdev</id>
|
|
<url>https://git.lions.dev/api/packages/lionsdev/maven</url>
|
|
<releases><enabled>true</enabled></releases>
|
|
<snapshots><enabled>true</enabled></snapshots>
|
|
</repository>
|
|
</repositories>
|
|
|
|
<dependencies>
|
|
<!-- Module API -->
|
|
<dependency>
|
|
<groupId>dev.lions.user.manager</groupId>
|
|
<artifactId>lions-user-manager-server-api</artifactId>
|
|
</dependency>
|
|
|
|
<!-- Quarkus Extensions -->
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-rest</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-rest-jackson</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-oidc</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-security</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-smallrye-openapi</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-smallrye-health</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-micrometer-registry-prometheus</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-hibernate-validator</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-rest-client-jackson</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-smallrye-fault-tolerance</artifactId>
|
|
</dependency>
|
|
|
|
<!-- Keycloak Admin Client - Version Quarkus compatible avec RESTEasy Reactive -->
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-keycloak-admin-rest-client</artifactId>
|
|
</dependency>
|
|
|
|
|
|
|
|
<!-- Optional: Database for audit logs -->
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-hibernate-orm-panache</artifactId>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-jdbc-postgresql</artifactId>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-flyway</artifactId>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
|
|
<!-- Lombok -->
|
|
<dependency>
|
|
<groupId>org.projectlombok</groupId>
|
|
<artifactId>lombok</artifactId>
|
|
</dependency>
|
|
|
|
<!-- MapStruct -->
|
|
<dependency>
|
|
<groupId>org.mapstruct</groupId>
|
|
<artifactId>mapstruct</artifactId>
|
|
</dependency>
|
|
|
|
<!-- Testing -->
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-junit5</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>io.rest-assured</groupId>
|
|
<artifactId>rest-assured</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.testcontainers</groupId>
|
|
<artifactId>junit-jupiter</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.testcontainers</groupId>
|
|
<artifactId>postgresql</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.mockito</groupId>
|
|
<artifactId>mockito-core</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.mockito</groupId>
|
|
<artifactId>mockito-junit-jupiter</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>io.quarkus</groupId>
|
|
<artifactId>quarkus-jdbc-h2</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
|
|
</dependencies>
|
|
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>io.quarkus.platform</groupId>
|
|
<artifactId>quarkus-maven-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<goals>
|
|
<goal>build</goal>
|
|
<goal>generate-code</goal>
|
|
<goal>generate-code-tests</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
<configuration>
|
|
<annotationProcessorPaths>
|
|
<path>
|
|
<groupId>org.mapstruct</groupId>
|
|
<artifactId>mapstruct-processor</artifactId>
|
|
<version>1.6.3</version>
|
|
</path>
|
|
<path>
|
|
<groupId>org.projectlombok</groupId>
|
|
<artifactId>lombok</artifactId>
|
|
<version>1.18.34</version>
|
|
</path>
|
|
<path>
|
|
<groupId>org.projectlombok</groupId>
|
|
<artifactId>lombok-mapstruct-binding</artifactId>
|
|
<version>0.2.0</version>
|
|
</path>
|
|
</annotationProcessorPaths>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
</plugin>
|
|
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-failsafe-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<goals>
|
|
<goal>integration-test</goal>
|
|
<goal>verify</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
|
|
<plugin>
|
|
<groupId>org.jacoco</groupId>
|
|
<artifactId>jacoco-maven-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>jacoco-check</id>
|
|
<goals>
|
|
<goal>check</goal>
|
|
</goals>
|
|
<configuration>
|
|
<excludes>
|
|
<!-- Code généré par MapStruct (pas de la logique métier) -->
|
|
<exclude>**/*MapperImpl.class</exclude>
|
|
<!-- Repositories Panache : nécessitent une base de données réelle -->
|
|
<exclude>**/server/impl/repository/*.class</exclude>
|
|
<!-- Infrastructure de démarrage Keycloak : nécessite un serveur Keycloak réel -->
|
|
<exclude>dev/lions/user/manager/config/KeycloakRealmSetupService.class</exclude>
|
|
<exclude>dev/lions/user/manager/config/KeycloakRealmSetupService$*.class</exclude>
|
|
<!-- Configuration dev-only : activée uniquement par @IfBuildProfile("dev") -->
|
|
<exclude>dev/lions/user/manager/config/KeycloakTestUserConfig.class</exclude>
|
|
<exclude>dev/lions/user/manager/config/KeycloakTestUserConfig$*.class</exclude>
|
|
</excludes>
|
|
<rules>
|
|
<rule>
|
|
<element>PACKAGE</element>
|
|
<limits>
|
|
<limit>
|
|
<counter>LINE</counter>
|
|
<value>COVEREDRATIO</value>
|
|
<minimum>1.0</minimum>
|
|
</limit>
|
|
</limits>
|
|
</rule>
|
|
</rules>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
</project>
|