Search in sources :

Example 1 with ResteasyDeploymentCustomizerBuildItem

use of io.quarkus.resteasy.server.common.deployment.ResteasyDeploymentCustomizerBuildItem in project keycloak by keycloak.

the class KeycloakProcessor method configureResteasy.

@BuildStep
void configureResteasy(BuildProducer<ResteasyDeploymentCustomizerBuildItem> deploymentCustomizerProducer) {
    deploymentCustomizerProducer.produce(new ResteasyDeploymentCustomizerBuildItem(new Consumer<ResteasyDeployment>() {

        @Override
        public void accept(ResteasyDeployment resteasyDeployment) {
            // we need to explicitly set the application to avoid errors at build time due to the application
            // from keycloak-services also being added to the index
            resteasyDeployment.setApplicationClass(QuarkusKeycloakApplication.class.getName());
            // we need to disable the sanitizer to avoid escaping text/html responses from the server
            resteasyDeployment.setProperty(ResteasyContextParameters.RESTEASY_DISABLE_HTML_SANITIZER, Boolean.TRUE);
        }
    }));
}
Also used : ResteasyDeployment(org.jboss.resteasy.spi.ResteasyDeployment) Consumer(java.util.function.Consumer) QuarkusKeycloakApplication(org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication) ResteasyDeploymentCustomizerBuildItem(io.quarkus.resteasy.server.common.deployment.ResteasyDeploymentCustomizerBuildItem) BuildStep(io.quarkus.deployment.annotations.BuildStep)

Aggregations

BuildStep (io.quarkus.deployment.annotations.BuildStep)1 ResteasyDeploymentCustomizerBuildItem (io.quarkus.resteasy.server.common.deployment.ResteasyDeploymentCustomizerBuildItem)1 Consumer (java.util.function.Consumer)1 ResteasyDeployment (org.jboss.resteasy.spi.ResteasyDeployment)1 QuarkusKeycloakApplication (org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication)1