diff --git a/common/src/main/java/org/keycloak/common/util/SystemEnvProperties.java b/common/src/main/java/org/keycloak/common/util/SystemEnvProperties.java index 78fc4c7f98f0..1fdfff8d6ac9 100644 --- a/common/src/main/java/org/keycloak/common/util/SystemEnvProperties.java +++ b/common/src/main/java/org/keycloak/common/util/SystemEnvProperties.java @@ -17,8 +17,6 @@ package org.keycloak.common.util; -import java.util.Collections; -import java.util.Map; import java.util.Properties; /** @@ -26,21 +24,9 @@ */ public class SystemEnvProperties extends Properties { - private final Map overrides; - - public SystemEnvProperties(Map overrides) { - this.overrides = overrides; - } - - public SystemEnvProperties() { - this.overrides = Collections.EMPTY_MAP; - } - @Override public String getProperty(String key) { - if (overrides.containsKey(key)) { - return overrides.get(key); - } else if (key.startsWith("env.")) { + if (key.startsWith("env.")) { return System.getenv().get(key.substring(4)); } else { return System.getProperty(key); diff --git a/testsuite/integration-arquillian/servers/auth-server/undertow/src/main/java/org/keycloak/testsuite/arquillian/undertow/KeycloakOnUndertow.java b/testsuite/integration-arquillian/servers/auth-server/undertow/src/main/java/org/keycloak/testsuite/arquillian/undertow/KeycloakOnUndertow.java index 7c842121e06f..0eadcec74e9b 100644 --- a/testsuite/integration-arquillian/servers/auth-server/undertow/src/main/java/org/keycloak/testsuite/arquillian/undertow/KeycloakOnUndertow.java +++ b/testsuite/integration-arquillian/servers/auth-server/undertow/src/main/java/org/keycloak/testsuite/arquillian/undertow/KeycloakOnUndertow.java @@ -52,7 +52,6 @@ import org.keycloak.services.managers.ApplianceBootstrap; import org.keycloak.services.resources.KeycloakApplication; import org.keycloak.services.resteasy.ResteasyKeycloakApplication; -import org.keycloak.testsuite.JsonConfigProviderFactory; import org.keycloak.testsuite.KeycloakServer; import org.keycloak.testsuite.UndertowRequestFilter; import org.keycloak.testsuite.utils.tls.TLSUtils; @@ -94,15 +93,6 @@ private DeploymentInfo createAuthServerDeploymentInfo() { di.setContextPath("/auth"); di.setDeploymentName("Keycloak"); di.setDefaultEncoding("UTF-8"); - if (configuration.getKeycloakConfigPropertyOverridesMap() != null) { - try { - di.addInitParameter(JsonConfigProviderFactory.SERVER_CONTEXT_CONFIG_PROPERTY_OVERRIDES, - JsonSerialization.writeValueAsString(configuration.getKeycloakConfigPropertyOverridesMap())); - } catch (IOException ex) { - throw new RuntimeException(ex); - } - } - di.setDefaultServletConfig(new DefaultServletConfig(true)); di.addWelcomePage("theme/keycloak/welcome/resources/index.html"); diff --git a/testsuite/integration-arquillian/servers/auth-server/undertow/src/main/java/org/keycloak/testsuite/arquillian/undertow/KeycloakOnUndertowConfiguration.java b/testsuite/integration-arquillian/servers/auth-server/undertow/src/main/java/org/keycloak/testsuite/arquillian/undertow/KeycloakOnUndertowConfiguration.java index dab2ff031094..82d2a4049f24 100644 --- a/testsuite/integration-arquillian/servers/auth-server/undertow/src/main/java/org/keycloak/testsuite/arquillian/undertow/KeycloakOnUndertowConfiguration.java +++ b/testsuite/integration-arquillian/servers/auth-server/undertow/src/main/java/org/keycloak/testsuite/arquillian/undertow/KeycloakOnUndertowConfiguration.java @@ -37,7 +37,6 @@ public class KeycloakOnUndertowConfiguration extends UndertowContainerConfigurat private boolean remoteMode; private String route; private String keycloakConfigPropertyOverrides; - private HashMap keycloakConfigPropertyOverridesMap; private int bindHttpPortOffset = 0; private int bindHttpsPortOffset = 0; @@ -99,18 +98,6 @@ public void setRemoteMode(boolean remoteMode) { this.remoteMode = remoteMode; } - public String getKeycloakConfigPropertyOverrides() { - return keycloakConfigPropertyOverrides; - } - - public void setKeycloakConfigPropertyOverrides(String keycloakConfigPropertyOverrides) { - this.keycloakConfigPropertyOverrides = keycloakConfigPropertyOverrides; - } - - public Map getKeycloakConfigPropertyOverridesMap() { - return keycloakConfigPropertyOverridesMap; - } - @Override public void validate() throws ConfigurationException { super.validate(); @@ -125,15 +112,6 @@ public void validate() throws ConfigurationException { log.info("KeycloakOnUndertow will listen for http on port: " + newPort + " and for https on port: " + newHttpsPort); - if (this.keycloakConfigPropertyOverrides != null) { - try { - TypeReference> typeRef = new TypeReference>() {}; - this.keycloakConfigPropertyOverridesMap = JsonSerialization.sysPropertiesAwareMapper.readValue(this.keycloakConfigPropertyOverrides, typeRef); - } catch (IOException ex) { - throw new ConfigurationException(ex); - } - } - // TODO validate workerThreads } diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/KeycloakQuarkusConfiguration.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/KeycloakQuarkusConfiguration.java index 213ba5e76f41..f3f0e3de2ed1 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/KeycloakQuarkusConfiguration.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/arquillian/containers/KeycloakQuarkusConfiguration.java @@ -40,7 +40,6 @@ public class KeycloakQuarkusConfiguration implements ContainerConfiguration { private int startupTimeoutInSeconds = 300; private String route; private String keycloakConfigPropertyOverrides; - private HashMap keycloakConfigPropertyOverridesMap; private String profile; private String javaOpts; private boolean reaugmentBeforeStart; @@ -62,15 +61,6 @@ public void validate() throws ConfigurationException { setBindHttpsPort(newHttpsPort); log.infof("Keycloak will listen for http on port: %d, for https on port: %d, and for management on port: %d\n", newPort, newHttpsPort, managementPort); - - if (this.keycloakConfigPropertyOverrides != null) { - try { - TypeReference> typeRef = new TypeReference>() {}; - this.keycloakConfigPropertyOverridesMap = JsonSerialization.sysPropertiesAwareMapper.readValue(this.keycloakConfigPropertyOverrides, typeRef); - } catch (IOException ex) { - throw new ConfigurationException(ex); - } - } } public int getBindHttpPortOffset() { @@ -182,18 +172,6 @@ public void setProfile(String profile) { this.profile = profile; } - public String getKeycloakConfigPropertyOverrides() { - return keycloakConfigPropertyOverrides; - } - - public void setKeycloakConfigPropertyOverrides(String keycloakConfigPropertyOverrides) { - this.keycloakConfigPropertyOverrides = keycloakConfigPropertyOverrides; - } - - public Map getKeycloakConfigPropertyOverridesMap() { - return keycloakConfigPropertyOverridesMap; - } - public void setJavaOpts(String javaOpts) { this.javaOpts = javaOpts; } diff --git a/testsuite/utils/src/main/java/org/keycloak/testsuite/JsonConfigProviderFactory.java b/testsuite/utils/src/main/java/org/keycloak/testsuite/JsonConfigProviderFactory.java deleted file mode 100644 index 25d6328cf860..000000000000 --- a/testsuite/utils/src/main/java/org/keycloak/testsuite/JsonConfigProviderFactory.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.testsuite; - -import com.fasterxml.jackson.databind.JsonNode; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; -import jakarta.servlet.ServletContext; - -import org.jboss.resteasy.core.ResteasyContext; -import org.keycloak.common.util.SystemEnvProperties; -import org.keycloak.util.JsonSerialization; - -public class JsonConfigProviderFactory extends org.keycloak.services.util.JsonConfigProviderFactory { - - public static final String SERVER_CONTEXT_CONFIG_PROPERTY_OVERRIDES = "keycloak.server.context.config.property-overrides"; - - @Override - protected Properties getProperties() { - return new SystemEnvProperties(getPropertyOverrides()); - } - - private Map getPropertyOverrides() { - - ServletContext context = ResteasyContext.getContextData(ServletContext.class); - Map propertyOverridesMap = new HashMap<>(); - String propertyOverrides = context.getInitParameter(SERVER_CONTEXT_CONFIG_PROPERTY_OVERRIDES); - - try { - if (context.getInitParameter(SERVER_CONTEXT_CONFIG_PROPERTY_OVERRIDES) != null) { - JsonNode jsonObj = JsonSerialization.mapper.readTree(propertyOverrides); - jsonObj.fields().forEachRemaining(e -> propertyOverridesMap.put(e.getKey(), e.getValue().asText())); - } - } catch (IOException e) { - } - - return propertyOverridesMap; - - } - -}