cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1397469 - /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/HttpsTokenBuilder.java
Date Fri, 12 Oct 2012 08:48:00 GMT
Author: coheigea
Date: Fri Oct 12 08:47:59 2012
New Revision: 1397469

URL: http://svn.apache.org/viewvc?rev=1397469&view=rev
Log:
[CXF-4558] - Relax the requirement for a child <wsp:Policy> element for a WS-SecurityPolicy
HttpsToken policy

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/HttpsTokenBuilder.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/HttpsTokenBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/HttpsTokenBuilder.java?rev=1397469&r1=1397468&r2=1397469&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/HttpsTokenBuilder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/HttpsTokenBuilder.java
Fri Oct 12 08:47:59 2012
@@ -18,10 +18,13 @@
  */
 package org.apache.cxf.ws.security.policy.builders;
 
+import java.util.logging.Logger;
+
 import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
 
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.policy.PolicyBuilder;
 import org.apache.cxf.ws.policy.PolicyConstants;
@@ -49,6 +52,8 @@ import org.apache.neethi.builders.Assert
  */
 public class HttpsTokenBuilder implements AssertionBuilder<Element> {
     
+    private static final Logger LOG = LogUtils.getL7dLogger(HttpsTokenBuilder.class);
+    
     PolicyBuilder builder;
     public HttpsTokenBuilder(PolicyBuilder b) {
         builder = b;
@@ -74,21 +79,19 @@ public class HttpsTokenBuilder implement
         } else {
             Element polEl = PolicyConstants.findPolicyElement(element);
             if (polEl == null) {
-                throw new IllegalArgumentException(
-                    "sp:HttpsToken/wsp:Policy must have a value"
-                );
-            }
-            
-            Element child = DOMUtils.getFirstElement(polEl);
-            if (child != null) {
-                if (SP12Constants.HTTP_BASIC_AUTHENTICATION.equals(DOMUtils.getElementQName(child)))
{
-                    httpsToken.setHttpBasicAuthentication(true);
-                } else if (SP12Constants.HTTP_DIGEST_AUTHENTICATION
-                        .equals(DOMUtils.getElementQName(child))) {
-                    httpsToken.setHttpDigestAuthentication(true);
-                } else if (SP12Constants.REQUIRE_CLIENT_CERTIFICATE
-                        .equals(DOMUtils.getElementQName(child))) {
-                    httpsToken.setRequireClientCertificate(true);
+                LOG.warning("sp:HttpsToken/wsp:Policy should have a value!");
+            } else {
+                Element child = DOMUtils.getFirstElement(polEl);
+                if (child != null) {
+                    if (SP12Constants.HTTP_BASIC_AUTHENTICATION.equals(DOMUtils.getElementQName(child)))
{
+                        httpsToken.setHttpBasicAuthentication(true);
+                    } else if (SP12Constants.HTTP_DIGEST_AUTHENTICATION
+                            .equals(DOMUtils.getElementQName(child))) {
+                        httpsToken.setHttpDigestAuthentication(true);
+                    } else if (SP12Constants.REQUIRE_CLIENT_CERTIFICATE
+                            .equals(DOMUtils.getElementQName(child))) {
+                        httpsToken.setRequireClientCertificate(true);
+                    }
                 }
             }
         }



Mime
View raw message