incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvazq...@apache.org
Subject svn commit: r790290 - in /sling/trunk: bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/impl/security/ bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/security/ bundles/jcr/jackrabbit...
Date Wed, 01 Jul 2009 17:41:52 GMT
Author: jvazquez
Date: Wed Jul  1 17:41:52 2009
New Revision: 790290

URL: http://svn.apache.org/viewvc?rev=790290&view=rev
Log:
SLING-1028: Additional principals support in LoginModulePlugin

Modified:
    sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/impl/security/PluggableDefaultLoginModule.java
    sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/security/LoginModulePlugin.java
    sling/trunk/bundles/jcr/jackrabbit-server/src/main/resources/repository.xml
    sling/trunk/launchpad/bundles/pom.xml

Modified: sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/impl/security/PluggableDefaultLoginModule.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/impl/security/PluggableDefaultLoginModule.java?rev=790290&r1=790289&r2=790290&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/impl/security/PluggableDefaultLoginModule.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/impl/security/PluggableDefaultLoginModule.java
Wed Jul  1 17:41:52 2009
@@ -18,6 +18,7 @@
 
 import java.security.Principal;
 import java.util.Map;
+import java.util.Set;
 
 import javax.jcr.Credentials;
 import javax.jcr.RepositoryException;
@@ -31,8 +32,6 @@
 import org.apache.sling.jcr.jackrabbit.server.impl.Activator;
 import org.apache.sling.jcr.jackrabbit.server.security.AuthenticationPlugin;
 import org.apache.sling.jcr.jackrabbit.server.security.LoginModulePlugin;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
 
 /**
  * Extends
@@ -47,6 +46,7 @@
     /**
      * @see org.apache.jackrabbit.core.security.authentication.DefaultLoginModule#doInit
      */
+    @SuppressWarnings("unchecked")
     protected void doInit(CallbackHandler callbackHandler, Session session,
             Map options) throws LoginException {
         LoginModulePlugin[] modules = Activator.getLoginModules();
@@ -73,6 +73,20 @@
 
         return super.getPrincipal(creds);
     }
+    
+    /**
+     * @see org.apache.jackrabbit.core.security.authentication.AbstractLoginModule#getPrincipals
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    protected Set getPrincipals() {
+        Set principals = super.getPrincipals();
+        LoginModulePlugin[] modules = Activator.getLoginModules();
+        for (int i = 0; i < modules.length; i++) {
+            modules[i].addPrincipals(principals);
+        }
+        return principals;
+    }
 
     /**
      * @see org.apache.jackrabbit.core.security.authentication.DefaultLoginModule#getAuthentication

Modified: sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/security/LoginModulePlugin.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/security/LoginModulePlugin.java?rev=790290&r1=790289&r2=790290&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/security/LoginModulePlugin.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/security/LoginModulePlugin.java
Wed Jul  1 17:41:52 2009
@@ -18,10 +18,12 @@
 
 import java.security.Principal;
 import java.util.Map;
+import java.util.Set;
 
 import javax.jcr.Credentials;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.security.auth.Subject;
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.login.FailedLoginException;
 import javax.security.auth.login.LoginException;
@@ -56,6 +58,7 @@
     /**
      * @see org.apache.jackrabbit.core.security.authentication.DefaultLoginModule#doInit
      */
+    @SuppressWarnings("unchecked")
     public void doInit(CallbackHandler callbackHandler, Session session,
             Map options) throws LoginException;
 
@@ -69,7 +72,16 @@
      * @see org.apache.jackrabbit.core.security.authentication.DefaultLoginModule#getPrincipal
      */
     public Principal getPrincipal(Credentials credentials);
-
+    
+    /**
+     * Enables to add additional {@link Principal} objects, such as groups or 
+     * roles, to the {@link Subject}. 
+     * 
+     * @param principals original collection of principals
+     */
+    @SuppressWarnings("unchecked")
+    public void addPrincipals(Set principals);
+    
     /**
      * Return a PluggableAuthentication object that can authenticate the give
      * Principal and Credentials. If null is returned, and no other

Modified: sling/trunk/bundles/jcr/jackrabbit-server/src/main/resources/repository.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-server/src/main/resources/repository.xml?rev=790290&r1=790289&r2=790290&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-server/src/main/resources/repository.xml (original)
+++ sling/trunk/bundles/jcr/jackrabbit-server/src/main/resources/repository.xml Wed Jul  1
17:41:52 2009
@@ -28,7 +28,7 @@
         <SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager" workspaceName="security">
         </SecurityManager>
 
-        <AccessManager class="org.apache.jackrabbit.core.security.DefaultAccessManager">
+        <AccessManager class="org.apache.sling.jcr.jackrabbit.server.impl.security.PluggableDefaultAccessManager">
         </AccessManager>
 
         <LoginModule class="org.apache.sling.jcr.jackrabbit.server.impl.security.PluggableDefaultLoginModule">

Modified: sling/trunk/launchpad/bundles/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/bundles/pom.xml?rev=790290&r1=790289&r2=790290&view=diff
==============================================================================
--- sling/trunk/launchpad/bundles/pom.xml (original)
+++ sling/trunk/launchpad/bundles/pom.xml Wed Jul  1 17:41:52 2009
@@ -153,7 +153,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.jcr.jackrabbit.server</artifactId>
-            <version>2.0.4-incubator</version>
+            <version>2.0.5-SNAPSHOT</version>
             <scope>provided</scope>
         </dependency>
         <dependency>



Mime
View raw message