From 07a3def4a27da4a0f6d55feb51db89b6f9c91653 Mon Sep 17 00:00:00 2001 From: Steven Hawkins Date: Wed, 15 Nov 2023 08:31:44 -0500 Subject: [PATCH] fix: all mappings should use getValidProxyModeValue (#24756) closes #24630 Signed-off-by: Steve Hawkins --- .../configuration/mappers/ProxyPropertyMappers.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ProxyPropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ProxyPropertyMappers.java index 1698df33cb..a1d72829f3 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ProxyPropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ProxyPropertyMappers.java @@ -25,17 +25,17 @@ final class ProxyPropertyMappers { fromOption(ProxyOptions.PROXY_FORWARDED_HOST) .to("quarkus.http.proxy.enable-forwarded-host") .mapFrom("proxy") - .transformer(ProxyPropertyMappers::getResolveEnableForwardedHost) + .transformer(ProxyPropertyMappers::getValidProxyModeValue) .build(), fromOption(ProxyOptions.PROXY_FORWARDED_HEADER_ENABLED) .to("quarkus.http.proxy.allow-forwarded") .mapFrom("proxy") - .transformer(ProxyPropertyMappers::getResolveEnableForwardedHost) + .transformer(ProxyPropertyMappers::getValidProxyModeValue) .build(), fromOption(ProxyOptions.PROXY_X_FORWARDED_HEADER_ENABLED) .to("quarkus.http.proxy.allow-x-forwarded") .mapFrom("proxy") - .transformer(ProxyPropertyMappers::getResolveEnableForwardedHost) + .transformer(ProxyPropertyMappers::getValidProxyModeValue) .build() }; } @@ -56,8 +56,4 @@ final class ProxyPropertyMappers { } } - private static Optional getResolveEnableForwardedHost(Optional proxy, ConfigSourceInterceptorContext context) { - return of(String.valueOf(!ProxyOptions.Mode.none.name().equals(proxy))); - } - }