Merge pull request #4189 from mposolda/master

KEYCLOAK-4977 Upgrade infinispan and undertow version to align with W…
This commit is contained in:
Marek Posolda 2017-05-26 15:22:14 +02:00 committed by GitHub
commit c47952250d
4 changed files with 24 additions and 12 deletions

View file

@ -64,7 +64,7 @@
<h2.version>1.3.173</h2.version>
<hibernate.entitymanager.version>5.0.7.Final</hibernate.entitymanager.version>
<hibernate.javax.persistence.version>1.0.0.Final</hibernate.javax.persistence.version>
<infinispan.version>8.1.0.Final</infinispan.version>
<infinispan.version>8.2.6.Final</infinispan.version>
<jackson.version>2.5.4</jackson.version>
<javax.mail.version>1.5.5</javax.mail.version>
<jboss.logging.version>3.3.0.Final</jboss.logging.version>
@ -79,7 +79,7 @@
<sun.istack.version>2.21</sun.istack.version>
<sun.jaxb.version>2.2.11</sun.jaxb.version>
<sun.xsom.version>20140925</sun.xsom.version>
<undertow.version>1.3.15.Final</undertow.version>
<undertow.version>1.4.11.Final</undertow.version>
<xmlsec.version>2.0.5</xmlsec.version>
<!-- Authorization Drools Policy Provider -->

View file

@ -233,15 +233,17 @@ public class KeycloakOnUndertow implements DeployableContainer<KeycloakOnUnderto
Reflections.setAccessible(containerField);
ServletContainer container = (ServletContainer) Reflections.getFieldValue(containerField, undertow);
DeploymentManager deployment = container.getDeployment(archive.getName());
if (deployment != null) {
DeploymentManager deploymentMgr = container.getDeployment(archive.getName());
if (deploymentMgr != null) {
DeploymentInfo deployment = deploymentMgr.getDeployment().getDeploymentInfo();
try {
deployment.stop();
deploymentMgr.stop();
} catch (ServletException se) {
throw new DeploymentException(se.getMessage(), se);
}
deployment.undeploy();
deploymentMgr.undeploy();
Field rootField = Reflections.findDeclaredField(UndertowJaxrsServer.class, "root");
Reflections.setAccessible(rootField);
@ -249,6 +251,8 @@ public class KeycloakOnUndertow implements DeployableContainer<KeycloakOnUnderto
String path = deployedArchivesToContextPath.get(archive.getName());
root.removePrefixPath(path);
container.removeDeployment(deployment);
} else {
log.warnf("Deployment '%s' not found", archive.getName());
}

View file

@ -33,6 +33,7 @@ import io.undertow.servlet.api.LoginConfig;
import io.undertow.servlet.api.SecurityConstraint;
import io.undertow.servlet.api.SecurityInfo;
import io.undertow.servlet.api.ServletInfo;
import io.undertow.servlet.api.ServletSessionConfig;
import io.undertow.servlet.api.WebResourceCollection;
import org.jboss.logging.Logger;
import org.w3c.dom.Document;
@ -170,6 +171,19 @@ class SimpleWebXmlParser {
}
}
// COOKIE CONFIG
ElementWrapper sessionCfg = document.getElementByTagName("session-config");
if (sessionCfg != null) {
ElementWrapper cookieConfig = sessionCfg.getElementByTagName("cookie-config");
String httpOnly = cookieConfig.getElementByTagName("http-only").getText();
String cookieName = cookieConfig.getElementByTagName("name").getText();
ServletSessionConfig cfg = new ServletSessionConfig();
cfg.setHttpOnly(Boolean.parseBoolean(httpOnly));
cfg.setName(cookieName);
di.setServletSessionConfig(cfg);
}
} catch (ClassNotFoundException cnfe) {
throw new RuntimeException(cnfe);
}

View file

@ -27,10 +27,4 @@ import org.junit.Ignore;
*/
@AppServerContainer("auth-server-undertow")
public class UndertowDemoServletsAdapterTest extends AbstractDemoServletsAdapterTest {
@Ignore
@Override
public void testAuthenticatedWithCustomSessionConfig() {
// Undertow deployment ignores session cookie settings in web.xml, see org.keycloak.testsuite.arquillian.undertow.SimpleWebXmlParser class
}
}