directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r546069 - in /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core: DefaultDirectoryService.java jndi/LdapJndiProperties.java
Date Mon, 11 Jun 2007 10:00:57 GMT
Author: elecharny
Date: Mon Jun 11 03:00:57 2007
New Revision: 546069

URL: http://svn.apache.org/viewvc?view=rev&rev=546069
Log:
- Removed the PARSED_BIND_DN, which was useless (seems to have been needed a while back when
DN weren't parsed by the message decoder)
- Modified the BindHandler so that the simple authentication is handled locally, and not in
the chain, to improve performances
- Added some javadoc

Modified:
    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/jndi/LdapJndiProperties.java

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?view=diff&rev=546069&r1=546068&r2=546069
==============================================================================
--- 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
Mon Jun 11 03:00:57 2007
@@ -47,7 +47,6 @@
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.jndi.AbstractContextFactory;
 import org.apache.directory.server.core.jndi.DeadContext;
-import org.apache.directory.server.core.jndi.PropertyKeys;
 import org.apache.directory.server.core.jndi.ServerLdapContext;
 import org.apache.directory.server.core.partition.DefaultPartitionNexus;
 import org.apache.directory.server.core.partition.PartitionNexus;
@@ -192,10 +191,6 @@
         }
         environment.put( Context.PROVIDER_URL, rootDN );
         
-        if ( principalDn != null )
-        {
-            environment.put( PropertyKeys.PARSED_BIND_DN, principalDn );
-        }
         return new ServerLdapContext( this, environment );
     }
 
@@ -261,10 +256,12 @@
         showSecurityWarnings();
         this.serviceListener = listener;
         started = true;
+        
         if ( !startupConfiguration.getTestEntries().isEmpty() )
         {
             createTestEntries( env );
         }
+        
         listener.afterStartup( this );
     }
 
@@ -751,11 +748,13 @@
         byte[] credential = AbstractContextFactory.getCredential( env );
         String authentication = AbstractContextFactory.getAuthentication( env );
         
-        LdapDN principalDn = ( LdapDN ) env.get( PropertyKeys.PARSED_BIND_DN );
+        LdapDN principalDn = new LdapDN( principal );
+
         ServerLdapContext ctx = ( ServerLdapContext ) 
             getJndiContext( principalDn, principal, credential, authentication, "" );
 
         Iterator i = startupConfiguration.getTestEntries().iterator();
+        
         while ( i.hasNext() )
         {
         	try

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/LdapJndiProperties.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/LdapJndiProperties.java?view=diff&rev=546069&r1=546068&r2=546069
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/LdapJndiProperties.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/LdapJndiProperties.java
Mon Jun 11 03:00:57 2007
@@ -193,34 +193,25 @@
         // Figure out and set the security principal bindDn and saslAuthId
         // -------------------------------------------------------------------
 
-        if ( env.containsKey( PropertyKeys.PARSED_BIND_DN ) )
+        if ( principal == null )
         {
-            props.bindDn = ( LdapDN ) env.get( PropertyKeys.PARSED_BIND_DN );
+            throw new LdapConfigurationException( Context.SECURITY_PRINCIPAL + " cannot be
null." );
         }
-        else
+        
+        if ( !( principal instanceof String ) )
         {
-            if ( principal == null )
-            {
-                throw new LdapConfigurationException( Context.SECURITY_PRINCIPAL + " cannot
be null." );
-            }
-    
-            if ( !( principal instanceof String ) )
-            {
-                throw new LdapConfigurationException( "Don't know how to interpret " + principal.getClass()
-                    + " objects for environment property " + Context.SECURITY_PRINCIPAL );
-            }
-    
-            if ( ( ( String ) principal ).trim().equals( "" ) )
-            {
-                props.bindDn = LdapDN.EMPTY_LDAPDN;
-            }
-            else
-            {
-                props.bindDn = new LdapDN( ( String ) principal );
-            }
+            throw new LdapConfigurationException( "Don't know how to interpret " + principal.getClass()
+                + " objects for environment property " + Context.SECURITY_PRINCIPAL );
         }
         
-        
+        if ( ( ( String ) principal ).trim().equals( "" ) )
+        {
+            props.bindDn = LdapDN.EMPTY_LDAPDN;
+        }
+        else
+        {
+            props.bindDn = new LdapDN( ( String ) principal );
+        }
         
 
         if ( env.get( SASL_AUTHID ) != null && props.level == AuthenticationLevel.STRONG
)



Mime
View raw message