portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r693076 - in /portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed: profiler/impl/ profiler/rules/impl/ serializer/
Date Mon, 08 Sep 2008 12:35:41 GMT
Author: woonsan
Date: Mon Sep  8 05:35:40 2008
New Revision: 693076

URL: http://svn.apache.org/viewvc?rev=693076&view=rev
Log:
Flattening the Principal API.
Modified profiler components to use new flattened security APIs.

Modified:
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/GroupCriterionResolver.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/RoleComboCriterionResolver.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/RoleCriterionResolver.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/UserCriterionResolver.java
    portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/serializer/JetspeedProfilerSerializer.java

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java?rev=693076&r1=693075&r2=693076&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/impl/JetspeedProfilerImpl.java
Mon Sep  8 05:35:40 2008
@@ -40,8 +40,8 @@
 import org.apache.jetspeed.profiler.rules.impl.PrincipalRuleImpl;
 import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.security.SecurityHelper;
-import org.apache.jetspeed.security.UserPrincipal;
-import org.apache.jetspeed.security.impl.UserPrincipalImpl;
+import org.apache.jetspeed.security.UserSubjectPrincipal;
+import org.apache.jetspeed.security.impl.UserImpl;
 import org.apache.ojb.broker.query.Criteria;
 import org.apache.ojb.broker.query.QueryFactory;
 import org.springframework.beans.BeansException;
@@ -64,9 +64,13 @@
     protected final static Log log = LogFactory.getLog(JetspeedProfilerImpl.class);
 
     /**
-     * This is the princapl that is used if there are no principal to rule associations for
the current principal
+     * This is the principal that is used if there are no principal to rule associations
for the current principal
      */
-    public final static Principal DEFAULT_RULE_PRINCIPAL = new UserPrincipalImpl("*");
+    public final static Principal DEFAULT_RULE_PRINCIPAL = new UserImpl();
+    static
+    {
+        ((UserImpl) DEFAULT_RULE_PRINCIPAL).setName("*");
+    }
 
     /** The default locator class implementation */
     private String locatorBean = "ProfileLocator";
@@ -199,7 +203,7 @@
         // get the UserPrincipal, finding the first UserPrincipal, or
         // find the first principal if no UserPrincipal isn't available
         Principal principal = SecurityHelper.getBestPrincipal(subject,
-                UserPrincipal.class);
+                UserSubjectPrincipal.class);
         if (principal == null)
         {
             String msg = "Could not find a principle for subject in request pipeline";

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/GroupCriterionResolver.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/GroupCriterionResolver.java?rev=693076&r1=693075&r2=693076&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/GroupCriterionResolver.java
(original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/GroupCriterionResolver.java
Mon Sep  8 05:35:40 2008
@@ -23,7 +23,7 @@
 import org.apache.jetspeed.profiler.rules.RuleCriterion;
 import org.apache.jetspeed.profiler.rules.RuleCriterionResolver;
 import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.security.GroupPrincipal;
+import org.apache.jetspeed.security.Group;
 
 /**
  * Standard Jetspeed-1 Group resolver.
@@ -60,7 +60,7 @@
              return null;
          }
 
-         return resolvePrincipals(context, criterion, subject, GroupPrincipal.class);
+         return resolvePrincipals(context, criterion, subject, Group.class);
       }
      
      /* (non-Javadoc)

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/RoleComboCriterionResolver.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/RoleComboCriterionResolver.java?rev=693076&r1=693075&r2=693076&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/RoleComboCriterionResolver.java
(original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/RoleComboCriterionResolver.java
Mon Sep  8 05:35:40 2008
@@ -23,7 +23,7 @@
 import org.apache.jetspeed.profiler.rules.RuleCriterion;
 import org.apache.jetspeed.profiler.rules.RuleCriterionResolver;
 import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.security.RolePrincipal;
+import org.apache.jetspeed.security.Role;
 
 /**
  * Role combo resolver 
@@ -59,7 +59,7 @@
             return null;
         }
             
-        return combinePrincipals(context, criterion, subject, RolePrincipal.class);
+        return combinePrincipals(context, criterion, subject, Role.class);
      }
     
     /* (non-Javadoc)

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/RoleCriterionResolver.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/RoleCriterionResolver.java?rev=693076&r1=693075&r2=693076&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/RoleCriterionResolver.java
(original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/RoleCriterionResolver.java
Mon Sep  8 05:35:40 2008
@@ -23,7 +23,7 @@
 import org.apache.jetspeed.profiler.rules.RuleCriterion;
 import org.apache.jetspeed.profiler.rules.RuleCriterionResolver;
 import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.security.RolePrincipal;
+import org.apache.jetspeed.security.Role;
 
 /**
  * Standard Jetspeed-1 Role resolver (not role-based fallback).
@@ -60,7 +60,7 @@
             return null;
         }
             
-        return resolvePrincipals(context, criterion, subject, RolePrincipal.class);
+        return resolvePrincipals(context, criterion, subject, Role.class);
      }
     
     /* (non-Javadoc)

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/UserCriterionResolver.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/UserCriterionResolver.java?rev=693076&r1=693075&r2=693076&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/UserCriterionResolver.java
(original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/impl/UserCriterionResolver.java
Mon Sep  8 05:35:40 2008
@@ -26,7 +26,7 @@
 import org.apache.jetspeed.profiler.rules.RuleCriterionResolver;
 import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.security.SecurityHelper;
-import org.apache.jetspeed.security.UserPrincipal;
+import org.apache.jetspeed.security.User;
 
 /**
  * Standard Jetspeed-1 User resolver.
@@ -63,7 +63,7 @@
             return null;
         }
             
-        Principal principal = SecurityHelper.getPrincipal(subject, UserPrincipal.class);
+        Principal principal = SecurityHelper.getPrincipal(subject, User.class);
         if (principal != null)
         {
             return principal.getName();              

Modified: portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/serializer/JetspeedProfilerSerializer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/serializer/JetspeedProfilerSerializer.java?rev=693076&r1=693075&r2=693076&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/serializer/JetspeedProfilerSerializer.java
(original)
+++ portals/jetspeed-2/portal/branches/security-refactoring/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/serializer/JetspeedProfilerSerializer.java
Mon Sep  8 05:35:40 2008
@@ -31,11 +31,9 @@
 import org.apache.jetspeed.profiler.rules.PrincipalRule;
 import org.apache.jetspeed.profiler.rules.ProfilingRule;
 import org.apache.jetspeed.profiler.rules.RuleCriterion;
-import org.apache.jetspeed.security.BasePrincipal;
 import org.apache.jetspeed.security.SecurityHelper;
 import org.apache.jetspeed.security.User;
 import org.apache.jetspeed.security.UserManager;
-import org.apache.jetspeed.security.UserPrincipal;
 import org.apache.jetspeed.serializer.objects.JSPrincipalRule;
 import org.apache.jetspeed.serializer.objects.JSPrincipalRules;
 import org.apache.jetspeed.serializer.objects.JSProfilingRule;
@@ -90,7 +88,7 @@
                 String anonymousUser = userManager.getAnonymousUser();
                 for (User _user : userManager.getUsers(""))    
                 {
-                    Principal principal = SecurityHelper.getPrincipal(_user.getSubject(),
UserPrincipal.class);
+                    Principal principal = SecurityHelper.getPrincipal(userManager.getSubject(_user),
User.class);
                     if (principal != null)
                     {
                         Collection col = pm.getRulesForPrincipal(principal);



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message