You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2017/01/31 00:17:20 UTC
svn commit: r1781009 [4/7] - in
/axis/axis2/java/rampart/branches/RAMPART-385: ./ apidocs/ code-coverage/
etc/ modules/distribution/ modules/distribution/src/ modules/documentation/
modules/rampart-core/ modules/rampart-core/src/main/java/META-INF/ mod...
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenUTForHoKTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenUTForHoKTest.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenUTForHoKTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenUTForHoKTest.java Tue Jan 31 00:17:19 2017
@@ -20,18 +20,13 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.neethi.Policy;
-import org.apache.rampart.handler.config.InflowConfiguration;
-import org.apache.rampart.handler.config.OutflowConfiguration;
import org.apache.ws.secpolicy.SP11Constants;
+import static org.junit.Assert.assertNotNull;
+
import javax.xml.namespace.QName;
public class RahasSAMLTokenUTForHoKTest extends TestClient {
-
- public RahasSAMLTokenUTForHoKTest(String name) {
- super(name);
- }
-
public OMElement getRequest() {
try {
OMElement rstElem = TrustUtil.createRequestSecurityTokenElement(RahasConstants.VERSION_05_02);
@@ -51,23 +46,6 @@ public class RahasSAMLTokenUTForHoKTest
}
}
- public OutflowConfiguration getClientOutflowConfiguration() {
- OutflowConfiguration ofc = new OutflowConfiguration();
-
- ofc.setActionItems("UsernameToken Timestamp");
- ofc.setUser("joe");
- ofc.setPasswordCallbackClass(PWCallback.class.getName());
- return ofc;
- }
-
- public InflowConfiguration getClientInflowConfiguration() {
- InflowConfiguration ifc = new InflowConfiguration();
-
- ifc.setActionItems("Timestamp");
-
- return ifc;
- }
-
public String getServiceRepo() {
return "rahas_service_repo_3";
}
@@ -116,4 +94,9 @@ public class RahasSAMLTokenUTForHoKTest
public int getTrstVersion() {
return RahasConstants.VERSION_05_02;
}
+
+ @Override
+ public String getClientPolicyPath() {
+ return "/rahas/3.xml";
+ }
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenUTForHoKV1205Test.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenUTForHoKV1205Test.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenUTForHoKV1205Test.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenUTForHoKV1205Test.java Tue Jan 31 00:17:19 2017
@@ -16,6 +16,8 @@
package org.apache.rahas;
+import static org.junit.Assert.assertNotNull;
+
import javax.xml.namespace.QName;
import org.apache.axiom.om.OMAbstractFactory;
@@ -23,23 +25,13 @@ import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.util.base64.Base64Utils;
import org.apache.neethi.Policy;
-import org.apache.rampart.handler.config.InflowConfiguration;
-import org.apache.rampart.handler.config.OutflowConfiguration;
import org.apache.ws.secpolicy.SP12Constants;
-import org.apache.ws.security.WSConstants;
import org.apache.ws.security.util.WSSecurityUtil;
public class RahasSAMLTokenUTForHoKV1205Test extends TestClient {
byte[] clientEntr;
- /**
- * @param name
- */
- public RahasSAMLTokenUTForHoKV1205Test(String name) {
- super(name);
- }
-
public OMElement getRequest() {
try {
OMElement rstElem = TrustUtil.createRequestSecurityTokenElement(RahasConstants.VERSION_05_12);
@@ -67,24 +59,6 @@ public class RahasSAMLTokenUTForHoKV1205
}
}
- public OutflowConfiguration getClientOutflowConfiguration() {
- OutflowConfiguration ofc = new OutflowConfiguration();
-
- ofc.setActionItems("UsernameToken Timestamp");
- ofc.setUser("joe");
- ofc.setPasswordType(WSConstants.PW_TEXT);
- ofc.setPasswordCallbackClass(PWCallback.class.getName());
- return ofc;
- }
-
- public InflowConfiguration getClientInflowConfiguration() {
- InflowConfiguration ifc = new InflowConfiguration();
-
- ifc.setActionItems("Timestamp");
-
- return ifc;
- }
-
public String getServiceRepo() {
return "rahas_service_repo_3";
}
@@ -158,6 +132,11 @@ public class RahasSAMLTokenUTForHoKV1205
public int getTrstVersion() {
return RahasConstants.VERSION_05_12;
}
+
+ @Override
+ public String getClientPolicyPath() {
+ return "/rahas/3.xml";
+ }
// private void requestService(OMElement assertion, byte[] reqEnt, byte[] respEnt) throws Exception {
//
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenV1205Test.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenV1205Test.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenV1205Test.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rahas/RahasSAMLTokenV1205Test.java Tue Jan 31 00:17:19 2017
@@ -20,24 +20,16 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.neethi.Policy;
-import org.apache.rampart.handler.config.InflowConfiguration;
-import org.apache.rampart.handler.config.OutflowConfiguration;
import org.apache.ws.secpolicy.SP12Constants;
+import static org.junit.Assert.assertNotNull;
+
import javax.xml.namespace.QName;
/**
* RahasSAMLTokenTest with the WS-SX namespaces
*/
public class RahasSAMLTokenV1205Test extends TestClient {
-
- /**
- * @param name
- */
- public RahasSAMLTokenV1205Test(String name) {
- super(name);
- }
-
public OMElement getRequest() {
try {
OMElement rstElem = TrustUtil.createRequestSecurityTokenElement(RahasConstants.VERSION_05_12);
@@ -56,25 +48,6 @@ public class RahasSAMLTokenV1205Test ext
throw new RuntimeException(e);
}
}
- public OutflowConfiguration getClientOutflowConfiguration() {
- OutflowConfiguration ofc = new OutflowConfiguration();
-
- ofc.setActionItems("Signature Encrypt Timestamp");
- ofc.setUser("alice");
- ofc.setSignaturePropFile("rahas/rahas-sec.properties");
- ofc.setPasswordCallbackClass(PWCallback.class.getName());
- return ofc;
- }
-
- public InflowConfiguration getClientInflowConfiguration() {
- InflowConfiguration ifc = new InflowConfiguration();
-
- ifc.setActionItems("Signature Encrypt Timestamp");
- ifc.setPasswordCallbackClass(PWCallback.class.getName());
- ifc.setSignaturePropFile("rahas/rahas-sec.properties");
-
- return ifc;
- }
public String getServiceRepo() {
return "rahas_service_repo_1";
@@ -129,4 +102,9 @@ public class RahasSAMLTokenV1205Test ext
return RahasConstants.VERSION_05_12;
}
+ @Override
+ public String getClientPolicyPath() {
+ return "/rahas/1.xml";
+ }
+
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/java/org/apache/rampart/RampartTest.java Tue Jan 31 00:17:19 2017
@@ -16,7 +16,10 @@
package org.apache.rampart;
-import junit.framework.TestCase;
+import static org.apache.axis2.integration.TestConstants.TESTING_PATH;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
@@ -25,26 +28,47 @@ import org.apache.axiom.om.util.AXIOMUti
import org.apache.axiom.soap.SOAPHeaderBlock;
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
-import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.integration.UtilServer;
+import org.apache.axis2.testutils.ClientHelper;
+import org.apache.axis2.testutils.JettyServer;
import org.apache.neethi.Policy;
import org.apache.neethi.PolicyEngine;
+import org.junit.Rule;
+import org.junit.Test;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-
-public class RampartTest extends TestCase {
-
- public final static int PORT = UtilServer.TESTING_PORT;
+public class RampartTest {
private static ResourceBundle resources;
-
+
+ @Rule
+ public final JettyServer server = new JettyServer(TESTING_PATH + "rampart_service_repo", false);
+
+ @Rule
+ public final ClientHelper clientHelper = new ClientHelper(server, TESTING_PATH + "rampart_client_repo") {
+ @Override
+ protected void configureServiceClient(ServiceClient serviceClient) throws Exception {
+ serviceClient.engageModule("addressing");
+ serviceClient.engageModule("rampart");
+ }
+ };
+
+ @Rule
+ public final JettyServer secureServer = new JettyServer(TESTING_PATH + "rampart_service_repo", true);
+
+ @Rule
+ public final ClientHelper secureClientHelper = new ClientHelper(secureServer, TESTING_PATH + "rampart_client_repo") {
+ @Override
+ protected void configureServiceClient(ServiceClient serviceClient) throws Exception {
+ serviceClient.engageModule("addressing");
+ serviceClient.engageModule("rampart");
+ }
+ };
+
static {
try {
resources = ResourceBundle.getBundle("org.apache.rampart.errors");
@@ -53,40 +77,9 @@ public class RampartTest extends TestCas
}
}
- public RampartTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- UtilServer.start(Constants.TESTING_PATH + "rampart_service_repo" ,null);
- }
-
-
- protected void tearDown() throws Exception {
- UtilServer.stop();
- }
-
- private ServiceClient getServiceClientInstance() throws AxisFault {
-
- String repository = Constants.TESTING_PATH + "rampart_client_repo";
-
- ConfigurationContext configContext = ConfigurationContextFactory.
- createConfigurationContextFromFileSystem(repository, null);
- ServiceClient serviceClient = new ServiceClient(configContext, null);
-
-
- serviceClient.engageModule("addressing");
- serviceClient.engageModule("rampart");
-
- return serviceClient;
-
- }
-
+ @Test
public void testWithPolicy() {
try {
-
- ServiceClient serviceClient = getServiceClientInstance();
-
//TODO : figure this out !!
boolean basic256Supported = false;
@@ -96,7 +89,7 @@ public class RampartTest extends TestCas
}
//for (int i = 34; i <= 34; i++) { //<-The number of tests we have
- for (int i = 1; i <= 34; i++) { //<-The number of tests we have
+ for (int i = 1; i <= 35; i++) { //<-The number of tests we have
if(!basic256Supported && (i == 3 || i == 4 || i == 5)) {
//Skip the Basic256 tests
continue;
@@ -106,25 +99,22 @@ public class RampartTest extends TestCas
// Testcase - 25 is failing, for the moment skipping it.
continue;
}
- Options options = new Options();
+
+ ServiceClient serviceClient = (i == 13 ? secureClientHelper : clientHelper).createServiceClient("SecureService" + i);
+ Options options = serviceClient.getOptions();
if( i == 13 ) {
- continue; // Can't test Transport binding with Simple HTTP Server
//Username token created with user/pass from options
- //options.setUserName("alice");
- //options.setPassword("password");
+ options.setUserName("alice");
+ options.setPassword("password");
}
System.out.println("Testing WS-Sec: custom scenario " + i);
options.setAction("urn:echo");
- options.setTo(new EndpointReference("http://127.0.0.1:" +
- PORT +
- "/axis2/services/SecureService" + i));
-
+
ServiceContext context = serviceClient.getServiceContext();
context.setProperty(RampartMessageData.KEY_RAMPART_POLICY,
loadPolicy("/rampart/policy/" + i + ".xml"));
- serviceClient.setOptions(options);
if (i == 31) {
OMNamespace omNamespace = OMAbstractFactory.getOMFactory().createOMNamespace(
@@ -178,22 +168,21 @@ public class RampartTest extends TestCas
//Skip the Basic256 tests
continue;
}
- Options options = new Options();
+
+ ServiceClient serviceClient = (i == 13 ? secureClientHelper : clientHelper).createServiceClient("SecureService" + i);
+ Options options = serviceClient.getOptions();
if (i == 13) {
- continue;
+ //Username token created with user/pass from options
+ options.setUserName("alice");
+ options.setPassword("password");
}
-
System.out.println("Testing WS-Sec: negative scenario " + i);
options.setAction("urn:returnError");
- options.setTo(new EndpointReference("http://127.0.0.1:" +
- PORT +
- "/axis2/services/SecureService" + i));
ServiceContext context = serviceClient.getServiceContext();
context.setProperty(RampartMessageData.KEY_RAMPART_POLICY,
loadPolicy("/rampart/policy/" + i + ".xml"));
- serviceClient.setOptions(options);
try {
//Blocking invocation
@@ -207,21 +196,19 @@ public class RampartTest extends TestCas
for (int i = 1; i <= 6; i++) { //<-The number of tests we have
-
+ ServiceClient serviceClient;
if (i == 3 || i == 6) {
- continue; // Can't test Transport binding scenarios with Simple HTTP Server
+ serviceClient = secureClientHelper.createServiceClient("SecureServiceSC" + i);
}
+ else {
+ serviceClient = clientHelper.createServiceClient("SecureServiceSC" + i);
+ }
+ Options options = serviceClient.getOptions();
- Options options = new Options();
System.out.println("Testing WS-SecConv: custom scenario " + i);
options.setAction("urn:echo");
- options.setTo(new EndpointReference("http://127.0.0.1:" + PORT + "/axis2/services/SecureServiceSC" + i));
-
- //Create a new service client instance for each secure conversation scenario
- serviceClient = getServiceClientInstance();
serviceClient.getServiceContext().setProperty(RampartMessageData.KEY_RAMPART_POLICY, loadPolicy("/rampart/policy/sc-" + i + ".xml"));
- serviceClient.setOptions(options);
//Blocking invocation
serviceClient.sendReceive(getEchoElement());
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/conf/axis2.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/conf/axis2.xml?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/conf/axis2.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/conf/axis2.xml Tue Jan 31 00:17:19 2017
@@ -91,32 +91,16 @@
<!-- ================================================= -->
<!-- Transport Ins -->
<!-- ================================================= -->
+ <!-- The default configuration assumes that AxisServlet only receives requests
+ through HTTP. To allow HTTPS as well, configure a second AxisServletListener
+ with name="https" and specify the port parameter on both receivers.
+ For more information, please have a look at the servlet transport documentation:
+ http://axis.apache.org/axis2/java/core/docs/servlet-transport.html -->
<transportReceiver name="http"
- class="org.apache.axis2.transport.http.SimpleHTTPServer">
- <parameter name="port" locked="false">6060</parameter>
- <!-- Here is the complete list of supported parameters (see example settings further below):
- port: the port to listen on (default 6060)
- hostname: if non-null, url prefix used in reply-to endpoint references (default null)
- originServer: value of http Server header in outgoing messages (default "Simple-Server/1.1")
- requestTimeout: value in millis of time that requests can wait for data (default 20000)
- requestTcpNoDelay: true to maximize performance and minimize latency (default true)
- false to minimize bandwidth consumption by combining segments
- requestCoreThreadPoolSize: number of threads available for request processing (unless queue fills up) (default 25)
- requestMaxThreadPoolSize: number of threads available for request processing if queue fills us (default 150)
- note that default queue never fills up: see HttpFactory
- threadKeepAliveTime: time to keep threads in excess of core size alive while inactive (default 180)
- note that no such threads can exist with default unbounded request queue
- threadKeepAliveTimeUnit: TimeUnit of value in threadKeepAliveTime (default SECONDS) (default SECONDS)
- -->
- <!-- <parameter name="hostname" locked="false">http://www.myApp.com/ws</parameter> -->
- <!-- <parameter name="originServer" locked="false">My-Server/1.1</parameter> -->
- <!-- <parameter name="requestTimeout" locked="false">10000</parameter> -->
- <!-- <parameter name="requestTcpNoDelay" locked="false">false</parameter> -->
- <!-- <parameter name="requestCoreThreadPoolSize" locked="false">50</parameter> -->
- <!-- <parameter name="RequestMaxThreadPoolSize" locked="false">100</parameter> -->
- <!-- <parameter name="threadKeepAliveTime" locked="false">240000</parameter> -->
- <!-- <parameter name="threadKeepAliveTimeUnit" locked="false">MILLISECONDS</parameter> -->
- </transportReceiver>
+ class="org.apache.axis2.transport.http.AxisServletListener"/>
+
+ <transportReceiver name="https"
+ class="org.apache.axis2.transport.http.AxisServletListener"/>
<!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
@@ -155,12 +139,12 @@
<transportSender name="local"
class="org.apache.axis2.transport.local.LocalTransportSender"/>
<transportSender name="http"
- class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ class="org.apache.axis2.transport.http.impl.httpclient4.HTTPClient4TransportSender">
<parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
<parameter name="Transfer-Encoding" locked="false">chunked</parameter>
</transportSender>
<transportSender name="https"
- class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ class="org.apache.axis2.transport.http.impl.httpclient4.HTTPClient4TransportSender">
<parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
<parameter name="Transfer-Encoding" locked="false">chunked</parameter>
</transportSender>
@@ -179,9 +163,10 @@
<!-- ================================================= -->
<!-- Global Modules -->
<!-- ================================================= -->
- <!-- Comment this to disable Addressing -->
+ <!-- Comment this to disable Addressing
<module ref="addressing"/>
-
+ -->
+
<!--Configuring module , providing parameters for modules whether they refer or not-->
<moduleConfig name="addressing">
<parameter name="includeOptionalHeaders" locked="false">true</parameter>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/log4j.properties?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/log4j.properties (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/log4j.properties Tue Jan 31 00:17:19 2017
@@ -23,3 +23,9 @@ log4j.appender.CONSOLE=org.apache.log4j.
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d %-5p %c - %m%n
+log4j.appender.JETTY=org.apache.log4j.ConsoleAppender
+log4j.appender.JETTY.layout=org.apache.log4j.PatternLayout
+log4j.appender.JETTY.layout.ConversionPattern=[%C{1}] - %m%n
+
+log4j.category.org.apache.axis2.integration.JettyServer=INFO, JETTY
+log4j.additivity.org.apache.axis2.integration.JettyServer = false
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/rahas/s1-services.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/rahas/s1-services.xml?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/rahas/s1-services.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/rahas/s1-services.xml Tue Jan 31 00:17:19 2017
@@ -50,25 +50,79 @@
</trusted-services>
</saml-issuer-config>
</parameter>
-
- <parameter name="InflowSecurity">
- <action>
- <items>Signature Encrypt Timestamp</items>
- <signaturePropFile>issuer.properties</signaturePropFile>
- <decryptionPropFile>issuer.properties</decryptionPropFile>
- <passwordCallbackClass xmlns="">org.apache.rahas.PWCallback</passwordCallbackClass>
- </action>
- </parameter>
- <parameter name="OutflowSecurity">
- <action>
- <items>Signature Encrypt Timestamp</items>
- <user>ip</user>
- <encryptionUser>useReqSigCert</encryptionUser>
- <signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
- <signaturePropFile xmlns="">issuer.properties</signaturePropFile>
- <passwordCallbackClass xmlns="">org.apache.rahas.PWCallback</passwordCallbackClass>
- </action>
- </parameter>
+ <wsp:Policy wsu:Id="SigEncr" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic128/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ </wsp:Policy>
+ </sp:Wss10>
+ <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ </sp:SignedParts>
+ <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
+ <ramp:user>ip</ramp:user>
+ <ramp:encryptionUser>useReqSigCert</ramp:encryptionUser>
+ <ramp:passwordCallbackClass>org.apache.rahas.PWCallback</ramp:passwordCallbackClass>
+
+ <ramp:signatureCrypto>
+ <ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
+ <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
+ <ramp:property name="org.apache.ws.security.crypto.merlin.file">rahas-sts.jks</ramp:property>
+ <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">password</ramp:property>
+ </ramp:crypto>
+ </ramp:signatureCrypto>
+ <ramp:encryptionCypto>
+ <ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
+ <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
+ <ramp:property name="org.apache.ws.security.crypto.merlin.file">rahas-sts.jks</ramp:property>
+ <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">password</ramp:property>
+ </ramp:crypto>
+ </ramp:encryptionCypto>
+ </ramp:RampartConfig>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
</service>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/rahas/s3-services.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/rahas/s3-services.xml?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/rahas/s3-services.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/rahas/s3-services.xml Tue Jan 31 00:17:19 2017
@@ -51,20 +51,42 @@
</saml-issuer-config>
</parameter>
- <parameter name="InflowSecurity">
- <action>
- <items>UsernameToken Timestamp</items>
- <passwordCallbackClass xmlns="">org.apache.rahas.PWCallback</passwordCallbackClass>
- </action>
- </parameter>
+ <wsp:Policy wsu:Id="UTOverTransport" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:TransportToken>
+ <wsp:Policy>
+ <!-- <sp:HttpsToken RequireClientCertificate="false"/> -->
+ </wsp:Policy>
+ </sp:TransportToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic128/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Lax/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ </wsp:Policy>
+ </sp:TransportBinding>
+ <sp:SignedSupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient" />
+ </wsp:Policy>
+ </sp:SignedSupportingTokens>
+
+ <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
+ <ramp:user>ip</ramp:user>
+ <ramp:passwordCallbackClass>org.apache.rampart.PWCallback</ramp:passwordCallbackClass>
+ </ramp:RampartConfig>
- <parameter name="OutflowSecurity">
- <action>
- <items>Timestamp</items>
- <user>ip</user>
- <passwordCallbackClass xmlns="">org.apache.rahas.PWCallback</passwordCallbackClass>
- <enableSignatureConfirmation>false</enableSignatureConfirmation>
- </action>
- </parameter>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
</service>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/rahas/s5-services.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/rahas/s5-services.xml?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/rahas/s5-services.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-integration/src/test/resources/rahas/s5-services.xml Tue Jan 31 00:17:19 2017
@@ -51,20 +51,44 @@
</saml-issuer-config>
</parameter>
- <parameter name="InflowSecurity">
- <action>
- <items>UsernameToken Timestamp</items>
- <passwordCallbackClass xmlns="">org.apache.rahas.PWCallback</passwordCallbackClass>
- </action>
- </parameter>
- <parameter name="OutflowSecurity">
- <action>
- <items>Timestamp</items>
- <user>ip</user>
- <passwordCallbackClass xmlns="">org.apache.rahas.PWCallback</passwordCallbackClass>
- <enableSignatureConfirmation>false</enableSignatureConfirmation>
- </action>
- </parameter>
+ <wsp:Policy wsu:Id="UTOverTransport" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:TransportToken>
+ <wsp:Policy>
+ <!-- <sp:HttpsToken RequireClientCertificate="false"/> -->
+ </wsp:Policy>
+ </sp:TransportToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic128/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Lax/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ </wsp:Policy>
+ </sp:TransportBinding>
+ <sp:SignedSupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient" />
+ </wsp:Policy>
+ </sp:SignedSupportingTokens>
+
+ <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
+ <ramp:user>ip</ramp:user>
+ <ramp:passwordCallbackClass>org.apache.rampart.PWCallback</ramp:passwordCallbackClass>
+ </ramp:RampartConfig>
+
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
</service>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-mar/module.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-mar/module.xml?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-mar/module.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-mar/module.xml Tue Jan 31 00:17:19 2017
@@ -9,9 +9,6 @@
<handler name="PolicyBasedSecurityInHandler" class="org.apache.rampart.handler.RampartReceiver">
<order phase="Security" phaseFirst="true"/>
</handler>
- <handler name="SecurityInHandler" class="org.apache.rampart.handler.WSDoAllReceiver">
- <order phase="Security"/>
- </handler>
<handler name="PostDispatchVerificationHandler" class="org.apache.rampart.handler.PostDispatchVerificationHandler">
<order phase="Dispatch" phaseLast="true"/>
</handler>
@@ -19,18 +16,12 @@
</InFlow>
<OutFlow>
- <handler name="SecurityOutHandler" class="org.apache.rampart.handler.WSDoAllSender">
- <order phase="Security"/>
- </handler>
<handler name="PolicyBasedSecurityOutHandler" class="org.apache.rampart.handler.RampartSender">
<order phase="Security" phaseLast="true"/>
</handler>
</OutFlow>
<OutFaultFlow>
- <handler name="SecurityOutHandler" class="org.apache.rampart.handler.WSDoAllSender">
- <order phase="Security"/>
- </handler>
<handler name="PolicyBasedSecurityOutHandler" class="org.apache.rampart.handler.RampartSender">
<order phase="Security" phaseLast="true"/>
</handler>
@@ -40,9 +31,6 @@
<handler name="PolicyBasedSecurityInHandler" class="org.apache.rampart.handler.RampartReceiver">
<order phase="Security" phaseFirst="true"/>
</handler>
- <handler name="SecurityInHandler" class="org.apache.rampart.handler.WSDoAllReceiver">
- <order phase="Security"/>
- </handler>
</InFaultFlow>
<supported-policy-namespaces namespaces="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"/>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-mar/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-mar/pom.xml?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-mar/pom.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-mar/pom.xml Tue Jan 31 00:17:19 2017
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-project</artifactId>
- <version>1.7.0-SNAPSHOT</version>
+ <version>1.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -34,31 +34,9 @@
<packaging>mar</packaging>
<name>Rampart - Mar</name>
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/axis/axis2/java/rampart/trunk</connection>
- <developerConnection>
- scm:svn:https://svn.apache.org/repos/asf/axis/axis2/java/rampart/trunk
- </developerConnection>
- <url>http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk</url>
- </scm>
-
<build>
- <sourceDirectory>src/main/java</sourceDirectory>
- <resources>
- <resource>
- <directory>src/main/java</directory>
- </resource>
- </resources>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-mar-maven-plugin</artifactId>
<extensions>true</extensions>
@@ -70,7 +48,6 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
- <version>1.0</version>
<executions>
<execution>
<id>aar</id>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/pom.xml?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/pom.xml (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/pom.xml Tue Jan 31 00:17:19 2017
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.rampart</groupId>
<artifactId>rampart-project</artifactId>
- <version>1.7.0-SNAPSHOT</version>
+ <version>1.8.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -34,40 +34,24 @@
<packaging>jar</packaging>
<name>Rampart - Policy</name>
- <build>
- <sourceDirectory>src/main/java</sourceDirectory>
- <resources>
- <resource>
- <directory>src/main/java</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <version>2.0-beta-5</version>
- <configuration>
- <templateDirectory>${basedir}</templateDirectory>
- <menu ref="parent" />
- </configuration>
- </plugin>
- </plugins>
- </reporting>
-
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-kernel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>axiom-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>axiom-truth</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/Constants.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/Constants.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/Constants.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/Constants.java Tue Jan 31 00:17:19 2017
@@ -201,6 +201,10 @@ public class Constants {
public static final String XPATH_FILTER20 = "XPathFilter20";
// /////////////////////////////////////////////////////////////////////
+
+ public final static String WSS_KERBEROS_TOKEN11 = "http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#GSS_Kerberosv5_AP_REQ";
+
+ // /////////////////////////////////////////////////////////////////////
public static final QName ATTR_XPATH_VERSION = new QName(SP_NS, "XPathVersion", Constants.SP_PREFIX);
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/SP11Constants.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/SP11Constants.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/SP11Constants.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/SP11Constants.java Tue Jan 31 00:17:19 2017
@@ -258,6 +258,15 @@ public class SP11Constants {
public static final QName BODY = new QName(SP11Constants.SP_NS, "Body");
+ public static final QName KERBEROS_TOKEN = new QName(SP11Constants.SP_NS,
+ SPConstants.KERBEROS_TOKEN, SP11Constants.SP_PREFIX);
+
+ public static final QName REQUIRE_KERBEROS_GSS_V5_TOKEN_11 = new QName(SP11Constants.SP_NS,
+ SPConstants.REQUIRE_KERBEROS_GSS_V5_TOKEN_11, SP11Constants.SP_PREFIX);
+
+ public static final QName REQUIRE_KERBEROS_V5_TOKEN_11 = new QName(SP11Constants.SP_NS,
+ SPConstants.REQUIRE_KERBEROS_V5_TOKEN_11, SP11Constants.SP_PREFIX);
+
public static int getInclusionFromAttributeValue(String value ) {
if (INCLUDE_ALWAYS.equals(value)) {
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/SP12Constants.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/SP12Constants.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/SP12Constants.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/SP12Constants.java Tue Jan 31 00:17:19 2017
@@ -317,6 +317,15 @@ public class SP12Constants {
////////////////////////////////////////////////////////////////////////////////////////////////
+ public static final QName KERBEROS_TOKEN = new QName(SP12Constants.SP_NS,
+ SPConstants.KERBEROS_TOKEN, SP12Constants.SP_PREFIX);
+
+ public static final QName REQUIRE_KERBEROS_GSS_V5_TOKEN_11 = new QName(SP12Constants.SP_NS,
+ SPConstants.REQUIRE_KERBEROS_GSS_V5_TOKEN_11, SP12Constants.SP_PREFIX);
+
+ public static final QName REQUIRE_KERBEROS_V5_TOKEN_11 = new QName(SP12Constants.SP_NS,
+ SPConstants.REQUIRE_KERBEROS_V5_TOKEN_11, SP12Constants.SP_PREFIX);
+
public static int getInclusionFromAttributeValue(String value ) {
if (INCLUDE_ALWAYS.equals(value)) {
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/SPConstants.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/SPConstants.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/SPConstants.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/SPConstants.java Tue Jan 31 00:17:19 2017
@@ -131,6 +131,7 @@ public class SPConstants {
public final static String USERNAME_TOKEN11 = "WssUsernameToken11";
+ public final static String KERBEROS_TOKEN = "KerberosToken";
public final static String TRANSPORT_TOKEN = "TransportToken";
@@ -429,7 +430,7 @@ public class SPConstants {
public static final String HASH_PASSWORD = "HashPassword";
-
+ public static final String REQUIRE_KERBEROS_V5_TOKEN_11 = "WssKerberosV5ApReqToken11";
-
+ public static final String REQUIRE_KERBEROS_GSS_V5_TOKEN_11 = "WssGssKerberosV5ApReqToken11";
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AbstractConfigurableSecurityAssertion.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AbstractConfigurableSecurityAssertion.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AbstractConfigurableSecurityAssertion.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AbstractConfigurableSecurityAssertion.java Tue Jan 31 00:17:19 2017
@@ -22,16 +22,16 @@ import org.apache.neethi.Assertion;
public abstract class AbstractConfigurableSecurityAssertion extends AbstractSecurityAssertion {
- protected ArrayList configurations = null;
+ protected ArrayList<Assertion> configurations = null;
public void addConfiguration(Assertion assertion) {
if (configurations == null) {
- configurations = new ArrayList();
+ configurations = new ArrayList<Assertion>();
}
configurations.add(assertion);
}
- public List getConfigurations() {
+ public List<Assertion> getConfigurations() {
return configurations;
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AbstractSecurityAssertion.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AbstractSecurityAssertion.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AbstractSecurityAssertion.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AbstractSecurityAssertion.java Tue Jan 31 00:17:19 2017
@@ -21,9 +21,6 @@ import javax.xml.stream.XMLStreamWriter;
import org.apache.neethi.Assertion;
import org.apache.neethi.PolicyComponent;
-import org.apache.ws.secpolicy.SP12Constants;
-import org.apache.ws.secpolicy.SPConstants;
-import org.apache.ws.secpolicy.SP12Constants;
public abstract class AbstractSecurityAssertion implements Assertion {
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AsymmetricBinding.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AsymmetricBinding.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AsymmetricBinding.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AsymmetricBinding.java Tue Jan 31 00:17:19 2017
@@ -24,6 +24,7 @@ import javax.xml.stream.XMLStreamExcepti
import javax.xml.stream.XMLStreamWriter;
import org.apache.neethi.All;
+import org.apache.neethi.Assertion;
import org.apache.neethi.ExactlyOne;
import org.apache.neethi.Policy;
import org.apache.neethi.PolicyComponent;
@@ -86,7 +87,7 @@ public class AsymmetricBinding extends S
}
AlgorithmSuite algorithmSuite = getAlgorithmSuite();
- List configs = algorithmSuite.getConfigurations();
+ List<Assertion> configs = algorithmSuite.getConfigurations();
Policy policy = new Policy();
ExactlyOne exactlyOne = new ExactlyOne();
@@ -96,7 +97,7 @@ public class AsymmetricBinding extends S
All wrapper;
AsymmetricBinding asymmetricBinding;
- for (Iterator iterator = configs.iterator(); iterator.hasNext();) {
+ for (Iterator<Assertion> iterator = configs.iterator(); iterator.hasNext();) {
wrapper = new All();
asymmetricBinding = new AsymmetricBinding(this.version);
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/ContentEncryptedElements.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/ContentEncryptedElements.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/ContentEncryptedElements.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/ContentEncryptedElements.java Tue Jan 31 00:17:19 2017
@@ -25,15 +25,14 @@ import javax.xml.stream.XMLStreamExcepti
import javax.xml.stream.XMLStreamWriter;
import org.apache.neethi.PolicyComponent;
-import org.apache.ws.secpolicy.SP11Constants;
import org.apache.ws.secpolicy.SP12Constants;
import org.apache.ws.secpolicy.SPConstants;
public class ContentEncryptedElements extends AbstractSecurityAssertion {
- private ArrayList xPathExpressions = new ArrayList();
+ private ArrayList<String> xPathExpressions = new ArrayList<String>();
- private HashMap declaredNamespaces = new HashMap();
+ private HashMap<String, String> declaredNamespaces = new HashMap<String, String>();
private String xPathVersion;
@@ -44,7 +43,7 @@ public class ContentEncryptedElements ex
/**
* @return Returns the xPathExpressions.
*/
- public ArrayList getXPathExpressions() {
+ public ArrayList<String> getXPathExpressions() {
return xPathExpressions;
}
@@ -67,7 +66,7 @@ public class ContentEncryptedElements ex
xPathVersion = pathVersion;
}
- public HashMap getDeclaredNamespaces () {
+ public HashMap<String, String> getDeclaredNamespaces () {
return declaredNamespaces;
}
@@ -90,9 +89,9 @@ public class ContentEncryptedElements ex
String xpathExpression;
- for (Iterator iterator = xPathExpressions.iterator(); iterator
+ for (Iterator<String> iterator = xPathExpressions.iterator(); iterator
.hasNext();) {
- xpathExpression = (String) iterator.next();
+ xpathExpression = iterator.next();
// <sp:XPath ..>
writeStartElement(writer, prefix, SPConstants.XPATH_EXPR, namespaceURI);
writer.writeCharacters(xpathExpression);
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/RequiredElements.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/RequiredElements.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/RequiredElements.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/RequiredElements.java Tue Jan 31 00:17:19 2017
@@ -31,9 +31,9 @@ import org.apache.ws.secpolicy.SPConstan
public class RequiredElements extends AbstractSecurityAssertion {
- private ArrayList xPathExpressions = new ArrayList();
+ private ArrayList<String> xPathExpressions = new ArrayList<String>();
- private HashMap declaredNamespaces = new HashMap();
+ private HashMap<String, String> declaredNamespaces = new HashMap<String, String>();
private String xPathVersion;
@@ -44,7 +44,7 @@ public class RequiredElements extends Ab
/**
* @return Returns the xPathExpressions.
*/
- public ArrayList getXPathExpressions() {
+ public ArrayList<String> getXPathExpressions() {
return xPathExpressions;
}
@@ -67,7 +67,7 @@ public class RequiredElements extends Ab
xPathVersion = pathVersion;
}
- public HashMap getDeclaredNamespaces () {
+ public HashMap<String, String> getDeclaredNamespaces () {
return declaredNamespaces;
}
@@ -90,7 +90,7 @@ public class RequiredElements extends Ab
String xpathExpression;
- for (Iterator iterator = xPathExpressions.iterator(); iterator
+ for (Iterator<String> iterator = xPathExpressions.iterator(); iterator
.hasNext();) {
xpathExpression = (String) iterator.next();
// <sp:XPath ..>
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/RequiredParts.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/RequiredParts.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/RequiredParts.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/RequiredParts.java Tue Jan 31 00:17:19 2017
@@ -24,13 +24,12 @@ import javax.xml.stream.XMLStreamExcepti
import javax.xml.stream.XMLStreamWriter;
import org.apache.neethi.PolicyComponent;
-import org.apache.ws.secpolicy.SP11Constants;
import org.apache.ws.secpolicy.SP12Constants;
import org.apache.ws.secpolicy.SPConstants;
public class RequiredParts extends AbstractSecurityAssertion {
- private ArrayList headers = new ArrayList();
+ private ArrayList<Header> headers = new ArrayList<Header>();
public RequiredParts(int version) {
setVersion(version);
@@ -39,7 +38,7 @@ public class RequiredParts extends Abstr
/**
* @return Returns the headers.
*/
- public ArrayList getHeaders() {
+ public ArrayList<Header> getHeaders() {
return this.headers;
}
@@ -68,8 +67,8 @@ public class RequiredParts extends Abstr
writeStartElement(writer, prefix, localName, namespaceURI);
Header header;
- for (Iterator iterator = headers.iterator(); iterator.hasNext();) {
- header = (Header) iterator.next();
+ for (Iterator<Header> iterator = headers.iterator(); iterator.hasNext();) {
+ header = iterator.next();
// <sp:Header Name=".." Namespace=".." />
writeStartElement(writer, prefix, SPConstants.HEADER, namespaceURI);
// Name attribute is optional
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SignedEncryptedElements.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SignedEncryptedElements.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SignedEncryptedElements.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SignedEncryptedElements.java Tue Jan 31 00:17:19 2017
@@ -31,9 +31,9 @@ import org.apache.ws.secpolicy.SPConstan
public class SignedEncryptedElements extends AbstractSecurityAssertion {
- private ArrayList xPathExpressions = new ArrayList();
+ private ArrayList<String> xPathExpressions = new ArrayList<String>();
- private HashMap declaredNamespaces = new HashMap();
+ private HashMap<String, String> declaredNamespaces = new HashMap<String, String>();
private String xPathVersion;
@@ -51,7 +51,7 @@ public class SignedEncryptedElements ext
/**
* @return Returns the xPathExpressions.
*/
- public ArrayList getXPathExpressions() {
+ public ArrayList<String> getXPathExpressions() {
return xPathExpressions;
}
@@ -81,7 +81,7 @@ public class SignedEncryptedElements ext
return signedElemets;
}
- public HashMap getDeclaredNamespaces () {
+ public HashMap<String, String> getDeclaredNamespaces () {
return declaredNamespaces;
}
@@ -104,9 +104,9 @@ public class SignedEncryptedElements ext
String xpathExpression;
- for (Iterator iterator = xPathExpressions.iterator(); iterator
+ for (Iterator<String> iterator = xPathExpressions.iterator(); iterator
.hasNext();) {
- xpathExpression = (String) iterator.next();
+ xpathExpression = iterator.next();
// <sp:XPath ..>
writeStartElement(writer, prefix, SPConstants.XPATH_EXPR, namespaceURI);
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SignedEncryptedParts.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SignedEncryptedParts.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SignedEncryptedParts.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SignedEncryptedParts.java Tue Jan 31 00:17:19 2017
@@ -34,7 +34,7 @@ public class SignedEncryptedParts extend
private boolean attachments;
- private ArrayList headers = new ArrayList();
+ private ArrayList<Header> headers = new ArrayList<Header>();
private boolean signedParts;
@@ -84,7 +84,7 @@ public class SignedEncryptedParts extend
/**
* @return Returns the headers.
*/
- public ArrayList getHeaders() {
+ public ArrayList<Header> getHeaders() {
return this.headers;
}
@@ -137,8 +137,8 @@ public class SignedEncryptedParts extend
}
Header header;
- for (Iterator iterator = headers.iterator(); iterator.hasNext();) {
- header = (Header) iterator.next();
+ for (Iterator<Header> iterator = headers.iterator(); iterator.hasNext();) {
+ header = iterator.next();
// <sp:Header Name=".." Namespace=".." />
writeStartElement(writer, prefix, SPConstants.HEADER, namespaceURI);
// Name attribute is optional
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SupportingToken.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SupportingToken.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SupportingToken.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SupportingToken.java Tue Jan 31 00:17:19 2017
@@ -43,7 +43,7 @@ public class SupportingToken extends Abs
private AlgorithmSuite algorithmSuite;
- private ArrayList tokens = new ArrayList();
+ private ArrayList<Token> tokens = new ArrayList<Token>();
private SignedEncryptedElements signedElements;
@@ -84,7 +84,7 @@ public class SupportingToken extends Abs
/**
* @return Returns the token.
*/
- public ArrayList getTokens() {
+ public ArrayList<Token> getTokens() {
return tokens;
}
@@ -289,9 +289,9 @@ public class SupportingToken extends Abs
writeStartElement(writer, SPConstants.POLICY);
Token token;
- for (Iterator iterator = getTokens().iterator(); iterator.hasNext();) {
+ for (Iterator<Token> iterator = getTokens().iterator(); iterator.hasNext();) {
// [Token Assertion] +
- token = (Token) iterator.next();
+ token = iterator.next();
token.serialize(writer);
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SymmetricBinding.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SymmetricBinding.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SymmetricBinding.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/SymmetricBinding.java Tue Jan 31 00:17:19 2017
@@ -24,12 +24,14 @@ import javax.xml.stream.XMLStreamExcepti
import javax.xml.stream.XMLStreamWriter;
import org.apache.neethi.All;
+import org.apache.neethi.Assertion;
import org.apache.neethi.ExactlyOne;
import org.apache.neethi.Policy;
import org.apache.neethi.PolicyComponent;
import org.apache.ws.secpolicy.SP11Constants;
import org.apache.ws.secpolicy.SP12Constants;
import org.apache.ws.secpolicy.SPConstants;
+import org.apache.ws.secpolicy.WSSPolicyException;
public class SymmetricBinding extends SymmetricAsymmetricBindingBase {
@@ -52,11 +54,13 @@ public class SymmetricBinding extends Sy
/**
* @param encryptionToken The encryptionToken to set.
+ * @throws WSSPolicyException
*/
- public void setEncryptionToken(EncryptionToken encryptionToken) {
+ public void setEncryptionToken(EncryptionToken encryptionToken)
+ throws WSSPolicyException {
if(this.protectionToken != null) {
-// throw new WSSPolicyException("Cannot use an EncryptionToken in a " +
-// "SymmetricBinding when there is a ProtectionToken");
+ throw new WSSPolicyException("Cannot use an EncryptionToken in a " +
+ "SymmetricBinding when there is a ProtectionToken");
}
this.encryptionToken = encryptionToken;
}
@@ -70,12 +74,14 @@ public class SymmetricBinding extends Sy
/**
* @param protectionToken The protectionToken to set.
+ * @throws WSSPolicyException
*/
- public void setProtectionToken(ProtectionToken protectionToken) {
+ public void setProtectionToken(ProtectionToken protectionToken)
+ throws WSSPolicyException {
if(this.encryptionToken != null || this.signatureToken != null) {
-// throw new WSSPolicyException("Cannot use a ProtectionToken in a " +
-// "SymmetricBinding when there is a SignatureToken or an" +
-// "EncryptionToken");
+ throw new WSSPolicyException("Cannot use a ProtectionToken in a " +
+ "SymmetricBinding when there is a SignatureToken or an" +
+ "EncryptionToken");
}
this.protectionToken = protectionToken;
}
@@ -89,11 +95,13 @@ public class SymmetricBinding extends Sy
/**
* @param signatureToken The signatureToken to set.
+ * @throws WSSPolicyException
*/
- public void setSignatureToken(SignatureToken signatureToken) {
+ public void setSignatureToken(SignatureToken signatureToken)
+ throws WSSPolicyException {
if(this.protectionToken != null) {
-// throw new WSSPolicyException("Cannot use a SignatureToken in a " +
-// "SymmetricBinding when there is a ProtectionToken");
+ throw new WSSPolicyException("Cannot use a SignatureToken in a " +
+ "SymmetricBinding when there is a ProtectionToken");
}
this.signatureToken = signatureToken;
}
@@ -113,7 +121,7 @@ public class SymmetricBinding extends Sy
}
AlgorithmSuite algorithmSuite = getAlgorithmSuite();
- List configurations = algorithmSuite.getConfigurations();
+ List<Assertion> configurations = algorithmSuite.getConfigurations();
Policy policy = new Policy();
ExactlyOne exactlyOne = new ExactlyOne();
@@ -121,30 +129,33 @@ public class SymmetricBinding extends Sy
All wrapper;
SymmetricBinding symmetricBinding;
- for (Iterator iterator = configurations.iterator(); iterator.hasNext();) {
- wrapper = new All();
- symmetricBinding = new SymmetricBinding(this.version);
-
- algorithmSuite = (AlgorithmSuite) iterator.next();
- symmetricBinding.setAlgorithmSuite(algorithmSuite);
-
- symmetricBinding.setEncryptionToken(getEncryptionToken());
- symmetricBinding.setEntireHeadersAndBodySignatures(isEntireHeadersAndBodySignatures());
- symmetricBinding.setIncludeTimestamp(isIncludeTimestamp());
- symmetricBinding.setLayout(getLayout());
- symmetricBinding.setProtectionOrder(getProtectionOrder());
- symmetricBinding.setProtectionToken(getProtectionToken());
- symmetricBinding.setSignatureProtection(isSignatureProtection());
- symmetricBinding.setSignatureToken(getSignatureToken());
- symmetricBinding.setSignedEndorsingSupportingTokens(getSignedEndorsingSupportingTokens());
- symmetricBinding.setSignedSupportingToken(getSignedSupportingToken());
- symmetricBinding.setTokenProtection(isTokenProtection());
-
- symmetricBinding.setNormalized(true);
- wrapper.addPolicyComponent(symmetricBinding);
- exactlyOne.addPolicyComponent(wrapper);
+ try {
+ for (Iterator<Assertion> iterator = configurations.iterator(); iterator.hasNext();) {
+ wrapper = new All();
+ symmetricBinding = new SymmetricBinding(this.version);
+
+ algorithmSuite = (AlgorithmSuite) iterator.next();
+ symmetricBinding.setAlgorithmSuite(algorithmSuite);
+
+ symmetricBinding.setEncryptionToken(getEncryptionToken());
+ symmetricBinding.setEntireHeadersAndBodySignatures(isEntireHeadersAndBodySignatures());
+ symmetricBinding.setIncludeTimestamp(isIncludeTimestamp());
+ symmetricBinding.setLayout(getLayout());
+ symmetricBinding.setProtectionOrder(getProtectionOrder());
+ symmetricBinding.setProtectionToken(getProtectionToken());
+ symmetricBinding.setSignatureProtection(isSignatureProtection());
+ symmetricBinding.setSignatureToken(getSignatureToken());
+ symmetricBinding.setSignedEndorsingSupportingTokens(getSignedEndorsingSupportingTokens());
+ symmetricBinding.setSignedSupportingToken(getSignedSupportingToken());
+ symmetricBinding.setTokenProtection(isTokenProtection());
+
+ symmetricBinding.setNormalized(true);
+ wrapper.addPolicyComponent(symmetricBinding);
+ exactlyOne.addPolicyComponent(wrapper);
+ }
+ } catch (WSSPolicyException e) {
+ throw new IllegalArgumentException(e);
}
-
policy.addPolicyComponent(exactlyOne);
return policy;
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/TransportBinding.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/TransportBinding.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/TransportBinding.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/TransportBinding.java Tue Jan 31 00:17:19 2017
@@ -25,6 +25,7 @@ import javax.xml.stream.XMLStreamExcepti
import javax.xml.stream.XMLStreamWriter;
import org.apache.neethi.All;
+import org.apache.neethi.Assertion;
import org.apache.neethi.ExactlyOne;
import org.apache.neethi.Policy;
import org.apache.neethi.PolicyComponent;
@@ -36,7 +37,7 @@ public class TransportBinding extends Bi
private TransportToken transportToken;
- private List transportBindings;
+ private List<TransportBinding> transportBindings;
private boolean tokenProtection;
@@ -74,7 +75,7 @@ public class TransportBinding extends Bi
}
- public List getConfigurations() {
+ public List<TransportBinding> getConfigurations() {
return transportBindings;
}
@@ -87,7 +88,7 @@ public class TransportBinding extends Bi
public void addConfiguration(TransportBinding transportBinding) {
if (transportBindings == null) {
- transportBindings = new ArrayList();
+ transportBindings = new ArrayList<TransportBinding>();
}
transportBindings.add(transportBinding);
}
@@ -106,7 +107,7 @@ public class TransportBinding extends Bi
}
AlgorithmSuite algorithmSuite = getAlgorithmSuite();
- List configurations = algorithmSuite.getConfigurations();
+ List<Assertion> configurations = algorithmSuite.getConfigurations();
if (configurations != null && configurations.size() == 1) {
setNormalized(true);
@@ -119,7 +120,7 @@ public class TransportBinding extends Bi
All wrapper;
TransportBinding transportBinding;
- for (Iterator iterator = configurations.iterator(); iterator.hasNext();) {
+ for (Iterator<Assertion> iterator = configurations.iterator(); iterator.hasNext();) {
wrapper = new All();
transportBinding = new TransportBinding(this.getVersion());
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/Trust10.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/Trust10.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/Trust10.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/Trust10.java Tue Jan 31 00:17:19 2017
@@ -23,7 +23,6 @@ import javax.xml.stream.XMLStreamWriter;
import org.apache.neethi.PolicyComponent;
import org.apache.ws.secpolicy.SP11Constants;
import org.apache.ws.secpolicy.SPConstants;
-import org.apache.ws.secpolicy.SP12Constants;
/**
* Model bean to capture Trust10 assertion info
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/Trust13.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/Trust13.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/Trust13.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/Trust13.java Tue Jan 31 00:17:19 2017
@@ -21,7 +21,6 @@ import javax.xml.stream.XMLStreamExcepti
import javax.xml.stream.XMLStreamWriter;
import org.apache.neethi.PolicyComponent;
-import org.apache.ws.secpolicy.SP11Constants;
import org.apache.ws.secpolicy.SPConstants;
import org.apache.ws.secpolicy.SP12Constants;
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/UsernameToken.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/UsernameToken.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/UsernameToken.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/UsernameToken.java Tue Jan 31 00:17:19 2017
@@ -109,46 +109,41 @@ public class UsernameToken extends Token
if (inclusion != null) {
writeAttribute(writer, prefix, namespaceURI, SPConstants.ATTR_INCLUDE_TOKEN, inclusion);
}
-
- if (isUseUTProfile10() || isUseUTProfile11()) {
- // <wsp:Policy>
- writeStartElement(writer, SPConstants.POLICY);
-
- // CHECKME
- if (isUseUTProfile10()) {
- // <sp:WssUsernameToken10 />
- writeStartElement(writer, prefix, SPConstants.USERNAME_TOKEN10 , namespaceURI);
- } else {
- // <sp:WssUsernameToken11 />
- writeStartElement(writer, prefix, SPConstants.USERNAME_TOKEN11 , namespaceURI);
+
+ // <wsp:Policy>
+ writeStartElement(writer, SPConstants.POLICY);
+
+ if (version == SPConstants.SP_V12) {
+
+ if (isNoPassword()) {
+ writeEmptyElement(writer, prefix, SPConstants.NO_PASSWORD, namespaceURI);
+ } else if (isHashPassword()){
+ writeEmptyElement(writer, prefix, SPConstants.HASH_PASSWORD, namespaceURI);
}
- if (version == SPConstants.SP_V12) {
-
- if (isNoPassword()) {
- writeEmptyElement(writer, prefix, SPConstants.NO_PASSWORD, namespaceURI);
- } else if (isHashPassword()){
- writeEmptyElement(writer, prefix, SPConstants.HASH_PASSWORD, namespaceURI);
- }
-
- if (isDerivedKeys()) {
- writeEmptyElement(writer, prefix, SPConstants.REQUIRE_DERIVED_KEYS, namespaceURI);
- } else if (isExplicitDerivedKeys()) {
- writeEmptyElement(writer, prefix, SPConstants.REQUIRE_EXPLICIT_DERIVED_KEYS, namespaceURI);
- } else if (isImpliedDerivedKeys()) {
- writeEmptyElement(writer, prefix, SPConstants.REQUIRE_IMPLIED_DERIVED_KEYS, namespaceURI);
- }
-
+ if (isDerivedKeys()) {
+ writeEmptyElement(writer, prefix, SPConstants.REQUIRE_DERIVED_KEYS, namespaceURI);
+ } else if (isExplicitDerivedKeys()) {
+ writeEmptyElement(writer, prefix, SPConstants.REQUIRE_EXPLICIT_DERIVED_KEYS, namespaceURI);
+ } else if (isImpliedDerivedKeys()) {
+ writeEmptyElement(writer, prefix, SPConstants.REQUIRE_IMPLIED_DERIVED_KEYS, namespaceURI);
}
- writer.writeEndElement();
-
- // </wsp:Policy>
- writer.writeEndElement();
-
+
+ }
+
+ if (isUseUTProfile10()) {
+ // <sp:WssUsernameToken10 />
+ writeEmptyElement(writer, prefix, SPConstants.USERNAME_TOKEN10 , namespaceURI);
+ } else if(isUseUTProfile11()) {
+ // <sp:WssUsernameToken11 />
+ writeEmptyElement(writer, prefix, SPConstants.USERNAME_TOKEN11 , namespaceURI);
}
+ // </wsp:Policy>
writer.writeEndElement();
+
// </sp:UsernameToken>
+ writer.writeEndElement();
}
}
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/AlgorithmSuiteBuilder.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/AlgorithmSuiteBuilder.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/AlgorithmSuiteBuilder.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/AlgorithmSuiteBuilder.java Tue Jan 31 00:17:19 2017
@@ -40,8 +40,8 @@ public class AlgorithmSuiteBuilder imple
Policy policy = PolicyEngine.getPolicy(element.getFirstElement());
policy = (Policy) policy.normalize(false);
- Iterator iterAlterns = policy.getAlternatives();
- List assertions = ((List) iterAlterns.next());
+ Iterator<List<Assertion>> iterAlterns = policy.getAlternatives();
+ List<Assertion> assertions = iterAlterns.next();
processAlternative(assertions, algorithmSuite);
@@ -49,8 +49,8 @@ public class AlgorithmSuiteBuilder imple
}
- private void processAlternative(List assertions, AlgorithmSuite algorithmSuite) {
- Iterator iterator = assertions.iterator();
+ private void processAlternative(List<Assertion> assertions, AlgorithmSuite algorithmSuite) {
+ Iterator<Assertion> iterator = assertions.iterator();
Assertion assertion = ((Assertion) iterator.next());
String name = assertion.getName().getLocalPart();
try {
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/AsymmetricBindingBuilder.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/AsymmetricBindingBuilder.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/AsymmetricBindingBuilder.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/AsymmetricBindingBuilder.java Tue Jan 31 00:17:19 2017
@@ -43,8 +43,8 @@ public class AsymmetricBindingBuilder im
Policy policy = PolicyEngine.getPolicy(element.getFirstElement());
policy = (Policy) policy.normalize(false);
- for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
- processAlternative((List) iterator.next(), asymmetricBinding);
+ for (Iterator<List<Assertion>> iterator = policy.getAlternatives(); iterator.hasNext();) {
+ processAlternative(iterator.next(), asymmetricBinding);
/*
* since there should be only one alternative
@@ -55,13 +55,13 @@ public class AsymmetricBindingBuilder im
return asymmetricBinding;
}
- private void processAlternative(List assertions, AsymmetricBinding asymmetricBinding) {
+ private void processAlternative(List<Assertion> assertions, AsymmetricBinding asymmetricBinding) {
Assertion assertion;
QName name;
- for (Iterator iterator = assertions.iterator(); iterator.hasNext();) {
- assertion = (Assertion) iterator.next();
+ for (Iterator<Assertion> iterator = assertions.iterator(); iterator.hasNext();) {
+ assertion = iterator.next();
name = assertion.getName();
if (SP11Constants.INITIATOR_TOKEN.equals(name)) {
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/InitiatorTokenBuilder.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/InitiatorTokenBuilder.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/InitiatorTokenBuilder.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/InitiatorTokenBuilder.java Tue Jan 31 00:17:19 2017
@@ -40,19 +40,19 @@ public class InitiatorTokenBuilder imple
Policy policy = PolicyEngine.getPolicy(element.getFirstElement());
policy = (Policy) policy.normalize(false);
- for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
- processAlternative((List) iterator.next(), initiatorToken);
+ for (Iterator<List<Assertion>> iterator = policy.getAlternatives(); iterator.hasNext();) {
+ processAlternative(iterator.next(), initiatorToken);
break; // TODO process all the token that must be set ..
}
return initiatorToken;
}
- private void processAlternative(List assertions, InitiatorToken parent) {
+ private void processAlternative(List<Assertion> assertions, InitiatorToken parent) {
Object token;
- for (Iterator iterator = assertions.iterator(); iterator.hasNext();) {
+ for (Iterator<Assertion> iterator = assertions.iterator(); iterator.hasNext();) {
token = iterator.next();
if (token instanceof Token) {
Modified: axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/IssuedTokenBuilder.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/IssuedTokenBuilder.java?rev=1781009&r1=1781008&r2=1781009&view=diff
==============================================================================
--- axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/IssuedTokenBuilder.java (original)
+++ axis/axis2/java/rampart/branches/RAMPART-385/modules/rampart-policy/src/main/java/org/apache/ws/secpolicy11/builders/IssuedTokenBuilder.java Tue Jan 31 00:17:19 2017
@@ -83,9 +83,9 @@ public class IssuedTokenBuilder implemen
Policy policy = PolicyEngine.getPolicy(policyElement);
policy = (Policy) policy.normalize(false);
- for (Iterator iterator = policy.getAlternatives(); iterator
+ for (Iterator<List<Assertion>> iterator = policy.getAlternatives(); iterator
.hasNext();) {
- processAlternative((List) iterator.next(), issuedToken);
+ processAlternative(iterator.next(), issuedToken);
break; // since there should be only one alternative ..
}
}
@@ -97,12 +97,12 @@ public class IssuedTokenBuilder implemen
return new QName[] { SP11Constants.ISSUED_TOKEN };
}
- private void processAlternative(List assertions, IssuedToken parent) {
+ private void processAlternative(List<Assertion> assertions, IssuedToken parent) {
Assertion assertion;
QName name;
- for (Iterator iterator = assertions.iterator(); iterator.hasNext();) {
- assertion = (Assertion) iterator.next();
+ for (Iterator<Assertion> iterator = assertions.iterator(); iterator.hasNext();) {
+ assertion = iterator.next();
name = assertion.getName();
if (SP11Constants.REQUIRE_DERIVED_KEYS.equals(name)) {