directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1095533 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/ core-api/src/main/java/org/apache/directory/server/core/ppolicy/ core-api/src/test/java/org/apache/directory/server/core/ core-integ/src/test/...
Date Wed, 20 Apr 2011 21:59:27 GMT
Author: elecharny
Date: Wed Apr 20 21:59:26 2011
New Revision: 1095533

URL: http://svn.apache.org/viewvc?rev=1095533&view=rev
Log:
Moved the PPolicy classes out of core-api to core/authn interceptor

Added:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/DefaultPasswordValidator.java
      - copied, changed from r1095232, directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/DefaultPasswordValidator.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyConfiguration.java
      - copied, changed from r1095232, directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PasswordPolicyConfiguration.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyException.java
      - copied, changed from r1095232, directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PasswordPolicyException.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PasswordValidator.java
      - copied, changed from r1095232, directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PasswordValidator.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PpolicyConfigContainer.java
      - copied, changed from r1095232, directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PpolicyConfigContainer.java
Removed:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/DefaultPasswordValidator.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PasswordPolicyConfiguration.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PasswordPolicyException.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PasswordValidator.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PpolicyConfigContainer.java
Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/Authenticator.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java
    directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/ServiceBuilder.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java?rev=1095533&r1=1095532&r2=1095533&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java
Wed Apr 20 21:59:26 2011
@@ -35,8 +35,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.journal.Journal;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.PartitionNexus;
-import org.apache.directory.server.core.ppolicy.PasswordPolicyConfiguration;
-import org.apache.directory.server.core.ppolicy.PpolicyConfigContainer;
 import org.apache.directory.server.core.replication.ReplicationConfiguration;
 import org.apache.directory.server.core.schema.SchemaService;
 import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
@@ -566,28 +564,6 @@ public interface DirectoryService extend
      * @return true if the password policy is enabled, false otherwise
      */
     boolean isPwdPolicyEnabled();
-    
-
-    /**
-     * Gets the effective password policy of the given entry. 
-     * If the entry has defined a custom password policy by setting "pwdPolicySubentry" attribute
-     * then the password policy associated with the Dn specified at the above attribute's
value will be returned.
-     * Otherwise the default password policy will be returned (if present)
-     * 
-     * @param userEntry the user's entry
-     * @return the associated password policy
-     * @throws LdapException
-     */
-    PasswordPolicyConfiguration getPwdPolicy( Entry userEntry ) throws LdapException;
-    
-    
-    /**
-     * set all the password policies to be used by the server.
-     * This includes a default(i.e applicable to all entries) and custom(a.k.a per user)
password policies
-     *  
-     * @param policyContainer the container holding all the password policies
-     */
-    void setPwdPolicies( PpolicyConfigContainer policyContainer );
 
 
     /**

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java?rev=1095533&r1=1095532&r2=1095533&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java
(original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java
Wed Apr 20 21:59:26 2011
@@ -38,8 +38,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.journal.Journal;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.PartitionNexus;
-import org.apache.directory.server.core.ppolicy.PasswordPolicyConfiguration;
-import org.apache.directory.server.core.ppolicy.PpolicyConfigContainer;
 import org.apache.directory.server.core.replication.ReplicationConfiguration;
 import org.apache.directory.server.core.schema.SchemaService;
 import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
@@ -546,23 +544,6 @@ public class MockDirectoryService implem
     /**
      * {@inheritDoc}
      */
