chore(docker): add root Dockerfile pinning ubi8/openjdk-21:1.21 + UID 1001 for lionsctl pipeline
Some checks failed
CI/CD Pipeline / pipeline (push) Failing after 4m2s
Some checks failed
CI/CD Pipeline / pipeline (push) Failing after 4m2s
This commit is contained in:
@@ -1,64 +0,0 @@
|
||||
package dev.lions.unionflow.server.resource;
|
||||
|
||||
import dev.lions.unionflow.server.service.MigrerOrganisationsVersKeycloakService;
|
||||
import dev.lions.unionflow.server.service.MigrerOrganisationsVersKeycloakService.MigrationReport;
|
||||
import jakarta.annotation.security.RolesAllowed;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Endpoints d'administration Keycloak 26 Organizations.
|
||||
*
|
||||
* <p>Réservés aux SUPER_ADMIN. Opérations à déclencher manuellement lors de la
|
||||
* migration Keycloak 23 → 26.
|
||||
*/
|
||||
@Slf4j
|
||||
@Path("/api/admin/keycloak")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@RolesAllowed("SUPER_ADMIN")
|
||||
public class AdminKeycloakOrganisationResource {
|
||||
|
||||
@Inject
|
||||
MigrerOrganisationsVersKeycloakService migrationService;
|
||||
|
||||
/**
|
||||
* Lance la migration one-shot des organisations UnionFlow vers Keycloak 26 Organizations.
|
||||
*
|
||||
* <p>Idempotent : les organisations déjà migrées (keycloak_org_id non null) sont ignorées.
|
||||
*
|
||||
* @return rapport de migration (total, créés, ignorés, erreurs)
|
||||
*/
|
||||
@POST
|
||||
@Path("/migrer-organisations")
|
||||
public Response migrerOrganisations() {
|
||||
log.info("Déclenchement migration organisations → Keycloak 26 Organizations");
|
||||
try {
|
||||
MigrationReport report = migrationService.migrerToutesLesOrganisations();
|
||||
log.info("Migration terminée : {}", report);
|
||||
|
||||
return Response
|
||||
.status(report.success() ? Response.Status.OK.getStatusCode() : 207)
|
||||
.entity(Map.of(
|
||||
"total", report.total(),
|
||||
"crees", report.crees(),
|
||||
"ignores", report.ignores(),
|
||||
"erreurs", report.erreurs(),
|
||||
"succes", report.success()
|
||||
))
|
||||
.build();
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("Erreur critique lors de la migration : {}", e.getMessage(), e);
|
||||
return Response.serverError()
|
||||
.entity(Map.of("error", e.getMessage()))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user