From 6fcfc79aa4b4fcef09f1b19d9b11d21d45e0132d Mon Sep 17 00:00:00 2001 From: Andreas Dinauer Date: Sat, 14 Mar 2026 19:16:46 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Transform=20to=20IDP=20pro?= =?UTF-8?q?vider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/de/tavolio/bootstrap/BootstrapService.java | 8 ++++++-- src/main/resources/application.properties | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/tavolio/bootstrap/BootstrapService.java b/src/main/java/de/tavolio/bootstrap/BootstrapService.java index bf68a9c..3b6f8fc 100644 --- a/src/main/java/de/tavolio/bootstrap/BootstrapService.java +++ b/src/main/java/de/tavolio/bootstrap/BootstrapService.java @@ -9,7 +9,9 @@ import io.quarkus.runtime.Startup; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import jakarta.transaction.Transactional; +import org.eclipse.microprofile.config.inject.ConfigProperty; +import java.io.File; import java.io.IOException; import java.nio.file.Path; import java.util.Map; @@ -17,9 +19,11 @@ import java.util.Map; @ApplicationScoped public class BootstrapService { - private static final Path PATH = Path.of("/home/andreas/Documents/dev/iam-backend/src/main/resources/bootstrap.yaml"); private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(new YAMLFactory()).configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + @ConfigProperty(name = "io.verifoo.bootstrap.config.location") + String configLocation; + @Inject RealmBootstrapService realmBootstrapService; @@ -31,7 +35,7 @@ public class BootstrapService void bootstrap() throws IOException { superuserBootstrapper.bootstrap(); - Bootstrap bootstrap = OBJECT_MAPPER.readValue(PATH.toFile(), Bootstrap.class); + Bootstrap bootstrap = OBJECT_MAPPER.readValue(new File(configLocation), Bootstrap.class); for (Map.Entry realmEntry : bootstrap.realms().entrySet()) { realmBootstrapService.bootstrap(realmEntry); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f98b894..1b3879d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -29,5 +29,8 @@ quarkus.http.auth.basic=true io.verifoo.http.origin=http://localhost:8089 +%dev.io.verifoo.bootstrap.config.location=/home/andreas/Documents/dev/iam-backend/src/main/resources/bootstrap.yaml %dev.io.verifoo.superuser.username=admin -%dev.io.verifoo.superuser.password=pw \ No newline at end of file +%dev.io.verifoo.superuser.password=pw + +%prod.io.verifoo.bootstrap.config.location=/var/lib/verifoo/bootstrap.yaml \ No newline at end of file