All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkiverse.langchain4j.oidc.deployment.OidcModelAuthProviderProcessor Maven / Gradle / Ivy

There is a newer version: 0.23.0.CR2
Show newest version
package io.quarkiverse.langchain4j.oidc.deployment;

import java.util.function.BooleanSupplier;

import io.quarkiverse.langchain4j.oidc.runtime.OidcModelAuthProvider;
import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.BuildSteps;
import io.quarkus.deployment.builditem.FeatureBuildItem;

@BuildSteps(onlyIf = OidcModelAuthProviderProcessor.IsEnabled.class)
public class OidcModelAuthProviderProcessor {
    private static final String FEATURE = "langchain4j-oidc-model-auth-provider";

    @BuildStep
    FeatureBuildItem feature() {
        return new FeatureBuildItem(FEATURE);
    }

    @BuildStep
    public void additionalBeans(BuildProducer additionalBeans) {
        AdditionalBeanBuildItem.Builder builder = AdditionalBeanBuildItem.builder().setUnremovable();
        builder.addBeanClass(OidcModelAuthProvider.class);
        additionalBeans.produce(builder.build());
    }

    public static class IsEnabled implements BooleanSupplier {
        OidcModelAuthProviderBuildConfig config;

        public boolean getAsBoolean() {
            return config.enabled().orElse(true);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy