directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1475674 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/api/ core-jndi/src/main/java/org/apache/directory/server/core/jndi/ core/src/main/java/org/apache/directory/server/core/ interceptors/normaliza...
Date Thu, 25 Apr 2013 08:40:16 GMT
Author: elecharny
Date: Thu Apr 25 08:40:16 2013
New Revision: 1475674

URL: http://svn.apache.org/r1475674
Log:
o Remove the bind() method from the Normalization interceptor
o Normalize the BindContext DN before injecting in into the OperationManager in the coreContextFactory,
LdapCoreSessionConnection and getSession() methods in DirectoryService

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/CoreContextFactory.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java?rev=1475674&r1=1475673&r2=1475674&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
Thu Apr 25 08:40:16 2013
@@ -505,7 +505,7 @@ public class LdapCoreSessionConnection e
     public Entry lookup( String dn, String... attributes ) throws LdapException
     {
         Dn baseDn = new Dn( schemaManager, dn );
-        
+
         return lookup( baseDn, null, attributes );
     }
 
@@ -576,7 +576,7 @@ public class LdapCoreSessionConnection e
      */
     public Entry lookup( Dn dn ) throws LdapException
     {
-        return lookup( dn, (String[])null );
+        return lookup( dn, ( String[] ) null );
     }
 
 
@@ -585,7 +585,7 @@ public class LdapCoreSessionConnection e
      */
     public Entry lookup( String dn ) throws LdapException
     {
-        return lookup( new Dn( schemaManager, dn ), (String[])null );
+        return lookup( new Dn( schemaManager, dn ), ( String[] ) null );
     }
 
 
@@ -1062,7 +1062,7 @@ public class LdapCoreSessionConnection e
             {
                 session.unbind();
             }
-            
+
             session = null;
         }
     }
@@ -1190,7 +1190,8 @@ public class LdapCoreSessionConnection e
 
         BindOperationContext bindContext = new BindOperationContext( null );
         bindContext.setCredentials( bindRequest.getCredentials() );
-        bindContext.setDn( bindRequest.getDn() );
+
+        bindContext.setDn( bindRequest.getDn().apply( directoryService.getSchemaManager()
) );
         bindContext.setInterceptors( directoryService.getInterceptors( OperationEnum.BIND
) );
 
         OperationManager operationManager = directoryService.getOperationManager();

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/CoreContextFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/CoreContextFactory.java?rev=1475674&r1=1475673&r2=1475674&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/CoreContextFactory.java
(original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/CoreContextFactory.java
Thu Apr 25 08:40:16 2013
@@ -53,15 +53,6 @@ public class CoreContextFactory implemen
         env = ( Hashtable<String, Object> ) env.clone();
         Dn principalDn = null;
 
-        try
-        {
-            principalDn = new Dn( getPrincipal( env ) );
-        }
-        catch ( LdapInvalidDnException lide )
-        {
-            throw new InvalidNameException( I18n.err( I18n.ERR_733, env ) );
-        }
-
         byte[] credential = getCredential( env );
         String providerUrl = getProviderUrl( env );
 
@@ -77,6 +68,15 @@ public class CoreContextFactory implemen
             return new DeadContext();
         }
 
+        try
+        {
+            principalDn = new Dn( service.getSchemaManager(), getPrincipal( env ) );
+        }
+        catch ( LdapInvalidDnException lide )
+        {
+            throw new InvalidNameException( I18n.err( I18n.ERR_733, env ) );
+        }
+
         ServerLdapContext ctx = null;
         try
         {

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=1475674&r1=1475673&r2=1475674&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
Thu Apr 25 08:40:16 2013
@@ -981,7 +981,7 @@ public class DefaultDirectoryService imp
 
         BindOperationContext bindContext = new BindOperationContext( null );
         bindContext.setCredentials( credentials );
-        bindContext.setDn( principalDn );
+        bindContext.setDn( principalDn.apply( schemaManager ) );
         bindContext.setInterceptors( getInterceptors( OperationEnum.BIND ) );
 
         operationManager.bind( bindContext );
@@ -1003,7 +1003,7 @@ public class DefaultDirectoryService imp
 
         BindOperationContext bindContext = new BindOperationContext( null );
         bindContext.setCredentials( credentials );
-        bindContext.setDn( principalDn );
+        bindContext.setDn( principalDn.apply( schemaManager ) );
         bindContext.setSaslMechanism( saslMechanism );
         bindContext.setInterceptors( getInterceptors( OperationEnum.BIND ) );
 

Modified: directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=1475674&r1=1475673&r2=1475674&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
(original)
+++ directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
Thu Apr 25 08:40:16 2013
@@ -46,7 +46,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.api.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
-import org.apache.directory.server.core.api.interceptor.context.BindOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.CompareOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.HasEntryOperationContext;
@@ -132,16 +131,6 @@ public class NormalizationInterceptor ex
     /**
      * {@inheritDoc}
      */
-    public void bind( BindOperationContext bindContext ) throws LdapException
-    {
-        bindContext.getDn().apply( schemaManager );
-        next( bindContext );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     public boolean compare( CompareOperationContext compareContext ) throws LdapException
     {
         compareContext.getDn().apply( schemaManager );



Mime
View raw message