directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r947806 - in /directory/apacheds/trunk/default-config/src/main: java/org/apache/directory/server/config/ resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmec...
Date Mon, 24 May 2010 20:56:48 GMT
Author: kayyagari
Date: Mon May 24 20:56:48 2010
New Revision: 947806

URL: http://svn.apache.org/viewvc?rev=947806&view=rev
Log:
added default SASL mechanism handlers

Added:
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms.ldif
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=cram-md5.ldif
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=digest-md5.ldif
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=gss-spnego.ldif
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=gssapi.ldif
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=ntlm.ldif
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=simple.ldif
Modified:
    directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
    directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java

Modified: directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java?rev=947806&r1=947805&r2=947806&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
(original)
+++ directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
Mon May 24 20:56:48 2010
@@ -60,6 +60,8 @@ import org.apache.directory.server.integ
 import org.apache.directory.server.kerberos.kdc.KdcServer;
 import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
 import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.server.ldap.handlers.bind.MechanismHandler;
+import org.apache.directory.server.ldap.handlers.bind.ntlm.NtlmMechanismHandler;
 import org.apache.directory.server.ldap.replication.ReplicationProvider;
 import org.apache.directory.server.ldap.replication.SyncreplConfiguration;
 import org.apache.directory.server.ntp.NtpServer;
@@ -218,6 +220,23 @@ public class ConfigPartitionReader
             server.setSearchBaseDn( searchBaseAttr.getString() );
         }
         
+        filter = new EqualityNode<String>( SchemaConstants.OBJECT_CLASS_AT, new StringValue(
+            ConfigSchemaConstants.ADS_LDAP_SERVER_SASL_MECH_HANDLER_OC ) );
+        cursor = se.cursor( ldapServerEntry.getDn(), AliasDerefMode.NEVER_DEREF_ALIASES,
filter, controls );
+        
+        while( cursor.next() )
+        {
+            ForwardIndexEntry<Long, Entry, Long> forwardSaslMechEntry = ( ForwardIndexEntry<Long,
Entry, Long> ) cursor.get();
+            Entry saslMechHandlerEntry = configPartition.lookup( forwardSaslMechEntry.getId()
);
+            if( isEnabled( saslMechHandlerEntry ) )
+            {
+                String mechanism = getString( ConfigSchemaConstants.ADS_LDAP_SERVER_SASL_MECH_NAME,
saslMechHandlerEntry );
+                server.addSaslMechanismHandler( mechanism, getSaslMechHandler( saslMechHandlerEntry
) );
+            }
+        }
+        
+        cursor.close();
+        
         return server;
     }
 
@@ -1334,6 +1353,36 @@ public class ConfigPartitionReader
         return webApps;
     }
 
+    
+    /**
+     * Loads and instantiates a MechanismHandler from the configuration entry
+     *
+     * @param saslMechHandlerEntry the entry of OC type {@link ConfigSchemaConstants#ADS_LDAP_SERVER_SASL_MECH_HANDLER_OC}
+     * @return an instance of the MechanismHandler type
+     * @throws Exception
+     */
+    private MechanismHandler getSaslMechHandler( Entry saslMechHandlerEntry ) throws Exception
+    {
+        String mechClassName = saslMechHandlerEntry.get( ConfigSchemaConstants.ADS_LDAP_SERVER_SASL_MECH_CLASS_NAME
).getString();
+        
+        Class<?> mechClass = Class.forName( mechClassName );
+        
+        MechanismHandler handler = ( MechanismHandler ) mechClass.newInstance();
+        
+        if( mechClass == NtlmMechanismHandler.class )
+        {
+            EntryAttribute ntlmHandlerAttr = saslMechHandlerEntry.get( ConfigSchemaConstants.ADS_LDAP_SERVER_NTLM_MECH_PROVIDER
);
+            if( ntlmHandlerAttr != null )
+            {
+                NtlmMechanismHandler ntlmHandler = ( NtlmMechanismHandler ) handler;
+                ntlmHandler.setNtlmProviderFqcn( ntlmHandlerAttr.getString() );
+            }
+        }
+        
+        return handler;
+    }
+    
+    
     /**
      * internal class used for holding the Interceptor classname and order configuration
      */

Modified: directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java?rev=947806&r1=947805&r2=947806&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java
(original)
+++ directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java
Mon May 24 20:56:48 2010
@@ -210,4 +210,12 @@ public interface ConfigSchemaConstants
     String ADS_REPL_PROVIDER_OC = "ads-replProvider";
     
     String ADS_REPL_PROVIDER_IMPL = "ads-replProviderImpl";
+    
+    String ADS_LDAP_SERVER_SASL_MECH_HANDLER_OC = "ads-ldapServerSaslMechanismHandler";
+    
+    String ADS_LDAP_SERVER_SASL_MECH_NAME = "ads-ldapServerSaslMechName";
+    
+    String ADS_LDAP_SERVER_SASL_MECH_CLASS_NAME = "ads-ldapServerSaslMechClassName";
+    
+    String ADS_LDAP_SERVER_NTLM_MECH_PROVIDER = "ads-ldapServerNtlmMechProvider";
 }

Added: directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/resources/config/ou%3Dconfig/ou%3Dservers/ads-serverid%3Dldapserver/ou%3Dsaslmechanisms.ldif?rev=947806&view=auto
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms.ldif
(added)
+++ directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms.ldif
Mon May 24 20:56:48 2010
@@ -0,0 +1,4 @@
+dn: ou=saslmechanisms,ads-serverId=ldapServer,ou=servers,ou=config
+objectClass: organizationalUnit
+objectClass: top
+ou: saslmechanisms
\ No newline at end of file

