KEYCLOAK-4189 - Cross DC testing
This commit is contained in:
1 parent
fd8a3dccaf
commit
a0f3a6469f
45 files changed
+1752
-158
No files matched your search
@@ -70,8 +70,10 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.StringTokenizer;
|
||||
@@ -88,6 +90,8 @@ public class KeycloakApplication extends Application {
|
||||
|
||||
public static final String KEYCLOAK_EMBEDDED = "keycloak.embedded";
|
||||
|
||||
public static final String SERVER_CONTEXT_CONFIG_PROPERTY_OVERRIDES = "keycloak.server.context.config.property-overrides";
|
||||
|
||||
private static final Logger logger = Logger.getLogger(KeycloakApplication.class);
|
||||
|
||||
protected boolean embedded = false;
|
||||
@@ -262,7 +266,7 @@ public class KeycloakApplication extends Application {
|
||||
public static void loadConfig(ServletContext context) {
|
||||
try {
|
||||
JsonNode node = null;
|
||||
|
||||
|
||||
String dmrConfig = loadDmrConfig(context);
|
||||
if (dmrConfig != null) {
|
||||
node = new ObjectMapper().readTree(dmrConfig);
|
||||
@@ -287,7 +291,13 @@ public class KeycloakApplication extends Application {
|
||||
}
|
||||
|
||||
if (node != null) {
|
||||
Properties properties = new SystemEnvProperties();
|
||||
Map<String, String> propertyOverridesMap = new HashMap<>();
|
||||
String propertyOverrides = context.getInitParameter(SERVER_CONTEXT_CONFIG_PROPERTY_OVERRIDES);
|
||||
if (context.getInitParameter(SERVER_CONTEXT_CONFIG_PROPERTY_OVERRIDES) != null) {
|
||||
JsonNode jsonObj = new ObjectMapper().readTree(propertyOverrides);
|
||||
jsonObj.fields().forEachRemaining(e -> propertyOverridesMap.put(e.getKey(), e.getValue().asText()));
|
||||
}
|
||||
Properties properties = new SystemEnvProperties(propertyOverridesMap);
|
||||
Config.init(new JsonConfigProvider(node, properties));
|
||||
} else {
|
||||
throw new RuntimeException("Keycloak config not found.");
|
||||
|
||||
Reference in new issue
Block a user