Author: coheigea
Date: Tue Mar  1 16:22:28 2011
New Revision: 1075882

URL: http://svn.apache.org/viewvc?rev=1075882&view=rev
Log:
[WSS-256] - Adding a config option to turn on or off BSP compliance.

Modified:
    
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/handler/WSHandler.java
    
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/handler/WSHandlerConstants.java

Modified: 
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/handler/WSHandler.java
URL: 
http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/handler/WSHandler.java?rev=1075882&r1=1075881&r2=1075882&view=diff
==============================================================================
--- 
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/handler/WSHandler.java
 (original)
+++ 
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/handler/WSHandler.java
 Tue Mar  1 16:22:28 2011
@@ -264,6 +264,7 @@ public abstract class WSHandler {
             decodeNamespaceQualifiedPasswordTypes(reqData)
         );
         wssConfig.setSecretKeyLength(reqData.getSecretKeyLength());
+        wssConfig.setWsiBSPCompliant(decodeBSPCompliance(reqData));
         reqData.setWssConfig(wssConfig);
 
         if ((doAction & WSConstants.SIGN) == WSConstants.SIGN) {
@@ -687,6 +688,13 @@ public abstract class WSHandler {
         return ttl_i;
     }
     
+    protected boolean decodeBSPCompliance(RequestData reqData)
+        throws WSSecurityException {
+        return decodeBooleanConfigValue(
+            reqData, WSHandlerConstants.IS_BSP_COMPLIANT, true
+        );
+    }
+    
     protected String decodePasswordType(RequestData reqData) throws 
WSSecurityException {
         String type = getString(WSHandlerConstants.PASSWORD_TYPE, 
reqData.getMsgContext());
         if (type != null) {

Modified: 
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/handler/WSHandlerConstants.java
URL: 
http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/handler/WSHandlerConstants.java?rev=1075882&r1=1075881&r2=1075882&view=diff
==============================================================================
--- 
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/handler/WSHandlerConstants.java
 (original)
+++ 
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/handler/WSHandlerConstants.java
 Tue Mar  1 16:22:28 2011
@@ -156,7 +156,7 @@ public class WSHandlerConstants {
      * <p/>
      * If the parameter has the value <code>1</code>
      * or <code>true</code> the <code>mustUnderstand</code> is set.
-     * The values <code>0</code> or <code>false</code> supress the
+     * The values <code>0</code> or <code>false</code> suppress the
      * flag.
      * <p/>
      * The application may set this parameter using the following method:
@@ -172,6 +172,23 @@ public class WSHandlerConstants {
      * about the parameter name (<code>"mustUnderstand"</code>).
      */
     public static final String MUST_UNDERSTAND = "mustUnderstand";
+    
+    /**
+     * Sets the <code>isBSPCompliant</code> flag.
+     * <p/>
+     * If the parameter has the value <code>1</code>
+     * or <code>true</code> the <code>isBSPCompliant</code> is set.
+     * The values <code>0</code> or <code>false</code> suppress the
+     * flag.
+     * <p/>
+     * The application may set this parameter using the following method:
+     * <pre>
+     * call.setProperty(WSHandlerConstants.IS_BSP_COMPLIANT, "false");
+     * </pre>
+     * The default setting is <code>true</code>
+     * <p/>
+     */
+    public static final String IS_BSP_COMPLIANT = "isBSPCompliant";
 
     /**
      * The user's name. It is used differently by the WS Security functions.


Reply via email to