Skip to content

Commit

Permalink
minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
tkyjovsk committed Feb 5, 2016
1 parent 58084d5 commit 191d03f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Expand Up @@ -106,7 +106,7 @@ public void startAppServer(@Observes(precedence = -1) BeforeClass event) throws
}

public void installAdapterLibs(@Observes BeforeDeploy event) {
log.info("BEFORE DEPLOY");
log.debug("BEFORE DEPLOY - INSTALL ADAPTER LIBS");
if (testContext.isAdapterTest()) {
// install adapter libs on JBoss-based container via CLI
if (testContext.getAppServerInfo().isJBossBased()) {
Expand Down
Expand Up @@ -70,7 +70,7 @@ public void process(Archive<?> archive, TestClass testClass) {
log.info("Processing archive " + archive.getName());
// if (isAdapterTest(testClass)) {
modifyAdapterConfigs(archive, testClass);
attachKeycloakLibs(archive, testClass);
attachAdapterLibs(archive, testClass);
modifyWebXml(archive, testClass);
// } else {
// log.info(testClass.getJavaClass().getSimpleName() + " is not an AdapterTest");
Expand All @@ -93,21 +93,21 @@ protected void modifyAdapterConfigs(Archive<?> archive, TestClass testClass) {
protected void modifyAdapterConfig(Archive<?> archive, String adapterConfigPath, boolean relative) {
if (archive.contains(adapterConfigPath)) {
log.info("Modifying adapter config " + adapterConfigPath + " in " + archive.getName());
if (adapterConfigPath.equals(SAML_ADAPTER_CONFIG_PATH)) {
if (adapterConfigPath.equals(SAML_ADAPTER_CONFIG_PATH)) { // SAML adapter config
log.info("Modyfying saml adapter config in " + archive.getName());

Document doc = loadXML(archive.get("WEB-INF/keycloak-saml.xml").getAsset().openStream());
if (authServerSslRequired) {
modifyDocElementAttribute(doc, "SingleSignOnService", "bindingUrl", "8080", System.getProperty("auth.server.https.port", null));
modifyDocElementAttribute(doc, "SingleSignOnService", "bindingUrl", "8080", System.getProperty("auth.server.https.port"));
modifyDocElementAttribute(doc, "SingleSignOnService", "bindingUrl", "http", "https");
modifyDocElementAttribute(doc, "SingleLogoutService", "postBindingUrl", "8080", System.getProperty("auth.server.https.port", null));
modifyDocElementAttribute(doc, "SingleLogoutService", "postBindingUrl", "8080", System.getProperty("auth.server.https.port"));
modifyDocElementAttribute(doc, "SingleLogoutService", "postBindingUrl", "http", "https");
modifyDocElementAttribute(doc, "SingleLogoutService", "redirectBindingUrl", "8080", System.getProperty("auth.server.https.port", null));
modifyDocElementAttribute(doc, "SingleLogoutService", "redirectBindingUrl", "8080", System.getProperty("auth.server.https.port"));
modifyDocElementAttribute(doc, "SingleLogoutService", "redirectBindingUrl", "http", "https");
} else {
modifyDocElementAttribute(doc, "SingleSignOnService", "bindingUrl", "8080", System.getProperty("auth.server.http.port", null));
modifyDocElementAttribute(doc, "SingleLogoutService", "postBindingUrl", "8080", System.getProperty("auth.server.http.port", null));
modifyDocElementAttribute(doc, "SingleLogoutService", "redirectBindingUrl", "8080", System.getProperty("auth.server.http.port", null));
modifyDocElementAttribute(doc, "SingleSignOnService", "bindingUrl", "8080", System.getProperty("auth.server.http.port"));
modifyDocElementAttribute(doc, "SingleLogoutService", "postBindingUrl", "8080", System.getProperty("auth.server.http.port"));
modifyDocElementAttribute(doc, "SingleLogoutService", "redirectBindingUrl", "8080", System.getProperty("auth.server.http.port"));
}

try {
Expand All @@ -116,7 +116,7 @@ protected void modifyAdapterConfig(Archive<?> archive, String adapterConfigPath,
log.error("Can't transform document to String");
throw new RuntimeException(e);
}
} else {
} else { // OIDC adapter config
try {
BaseAdapterConfig adapterConfig = loadJson(archive.get(adapterConfigPath)
.getAsset().openStream(), BaseAdapterConfig.class);
Expand Down Expand Up @@ -144,7 +144,7 @@ protected void modifyAdapterConfig(Archive<?> archive, String adapterConfigPath,
}
}

protected void attachKeycloakLibs(Archive<?> archive, TestClass testClass) {
protected void attachAdapterLibs(Archive<?> archive, TestClass testClass) {
AdapterLibsMode adapterType = AdapterLibsMode.getByType(System.getProperty("adapter.libs.mode",
AdapterLibsMode.PROVIDED.getType()));
log.info("Adapter type: " + adapterType);
Expand Down

0 comments on commit 191d03f

Please sign in to comment.