cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1508101 - in /cxf/branches/2.7.x-fixes/rt/security/src: main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java test/java/org/apache/cxf/rt/security/xacml/XACMLRequestBuilderTest.java
Date Mon, 29 Jul 2013 15:31:43 GMT
Author: coheigea
Date: Mon Jul 29 15:31:43 2013
New Revision: 1508101

URL: http://svn.apache.org/r1508101
Log:
Revert to sending truncated URI by default

Modified:
    cxf/branches/2.7.x-fixes/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java
    cxf/branches/2.7.x-fixes/rt/security/src/test/java/org/apache/cxf/rt/security/xacml/XACMLRequestBuilderTest.java

Modified: cxf/branches/2.7.x-fixes/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java?rev=1508101&r1=1508100&r2=1508101&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/security/src/main/java/org/apache/cxf/rt/security/xacml/DefaultXACMLRequestBuilder.java
Mon Jul 29 15:31:43 2013
@@ -54,15 +54,15 @@ import org.opensaml.xacml.ctx.SubjectTyp
  * "{serviceNamespace}serviceName", "{operationNamespace}operationName" and resource URI
are also
  * sent to simplify processing at the PDP side.
  * 
- * For a REST service the request URL is the resource. You can also configure the ability
to 
- * send the truncated request URI instead for a SOAP or REST service. The current DateTime
is 
+ * For a REST service the request URI is the resource. You can also configure the ability
to 
+ * send the full request URL instead for a SOAP or REST service. The current DateTime is

  * also sent in an Environment, however this can be disabled via configuration.
  */
 public class DefaultXACMLRequestBuilder implements XACMLRequestBuilder {
     
     private String action = "execute";
     private boolean sendDateTime = true;
-    private boolean sendFullRequestURL = true;
+    private boolean sendFullRequestURL;
     
     /**
      * Set a new Action String to use

Modified: cxf/branches/2.7.x-fixes/rt/security/src/test/java/org/apache/cxf/rt/security/xacml/XACMLRequestBuilderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/security/src/test/java/org/apache/cxf/rt/security/xacml/XACMLRequestBuilderTest.java?rev=1508101&r1=1508100&r2=1508101&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/security/src/test/java/org/apache/cxf/rt/security/xacml/XACMLRequestBuilderTest.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/security/src/test/java/org/apache/cxf/rt/security/xacml/XACMLRequestBuilderTest.java
Mon Jul 29 15:31:43 2013
@@ -56,7 +56,7 @@ public class XACMLRequestBuilderTest ext
         msg.put(Message.WSDL_OPERATION, QName.valueOf(operation));
         String service = "{http://www.example.org/contract/DoubleIt}DoubleItService";
         msg.put(Message.WSDL_SERVICE, QName.valueOf(service));
-        String resourceURL = "https://localhost:8080/doubleit";
+        String resourceURL = "/doubleit";
         msg.put(Message.REQUEST_URI, resourceURL);
         
         XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
@@ -79,7 +79,7 @@ public class XACMLRequestBuilderTest ext
         msg.put(Message.WSDL_OPERATION, QName.valueOf(operation));
         String service = "{http://www.example.org/contract/DoubleIt}DoubleItService";
         msg.put(Message.WSDL_SERVICE, QName.valueOf(service));
-        String resourceURL = "https://localhost:8080/doubleit";
+        String resourceURL = "/doubleit";
         msg.put(Message.REQUEST_URI, resourceURL);
         
         XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
@@ -114,8 +114,8 @@ public class XACMLRequestBuilderTest ext
         msg.put(Message.WSDL_OPERATION, QName.valueOf(operation));
         String service = "{http://www.example.org/contract/DoubleIt}DoubleItService";
         msg.put(Message.WSDL_SERVICE, QName.valueOf(service));
-        String resourceURL = "https://localhost:8080/doubleit";
-        msg.put(Message.REQUEST_URL, resourceURL);
+        String resourceURL = "/doubleit";
+        msg.put(Message.REQUEST_URI, resourceURL);
         
         XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
         RequestType request = 
@@ -143,8 +143,8 @@ public class XACMLRequestBuilderTest ext
         msg.put(Message.WSDL_OPERATION, QName.valueOf(operation));
         String service = "{http://www.example.org/contract/DoubleIt}DoubleItService";
         msg.put(Message.WSDL_SERVICE, QName.valueOf(service));
-        String resourceURL = "https://localhost:8080/doubleit";
-        msg.put(Message.REQUEST_URL, resourceURL);
+        String resourceURL = "/doubleit";
+        msg.put(Message.REQUEST_URI, resourceURL);
         
         XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
         RequestType request = 
@@ -198,8 +198,8 @@ public class XACMLRequestBuilderTest ext
         msg.put(Message.WSDL_OPERATION, QName.valueOf(operation));
         String service = "{http://www.example.org/contract/DoubleItService}DoubleItService";
         msg.put(Message.WSDL_SERVICE, QName.valueOf(service));
-        String resourceURL = "https://localhost:8080/doubleit";
-        msg.put(Message.REQUEST_URL, resourceURL);
+        String resourceURL = "/doubleit";
+        msg.put(Message.REQUEST_URI, resourceURL);
         
         XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
         RequestType request = 
@@ -250,8 +250,8 @@ public class XACMLRequestBuilderTest ext
         };
         
         MessageImpl msg = new MessageImpl();
-        String resourceURL = "https://localhost:8080/doubleit";
-        msg.put(Message.REQUEST_URL, resourceURL);
+        String resourceURL = "/doubleit";
+        msg.put(Message.REQUEST_URI, resourceURL);
         
         XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
         RequestType request = 
@@ -272,7 +272,7 @@ public class XACMLRequestBuilderTest ext
     }
     
     @org.junit.Test
-    public void testRESTResourceTruncatedURI() throws Exception {
+    public void testRESTResourceFullURL() throws Exception {
         // Mock up a request
         Principal principal = new Principal() {
             public String getName() {
@@ -287,7 +287,7 @@ public class XACMLRequestBuilderTest ext
         msg.put(Message.REQUEST_URI, resourceURI);
         
         XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
-        ((DefaultXACMLRequestBuilder)builder).setSendFullRequestURL(false);
+        ((DefaultXACMLRequestBuilder)builder).setSendFullRequestURL(true);
         RequestType request = 
             builder.createRequest(principal, Collections.singletonList("manager"), msg);
         assertNotNull(request);
@@ -301,7 +301,7 @@ public class XACMLRequestBuilderTest ext
         
         for (AttributeType attribute : resource.getAttributes()) {
             String attributeValue = attribute.getAttributeValues().get(0).getValue();
-            assertEquals(attributeValue, resourceURI);
+            assertEquals(attributeValue, resourceURL);
         }
     }
 }



Mime
View raw message