cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From owu...@apache.org
Subject svn commit: r1210594 - in /cxf/trunk/services/sts: sts-core/src/main/java/org/apache/cxf/sts/claims/ sts-core/src/test/java/org/apache/cxf/sts/common/ sts-core/src/test/java/org/apache/cxf/sts/ldap/ systests/advanced/src/test/java/org/apache/cxf/systes...
Date Mon, 05 Dec 2011 19:46:41 GMT
Author: owulff
Date: Mon Dec  5 19:46:41 2011
New Revision: 1210594

URL: http://svn.apache.org/viewvc?rev=1210594&view=rev
Log:
[CXF-3930] Extend ClaimsHandler interface to pass current realm and WebServiceContext

Modified:
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsHandler.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomAttributeProvider.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimsHandler.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/ldap/LDAPClaimsTest.java
    cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomAttributeStatementProvider.java
    cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsHandler.java

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java?rev=1210594&r1=1210593&r2=1210594&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java
Mon Dec  5 19:46:41 2011
@@ -40,7 +40,10 @@ public class ClaimsAttributeStatementPro
         if (claimsManager != null) {
             retrievedClaims = 
                 claimsManager.retrieveClaimValues(
-                    providerParameters.getPrincipal(), providerParameters.getRequestedClaims()
+                    providerParameters.getPrincipal(),
+                    providerParameters.getRequestedClaims(),
+                    providerParameters.getWebServiceContext(),
+                    providerParameters.getRealm()
                 );
         }
                 

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsHandler.java?rev=1210594&r1=1210593&r2=1210594&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsHandler.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsHandler.java
Mon Dec  5 19:46:41 2011
@@ -23,6 +23,8 @@ import java.net.URI;
 import java.security.Principal;
 import java.util.List;
 
+import javax.xml.ws.WebServiceContext;
+
 /**
  * This interface provides a pluggable way to handle Claims.
  */
@@ -30,7 +32,8 @@ public interface ClaimsHandler {
 
     List<URI> getSupportedClaimTypes();
 
-    ClaimCollection retrieveClaimValues(Principal principal, RequestClaimCollection claims);
+    ClaimCollection retrieveClaimValues(
+            Principal principal, RequestClaimCollection claims, WebServiceContext context,
String realm);
 
 }
  
\ No newline at end of file

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java?rev=1210594&r1=1210593&r2=1210594&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java
Mon Dec  5 19:46:41 2011
@@ -24,6 +24,8 @@ import java.security.Principal;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.xml.ws.WebServiceContext;
+
 /**
  * This class holds various ClaimsHandler implementations.
  */
@@ -51,11 +53,13 @@ public class ClaimsManager {
         }
     }
 
