diff --git a/core/deployment/src/main/java/io/quarkus/deployment/ExtensionLoader.java b/core/deployment/src/main/java/io/quarkus/deployment/ExtensionLoader.java index a48946735e4ea..af64656ab896e 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/ExtensionLoader.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/ExtensionLoader.java @@ -600,7 +600,7 @@ private static Consumer loadStepsFromClass(Class clazz, methodParamFns.add((bc, bri) -> bc.consume(buildItemClass)); } else if (isAnEmptyBuildItemConsumer(parameterType)) { throw reportError(parameter, - "Cannot consume an empty build item, use @Produce(class) on the build step method instead"); + "Cannot consume an empty build item, use @Consume(class) on the build step method instead"); } else if (isAnEmptyBuildItemProducer(parameterType)) { throw reportError(parameter, "Cannot produce an empty build item, use @Produce(class) on the build step method instead"); diff --git a/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/OidcBuildStep.java b/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/OidcBuildStep.java index 38dc994428988..9dfa3e97ef47a 100644 --- a/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/OidcBuildStep.java +++ b/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/OidcBuildStep.java @@ -1,6 +1,5 @@ package io.quarkus.oidc.deployment; -import java.util.Collection; import java.util.function.BooleanSupplier; import javax.inject.Singleton; @@ -9,20 +8,19 @@ import org.jboss.jandex.DotName; import io.quarkus.arc.deployment.AdditionalBeanBuildItem; +import io.quarkus.arc.deployment.SynthesisFinishedBuildItem; import io.quarkus.arc.deployment.SyntheticBeanBuildItem; -import io.quarkus.arc.deployment.ValidationPhaseBuildItem; -import io.quarkus.arc.deployment.ValidationPhaseBuildItem.ValidationErrorBuildItem; -import io.quarkus.arc.processor.BuildExtension; -import io.quarkus.arc.processor.ObserverInfo; import io.quarkus.deployment.Capabilities; import io.quarkus.deployment.Capability; import io.quarkus.deployment.Feature; import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.annotations.Consume; import io.quarkus.deployment.annotations.ExecutionTime; import io.quarkus.deployment.annotations.Record; import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem; import io.quarkus.deployment.builditem.FeatureBuildItem; +import io.quarkus.deployment.builditem.RuntimeConfigSetupCompleteBuildItem; import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; import io.quarkus.oidc.SecurityEvent; import io.quarkus.oidc.TokenIntrospectionCache; @@ -128,16 +126,16 @@ public SyntheticBeanBuildItem setup( .done(); } + // Note that DefaultTenantConfigResolver injects quarkus.http.proxy.enable-forwarded-prefix + @Consume(RuntimeConfigSetupCompleteBuildItem.class) @BuildStep(onlyIf = IsEnabled.class) @Record(ExecutionTime.RUNTIME_INIT) - public ValidationErrorBuildItem findSecurityEventObservers( + public void findSecurityEventObservers( OidcRecorder recorder, - ValidationPhaseBuildItem validationPhase) { - Collection observers = validationPhase.getContext().get(BuildExtension.Key.OBSERVERS); - boolean isSecurityEventObserved = observers.stream() + SynthesisFinishedBuildItem synthesisFinished) { + boolean isSecurityEventObserved = synthesisFinished.getObservers().stream() .anyMatch(observer -> observer.asObserver().getObservedType().name().equals(DOTNAME_SECURITY_EVENT)); recorder.setSecurityEventObserved(isSecurityEventObserved); - return new ValidationErrorBuildItem(); } public static class IsEnabled implements BooleanSupplier {