You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2012/01/05 16:12:45 UTC

svn commit: r1227627 - in /cxf/trunk/services/sts: sts-core/src/main/java/org/apache/cxf/sts/ sts-core/src/main/java/org/apache/cxf/sts/operation/ systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/

Author: coheigea
Date: Thu Jan  5 15:12:45 2012
New Revision: 1227627

URL: http://svn.apache.org/viewvc?rev=1227627&view=rev
Log:
[CXF-4010] - Add ability to specific EncryptionProperties per STS instance

Modified:
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSPropertiesMBean.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
    cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/cxf-sts.xml

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSPropertiesMBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSPropertiesMBean.java?rev=1227627&r1=1227626&r2=1227627&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSPropertiesMBean.java (original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSPropertiesMBean.java Thu Jan  5 15:12:45 2012
@@ -21,6 +21,7 @@ package org.apache.cxf.sts;
 
 import javax.security.auth.callback.CallbackHandler;
 
+import org.apache.cxf.sts.service.EncryptionProperties;
 import org.apache.cxf.ws.security.sts.provider.STSException;
 import org.apache.ws.security.components.crypto.Crypto;
 
@@ -99,6 +100,18 @@ public interface STSPropertiesMBean {
     String getEncryptionUsername();
     
     /**
+     * Set the EncryptionProperties to use.
+     * @param encryptionProperties the EncryptionProperties to use.
+     */
+    void setEncryptionProperties(EncryptionProperties encryptionProperties);
+    
+    /**
+     * Get the EncryptionProperties to use.
+     * @return the EncryptionProperties to use.
+     */
+    EncryptionProperties getEncryptionProperties();
+    
+    /**
      * Set the STS issuer name
      * @param issuer the STS issuer name
      */

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java?rev=1227627&r1=1227626&r2=1227627&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java (original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java Thu Jan  5 15:12:45 2012
@@ -31,6 +31,7 @@ import org.apache.cxf.common.classloader
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.phase.PhaseInterceptorChain;
 import org.apache.cxf.resource.ResourceManager;
+import org.apache.cxf.sts.service.EncryptionProperties;
 import org.apache.cxf.ws.security.sts.provider.STSException;
 import org.apache.ws.security.WSSConfig;
 import org.apache.ws.security.WSSecurityException;
@@ -54,6 +55,7 @@ public class StaticSTSProperties impleme
     private String encryptionUsername;
     private String issuer;
     private SignatureProperties signatureProperties = new SignatureProperties();
+    private EncryptionProperties encryptionProperties = new EncryptionProperties();
     private RealmParser realmParser;
     private IdentityMapper identityMapper;
 
@@ -212,6 +214,22 @@ public class StaticSTSProperties impleme
     }
     
     /**
+     * Set the EncryptionProperties to use.
+     * @param encryptionProperties the EncryptionProperties to use.
+     */
+    public void setEncryptionProperties(EncryptionProperties encryptionProperties) {
+        this.encryptionProperties = encryptionProperties;
+    }
+    
+    /**
+     * Get the EncryptionProperties to use.
+     * @return the EncryptionProperties to use.
+     */
+    public EncryptionProperties getEncryptionProperties() {
+        return encryptionProperties;
+    }
+    
+    /**
      * Set the STS issuer name
      * @param issuer the STS issuer name
      */

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java?rev=1227627&r1=1227626&r2=1227627&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java (original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java Thu Jan  5 15:12:45 2012
@@ -439,7 +439,7 @@ public abstract class AbstractOperation 
         RequestClaimCollection claims = tokenRequirements.getClaims();
         providerParameters.setRequestedClaims(claims);
         
-        EncryptionProperties encryptionProperties = new EncryptionProperties();
+        EncryptionProperties encryptionProperties = stsProperties.getEncryptionProperties();
         if (address != null) {
             boolean foundService = false;
             // Get the stored Service object corresponding to the Service endpoint

Modified: cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/cxf-sts.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/cxf-sts.xml?rev=1227627&r1=1227626&r2=1227627&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/cxf-sts.xml (original)
+++ cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/cxf-sts.xml Thu Jan  5 15:12:45 2012
@@ -120,7 +120,6 @@
 
 	<bean id="transportService" class="org.apache.cxf.sts.service.StaticService">
 		<property name="endpoints" ref="transportEndpoints" />
-		<property name="encryptionProperties" ref="encProperties" />
 	</bean>
 
 	<util:list id="transportEndpoints">
@@ -140,6 +139,7 @@
 		<property name="callbackHandlerClass"
 			value="org.apache.cxf.systest.sts.common.CommonCallbackHandler" />
 		<property name="encryptionPropertiesFile" value="stsKeystore.properties" />
+		<property name="encryptionProperties" ref="encProperties" />
 		<property name="issuer" value="DoubleItSTSIssuer" />
 		<property name="encryptionUsername" value="myservicekey" />
 	</bean>