-    public ClaimCollection retrieveClaimValues(Principal principal, RequestClaimCollection
claims) {
+    public ClaimCollection retrieveClaimValues(
+            Principal principal, RequestClaimCollection claims, WebServiceContext context,
String realm) {
         if (claimHandlers != null && claimHandlers.size() > 0) {
             ClaimCollection returnCollection = new ClaimCollection();
             for (ClaimsHandler handler : claimHandlers) {
-                ClaimCollection claimCollection = handler.retrieveClaimValues(principal,
claims);
+                ClaimCollection claimCollection = handler.retrieveClaimValues(
+                        principal, claims, context, realm);
                 if (claimCollection != null && claimCollection.size() != 0) {
                     returnCollection.addAll(claimCollection);
                 }

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java?rev=1210594&r1=1210593&r2=1210594&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
Mon Dec  5 19:46:41 2011
@@ -37,6 +37,7 @@ import javax.naming.directory.Attributes
 import javax.naming.directory.SearchControls;
 import javax.security.auth.kerberos.KerberosPrincipal;
 import javax.security.auth.x500.X500Principal;
+import javax.xml.ws.WebServiceContext;
 
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.ws.security.sts.provider.STSException;
@@ -91,7 +92,8 @@ public class LdapClaimsHandler implement
         return uriList;
     }
 
-    public ClaimCollection retrieveClaimValues(Principal principal, RequestClaimCollection
claims) {
+    public ClaimCollection retrieveClaimValues(
+            Principal principal, RequestClaimCollection claims, WebServiceContext context,
String realm) {
 
         String user = null;
         if (principal instanceof KerberosPrincipal) {

Modified: cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomAttributeProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomAttributeProvider.java?rev=1210594&r1=1210593&r2=1210594&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomAttributeProvider.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomAttributeProvider.java
Mon Dec  5 19:46:41 2011
@@ -61,7 +61,10 @@ public class CustomAttributeProvider imp
         if (claimsManager != null) {
             retrievedClaims = 
                 claimsManager.retrieveClaimValues(
-                    providerParameters.getPrincipal(), providerParameters.getRequestedClaims()
+                    providerParameters.getPrincipal(),
+                    providerParameters.getRequestedClaims(),
+                    providerParameters.getWebServiceContext(),
+                    providerParameters.getRealm()
                 );
         }
         

Modified: cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimsHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimsHandler.java?rev=1210594&r1=1210593&r2=1210594&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimsHandler.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimsHandler.java
Mon Dec  5 19:46:41 2011
@@ -23,6 +23,8 @@ import java.security.Principal;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.xml.ws.WebServiceContext;
+
 import org.apache.cxf.sts.claims.Claim;
 import org.apache.cxf.sts.claims.ClaimCollection;
 import org.apache.cxf.sts.claims.ClaimTypes;
@@ -47,7 +49,8 @@ public class CustomClaimsHandler impleme
         return knownURIs;
     }
 
-    public ClaimCollection retrieveClaimValues(Principal principal, RequestClaimCollection
claims) {
+    public ClaimCollection retrieveClaimValues(
+            Principal principal, RequestClaimCollection claims, WebServiceContext context,
String realm) {
         if (claims != null && claims.size() > 0) {
             ClaimCollection claimCollection = new ClaimCollection();
             for (RequestClaim requestClaim : claims) {

Modified: cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/ldap/LDAPClaimsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/ldap/LDAPClaimsTest.java?rev=1210594&r1=1210593&r2=1210594&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/ldap/LDAPClaimsTest.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/ldap/LDAPClaimsTest.java
Mon Dec  5 19:46:41 2011
@@ -89,7 +89,7 @@ public class LDAPClaimsTest {
         expectedClaims.add(ClaimTypes.EMAILADDRESS);
 
         ClaimCollection retrievedClaims = 
-            claimsHandler.retrieveClaimValues(new CustomTokenPrincipal(user), requestedClaims);
+            claimsHandler.retrieveClaimValues(new CustomTokenPrincipal(user), requestedClaims,
null, null);
 
         Assert.isTrue(
                       retrievedClaims.size() == expectedClaims.size(), 
@@ -123,7 +123,7 @@ public class LDAPClaimsTest {
         claim.setOptional(false);
         requestedClaims.add(claim);
 
-        claimsHandler.retrieveClaimValues(new CustomTokenPrincipal(user), requestedClaims);
+        claimsHandler.retrieveClaimValues(new CustomTokenPrincipal(user), requestedClaims,
null, null);
 
     }
 
@@ -149,7 +149,7 @@ public class LDAPClaimsTest {
         expectedClaims.add(ClaimTypes.EMAILADDRESS);
 
         ClaimCollection retrievedClaims = 
-            claimsHandler.retrieveClaimValues(new CustomTokenPrincipal(user), requestedClaims);
+            claimsHandler.retrieveClaimValues(new CustomTokenPrincipal(user), requestedClaims,
null, null);
 
         Assert.isTrue(
                       retrievedClaims.size() == expectedClaims.size(), 

Modified: cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomAttributeStatementProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomAttributeStatementProvider.java?rev=1210594&r1=1210593&r2=1210594&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomAttributeStatementProvider.java
(original)
+++ cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomAttributeStatementProvider.java
Mon Dec  5 19:46:41 2011
@@ -43,7 +43,10 @@ public class CustomAttributeStatementPro
         if (claimsManager != null) {
             retrievedClaims = 
                 claimsManager.retrieveClaimValues(
-                    providerParameters.getPrincipal(), providerParameters.getRequestedClaims()
+                    providerParameters.getPrincipal(),
+                    providerParameters.getRequestedClaims(),
+                    providerParameters.getWebServiceContext(),
+                    providerParameters.getRealm()
                 );
         }
 

Modified: cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsHandler.java?rev=1210594&r1=1210593&r2=1210594&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsHandler.java
(original)
+++ cxf/trunk/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsHandler.java
Mon Dec  5 19:46:41 2011
@@ -23,6 +23,8 @@ import java.security.Principal;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.xml.ws.WebServiceContext;
+
 import org.apache.cxf.sts.claims.Claim;
 import org.apache.cxf.sts.claims.ClaimCollection;
 import org.apache.cxf.sts.claims.ClaimsHandler;
@@ -37,7 +39,8 @@ public class CustomClaimsHandler impleme
     public static final URI ROLE = 
             URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role");
 
-    public ClaimCollection retrieveClaimValues(Principal principal, RequestClaimCollection
claims) {
+    public ClaimCollection retrieveClaimValues(
+            Principal principal, RequestClaimCollection claims, WebServiceContext context,
String realm) {
         if (claims != null && claims.size() > 0) {
             ClaimCollection claimCollection = new ClaimCollection();
             for (RequestClaim requestClaim : claims) {



Mime
View raw message