♻️ Transform to IDP provider

This commit is contained in:
Andreas Dinauer 2026-03-14 19:16:46 +01:00
parent 2d7af6fb0f
commit 6fcfc79aa4
2 changed files with 10 additions and 3 deletions

View File

@ -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<String, Realm> realmEntry : bootstrap.realms().entrySet())
{
realmBootstrapService.bootstrap(realmEntry);

View File

@ -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
%dev.io.verifoo.superuser.password=pw
%prod.io.verifoo.bootstrap.config.location=/var/lib/verifoo/bootstrap.yaml