Added: directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=cram-md5.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/resources/config/ou%3Dconfig/ou%3Dservers/ads-serverid%3Dldapserver/ou%3Dsaslmechanisms/ads-ldapServerSaslMechName%3Dcram-md5.ldif?rev=947806&view=auto
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=cram-md5.ldif
(added)
+++ directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=cram-md5.ldif
Mon May 24 20:56:48 2010
@@ -0,0 +1,6 @@
+version: 1
+dn: ads-ldapServerSaslMechName=cram-md5,ou=saslmechanisms,ads-serverId=ldapServer,ou=servers,ou=config
+objectClass: ads-ldapServerSaslMechanismHandler
+objectClass: top
+ads-ldapServerSaslMechClassName: org.apache.directory.server.ldap.handlers.bind.cramMD5.CramMd5MechanismHandler
+ads-ldapServerSaslMechName: cram-md5
\ No newline at end of file

Added: directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=digest-md5.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/resources/config/ou%3Dconfig/ou%3Dservers/ads-serverid%3Dldapserver/ou%3Dsaslmechanisms/ads-ldapServerSaslMechName%3Ddigest-md5.ldif?rev=947806&view=auto
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=digest-md5.ldif
(added)
+++ directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=digest-md5.ldif
Mon May 24 20:56:48 2010
@@ -0,0 +1,6 @@
+version: 1
+dn: ads-ldapServerSaslMechName=digest-md5,ou=saslmechanisms,ads-serverId=ldapServer,ou=servers,ou=config
+objectClass: ads-ldapServerSaslMechanismHandler
+objectClass: top
+ads-ldapserversaslmechclassname: org.apache.directory.server.ldap.handlers.bind.digestMD5.DigestMd5MechanismHandler
+ads-ldapServerSaslMechName: digest-md5

Added: directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=gss-spnego.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/resources/config/ou%3Dconfig/ou%3Dservers/ads-serverid%3Dldapserver/ou%3Dsaslmechanisms/ads-ldapServerSaslMechName%3Dgss-spnego.ldif?rev=947806&view=auto
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=gss-spnego.ldif
(added)
+++ directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=gss-spnego.ldif
Mon May 24 20:56:48 2010
@@ -0,0 +1,7 @@
+version: 1
+dn: ads-ldapServerSaslMechName=gss-spnego,ou=saslmechanisms,ads-serverId=ldapServer,ou=servers,ou=config
+objectClass: ads-ldapServerSaslMechanismHandler
+objectClass: top
+ads-ldapserversaslmechclassname: org.apache.directory.server.ldap.handlers.bind.ntlm.NtlmMechanismHandler
+ads-ldapServerSaslMechName: gss-spnego
+ads-ldapServerNtlmMechProvider: com.foo.Bar

Added: directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=gssapi.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/resources/config/ou%3Dconfig/ou%3Dservers/ads-serverid%3Dldapserver/ou%3Dsaslmechanisms/ads-ldapServerSaslMechName%3Dgssapi.ldif?rev=947806&view=auto
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=gssapi.ldif
(added)
+++ directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=gssapi.ldif
Mon May 24 20:56:48 2010
@@ -0,0 +1,6 @@
+version: 1
+dn: ads-ldapServerSaslMechName=gssapi,ou=saslmechanisms,ads-serverId=ldapServer,ou=servers,ou=config
+objectClass: ads-ldapServerSaslMechanismHandler
+objectClass: top
+ads-ldapserversaslmechclassname: org.apache.directory.server.ldap.handlers.bind.gssapi.GssapiMechanismHandler
+ads-ldapServerSaslMechName: gssapi

Added: directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=ntlm.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/resources/config/ou%3Dconfig/ou%3Dservers/ads-serverid%3Dldapserver/ou%3Dsaslmechanisms/ads-ldapServerSaslMechName%3Dntlm.ldif?rev=947806&view=auto
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=ntlm.ldif
(added)
+++ directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=ntlm.ldif
Mon May 24 20:56:48 2010
@@ -0,0 +1,7 @@
+version: 1
+dn: ads-ldapServerSaslMechName=ntlm,ou=saslmechanisms,ads-serverId=ldapServer,ou=servers,ou=config
+objectClass: ads-ldapServerSaslMechanismHandler
+objectClass: top
+ads-ldapserversaslmechclassname: org.apache.directory.server.ldap.handlers.bind.ntlm.NtlmMechanismHandler
+ads-ldapServerSaslMechName: ntlm
+ads-ldapServerNtlmMechProvider: com.foo.Bar

Added: directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=simple.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/resources/config/ou%3Dconfig/ou%3Dservers/ads-serverid%3Dldapserver/ou%3Dsaslmechanisms/ads-ldapServerSaslMechName%3Dsimple.ldif?rev=947806&view=auto
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=simple.ldif
(added)
+++ directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver/ou=saslmechanisms/ads-ldapServerSaslMechName=simple.ldif
Mon May 24 20:56:48 2010
@@ -0,0 +1,6 @@
+version: 1
+dn: ads-ldapServerSaslMechName=simple,ou=saslmechanisms,ads-serverId=ldapServer,ou=servers,ou=config
+objectClass: ads-ldapServerSaslMechanismHandler
+objectClass: top
+ads-ldapserversaslmechclassname: org.apache.directory.server.ldap.handlers.bind.SimpleMechanismHandler
+ads-ldapServerSaslMechName: simple



Mime
View raw message