-    public PasswordPolicyConfiguration getPwdPolicy( Entry userEntry ) throws LdapException
-    {
-        return null;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void setPwdPolicies( PpolicyConfigContainer policyContainer )
-    {
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     public DnFactory getDnFactory()
     {
         return null;

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java?rev=1095533&r1=1095532&r2=1095533&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
Wed Apr 20 21:59:26 2011
@@ -40,8 +40,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.core.integ.IntegrationUtils;
-import org.apache.directory.server.core.ppolicy.PasswordPolicyConfiguration;
-import org.apache.directory.server.core.ppolicy.PpolicyConfigContainer;
 import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.api.LdapCodecServiceFactory;
 import org.apache.directory.shared.ldap.extras.controls.ppolicy.PasswordPolicy;
@@ -108,7 +106,8 @@ public class PasswordPolicyTest extends 
 
         PpolicyConfigContainer policyContainer = new PpolicyConfigContainer();
         policyContainer.setDefaultPolicy( policyConfig );
-        getService().setPwdPolicies( policyContainer );
+        AuthenticationInterceptor authenticationInterceptor = (AuthenticationInterceptor)getService().getInterceptor(
AuthenticationInterceptor.class.getName() );
+        authenticationInterceptor.setPwdPolicies( policyContainer );
         
         AuthenticationInterceptor authInterceptor = ( AuthenticationInterceptor ) getService()
         .getInterceptor( AuthenticationInterceptor.class.getName() );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=1095533&r1=1095532&r2=1095533&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Wed Apr 20 21:59:26 2011
@@ -44,6 +44,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.administrative.SubschemaAdministrativePoint;
 import org.apache.directory.server.core.administrative.TriggerExecutionAdministrativePoint;
 import org.apache.directory.server.core.authn.AuthenticationInterceptor;
+import org.apache.directory.server.core.authn.ppolicy.PpolicyConfigContainer;
 import org.apache.directory.server.core.authz.AciAuthorizationInterceptor;
 import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
 import org.apache.directory.server.core.changelog.ChangeLog;
@@ -71,8 +72,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.partition.DefaultPartitionNexus;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.PartitionNexus;
-import org.apache.directory.server.core.ppolicy.PasswordPolicyConfiguration;
-import org.apache.directory.server.core.ppolicy.PpolicyConfigContainer;
 import org.apache.directory.server.core.referral.ReferralInterceptor;
 import org.apache.directory.server.core.replication.ReplicationConfiguration;
 import org.apache.directory.server.core.schema.DefaultSchemaService;
@@ -89,9 +88,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.csn.Csn;
 import org.apache.directory.shared.ldap.model.csn.CsnFactory;
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
+import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.Modification;
 import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
@@ -102,7 +101,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.ldif.LdifReader;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.name.Rdn;
-import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.util.tree.DnNode;
 import org.apache.directory.shared.util.DateUtils;
@@ -268,12 +266,6 @@ public class DefaultDirectoryService imp
     /** The TriggerExecution AdministrativePoint cache */
     private DnNode<TriggerExecutionAdministrativePoint> triggerExecutionAPCache;
 
-    /** a container to hold all the ppolicies */
-    private PpolicyConfigContainer pwdPolicyContainer;
-
-    /** the pwdPolicySubentry AT */
-    private AttributeType pwdPolicySubentryAT;
-
     /** The Dn factory */
     private DnFactory dnFactory;
 
@@ -1493,8 +1485,6 @@ public class DefaultDirectoryService imp
         partitions.add( schemaService.getSchemaPartition() );
         systemPartition.getSuffix().apply( schemaManager );
 
-        pwdPolicySubentryAT = schemaManager.lookupAttributeTypeRegistry( "pwdPolicySubentry"
);
-        
         adminDn = getDnFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
         adminSession = new DefaultCoreSession( new LdapPrincipal( schemaManager, adminDn,
AuthenticationLevel.STRONG ), this );
 
@@ -1887,34 +1877,17 @@ public class DefaultDirectoryService imp
     /**
      * {@inheritDoc}
      */
-    public PasswordPolicyConfiguration getPwdPolicy( Entry userEntry ) throws LdapException
+    public boolean isPwdPolicyEnabled()
     {
-        if ( pwdPolicyContainer == null )
-        {
-            return null;
-        }
+        AuthenticationInterceptor authenticationInterceptor = (AuthenticationInterceptor)getInterceptor(
AuthenticationInterceptor.class.getName() );
         
-        if ( pwdPolicyContainer.hasCustomConfigs() )
+        if ( authenticationInterceptor == null )
         {
-            Attribute pwdPolicySubentry = userEntry.get( pwdPolicySubentryAT );
-            
-            if ( pwdPolicySubentry != null )
-            {
-                Dn configDn = getDnFactory().create( pwdPolicySubentry.getString() );
-                
-                return pwdPolicyContainer.getPolicyConfig( configDn );
-            }
+            return false;
         }
-        
-        return pwdPolicyContainer.getDefaultPolicy();
-    }
 
-    
-    /**
-     * {@inheritDoc}
-     */
-    public boolean isPwdPolicyEnabled()
-    {
+        PpolicyConfigContainer pwdPolicyContainer = authenticationInterceptor.getPwdPolicyContainer();
+        
         return ( ( pwdPolicyContainer != null ) 
                 && ( ( pwdPolicyContainer.getDefaultPolicy() != null ) 
                 || ( pwdPolicyContainer.hasCustomConfigs() ) ) );
@@ -1924,15 +1897,6 @@ public class DefaultDirectoryService imp
     /**
      * {@inheritDoc}
      */
-    public void setPwdPolicies( PpolicyConfigContainer policyContainer )
-    {
-        this.pwdPolicyContainer = policyContainer;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     public DnFactory getDnFactory()
     {
         return dnFactory;

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java?rev=1095533&r1=1095532&r2=1095533&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java
Wed Apr 20 21:59:26 2011
@@ -33,12 +33,12 @@ import java.util.Collections;
 import java.util.Date;
 
 import org.apache.directory.server.core.DirectoryService;
-import org.apache.directory.server.core.ppolicy.PasswordPolicyConfiguration;
-import org.apache.directory.server.core.ppolicy.PasswordPolicyException;
+import org.apache.directory.server.core.authn.ppolicy.PasswordPolicyConfiguration;
+import org.apache.directory.server.core.authn.ppolicy.PasswordPolicyException;
 import org.apache.directory.shared.ldap.model.constants.AuthenticationLevel;
+import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.DefaultModification;
 import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.Modification;
 import org.apache.directory.shared.ldap.model.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
@@ -158,7 +158,8 @@ public abstract class AbstractAuthentica
             return;
         }
 
-        PasswordPolicyConfiguration pPolicyConfig = directoryService.getPwdPolicy( userEntry
);
+        AuthenticationInterceptor authenticationInterceptor = (AuthenticationInterceptor)directoryService.getInterceptor(
AuthenticationInterceptor.class.getName() );
+        PasswordPolicyConfiguration pPolicyConfig = authenticationInterceptor.getPwdPolicy(
userEntry );
         
         // check for locked out account
         if( pPolicyConfig.isPwdLockout() )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=1095533&r1=1095532&r2=1095533&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
Wed Apr 20 21:59:26 2011
@@ -50,6 +50,9 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
 import org.apache.directory.server.core.admin.AdministrativePointInterceptor;
+import org.apache.directory.server.core.authn.ppolicy.PasswordPolicyConfiguration;
+import org.apache.directory.server.core.authn.ppolicy.PasswordPolicyException;
+import org.apache.directory.server.core.authn.ppolicy.PpolicyConfigContainer;
 import org.apache.directory.server.core.authz.AciAuthorizationInterceptor;
 import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
 import org.apache.directory.server.core.collective.CollectiveAttributeInterceptor;
@@ -76,8 +79,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
 import org.apache.directory.server.core.normalization.NormalizationInterceptor;
 import org.apache.directory.server.core.operational.OperationalAttributeInterceptor;
-import org.apache.directory.server.core.ppolicy.PasswordPolicyConfiguration;
-import org.apache.directory.server.core.ppolicy.PasswordPolicyException;
 import org.apache.directory.server.core.schema.SchemaInterceptor;
 import org.apache.directory.server.core.subtree.SubentryInterceptor;
 import org.apache.directory.server.core.trigger.TriggerInterceptor;
@@ -150,6 +151,12 @@ public class AuthenticationInterceptor e
 
     private AttributeType AT_PWD_GRACE_USE_TIME;
 
+    /** a container to hold all the ppolicies */
+    private PpolicyConfigContainer pwdPolicyContainer;
+
+    /** the pwdPolicySubentry AT */
+    private AttributeType pwdPolicySubentryAT;
+
 
     /**
      * the set of interceptors we should *not* go through when pwdpolicy state information
is being updated
@@ -192,8 +199,7 @@ public class AuthenticationInterceptor e
         super.init( directoryService );
 
         adminSession = directoryService.getAdminSession();
-
-        loadPwdPolicyStateAtributeTypes();
+        pwdPolicySubentryAT = schemaManager.lookupAttributeTypeRegistry( "pwdPolicySubentry"
);
 
         if ( ( authenticators == null ) || ( authenticators.size() == 0 ) )
         {
@@ -205,6 +211,8 @@ public class AuthenticationInterceptor e
         {
             register( authenticator, directoryService );
         }
+
+        loadPwdPolicyStateAtributeTypes();
     }
 
 
@@ -344,7 +352,7 @@ public class AuthenticationInterceptor e
             return;
         }
         
-        PasswordPolicyConfiguration policyConfig = directoryService.getPwdPolicy( entry );
+        PasswordPolicyConfiguration policyConfig = getPwdPolicy( entry );
 
         boolean isPPolicyReqCtrlPresent = addContext.hasRequestControl( PasswordPolicy.OID
);
 
@@ -503,7 +511,7 @@ public class AuthenticationInterceptor e
         }
 
         // handle the case where pwdPolicySubentry AT is about to be deleted in thid modify()
-        PasswordPolicyConfiguration policyConfig = directoryService.getPwdPolicy( modifyContext.getOriginalEntry()
);
+        PasswordPolicyConfiguration policyConfig = getPwdPolicy( modifyContext.getOriginalEntry()
);
         
         boolean isPPolicyReqCtrlPresent = modifyContext.hasRequestControl( PasswordPolicy.OID
);
         Dn userDn = modifyContext.getSession().getAuthenticatedPrincipal().getDn();
@@ -931,7 +939,7 @@ public class AuthenticationInterceptor e
         Dn dn = bindContext.getDn();
         Entry userEntry = bindContext.getEntry();
         
-        PasswordPolicyConfiguration policyConfig = directoryService.getPwdPolicy( userEntry
);
+        PasswordPolicyConfiguration policyConfig = getPwdPolicy( userEntry );
         
         // check if the user entry is null, it will be null
         // in cases of anonymous bind
@@ -1439,4 +1447,78 @@ public class AuthenticationInterceptor e
             this.newPwd = newPwd;
         }
     }
+    
+
+    /**
+     * Gets the effective password policy of the given entry. 
+     * If the entry has defined a custom password policy by setting "pwdPolicySubentry" attribute
+     * then the password policy associated with the Dn specified at the above attribute's
value will be returned.
+     * Otherwise the default password policy will be returned (if present)
+     * 
+     * @param userEntry the user's entry
+     * @return the associated password policy
+     * @throws LdapException
+     */
+    public PasswordPolicyConfiguration getPwdPolicy( Entry userEntry ) throws LdapException
+    {
+        if ( pwdPolicyContainer == null )
+        {
+            return null;
+        }
+        
+        if ( pwdPolicyContainer.hasCustomConfigs() )
+        {
+            Attribute pwdPolicySubentry = userEntry.get( pwdPolicySubentryAT );
+            
+            if ( pwdPolicySubentry != null )
+            {
+                Dn configDn = adminSession.getDirectoryService().getDnFactory().create( pwdPolicySubentry.getString()
);
+                
+                return pwdPolicyContainer.getPolicyConfig( configDn );
+            }
+        }
+        
+        return pwdPolicyContainer.getDefaultPolicy();
+    }
+    
+    
+    /**
+     * set all the password policies to be used by the server.
+     * This includes a default(i.e applicable to all entries) and custom(a.k.a per user)
password policies
+     *  
+     * @param policyContainer the container holding all the password policies
+     */
+    public void setPwdPolicies( PpolicyConfigContainer policyContainer )
+    {
+        this.pwdPolicyContainer = policyContainer;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isPwdPolicyEnabled()
+    {
+        return ( ( pwdPolicyContainer != null ) 
+                && ( ( pwdPolicyContainer.getDefaultPolicy() != null ) 
+                || ( pwdPolicyContainer.hasCustomConfigs() ) ) );
+    }
+
+
+    /**
+     * @return the pwdPolicyContainer
+     */
+    public PpolicyConfigContainer getPwdPolicyContainer()
+    {
+        return pwdPolicyContainer;
+    }
+
+
+    /**
+     * @param pwdPolicyContainer the pwdPolicyContainer to set
+     */
+    public void setPwdPolicyContainer( PpolicyConfigContainer pwdPolicyContainer )
+    {
+        this.pwdPolicyContainer = pwdPolicyContainer;
+    }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/Authenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/Authenticator.java?rev=1095533&r1=1095532&r2=1095533&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/Authenticator.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/Authenticator.java
Wed Apr 20 21:59:26 2011
@@ -24,9 +24,9 @@ import javax.naming.Context;
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
+import org.apache.directory.server.core.authn.ppolicy.PasswordPolicyException;
 import org.apache.directory.server.core.interceptor.context.BindOperationContext;
 import org.apache.directory.server.core.partition.DefaultPartitionNexus;
-import org.apache.directory.server.core.ppolicy.PasswordPolicyException;
 import org.apache.directory.shared.ldap.model.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.exception.LdapException;

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java?rev=1095533&r1=1095532&r2=1095533&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java
Wed Apr 20 21:59:26 2011
@@ -30,7 +30,7 @@ import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 
-import org.apache.directory.server.core.ppolicy.PasswordPolicyConfiguration;
+import org.apache.directory.server.core.authn.ppolicy.PasswordPolicyConfiguration;
 import org.apache.directory.shared.ldap.model.constants.LdapSecurityConstants;
 import org.apache.directory.shared.ldap.model.entry.Attribute;
 import org.apache.directory.shared.ldap.model.entry.Value;

Copied: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/DefaultPasswordValidator.java
(from r1095232, directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/DefaultPasswordValidator.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/DefaultPasswordValidator.java?p2=directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/DefaultPasswordValidator.java&p1=directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/DefaultPasswordValidator.java&r1=1095232&r2=1095533&rev=1095533&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/DefaultPasswordValidator.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/DefaultPasswordValidator.java
Wed Apr 20 21:59:26 2011
@@ -18,7 +18,7 @@
  *
  */
 
-package org.apache.directory.server.core.ppolicy;
+package org.apache.directory.server.core.authn.ppolicy;
 
 
 /**

Copied: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyConfiguration.java
(from r1095232, directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PasswordPolicyConfiguration.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyConfiguration.java?p2=directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyConfiguration.java&p1=directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PasswordPolicyConfiguration.java&r1=1095232&r2=1095533&rev=1095533&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PasswordPolicyConfiguration.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyConfiguration.java
Wed Apr 20 21:59:26 2011
@@ -18,7 +18,7 @@
  *
  */
 
-package org.apache.directory.server.core.ppolicy;
+package org.apache.directory.server.core.authn.ppolicy;
 
 
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;

Copied: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyException.java
(from r1095232, directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PasswordPolicyException.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyException.java?p2=directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyException.java&p1=directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PasswordPolicyException.java&r1=1095232&r2=1095533&rev=1095533&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PasswordPolicyException.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyException.java
Wed Apr 20 21:59:26 2011
@@ -17,7 +17,7 @@
  *   under the License.
  *
  */
-package org.apache.directory.server.core.ppolicy;
+package org.apache.directory.server.core.authn.ppolicy;
 
 
 import org.apache.directory.shared.ldap.model.exception.LdapException;

Copied: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PasswordValidator.java
(from r1095232, directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PasswordValidator.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PasswordValidator.java?p2=directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PasswordValidator.java&p1=directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PasswordValidator.java&r1=1095232&r2=1095533&rev=1095533&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PasswordValidator.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PasswordValidator.java
Wed Apr 20 21:59:26 2011
@@ -18,7 +18,7 @@
  *
  */
 
-package org.apache.directory.server.core.ppolicy;
+package org.apache.directory.server.core.authn.ppolicy;
 
 /**
  * An interface for implementing password quality verifiers.

Copied: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PpolicyConfigContainer.java
(from r1095232, directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PpolicyConfigContainer.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PpolicyConfigContainer.java?p2=directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PpolicyConfigContainer.java&p1=directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PpolicyConfigContainer.java&r1=1095232&r2=1095533&rev=1095533&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ppolicy/PpolicyConfigContainer.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/ppolicy/PpolicyConfigContainer.java
Wed Apr 20 21:59:26 2011
@@ -18,7 +18,7 @@
  *
  */
 
-package org.apache.directory.server.core.ppolicy;
+package org.apache.directory.server.core.authn.ppolicy;
 
 
 import java.util.HashMap;

Modified: directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/ServiceBuilder.java?rev=1095533&r1=1095532&r2=1095533&view=diff
==============================================================================
--- directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/ServiceBuilder.java
(original)
+++ directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/ServiceBuilder.java
Wed Apr 20 21:59:26 2011
@@ -67,6 +67,8 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.authn.DelegatingAuthenticator;
 import org.apache.directory.server.core.authn.SimpleAuthenticator;
 import org.apache.directory.server.core.authn.StrongAuthenticator;
+import org.apache.directory.server.core.authn.ppolicy.PasswordPolicyConfiguration;
+import org.apache.directory.server.core.authn.ppolicy.PpolicyConfigContainer;
 import org.apache.directory.server.core.changelog.ChangeLog;
 import org.apache.directory.server.core.changelog.DefaultChangeLog;
 import org.apache.directory.server.core.interceptor.Interceptor;
@@ -77,8 +79,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
-import org.apache.directory.server.core.ppolicy.PasswordPolicyConfiguration;
-import org.apache.directory.server.core.ppolicy.PpolicyConfigContainer;
 import org.apache.directory.server.integration.http.HttpServer;
 import org.apache.directory.server.integration.http.WebApp;
 import org.apache.directory.server.kerberos.kdc.KdcServer;
@@ -1292,7 +1292,8 @@ public class ServiceBuilder
             }
         }
         
-        directoryService.setPwdPolicies( ppolicyContainer );
+        AuthenticationInterceptor authenticationInterceptor = (AuthenticationInterceptor)directoryService.getInterceptor(
AuthenticationInterceptor.class.getName() );
+        authenticationInterceptor.setPwdPolicies( ppolicyContainer );
         
         // MaxPDUSize
         directoryService.setMaxPDUSize( directoryServiceBean.getDsMaxPDUSize() );



Mime
View raw message