JBossWS SVN: r18236 - projects/jaxws-undertow-httpspi/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-14 08:00:46 -0500 (Tue, 14 Jan 2014)
New Revision: 18236
Modified:
projects/jaxws-undertow-httpspi/trunk/pom.xml
Log:
Upgrading some dependencies' version and fixing project description
Modified: projects/jaxws-undertow-httpspi/trunk/pom.xml
===================================================================
--- projects/jaxws-undertow-httpspi/trunk/pom.xml 2014-01-14 12:58:11 UTC (rev 18235)
+++ projects/jaxws-undertow-httpspi/trunk/pom.xml 2014-01-14 13:00:46 UTC (rev 18236)
@@ -3,7 +3,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <name>JBoss JDK6 httpserver to JAXWS 2.2 HTTP SPI bridge</name>
+ <name>Undertow to JAXWS 2.2 HTTP SPI bridge</name>
<groupId>org.jboss.ws.projects</groupId>
<artifactId>jaxws-undertow-httpspi</artifactId>
<packaging>jar</packaging>
@@ -21,15 +21,15 @@
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-parent</artifactId>
- <version>1.0.9.GA</version>
+ <version>1.0.10.GA</version>
</parent>
<!-- Properties -->
<properties>
- <jaxws.version>1.0.0.Beta1</jaxws.version>
+ <jaxws.version>2.0.2.Final</jaxws.version>
<junit.version>4.8.1</junit.version>
- <cxf.version>2.3.0</cxf.version>
- <servlet-api.version>1.0.0.Beta2</servlet-api.version>
+ <cxf.version>2.7.8</cxf.version>
+ <servlet-api.version>1.0.2.Final</servlet-api.version>
<io.undertow.version>1.0.0.Beta30</io.undertow.version>
</properties>
10 years, 11 months
JBossWS SVN: r18234 - projects/jaxws-undertow-httpspi.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-14 07:53:42 -0500 (Tue, 14 Jan 2014)
New Revision: 18234
Added:
projects/jaxws-undertow-httpspi/trunk/
Log:
[JBWS-3702] Copying impl to a separate project
10 years, 11 months
JBossWS SVN: r18232 - in projects: jaxws-undertow-httpspi and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-14 07:50:58 -0500 (Tue, 14 Jan 2014)
New Revision: 18232
Added:
projects/jaxws-undertow-httpspi/
projects/jaxws-undertow-httpspi/branches/
projects/jaxws-undertow-httpspi/tags/
projects/jaxws-undertow-httpspi/trunk/
Log:
Preparing space for Undertow based impl of JAXWS 2.2 HTTP SPI container integration
10 years, 11 months
JBossWS SVN: r18231 - in projects/jaxws-httpserver-httpspi/trunk: src/main/java/org/jboss/ws/httpserver_httpspi and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2014-01-14 04:10:13 -0500 (Tue, 14 Jan 2014)
New Revision: 18231
Added:
projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHeaderMap.java
projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpContext.java
projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpExchange.java
projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpHandler.java
projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowServer.java
Modified:
projects/jaxws-httpserver-httpspi/trunk/pom.xml
projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpContextDelegate.java
projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpExchangeDelegate.java
projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpHandlerDelegate.java
projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpServerContextFactory.java
projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/PathUtils.java
projects/jaxws-httpserver-httpspi/trunk/src/test/java/org/jboss/ws/httpserver_httpspi/EndpointAPITest.java
Log:
[JBWS-3702]:Undertow jaxws http spi implemention
Modified: projects/jaxws-httpserver-httpspi/trunk/pom.xml
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/pom.xml 2014-01-13 10:05:29 UTC (rev 18230)
+++ projects/jaxws-httpserver-httpspi/trunk/pom.xml 2014-01-14 09:10:13 UTC (rev 18231)
@@ -30,6 +30,7 @@
<junit.version>4.8.1</junit.version>
<cxf.version>2.3.0</cxf.version>
<servlet-api.version>1.0.0.Beta2</servlet-api.version>
+ <io.undertow.version>1.0.0.Beta30</io.undertow.version>
</properties>
<!-- Dependencies -->
@@ -39,6 +40,19 @@
<artifactId>jboss-jaxws-api_2.2_spec</artifactId>
<version>${jaxws.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>io.undertow</groupId>
+ <artifactId>undertow-core</artifactId>
+ <version>${io.undertow.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>io.undertow</groupId>
+ <artifactId>undertow-build-config</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
<!-- test dependencies -->
<dependency>
Modified: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpContextDelegate.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpContextDelegate.java 2014-01-13 10:05:29 UTC (rev 18230)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpContextDelegate.java 2014-01-14 09:10:13 UTC (rev 18231)
@@ -35,7 +35,6 @@
* @since 22-Aug-2010
*
*/
-@SuppressWarnings("restriction")
public class HttpContextDelegate extends HttpContext
{
private com.sun.net.httpserver.HttpContext delegate;
Modified: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpExchangeDelegate.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpExchangeDelegate.java 2014-01-13 10:05:29 UTC (rev 18230)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpExchangeDelegate.java 2014-01-14 09:10:13 UTC (rev 18231)
@@ -45,7 +45,6 @@
* @since 22-Aug-2010
*
*/
-@SuppressWarnings("restriction")
public class HttpExchangeDelegate extends HttpExchange
{
private com.sun.net.httpserver.HttpExchange delegate;
Modified: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpHandlerDelegate.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpHandlerDelegate.java 2014-01-13 10:05:29 UTC (rev 18230)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpHandlerDelegate.java 2014-01-14 09:10:13 UTC (rev 18231)
@@ -34,7 +34,6 @@
* @sine 22-Aug-2010
*
*/
-@SuppressWarnings("restriction")
public class HttpHandlerDelegate implements HttpHandler {
private javax.xml.ws.spi.http.HttpHandler delegate;
Modified: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpServerContextFactory.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpServerContextFactory.java 2014-01-13 10:05:29 UTC (rev 18230)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpServerContextFactory.java 2014-01-14 09:10:13 UTC (rev 18231)
@@ -21,9 +21,10 @@
*/
package org.jboss.ws.httpserver_httpspi;
-import com.sun.net.httpserver.HttpServer;
import javax.xml.ws.spi.http.HttpContext;
+import com.sun.net.httpserver.HttpServer;
+
/**
* A factory for building JDK6 httpserver' flavor of
*
@@ -31,11 +32,15 @@
* @since 22-Aug-2010
*
*/
-@SuppressWarnings("restriction")
public class HttpServerContextFactory
{
public static HttpContext createHttpContext(HttpServer server, String contextPath, String path)
{
return new HttpContextDelegate(server.createContext(contextPath + path), path);
}
+
+ public static HttpContext createHttpContext(UndertowServer server, String contextPath, String path)
+ {
+ return new UndertowHttpContext(server.getPathHandler(), contextPath, path);
+ }
}
Modified: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/PathUtils.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/PathUtils.java 2014-01-13 10:05:29 UTC (rev 18230)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/PathUtils.java 2014-01-14 09:10:13 UTC (rev 18231)
@@ -44,6 +44,11 @@
return getPathInternal(addr.getPath());
}
+ public static String getPathFromRequest(String requestPath)
+ {
+ return getPathInternal(requestPath);
+ }
+
private static String getPathInternal(String rawpath)
{
String path = removeTrailingSlash(rawpath);
@@ -66,6 +71,11 @@
return getContextPathInternal(getPathFromString(addr));
}
+ public static String getContextPathFromRequest(String requestPath)
+ {
+ return getContextPathInternal(requestPath);
+ }
+
public static String getContextPath(URI addr)
{
return getContextPathInternal(addr.getPath());
@@ -96,7 +106,7 @@
return path;
}
- private static String removeTrailingSlash(String path)
+ public static String removeTrailingSlash(String path)
{
if (path != null && path.length() > 0 && path.lastIndexOf('/') == path.length() - 1)
{
Added: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHeaderMap.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHeaderMap.java (rev 0)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHeaderMap.java 2014-01-14 09:10:13 UTC (rev 18231)
@@ -0,0 +1,208 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.httpserver_httpspi;
+
+import io.undertow.util.HeaderMap;
+import io.undertow.util.HeaderValues;
+import io.undertow.util.HttpString;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+
+
+public class UndertowHeaderMap implements Map<String, List<String>>
+{
+
+ private HeaderMap headerMap;
+
+ public UndertowHeaderMap(HeaderMap headerMap) {
+ this.headerMap = headerMap;
+ }
+
+ @Override
+ public int size()
+ {
+ return headerMap.size();
+ }
+
+ @Override
+ public boolean isEmpty()
+ {
+ return headerMap.size() > 0;
+ }
+
+ @Override
+ public boolean containsKey(Object key)
+ {
+ return headerMap.contains(key.toString());
+ }
+
+ @Override
+ public boolean containsValue(Object value)
+ {
+ Iterator<HeaderValues> ite = headerMap.iterator();
+ while (ite.hasNext())
+ {
+ HeaderValues values = ite.next();
+ if (values.contains(value))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public List<String> get(Object key)
+ {
+ HeaderValues values = headerMap.get(key.toString());
+ List<String> result = new ArrayList<String>();
+ if (values != null)
+ {
+ for (String value : values.toArray())
+ {
+ result.add(value);
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public List<String> put(String key, List<String> value)
+ {
+ List<String> previous = get(key);
+ if (previous.isEmpty())
+ {
+ previous = null;
+ }
+ headerMap.addAll(new HttpString(key), value);
+ return previous;
+
+ }
+
+ @Override
+ public List<String> remove(Object key)
+ {
+ List<String> previous = get(key);
+ if (previous.isEmpty())
+ {
+ previous = null;
+ }
+ headerMap.remove(key.toString());
+ return previous;
+ }
+
+ @Override
+ public void putAll(Map<? extends String, ? extends List<String>> m)
+ {
+ for (String key : m.keySet())
+ {
+ headerMap.putAll(new HttpString(key), m.get(key));
+ }
+
+ }
+
+ @Override
+ public void clear()
+ {
+ headerMap.clear();
+
+ }
+
+ @Override
+ public Set<String> keySet()
+ {
+ Set<String> result = new HashSet<String>();
+ for (HeaderValues value : headerMap)
+ {
+ result.add(value.getHeaderName().toString());
+ }
+ return result;
+ }
+
+ @Override
+ public Collection<List<String>> values()
+ {
+ List<List<String>> collections = new ArrayList<List<String>>();
+ for (HeaderValues value : headerMap)
+ {
+ List<String> values = new ArrayList<String>();
+ for (String headerValue : value)
+ {
+ values.add(headerValue);
+ }
+ collections.add(values);
+ }
+ return collections;
+ }
+
+ @Override
+ public Set<java.util.Map.Entry<String, List<String>>> entrySet()
+ {
+ Set<java.util.Map.Entry<String, List<String>>> result = new HashSet<java.util.Map.Entry<String, List<String>>>();
+ for (HeaderValues headerValues : headerMap)
+ {
+ final String key = headerValues.getHeaderName().toString();
+ final List<String> headerValueList = new ArrayList<String>();
+ for (String value : headerValues)
+ {
+ headerValueList.add(value);
+ }
+ result.add(new Entry<String, List<String>>() {
+
+ @Override
+ public String getKey()
+ {
+ return key;
+ }
+
+ @Override
+ public List<String> getValue()
+ {
+ return headerValueList;
+ }
+
+ @Override
+ public List<String> setValue(List<String> value)
+ {
+ List<String> previous = headerMap.get(key);
+ if (previous.isEmpty())
+ {
+ previous = null;
+ }
+ headerMap.addAll(new HttpString(key), value);
+
+ return previous;
+
+ }
+ });
+ }
+ return result;
+ }
+
+}
Property changes on: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHeaderMap.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpContext.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpContext.java (rev 0)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpContext.java 2014-01-14 09:10:13 UTC (rev 18231)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.httpserver_httpspi;
+
+import io.undertow.server.handlers.PathHandler;
+
+import java.util.Set;
+
+import javax.xml.ws.spi.http.HttpContext;
+import javax.xml.ws.spi.http.HttpHandler;
+
+/**
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
+ *
+ */
+//TODO:Look at HttpHandlerImpl - avoid to create duplicate UndertowHttpContext to publish endpoint
+public class UndertowHttpContext extends HttpContext
+{
+ private String handlerpath;
+ private PathHandler pathHandler;
+ private String path;
+
+ public UndertowHttpContext(PathHandler pathHandler, String contextPath, String path)
+ {
+ this.pathHandler = pathHandler;
+ this.path = path;
+ this.handlerpath = contextPath + path;
+ }
+
+ @Override
+ public void setHandler(HttpHandler handler)
+ {
+ pathHandler.addExactPath(handlerpath, new UndertowHttpHandler(handler));
+ }
+
+ @Override
+ public String getPath()
+ {
+ return this.path;
+ }
+
+ @Override
+ public Object getAttribute(String name)
+ {
+ // TODO
+ return null;
+ }
+
+ @Override
+ public Set<String> getAttributeNames()
+ {
+ // TODO
+ return null;
+ }
+
+}
Property changes on: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpContext.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpExchange.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpExchange.java (rev 0)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpExchange.java 2014-01-14 09:10:13 UTC (rev 18231)
@@ -0,0 +1,209 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.httpserver_httpspi;
+
+import io.undertow.server.HttpServerExchange;
+import io.undertow.server.handlers.PathHandler;
+import io.undertow.util.HeaderValues;
+import io.undertow.util.HttpString;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.InetSocketAddress;
+import java.security.Principal;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.ws.spi.http.HttpContext;
+import javax.xml.ws.spi.http.HttpExchange;
+
+/**
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
+ *
+ */
+public class UndertowHttpExchange extends HttpExchange
+{
+ private HttpServerExchange undertowExchange;
+
+ private UndertowHttpContext context;
+
+ public UndertowHttpExchange(HttpServerExchange serverExchange)
+ {
+ undertowExchange = serverExchange;
+ }
+
+ @Override
+ public Map<String, List<String>> getRequestHeaders()
+ {
+ return new UndertowHeaderMap(undertowExchange.getRequestHeaders());
+ }
+
+ @Override
+ public String getRequestHeader(String name)
+ {
+ HeaderValues headerValues = undertowExchange.getRequestHeaders().get(name);
+ if (headerValues != null && headerValues.size() > 0)
+ {
+ String result = "";
+ for (String headerValue : headerValues)
+ {
+ result = result + headerValue;
+ }
+ return result;
+ }
+ return null;
+ }
+
+ @Override
+ public Map<String, List<String>> getResponseHeaders()
+ {
+ return new UndertowHeaderMap(undertowExchange.getResponseHeaders());
+ }
+
+ @Override
+ public void addResponseHeader(String name, String value)
+ {
+ undertowExchange.getResponseHeaders().add(new HttpString(name), value);
+
+ }
+
+ @Override
+ public String getRequestURI()
+ {
+ return undertowExchange.getRequestURI();
+ }
+
+ @Override
+ public String getContextPath()
+ {
+ return PathUtils.getContextPathFromRequest(undertowExchange.getRequestPath());
+ }
+
+ @Override
+ public String getRequestMethod()
+ {
+ return undertowExchange.getRequestMethod().toString();
+ }
+
+ @Override
+ public HttpContext getHttpContext()
+ {
+ if (context == null)
+ {
+ context = new UndertowHttpContext(new PathHandler(), PathUtils.getContextPathFromRequest(undertowExchange.getRequestPath()),
+ PathUtils.getPathFromRequest(undertowExchange.getRequestPath()));
+ }
+ return context;
+ }
+
+ @Override
+ public void close() throws IOException
+ {
+ undertowExchange.endExchange();
+ }
+
+ @Override
+ public InputStream getRequestBody() throws IOException
+ {
+ return undertowExchange.getInputStream();
+ }
+
+ @Override
+ public OutputStream getResponseBody() throws IOException
+ {
+ return undertowExchange.getOutputStream();
+ }
+
+ @Override
+ public void setStatus(int status)
+ {
+ undertowExchange.setResponseCode(status);
+
+ }
+
+ @Override
+ public InetSocketAddress getRemoteAddress()
+ {
+ return undertowExchange.getSourceAddress();
+ }
+
+ @Override
+ public InetSocketAddress getLocalAddress()
+ {
+ return undertowExchange.getDestinationAddress();
+ }
+
+ @Override
+ public String getProtocol()
+ {
+ return undertowExchange.getProtocol().toString();
+ }
+
+ @Override
+ public String getScheme()
+ {
+ return undertowExchange.getRequestScheme();
+ }
+
+ @Override
+ public String getPathInfo()
+ {
+ return undertowExchange.getRequestPath();
+ }
+
+ @Override
+ public String getQueryString()
+ {
+ return undertowExchange.getQueryString();
+ }
+
+ @Override
+ public Object getAttribute(String name)
+ {
+ // TODO
+ return null;
+ }
+
+ @Override
+ public Set<String> getAttributeNames()
+ {
+ // TODO
+ return null;
+ }
+
+ @Override
+ public Principal getUserPrincipal()
+ {
+ //TODO
+ return null;
+ }
+
+ @Override
+ public boolean isUserInRole(String role)
+ {
+ //TODO
+ return false;
+ }
+
+}
Property changes on: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpExchange.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpHandler.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpHandler.java (rev 0)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpHandler.java 2014-01-14 09:10:13 UTC (rev 18231)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.httpserver_httpspi;
+
+import io.undertow.server.HttpHandler;
+import io.undertow.server.HttpServerExchange;
+
+/**
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
+ *
+ */
+public class UndertowHttpHandler implements HttpHandler
+{
+
+ private javax.xml.ws.spi.http.HttpHandler spihandler;
+
+ public UndertowHttpHandler(javax.xml.ws.spi.http.HttpHandler handler)
+ {
+ spihandler = handler;
+ }
+
+ @Override
+ public void handleRequest(HttpServerExchange exchange) throws Exception
+ {
+ spihandler.handle(new UndertowHttpExchange(exchange));
+ }
+
+}
Property changes on: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowServer.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowServer.java (rev 0)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowServer.java 2014-01-14 09:10:13 UTC (rev 18231)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.httpserver_httpspi;
+
+import io.undertow.Undertow;
+import io.undertow.Undertow.Builder;
+import io.undertow.server.handlers.BlockingHandler;
+import io.undertow.server.handlers.PathHandler;
+
+/**
+ * @author <a href="mailto:ema@redhat.com">Jim Ma</a>
+ *
+ */
+public class UndertowServer
+{
+ private Builder builder;
+ private PathHandler pathHandler;
+ private Undertow undertow;
+
+ public UndertowServer(int port, String host)
+ {
+ builder = Undertow.builder().addListener(port, host);
+ pathHandler = new PathHandler();
+ }
+
+ public Builder getBuilder()
+ {
+ return builder;
+ }
+
+ public PathHandler getPathHandler()
+ {
+ return pathHandler;
+ }
+
+ public void start()
+ {
+ undertow = builder.setHandler(new BlockingHandler(pathHandler)).build();
+ undertow.start();
+ }
+
+ public void stop()
+ {
+ if (undertow != null)
+ {
+ undertow.stop();
+ }
+ }
+
+}
Property changes on: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowServer.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: projects/jaxws-httpserver-httpspi/trunk/src/test/java/org/jboss/ws/httpserver_httpspi/EndpointAPITest.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/test/java/org/jboss/ws/httpserver_httpspi/EndpointAPITest.java 2014-01-13 10:05:29 UTC (rev 18230)
+++ projects/jaxws-httpserver-httpspi/trunk/src/test/java/org/jboss/ws/httpserver_httpspi/EndpointAPITest.java 2014-01-14 09:10:13 UTC (rev 18231)
@@ -25,7 +25,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.net.InetSocketAddress;
import java.net.URL;
import javax.activation.DataHandler;
@@ -49,25 +48,24 @@
* @since 22-Aug-2010
*
*/
-@SuppressWarnings("restriction")
public class EndpointAPITest extends Assert
{
private static int currentPort = 9876;
- private com.sun.net.httpserver.HttpServer server;
+ private UndertowServer server;
@Before
public void setUp() throws IOException
{
currentPort++;
- server = com.sun.net.httpserver.HttpServer.create(new InetSocketAddress(currentPort), 0);
+ server = new UndertowServer(currentPort, "localhost");
}
@After
public void tearDown()
{
- server.stop(0);
+ server.stop();
server = null;
}
@@ -108,7 +106,6 @@
invokeEndpoint(address);
endpoint.stop();
- server.removeContext(contextPath + path);
}
}
10 years, 11 months
JBossWS SVN: r18230 - in stack/cxf/branches/jaspi/modules: client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration and 12 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2014-01-13 05:05:29 -0500 (Mon, 13 Jan 2014)
New Revision: 18230
Added:
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/META-INF/
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/META-INF/jaxws-client-config.xml
Modified:
stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/jaspi/JaspiClientAuthenticator.java
stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/jaspi/module/SOAPClientAuthModule.java
stack/cxf/branches/jaspi/modules/dist/pom.xml
stack/cxf/branches/jaspi/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
stack/cxf/branches/jaspi/modules/jaspi/pom.xml
stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/cxf/jbossws-cxf-client/main/module.xml
stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/jaxws-client/main/module.xml
stack/cxf/branches/jaspi/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/JaspiAuthenticationTestCase.java
Log:
Add test for client side jaspi AuthModule
Modified: stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
--- stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2014-01-10 14:24:51 UTC (rev 18229)
+++ stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2014-01-13 10:05:29 UTC (rev 18230)
@@ -604,11 +604,6 @@
Client client = obj instanceof DispatchImpl<?> ? ((DispatchImpl<?>)obj).getClient() : ClientProxy.getClient(obj);
client.getOutInterceptors().add(new HandlerChainSortInterceptor(binding));
- JaspiClientAuthenticator clientAuthenticator = getJaspiAuthenticator(client) ;
- if (clientAuthenticator != null) {
- client.getInInterceptors().add(new JaspiClientInInterceptor(clientAuthenticator));
- client.getOutInterceptors().add(new JaspiClientOutInterceptor(clientAuthenticator));
- }
if (jbossModulesEnv) { //optimization for avoiding checking for a server config when we know for sure we're out-of-container
ServerConfig sc = getServerConfig();
@@ -629,46 +624,7 @@
}
}
}
- }
-
- private JaspiClientAuthenticator getJaspiAuthenticator(Client client) {
- //TODO:Decide where to get the client jaspi security domain
- String securityDomain = "jaspi-client";
- ApplicationPolicy appPolicy = SecurityConfiguration.getApplicationPolicy(securityDomain);
- if (appPolicy == null) {
- Loggers.ROOT_LOGGER.noApplicationPolicy(securityDomain);
- return null;
- }
- BaseAuthenticationInfo bai = appPolicy.getAuthenticationInfo();
- if (bai == null || bai instanceof AuthenticationInfo) {
- Loggers.ROOT_LOGGER.noJaspiApplicationPolicy(securityDomain);
- return null;
- }
- JASPIAuthenticationInfo jai = (JASPIAuthenticationInfo) bai;
-
- String contextRoot = client.getEndpoint().getEndpointInfo().getName().toString();
- String appId = "localhost " + contextRoot;
- AuthConfigFactory factory = AuthConfigFactory.getFactory();
-
- Properties properties = new Properties();
- AuthConfigProvider provider = new JBossWSAuthConfigProvider(properties, factory);
- provider = factory.getConfigProvider(JBossWSAuthConstants.SOAP_LAYER, appId, null);
- JBossCallbackHandler callbackHandler = new JBossCallbackHandler();
- try
- {
- ClientAuthConfig clientConfig = provider.getClientAuthConfig("soap", appId, callbackHandler);
- return new JaspiClientAuthenticator(clientConfig, securityDomain, jai);
- }
- catch (Exception e)
- {
- //ignore
- }
-
- return null;
-
- }
-
-
+ }
}
//lazy get the server config (and try once per classloader only)
Modified: stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java
===================================================================
--- stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2014-01-10 14:24:51 UTC (rev 18229)
+++ stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/CXFClientConfigurer.java 2014-01-13 10:05:29 UTC (rev 18230)
@@ -22,14 +22,31 @@
package org.jboss.wsf.stack.cxf.client.configuration;
import java.util.Map;
+import java.util.Properties;
import java.util.Set;
+import javax.security.auth.message.config.AuthConfigFactory;
+import javax.security.auth.message.config.AuthConfigProvider;
+import javax.security.auth.message.config.ClientAuthConfig;
+
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.jaxws.DispatchImpl;
+import org.jboss.security.auth.callback.JBossCallbackHandler;
+import org.jboss.security.auth.login.AuthenticationInfo;
+import org.jboss.security.auth.login.BaseAuthenticationInfo;
+import org.jboss.security.auth.login.JASPIAuthenticationInfo;
+import org.jboss.security.config.ApplicationPolicy;
+import org.jboss.security.config.SecurityConfiguration;
import org.jboss.ws.common.configuration.ConfigHelper;
import org.jboss.wsf.spi.metadata.config.ClientConfig;
+import org.jboss.wsf.stack.cxf.Loggers;
+import org.jboss.wsf.stack.cxf.client.jaspi.JaspiClientAuthenticator;
+import org.jboss.wsf.stack.cxf.client.jaspi.JaspiClientInInterceptor;
+import org.jboss.wsf.stack.cxf.client.jaspi.JaspiClientOutInterceptor;
+import org.jboss.wsf.stack.cxf.jaspi.config.JBossWSAuthConfigProvider;
+import org.jboss.wsf.stack.cxf.jaspi.config.JBossWSAuthConstants;
/**
* CXF extension of common ClientConfigurer
@@ -57,8 +74,56 @@
savePropList(cxfClient, props);
}
setConfigProperties(cxfClient, props);
+
+ //config jaspi
+ JaspiClientAuthenticator clientAuthenticator = getJaspiAuthenticator(cxfClient, props) ;
+ if (clientAuthenticator != null) {
+ cxfClient.getInInterceptors().add(new JaspiClientInInterceptor(clientAuthenticator));
+ cxfClient.getOutInterceptors().add(new JaspiClientOutInterceptor(clientAuthenticator));
+ }
+
}
+
+ private JaspiClientAuthenticator getJaspiAuthenticator(Client client, Map<String, String> properties) {
+ String securityDomain = properties.get(JaspiClientAuthenticator.JASPI_SECURITY_DOMAIN);
+ if (securityDomain == null) {
+ return null;
+ }
+ ApplicationPolicy appPolicy = SecurityConfiguration.getApplicationPolicy(securityDomain);
+ if (appPolicy == null) {
+ Loggers.ROOT_LOGGER.noApplicationPolicy(securityDomain);
+ return null;
+ }
+ BaseAuthenticationInfo bai = appPolicy.getAuthenticationInfo();
+ if (bai == null || bai instanceof AuthenticationInfo) {
+ Loggers.ROOT_LOGGER.noJaspiApplicationPolicy(securityDomain);
+ return null;
+ }
+ JASPIAuthenticationInfo jai = (JASPIAuthenticationInfo) bai;
+
+ String contextRoot = client.getEndpoint().getEndpointInfo().getName().toString();
+ String appId = "localhost " + contextRoot;
+ AuthConfigFactory factory = AuthConfigFactory.getFactory();
+
+ Properties props = new Properties();
+ AuthConfigProvider provider = new JBossWSAuthConfigProvider(props, factory);
+ provider = factory.getConfigProvider(JBossWSAuthConstants.SOAP_LAYER, appId, null);
+ JBossCallbackHandler callbackHandler = new JBossCallbackHandler();
+ try
+ {
+ ClientAuthConfig clientConfig = provider.getClientAuthConfig("soap", appId, callbackHandler);
+ return new JaspiClientAuthenticator(clientConfig, securityDomain, jai);
+ }
+ catch (Exception e)
+ {
+ //ignore
+ }
+
+ return null;
+
+ }
+
public void setConfigProperties(Client client, Map<String, String> properties) {
client.getEndpoint().putAll(properties);
}
Modified: stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/jaspi/JaspiClientAuthenticator.java
===================================================================
--- stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/jaspi/JaspiClientAuthenticator.java 2014-01-10 14:24:51 UTC (rev 18229)
+++ stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/jaspi/JaspiClientAuthenticator.java 2014-01-13 10:05:29 UTC (rev 18230)
@@ -23,6 +23,7 @@
*/
public class JaspiClientAuthenticator
{
+ public static final String JASPI_SECURITY_DOMAIN = "jaspi.security.domain";
private ClientAuthConfig clientConfig;
private String securityDomain;
private JASPIAuthenticationInfo jpi;
Modified: stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/jaspi/module/SOAPClientAuthModule.java
===================================================================
--- stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/jaspi/module/SOAPClientAuthModule.java 2014-01-10 14:24:51 UTC (rev 18229)
+++ stack/cxf/branches/jaspi/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/jaspi/module/SOAPClientAuthModule.java 2014-01-13 10:05:29 UTC (rev 18230)
@@ -49,7 +49,7 @@
*/
public class SOAPClientAuthModule implements ClientAuthModule
{
-
+ public static String log;
@SuppressWarnings("rawtypes")
private List<Class> supportedTypes = new ArrayList<Class>();
private SimplePrincipal principal = null;
@@ -88,7 +88,7 @@
@SuppressWarnings({ "unchecked" })
public AuthStatus secureRequest(MessageInfo messageInfo, Subject source) throws AuthException
{
-
+ log = "secureRequest";
SOAPMessage soapMessage = (SOAPMessage)messageInfo.getRequestMessage();
return AuthStatus.SUCCESS;
}
Modified: stack/cxf/branches/jaspi/modules/dist/pom.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/dist/pom.xml 2014-01-10 14:24:51 UTC (rev 18229)
+++ stack/cxf/branches/jaspi/modules/dist/pom.xml 2014-01-13 10:05:29 UTC (rev 18230)
@@ -24,6 +24,12 @@
<dependency>
<groupId>org.jboss.ws.cxf</groupId>
+ <artifactId>jbossws-cxf-jaspi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-transports-httpserver</artifactId>
<version>${project.version}</version>
</dependency>
Modified: stack/cxf/branches/jaspi/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2014-01-10 14:24:51 UTC (rev 18229)
+++ stack/cxf/branches/jaspi/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2014-01-13 10:05:29 UTC (rev 18230)
@@ -30,6 +30,7 @@
<unpack>false</unpack>
<includes>
<include>org.jboss.ws.cxf:jbossws-cxf-client:jar</include>
+ <include>org.jboss.ws.cxf:jbossws-cxf-jaspi:jar</include>
<include>org.jboss.ws.cxf:jbossws-cxf-factories:jar</include>
<include>org.jboss.ws.cxf:jbossws-cxf-server:jar</include>
<include>org.jboss.ws.cxf:jbossws-cxf-transports-httpserver:jar</include>
Modified: stack/cxf/branches/jaspi/modules/jaspi/pom.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/jaspi/pom.xml 2014-01-10 14:24:51 UTC (rev 18229)
+++ stack/cxf/branches/jaspi/modules/jaspi/pom.xml 2014-01-13 10:05:29 UTC (rev 18230)
@@ -15,14 +15,7 @@
<!-- Dependencies -->
<dependencies>
-
<dependency>
- <groupId>org.jboss.ws.cxf</groupId>
- <artifactId>jbossws-cxf-jaspi</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
</dependency>
Modified: stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/cxf/jbossws-cxf-client/main/module.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/cxf/jbossws-cxf-client/main/module.xml 2014-01-10 14:24:51 UTC (rev 18229)
+++ stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/cxf/jbossws-cxf-client/main/module.xml 2014-01-13 10:05:29 UTC (rev 18230)
@@ -47,5 +47,8 @@
<module name="org.jboss.ws.cxf.jbossws-cxf-transports-httpserver" export="true" services="export" />
<module name="org.jboss.ws.cxf.jbossws-cxf-transports-udp" export="true" services="export" />
<module name="org.jboss.jaxbintros" export="true"/>
+ <module name="javax.security.auth.message.api" export="true"/>
+ <module name="org.picketbox" export="true"/>
+ <module name="org.apache.ws.security" export="true"/>
</dependencies>
</module>
Modified: stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/jaxws-client/main/module.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/jaxws-client/main/module.xml 2014-01-10 14:24:51 UTC (rev 18229)
+++ stack/cxf/branches/jaspi/modules/resources/src/main/resources/modules/wildfly800/org/jboss/ws/jaxws-client/main/module.xml 2014-01-13 10:05:29 UTC (rev 18230)
@@ -36,6 +36,7 @@
<module name="javax.api" />
<module name="javax.servlet.api" />
<module name="javax.xml.bind.api" />
+ <module name="javax.security.auth.message.api"/>
<module name="com.sun.xml.bind" services="import"/>
<module name="javax.xml.ws.api" />
<module name="org.jboss.ws.api" />
@@ -65,6 +66,7 @@
<module name="org.apache.neethi" />
<module name="org.apache.ws.security" />
<module name="org.jboss.logging" />
+ <module name="org.picketbox"/>
<module name="org.springframework.spring" optional="true">
<imports>
<include path="META-INF"/>
Modified: stack/cxf/branches/jaspi/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml 2014-01-10 14:24:51 UTC (rev 18229)
+++ stack/cxf/branches/jaspi/modules/resources/src/main/resources/resources/jbossws-deploy-macros.xml 2014-01-13 10:05:29 UTC (rev 18230)
@@ -38,6 +38,7 @@
<copy todir="@{targetdir}/org/jboss/ws/jaxws-client/main" flatten="false" overwrite="true">
<fileset dir="@{thirdpartydir}/lib">
<include name="**/jbossws-cxf-client.jar"/>
+ <include name="**/jbossws-cxf-jaspi.jar"/>
</fileset>
</copy>
<copy todir="@{targetdir}/org/jboss/ws/jaxws-jboss-httpserver-httpspi/main" flatten="false" overwrite="true">
Modified: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2014-01-10 14:24:51 UTC (rev 18229)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2014-01-13 10:05:29 UTC (rev 18230)
@@ -562,7 +562,25 @@
</manifest>
</war>
-
+ <!-- jaxws-samples-wsse-policy-username-jaspi-client -->
+ <war
+ warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-policy-username-jaspi-client.war" needxmlfile="false">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/Helper.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/ServiceIface.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/UsernamePasswordCallback.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/policy/jaxws/*.class"/>
+ <include name="org/jboss/wsf/test/TestServlet.class"/>
+ <include name="org/jboss/wsf/test/ClientHelper.class"/>
+ </classes>
+ <classes dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/jaspi">
+ <include name="META-INF/jaxws-client-config.xml"/>
+ </classes>
+ <manifest>
+ <attribute name="Dependencies" value="org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl"/> <!-- cxf impl required due to custom interceptor in deployment -->
+ </manifest>
+ </war>
+
<!-- jaxws-samples-wsse-policy-username-jaas-digest -->
<war
warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-policy-username-jaas-digest.war"
Modified: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/JaspiAuthenticationTestCase.java
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/JaspiAuthenticationTestCase.java 2014-01-10 14:24:51 UTC (rev 18229)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/jaspi/JaspiAuthenticationTestCase.java 2014-01-13 10:05:29 UTC (rev 18230)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.ws.jaxws.samples.wsse.policy.jaspi;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
@@ -46,7 +48,7 @@
public static Test suite()
{
- TestSetup testSetup = new JBossWSCXFTestSetup(JaspiAuthenticationTestCase.class, "jaxws-samples-wsse-policy-username-jaspi.war") {
+ TestSetup testSetup = new JBossWSCXFTestSetup(JaspiAuthenticationTestCase.class, "jaxws-samples-wsse-policy-username-jaspi.war, jaxws-samples-wsse-policy-username-jaspi-client.war") {
public void setUp() throws Exception
{
@@ -65,12 +67,15 @@
Map<String, String> authModuleOptions = new HashMap<String, String>();
JBossWSTestHelper.addJaspiSecurityDomain("jaspi", "jaas-lm-stack", loginModuleOptions, "org.jboss.wsf.stack.cxf.jaspi.module.UsernameTokenServerAuthModule",
authModuleOptions);
+ JBossWSTestHelper.addJaspiSecurityDomain("clientJaspi", "jaas-lm-stack", loginModuleOptions, "org.jboss.wsf.stack.cxf.client.jaspi.module.SOAPClientAuthModule",
+ authModuleOptions);
super.setUp();
}
public void tearDown() throws Exception
{
JBossWSTestHelper.removeSecurityDomain("jaspi");
+ JBossWSTestHelper.removeSecurityDomain("clientJaspi");
super.tearDown();
}
@@ -122,6 +127,25 @@
setupWsse(proxy, "kermit");
assertEquals("Secure Hello World!", proxy.sayHello());
}
+
+
+ public void testInContainerClientAuthModule() throws Exception
+ {
+ Helper helper = new Helper();
+ helper.setTargetEndpoint("http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-username-jaspi");
+ assertEquals("1", runTestInContainer("testJaspiClient"));
+ }
+
+
+ private String runTestInContainer(String test) throws Exception
+ {
+ URL url = new URL("http://" + getServerHost()
+ + ":8080/jaxws-samples-wsse-policy-username-jaspi-client?path=/jaxws-samples-wsse-policy-username-jaspi&method=" + test
+ + "&helper=" + Helper.class.getName());
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ return br.readLine();
+ }
+
private void setupWsse(ServiceIface proxy, String username)
{
Added: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/META-INF/jaxws-client-config.xml
===================================================================
--- stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/META-INF/jaxws-client-config.xml (rev 0)
+++ stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/META-INF/jaxws-client-config.xml 2014-01-13 10:05:29 UTC (rev 18230)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0 schema/jbossws-jaxws-config_4_0.xsd">
+ <client-config>
+ <config-name>jaspiSecurityDomain</config-name>
+ <property>
+ <property-name>jaspi.security.domain</property-name>
+ <property-value>clientJaspi</property-value>
+ </property>
+ </client-config>
+</jaxws-config>
\ No newline at end of file
Property changes on: stack/cxf/branches/jaspi/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/jaspi/META-INF/jaxws-client-config.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
10 years, 11 months
JBossWS SVN: r18229 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-10 09:24:51 -0500 (Fri, 10 Jan 2014)
New Revision: 18229
Modified:
stack/cxf/trunk/pom.xml
Log:
[JBWS-3751] Upgrade to WSS4J 1.6.14
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2014-01-10 01:37:01 UTC (rev 18228)
+++ stack/cxf/trunk/pom.xml 2014-01-10 14:24:51 UTC (rev 18229)
@@ -100,7 +100,7 @@
<velocity.version>1.7</velocity.version>
<xerces.version>2.9.1</xerces.version>
<xmlsec.version>1.5.6</xmlsec.version>
- <wss4j.version>1.6.13</wss4j.version>
+ <wss4j.version>1.6.14</wss4j.version>
<wstx.version>4.2.0</wstx.version>
<spring.version>3.0.7.RELEASE</spring.version>
<shrinkwrap.version>1.1.3</shrinkwrap.version>
10 years, 11 months
JBossWS SVN: r18227 - in projects/wsi-bp-test/trunk: bsp11-tests and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2014-01-09 09:18:53 -0500 (Thu, 09 Jan 2014)
New Revision: 18227
Added:
projects/wsi-bp-test/trunk/bsp11-tests/
Removed:
projects/wsi-bp-test/trunk/bsp12-tests/
Modified:
projects/wsi-bp-test/trunk/bsp11-tests/pom.xml
Log:
Correct the bsp test module name
Modified: projects/wsi-bp-test/trunk/bsp11-tests/pom.xml
===================================================================
--- projects/wsi-bp-test/trunk/bsp12-tests/pom.xml 2013-10-17 17:09:48 UTC (rev 18009)
+++ projects/wsi-bp-test/trunk/bsp11-tests/pom.xml 2014-01-09 14:18:53 UTC (rev 18227)
@@ -2,8 +2,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <name>JBoss Web Services - WSI-BSP12 Test</name>
- <artifactId>wsi-bsp12-tests</artifactId>
+ <name>JBoss Web Services - WSI-BSP11 Test</name>
+ <artifactId>wsi-bsp11-tests</artifactId>
<packaging>jar</packaging>
<!-- Parent -->
10 years, 11 months