Skip to content

Commit

Permalink
KEYCLOAK-4977 Upgrade infinispan and undertow version to align with W…
Browse files Browse the repository at this point in the history
…ildfly 11.0.0.Alpha1
  • Loading branch information
mposolda committed May 26, 2017
1 parent c43329d commit c4f172a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,22 +233,26 @@ public void undeploy(Archive<?> archive) throws DeploymentException {
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);
PathHandler root = (PathHandler) Reflections.getFieldValue(rootField, undertow);

String path = deployedArchivesToContextPath.get(archive.getName());
root.removePrefixPath(path);

container.removeDeployment(deployment);
} else {
log.warnf("Deployment '%s' not found", archive.getName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
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;
Expand Down Expand Up @@ -170,6 +171,19 @@ void parseWebXml(Document webXml, DeploymentInfo di) {
}
}

// 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,4 @@
*/
@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
}
}

0 comments on commit c4f172a

Please sign in to comment.