cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1291583 - in /cxf/trunk: rt/ws/security/src/main/java/org/apache/cxf/ws/security/ rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/ rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/ rt/ws/security/src/m...
Date Tue, 21 Feb 2012 03:55:00 GMT
Author: ffang
Date: Tue Feb 21 03:54:59 2012
New Revision: 1291583

URL: http://svn.apache.org/viewvc?rev=1291583&view=rev
Log:
[CXF-4119]use jaxws property to configure enableRevocation

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/SPConstants.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS10Builder.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS11Builder.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/Wss10.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/Wss11.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/security/SecurityPolicyTest.java
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/security/DoubleIt.wsdl

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java?rev=1291583&r1=1291582&r2=1291583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
Tue Feb 21 03:54:59 2012
@@ -61,6 +61,8 @@ public final class SecurityConstants {
     
     public static final String TIMESTAMP_TTL = "ws-security.timestamp.timeToLive";
     
+    public static final String ENABLE_REVOCATION = "ws-security.enableRevocation";
+    
     //WebLogic and WCF always encrypt UsernameTokens whenever possible
     //See:  http://e-docs.bea.com/wls/docs103/webserv_intro/interop.html
     //Be default, we will encrypt as well for interop reasons.  However, this

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/SPConstants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/SPConstants.java?rev=1291583&r1=1291582&r2=1291583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/SPConstants.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/SPConstants.java
Tue Feb 21 03:54:59 2012
@@ -386,8 +386,7 @@ public abstract class SPConstants {
     
     public static final String MUST_SUPPORT_ISSUED_TOKENS = "MustSupportIssuedTokens";
     
-    public static final String ENABLE_REVOCATION = "EnableRevocation";
-    
+       
     public static final String REQUIRE_REQUEST_SECURITY_TOKEN_COLLECTION 
         = "RequireRequestSecurityTokenCollection";
     

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS10Builder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS10Builder.java?rev=1291583&r1=1291582&r2=1291583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS10Builder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS10Builder.java
Tue Feb 21 03:54:59 2012
@@ -65,9 +65,7 @@ public class WSS10Builder implements Ass
                     parent.setMustSupportRefExternalURI(true);
                 } else if (SPConstants.MUST_SUPPORT_REF_EMBEDDED_TOKEN.equals(name)) {
                     parent.setMustSupportRefEmbeddedToken(true);
-                } else if (SPConstants.ENABLE_REVOCATION.equals(name)) {
-                    parent.setEnableRevocation(true);
-                }
+                } 
                 child = DOMUtils.getNextElement(child);
             }
         }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS11Builder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS11Builder.java?rev=1291583&r1=1291582&r2=1291583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS11Builder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS11Builder.java
Tue Feb 21 03:54:59 2012
@@ -75,9 +75,7 @@ public class WSS11Builder implements Ass
     
                 } else if (SPConstants.REQUIRE_SIGNATURE_CONFIRMATION.equals(name)) {
                     parent.setRequireSignatureConfirmation(true);
-                } else if (SPConstants.ENABLE_REVOCATION.equals(name)) {
-                    parent.setEnableRevocation(true);
-                }
+                } 
                 child = DOMUtils.getNextElement(child);
             }
         }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/Wss10.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/Wss10.java?rev=1291583&r1=1291582&r2=1291583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/Wss10.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/Wss10.java
Tue Feb 21 03:54:59 2012
@@ -31,7 +31,6 @@ public class Wss10 extends AbstractSecur
     private boolean mustSupportRefIssuerSerial;
     private boolean mustSupportRefExternalURI;
     private boolean mustSupportRefEmbeddedToken;
-    private boolean enableRevocation;
 
     public Wss10(SPConstants version) {
         super(version);
@@ -93,20 +92,7 @@ public class Wss10 extends AbstractSecur
         this.mustSupportRefKeyIdentifier = mustSupportRefKeyIdentifier;
     }
     
-    /**
-     * @return Returns the enableRevocation.
-     */
-    public boolean isEnableRevocation() {
-        return enableRevocation;
-    }
-
-    /**
-     * @param enableRevocation The enableRevocation to set.
-     */
-    public void setEnableRevocation(boolean enableRevocation) {
-        this.enableRevocation = enableRevocation;
-    }
-
+        
     public QName getRealName() {
         return constants.getWSS10();
     }
@@ -166,13 +152,7 @@ public class Wss10 extends AbstractSecur
 
         }
         
-        if (isEnableRevocation()) {
-            // <sp:EnableRevocation />
-            writer.writeStartElement(prefix, SPConstants.ENABLE_REVOCATION, namespaceURI);
-            writer.writeEndElement();
-
-        }
-
+        
         // </wsp:Policy>
         writer.writeEndElement();
 

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/Wss11.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/Wss11.java?rev=1291583&r1=1291582&r2=1291583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/Wss11.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/model/Wss11.java
Tue Feb 21 03:54:59 2012
@@ -152,13 +152,7 @@ public class Wss11 extends Wss10 {
             writer.writeEndElement();
         }
         
-        if (isEnableRevocation()) {
-            // <sp:EnableRevocation />
-            writer.writeStartElement(prefix, SPConstants.ENABLE_REVOCATION, namespaceURI);
-            writer.writeEndElement();
-
-        }
-
+        
         // </wsp:Policy>
         writer.writeEndElement();
 

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java?rev=1291583&r1=1291582&r2=1291583&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
Tue Feb 21 03:54:59 2012
@@ -1397,11 +1397,8 @@ public abstract class AbstractBindingBui
     public Crypto getEncryptionCrypto(TokenWrapper wrapper) throws WSSecurityException {
         Crypto crypto = getCrypto(wrapper, SecurityConstants.ENCRYPT_CRYPTO,
                                   SecurityConstants.ENCRYPT_PROPERTIES);
-        Wss10 wss10 = getWss10();
-        if (wss10 == null) {
-            return crypto;
-        }
-        boolean enableRevocation = wss10.isEnableRevocation();
+        boolean enableRevocation = MessageUtils.isTrue(
+                                       message.getContextualProperty(SecurityConstants.ENABLE_REVOCATION));
         if (enableRevocation && crypto != null) {
             CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);
             String encrUser = (String)message.getContextualProperty(SecurityConstants.ENCRYPT_USERNAME);

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/security/SecurityPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/security/SecurityPolicyTest.java?rev=1291583&r1=1291582&r2=1291583&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/security/SecurityPolicyTest.java
(original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/security/SecurityPolicyTest.java
Tue Feb 21 03:54:59 2012
@@ -513,6 +513,8 @@ public class SecurityPolicyTest extends 
                                                       getClass().getResource("alice.properties"));
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES,

                                                       getClass().getResource("revocation.properties"));
+        ((BindingProvider)pt).getRequestContext().put(SecurityConstants.ENABLE_REVOCATION,

+                                                      "true");
         
         DoubleIt di = new DoubleIt();
         di.setNumberToDouble(5);

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/security/DoubleIt.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/security/DoubleIt.wsdl?rev=1291583&r1=1291582&r2=1291583&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/security/DoubleIt.wsdl
(original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/security/DoubleIt.wsdl
Tue Feb 21 03:54:59 2012
@@ -859,7 +859,6 @@
                 <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                     <wsp:Policy>
                         <sp:MustSupportRefIssuerSerial />
-                        <sp:EnableRevocation/>
                     </wsp:Policy>
                 </sp:Wss10>
             </wsp:All>



Mime
View raw message