chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1338087 - in /chemistry/dotcmis/trunk/DotCMIS: Properties/AssemblyInfo.cs binding/binding-intf.cs binding/http.cs
Date Mon, 14 May 2012 09:02:00 GMT
Author: fmui
Date: Mon May 14 09:01:59 2012
New Revision: 1338087

URL: http://svn.apache.org/viewvc?rev=1338087&view=rev
Log:
CMIS-531: added NTLM authentication

Modified:
    chemistry/dotcmis/trunk/DotCMIS/Properties/AssemblyInfo.cs
    chemistry/dotcmis/trunk/DotCMIS/binding/binding-intf.cs
    chemistry/dotcmis/trunk/DotCMIS/binding/http.cs

Modified: chemistry/dotcmis/trunk/DotCMIS/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/chemistry/dotcmis/trunk/DotCMIS/Properties/AssemblyInfo.cs?rev=1338087&r1=1338086&r2=1338087&view=diff
==============================================================================
--- chemistry/dotcmis/trunk/DotCMIS/Properties/AssemblyInfo.cs (original)
+++ chemistry/dotcmis/trunk/DotCMIS/Properties/AssemblyInfo.cs Mon May 14 09:01:59 2012
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers 
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.4.0.0")]
+[assembly: AssemblyVersion("0.5.0.0")]
 [assembly: AssemblyFileVersion("1.0.0.0")]

Modified: chemistry/dotcmis/trunk/DotCMIS/binding/binding-intf.cs
URL: http://svn.apache.org/viewvc/chemistry/dotcmis/trunk/DotCMIS/binding/binding-intf.cs?rev=1338087&r1=1338086&r2=1338087&view=diff
==============================================================================
--- chemistry/dotcmis/trunk/DotCMIS/binding/binding-intf.cs (original)
+++ chemistry/dotcmis/trunk/DotCMIS/binding/binding-intf.cs Mon May 14 09:01:59 2012
@@ -86,9 +86,10 @@ namespace DotCMIS.Binding
             string password = GetPassword();
 
             // AtomPub authentictaion
-            WebRequest request = connection as WebRequest;
+            HttpWebRequest request = connection as HttpWebRequest;
             if (request != null)
             {
+                request.AllowWriteStreamBuffering = false;
                 if (user != null || password != null)
                 {
                     if (request.Headers.GetValues("Authorization") == null)
@@ -183,6 +184,28 @@ namespace DotCMIS.Binding
         }
     }
 
+    public class NtlmAuthenticationProvider : AbstractAuthenticationProvider
+    {
+        private CookieContainer Cookies { get; set; }
+
+        public NtlmAuthenticationProvider()
+        {
+            Cookies = new CookieContainer();
+        }
+
+        public override void Authenticate(object connection)
+        {
+            HttpWebRequest hwr = connection as HttpWebRequest;
+
+            if (hwr != null)
+            {
+                hwr.Credentials = CredentialCache.DefaultNetworkCredentials;
+                hwr.CookieContainer = Cookies;
+                hwr.AllowWriteStreamBuffering = true;
+            }
+        }
+    }
+
     public class CmisBindingFactory
     {
         // Default CMIS AtomPub binding SPI implementation

Modified: chemistry/dotcmis/trunk/DotCMIS/binding/http.cs
URL: http://svn.apache.org/viewvc/chemistry/dotcmis/trunk/DotCMIS/binding/http.cs?rev=1338087&r1=1338086&r2=1338087&view=diff
==============================================================================
--- chemistry/dotcmis/trunk/DotCMIS/binding/http.cs (original)
+++ chemistry/dotcmis/trunk/DotCMIS/binding/http.cs Mon May 14 09:01:59 2012
@@ -132,7 +132,6 @@ namespace DotCMIS.Binding.Impl
                 if (writer != null)
                 {
                     conn.SendChunked = true;
-                    conn.AllowWriteStreamBuffering = false;
                     Stream requestStream = conn.GetRequestStream();
                     writer(requestStream);
                     requestStream.Close();
@@ -163,7 +162,7 @@ namespace DotCMIS.Binding.Impl
 
         internal class Response
         {
-            private WebResponse response;
+            private readonly WebResponse response;
 
             public HttpStatusCode StatusCode { get; private set; }
             public string Message { get; private set; }



Mime
View raw message