directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r517116 - in /directory/apacheds/branches/apacheds-sasl-branch: constants/src/main/java/org/apache/directory/server/ldap/ constants/src/main/java/org/apache/directory/server/ldap/constants/ core/src/main/java/org/apache/directory/server/cor...
Date Mon, 12 Mar 2007 06:53:42 GMT
Author: akarasulu
Date: Sun Mar 11 23:53:41 2007
New Revision: 517116

URL: http://svn.apache.org/viewvc?view=rev&rev=517116
Log:
centralizing constants for SASL mechanisms

Added:
    directory/apacheds/branches/apacheds-sasl-branch/constants/src/main/java/org/apache/directory/server/ldap/
    directory/apacheds/branches/apacheds-sasl-branch/constants/src/main/java/org/apache/directory/server/ldap/constants/
    directory/apacheds/branches/apacheds-sasl-branch/constants/src/main/java/org/apache/directory/server/ldap/constants/SupportedSASLMechanisms.java
Modified:
    directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/branches/apacheds-sasl-branch/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/AbstractSaslCallbackHandler.java
    directory/apacheds/branches/apacheds-sasl-branch/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/ConfigureChain.java

Added: directory/apacheds/branches/apacheds-sasl-branch/constants/src/main/java/org/apache/directory/server/ldap/constants/SupportedSASLMechanisms.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/constants/src/main/java/org/apache/directory/server/ldap/constants/SupportedSASLMechanisms.java?view=auto&rev=517116
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/constants/src/main/java/org/apache/directory/server/ldap/constants/SupportedSASLMechanisms.java
(added)
+++ directory/apacheds/branches/apacheds-sasl-branch/constants/src/main/java/org/apache/directory/server/ldap/constants/SupportedSASLMechanisms.java
Sun Mar 11 23:53:41 2007
@@ -0,0 +1,37 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.server.ldap.constants;
+
+/**
+ * Contains constants used for populating the supportedSASLMechanisms 
+ * in the RootDSE.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface SupportedSASLMechanisms
+{
+    String ATTRIBUTE = "supportedSASLMechanisms";
+
+    String CRAM_MD5 = "CRAM-MD5";
+    String DIGEST_MD5 = "DIGEST-MD5";
+    String GSSAPI = "GSSAPI";
+    String SIMPLE = "SIMPLE";
+}

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?view=diff&rev=517116&r1=517115&r2=517116
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Sun Mar 11 23:53:41 2007
@@ -46,6 +46,7 @@
 import org.apache.directory.server.core.configuration.PartitionConfiguration;
 import org.apache.directory.server.core.partition.impl.btree.MutableBTreePartitionConfiguration;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
+import org.apache.directory.server.ldap.constants.SupportedSASLMechanisms;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.MultiException;
@@ -85,13 +86,6 @@
  */
 public class DefaultPartitionNexus extends PartitionNexus
 {
-    // SASL mechanism support constants
-    // TODO perhaps these belong in constants module
-    private static final String SUPPORTED_SASL_MECHANISMS_ATTR = "supportedSASLMechanisms";
-    private static final String SASL_MECH_CRAM_MD5 = "CRAM-MD5";
-    private static final String SASL_MECH_DIGEST_MD5 = "DIGEST-MD5";
-    private static final String SASL_MECH_GSSAPI = "GSSAPI";
-    
     private static final Logger log = LoggerFactory.getLogger( DefaultPartitionNexus.class
);
 
     /** Speedup for logs */
@@ -156,11 +150,12 @@
         attr.add( NoticeOfDisconnect.EXTENSION_OID );
 
         // Add the supportedSASLMechanisms attribute to rootDSE
-        attr = new AttributeImpl( SUPPORTED_SASL_MECHANISMS_ATTR );
+        attr = new AttributeImpl( SupportedSASLMechanisms.ATTRIBUTE );
         rootDSE.put( attr );
-        attr.add( SASL_MECH_GSSAPI );
-        attr.add( SASL_MECH_DIGEST_MD5 );
-        attr.add( SASL_MECH_CRAM_MD5 );
+        attr.add( SupportedSASLMechanisms.SIMPLE );
+        attr.add( SupportedSASLMechanisms.GSSAPI );
+        attr.add( SupportedSASLMechanisms.DIGEST_MD5 );
+        attr.add( SupportedSASLMechanisms.CRAM_MD5 );
 
         attr = new AttributeImpl( "supportedControl" );
         rootDSE.put( attr );

Modified: directory/apacheds/branches/apacheds-sasl-branch/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/AbstractSaslCallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/AbstractSaslCallbackHandler.java?view=diff&rev=517116&r1=517115&r2=517116
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/AbstractSaslCallbackHandler.java
(original)
+++ directory/apacheds/branches/apacheds-sasl-branch/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/AbstractSaslCallbackHandler.java
Sun Mar 11 23:53:41 2007
@@ -259,9 +259,9 @@
      * @param message The current message.
      * @return An environment suitable for acquiring an {@link LdapContext} for the client.
      */
-    protected Hashtable getEnvironment( IoSession session, Object message )
+    protected Hashtable<String, Object> getEnvironment( IoSession session, Object message
)
     {
-        Hashtable env = new Hashtable();
+        Hashtable<String, Object> env = new Hashtable<String, Object>();
         env.put( Context.PROVIDER_URL, ( String ) session.getAttribute( "baseDn" ) );
         env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory"
);
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );

Modified: directory/apacheds/branches/apacheds-sasl-branch/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/ConfigureChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/ConfigureChain.java?view=diff&rev=517116&r1=517115&r2=517116
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/ConfigureChain.java
(original)
+++ directory/apacheds/branches/apacheds-sasl-branch/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/ConfigureChain.java
Sun Mar 11 23:53:41 2007
@@ -30,6 +30,7 @@
 import javax.security.auth.kerberos.KerberosPrincipal;
 import javax.security.sasl.Sasl;
 
+import org.apache.directory.server.ldap.constants.SupportedSASLMechanisms;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.handler.chain.IoHandlerCommand;
 import org.slf4j.Logger;
@@ -51,10 +52,10 @@
          * TODO - Take intersection of supported mechanisms and mechanisms enabled in configuration.
          */
         Set<String> supportedMechanisms = new HashSet<String>();
-        supportedMechanisms.add( "SIMPLE" );
-        supportedMechanisms.add( "CRAM-MD5" );
-        supportedMechanisms.add( "DIGEST-MD5" );
-        supportedMechanisms.add( "GSSAPI" );
+        supportedMechanisms.add( SupportedSASLMechanisms.SIMPLE );
+        supportedMechanisms.add( SupportedSASLMechanisms.CRAM_MD5 );
+        supportedMechanisms.add( SupportedSASLMechanisms.DIGEST_MD5 );
+        supportedMechanisms.add( SupportedSASLMechanisms.GSSAPI );
         session.setAttribute( "supportedMechanisms", supportedMechanisms );
 
         /**



Mime
View raw message