directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r655408 - in /directory/apacheds/trunk: protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/ server-unit/src/test/java/org/apache/directory/s...
Date Mon, 12 May 2008 03:35:27 GMT
Author: akarasulu
Date: Sun May 11 20:35:26 2008
New Revision: 655408

URL: http://svn.apache.org/viewvc?rev=655408&view=rev
Log:
removing NtlmAuthenticationResult since we really never new to return anything but a boolean

Removed:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmAuthenticationResult.java
Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultBindHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmProvider.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java
    directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultBindHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultBindHandler.java?rev=655408&r1=655407&r2=655408&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultBindHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/DefaultBindHandler.java
Sun May 11 20:35:26 2008
@@ -398,12 +398,15 @@
 
                     if ( ss.isComplete() )
                     {
-                        /*
-                         * There may be a token to return to the client.  We set it here
-                         * so it will be returned in a SUCCESS message, after an LdapContext
-                         * has been initialized for the client.
-                         */
-                        session.setAttribute( "saslCreds", tokenBytes );
+                        if ( tokenBytes != null )
+                        {
+                            /*
+                             * There may be a token to return to the client.  We set it here
+                             * so it will be returned in a SUCCESS message, after an LdapContext
+                             * has been initialized for the client.
+                             */
+                            session.setAttribute( "saslCreds", tokenBytes );
+                        }
 
                         /*
                          * If we got here, we're ready to try getting an initial LDAP context.

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmProvider.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmProvider.java?rev=655408&r1=655407&r2=655408&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmProvider.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmProvider.java
Sun May 11 20:35:26 2008
@@ -49,7 +49,7 @@
      *
      * @param session the MINA IoSession to store any state to be thread safe
      * @param type3response the Type 3 NTLM response from the client
-     * @return the result of the successful authentication from the server
+     * @return the result of the authentication from the server
      */
-    NtlmAuthenticationResult authenticate( IoSession session, byte[] type3response ) throws
Exception;
+    boolean authenticate( IoSession session, byte[] type3response ) throws Exception;
 }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java?rev=655408&r1=655407&r2=655408&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java
Sun May 11 20:35:26 2008
@@ -129,11 +129,10 @@
                 }
                 break;
             case TYPE_3_RECEIVED:
-                NtlmAuthenticationResult result = null;
+                boolean result;
                 try
                 {
                     result = provider.authenticate( session, response );
-                    retval = result.getResponse();
                     session.setAttribute( Context.SECURITY_PRINCIPAL, request.getName().toString()
);
                 }
                 catch ( Exception e )
@@ -141,7 +140,7 @@
                     throw new SaslException( "There was a failure during NTLM Type 3 message
handling.", e );
                 }
 
-                if ( ! result.isSuccess() )
+                if ( ! result )
                 {
                     throw new SaslException( "Authentication occurred but the credentials
were invalid." );
                 }

Modified: directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java?rev=655408&r1=655407&r2=655408&view=diff
==============================================================================
--- directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java
(original)
+++ directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/SaslBindITest.java
Sun May 11 20:35:26 2008
@@ -28,7 +28,6 @@
 import org.apache.directory.server.core.partition.impl.btree.Index;
 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.ldap.handlers.bind.ntlm.NtlmAuthenticationResult;
 import org.apache.directory.server.ldap.handlers.bind.ntlm.NtlmMechanismHandler;
 import org.apache.directory.server.ldap.handlers.bind.ntlm.NtlmProvider;
 import org.apache.directory.server.unit.AbstractServerTest;
@@ -539,7 +538,6 @@
         assertEquals( 2, finalResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, finalResponse.getLdapResult().getResultCode()
);
         assertTrue( ArrayUtils.isEquals( "type3_test".getBytes(), provider.getType3Response()
) );
-        assertTrue( ArrayUtils.isEquals( "results".getBytes(), finalResponse.getServerSaslCreds()
) );
     }
 
 
@@ -559,7 +557,6 @@
         assertEquals( 2, finalResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, finalResponse.getLdapResult().getResultCode()
);
         assertTrue( ArrayUtils.isEquals( "type3_test".getBytes(), provider.getType3Response()
) );
-        assertTrue( ArrayUtils.isEquals( "results".getBytes(), finalResponse.getServerSaslCreds()
) );
     }
 
 
@@ -569,10 +566,10 @@
         private byte[] type3response;
         
         
-        public NtlmAuthenticationResult authenticate( IoSession session, byte[] type3response
) throws Exception
+        public boolean authenticate( IoSession session, byte[] type3response ) throws Exception
         {
             this.type3response = type3response;
-            return new NtlmAuthenticationResult( "results".getBytes(), true );
+            return true;
         }
 
 



Mime
View raw message