You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2005/08/17 15:25:32 UTC
svn commit: r233171 - in /webservices/axis/trunk/java/modules/security: ./
src/ src/META-INF/ src/org/ src/org/apache/ src/org/apache/axis2/
src/org/apache/axis2/security/ src/org/apache/axis2/security/handler/
test-resources/ test/
Author: dims
Date: Wed Aug 17 06:25:26 2005
New Revision: 233171
URL: http://svn.apache.org/viewcvs?rev=233171&view=rev
Log:
Adding the framework for wss4j based ws-security. Ruchith, it's all yours now.
Added:
webservices/axis/trunk/java/modules/security/
webservices/axis/trunk/java/modules/security/maven.xml (with props)
webservices/axis/trunk/java/modules/security/project.properties (with props)
webservices/axis/trunk/java/modules/security/project.xml (with props)
webservices/axis/trunk/java/modules/security/src/
webservices/axis/trunk/java/modules/security/src/META-INF/
webservices/axis/trunk/java/modules/security/src/META-INF/module.xml (with props)
webservices/axis/trunk/java/modules/security/src/org/
webservices/axis/trunk/java/modules/security/src/org/apache/
webservices/axis/trunk/java/modules/security/src/org/apache/axis2/
webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/
webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllReceiver.java (with props)
webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllSender.java (with props)
webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/handler/
webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/handler/WSDoAllHandler.java (with props)
webservices/axis/trunk/java/modules/security/test/
webservices/axis/trunk/java/modules/security/test-resources/
webservices/axis/trunk/java/modules/security/test-resources/axis2.xml (with props)
Added: webservices/axis/trunk/java/modules/security/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/security/maven.xml?rev=233171&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/security/maven.xml (added)
+++ webservices/axis/trunk/java/modules/security/maven.xml Wed Aug 17 06:25:26 2005
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Revision: 1.21 $ $Date: 2004-10-27 20:54:09 +0600 (Wed, 27 Oct 2004) $ -->
+
+<project default="jar"
+ xmlns:j="jelly:core"
+ xmlns:maven="jelly:maven"
+ xmlns:deploy="deploy"
+ xmlns:ant="jelly:ant">
+ <postGoal name="test:compile">
+ <mkdir dir="target/classes/META-INF"/>
+ <copy file="src/META-INF/module.xml"
+ tofile="target/classes/META-INF/module.xml"/>
+ <copy file="./test-resources/axis2.xml"
+ tofile="target/axis2.xml"/>
+ <mkdir dir="target/modules"/>
+ <jar jarfile="target/security.mar" basedir="target/classes">
+ <include name="**"/>
+ </jar>
+ <copy file="target/security.mar"
+ tofile="target/modules/security.mar"/>
+ </postGoal>
+</project>
Propchange: webservices/axis/trunk/java/modules/security/maven.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axis/trunk/java/modules/security/project.properties
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/security/project.properties?rev=233171&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/security/project.properties (added)
+++ webservices/axis/trunk/java/modules/security/project.properties Wed Aug 17 06:25:26 2005
@@ -0,0 +1,18 @@
+# -------------------------------------------------------------------
+# Copyright 2001-2004 The Apache Software Foundation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -------------------------------------------------------------------
+
+maven.repo.remote=http://cvs.apache.org/repository/, http://www.ibiblio.org/maven,http://www.apache.org/dist/java-repository/
+maven.multiproject.type=jar
Propchange: webservices/axis/trunk/java/modules/security/project.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axis/trunk/java/modules/security/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/security/project.xml?rev=233171&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/security/project.xml (added)
+++ webservices/axis/trunk/java/modules/security/project.xml Wed Aug 17 06:25:26 2005
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+<project>
+ <pomVersion>3</pomVersion>
+ <extend>../../etc/project.xml</extend>
+
+ <id>security</id>
+ <name>security</name>
+ <description>WS-Security implementation</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>axis2-xml</artifactId>
+ <version>${pom.currentVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>axis2-common</artifactId>
+ <version>${pom.currentVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>axis2-wsdl</artifactId>
+ <version>${pom.currentVersion}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>axis</groupId>
+ <artifactId>axis2-core</artifactId>
+ <version>${pom.currentVersion}</version>
+ </dependency>
+ <!-- external JARs -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.3</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax</artifactId>
+ <version>1.1.1-dev</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ <url>http://dist.codehaus.org/stax/jars/</url>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.8</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ <url>http://dist.codehaus.org/stax/jars/</url>
+ </dependency>
+
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ <url>http://dist.codehaus.org/stax/jars/</url>
+ </dependency>
+ <dependency>
+ <groupId>geronimo-spec</groupId>
+ <artifactId>geronimo-spec-activation</artifactId>
+ <version>1.0.2-rc4</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.0-rc3</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.3</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+
+ <dependency>
+ <groupId>wss4j</groupId>
+ <artifactId>wss4j</artifactId>
+ <version>SNAPSHOT</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+
+ </dependencies>
+
+ <reports/>
+</project>
Propchange: webservices/axis/trunk/java/modules/security/project.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axis/trunk/java/modules/security/src/META-INF/module.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/security/src/META-INF/module.xml?rev=233171&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/security/src/META-INF/module.xml (added)
+++ webservices/axis/trunk/java/modules/security/src/META-INF/module.xml Wed Aug 17 06:25:26 2005
@@ -0,0 +1,13 @@
+<module name="security">
+ <inflow>
+ <handler name="SecurityInHandler" class="org.apache.axis2.security.WSDoAllReceiver">
+ <order phase="PreDispatch"/>
+ </handler>
+ </inflow>
+
+ <outflow>
+ <handler name="SecurityOutHandler" class="org.apache.axis2.security.WSDoAllSender">
+ <order phase="MessageOut"/>
+ </handler>
+ </outflow>
+</module>
\ No newline at end of file
Propchange: webservices/axis/trunk/java/modules/security/src/META-INF/module.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllReceiver.java?rev=233171&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllReceiver.java (added)
+++ webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllReceiver.java Wed Aug 17 06:25:26 2005
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ */
+
+package org.apache.axis2.security;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.security.handler.WSDoAllHandler;
+
+public class WSDoAllReceiver extends WSDoAllHandler {
+ public void invoke(MessageContext msgContext) throws AxisFault {
+ }
+}
Propchange: webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllReceiver.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllSender.java?rev=233171&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllSender.java (added)
+++ webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllSender.java Wed Aug 17 06:25:26 2005
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ */
+
+package org.apache.axis2.security;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.security.handler.WSDoAllHandler;
+
+public class WSDoAllSender extends WSDoAllHandler {
+ public void invoke(MessageContext msgContext) throws AxisFault {
+ }
+}
+
Propchange: webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/WSDoAllSender.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/handler/WSDoAllHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/handler/WSDoAllHandler.java?rev=233171&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/handler/WSDoAllHandler.java (added)
+++ webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/handler/WSDoAllHandler.java Wed Aug 17 06:25:26 2005
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis2.security.handler;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.engine.Handler;
+import org.apache.ws.security.handler.WSHandler;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Class WSDoAllHandler
+ */
+public abstract class WSDoAllHandler extends WSHandler implements Handler {
+
+ /**
+ * Field EMPTY_HANDLER_METADATA
+ */
+ private static HandlerDescription EMPTY_HANDLER_METADATA =
+ new HandlerDescription(new QName("deafult Handler"));
+
+ /**
+ * Field handlerDesc
+ */
+ protected HandlerDescription handlerDesc;
+
+ /**
+ * Constructor AbstractHandler
+ */
+ public WSDoAllHandler() {
+ handlerDesc = EMPTY_HANDLER_METADATA;
+ }
+
+ /**
+ * Method getName
+ *
+ * @return name
+ */
+ public QName getName() {
+ return handlerDesc.getName();
+ }
+
+ /**
+ * Method revoke
+ *
+ * @param msgContext
+ */
+ public void revoke(MessageContext msgContext) {
+ }
+
+ /**
+ * Method cleanup
+ *
+ * @throws org.apache.axis2.AxisFault
+ */
+ public void cleanup() throws AxisFault {
+ }
+
+ /**
+ * Method getParameter
+ *
+ * @param name
+ * @return parameter
+ */
+ public Parameter getParameter(String name) {
+ return handlerDesc.getParameter(name);
+ }
+
+ /**
+ * Method init
+ *
+ * @param handlerdesc
+ */
+ public void init(HandlerDescription handlerdesc) {
+ this.handlerDesc = handlerdesc;
+ }
+
+ /**
+ * To get the phaseRule of a handler it is required to get the HnadlerDescription of the handler
+ * so the argumnet pass when it call return as HnadlerDescription
+ *
+ * @return handler description
+ */
+ public HandlerDescription getHandlerDesc() {
+ return handlerDesc;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ QName name = this.getName();
+ return (name != null) ? name.toString() : null;
+ }
+
+
+ public Object getOption(String key) {
+ throw new RuntimeException("Not yet implemented");
+ }
+
+ public Object getProperty(Object msgContext, String key) {
+ throw new RuntimeException("Not yet implemented");
+ }
+
+ public String getPassword(Object msgContext) {
+ throw new RuntimeException("Not yet implemented");
+ }
+
+ public void setPassword(Object msgContext, String password) {
+ throw new RuntimeException("Not yet implemented");
+ }
+}
Propchange: webservices/axis/trunk/java/modules/security/src/org/apache/axis2/security/handler/WSDoAllHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/axis/trunk/java/modules/security/test-resources/axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/security/test-resources/axis2.xml?rev=233171&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/security/test-resources/axis2.xml (added)
+++ webservices/axis/trunk/java/modules/security/test-resources/axis2.xml Wed Aug 17 06:25:26 2005
@@ -0,0 +1,39 @@
+<axisconfig name="AxisJava2.0">
+ <parameter name="hotdeployment" locked="xsd:false">true</parameter>
+ <parameter name="hotupdate" locked="xsd:false">true</parameter>
+
+ <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+
+ <transportReceiver name="http">
+ </transportReceiver>
+ <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL" locked="xsd:false">HTTP/1.0</parameter>
+ </transportSender>
+
+ <module ref="security"/>
+ <phaseOrder type="inflow">
+ <!-- System pre defined phases -->
+ <phase name="TransportIn"/>
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch"/>
+ <phase name="PostDispatch"/>
+ <!-- System pre defined phases -->
+ <!-- After Postdispatch phase module author or or service author can add any phase he want -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="outflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ <!-- This is temporray solution will be change soon-->
+ <phase name="security"/>
+ </phaseOrder>
+ <phaseOrder type="INfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="Outfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+</axisconfig>
+
Propchange: webservices/axis/trunk/java/modules/security/test-resources/axis2.xml
------------------------------------------------------------------------------
svn:eol-style = native