[CalendarServer-changes] [399] CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource. patch

source_changes at macosforge.org source_changes at macosforge.org
Wed Nov 8 14:31:56 PST 2006


Revision: 399
          http://trac.macosforge.org/projects/calendarserver/changeset/399
Author:   dreid at apple.com
Date:     2006-11-08 14:31:55 -0800 (Wed, 08 Nov 2006)

Log Message:
-----------
Fix deferred usage that caused authorization errors to be eaten and an UnauthenticatedResponse to always be returned.

Fix #81
Author: dreid

Modified Paths:
--------------
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch

Modified: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch	2006-11-08 04:55:55 UTC (rev 398)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch	2006-11-08 22:31:55 UTC (rev 399)
@@ -1,7 +1,7 @@
-Index: twisted/web2/dav/resource.py
+Index: resource.py
 ===================================================================
---- twisted/web2/dav/resource.py	(revision 18545)
-+++ twisted/web2/dav/resource.py	(working copy)
+--- resource.py	(revision 18545)
++++ resource.py	(working copy)
 @@ -130,6 +130,8 @@
          (dav_namespace, "acl-restrictions"          ), # RFC 3744, section 5.6
          (dav_namespace, "inherited-acl-set"         ), # RFC 3744, section 5.7
@@ -159,16 +159,8 @@
                      response = UnauthorizedResponse(request.credentialFactories,
                                                      request.remoteAddr)
                  else:
-@@ -594,22 +650,29 @@
-             return d
+@@ -600,16 +656,22 @@
  
-         d = maybeDeferred(self.authenticate, request)
--        d.addCallbacks(onAuth, onError)
-+        d.addCallback(onAuth)
-+        d.addErrback(onError)
- 
-         return d
- 
      def authenticate(self, request):
          def loginSuccess(result):
 -            request.user = result[1]
@@ -194,7 +186,7 @@
  
          authHeader = request.headers.getHeader('authorization')
  
-@@ -625,9 +688,11 @@
+@@ -625,9 +687,11 @@
  
                  # Try to match principals in each principal collection on the resource
                  def gotDetails(details):
@@ -209,7 +201,7 @@
  
                  def login(pcreds):
                      d = request.portal.login(pcreds, None, *request.loginInterfaces)
-@@ -635,13 +700,14 @@
+@@ -635,13 +699,14 @@
  
                      return d
  
@@ -227,7 +219,7 @@
  
      ##
      # ACL
-@@ -650,10 +716,10 @@
+@@ -650,10 +715,10 @@
      def currentPrincipal(self, request):
          """
          @param request: the request being processed.
@@ -241,7 +233,7 @@
          else:
              return unauthenticatedPrincipal
  
-@@ -666,32 +732,26 @@
+@@ -666,32 +731,26 @@
          present on this resource, it tries to get it from the parent, unless it
          is the root or has no parent.
          """
@@ -290,7 +282,7 @@
      def defaultAccessControlList(self):
          """
          @return: the L{davxml.ACL} element containing the default access control
-@@ -1146,49 +1206,95 @@
+@@ -1146,49 +1205,95 @@
  
          This implementation returns an empty set.
          """
@@ -403,7 +395,7 @@
      def samePrincipal(self, principal1, principal2):
          """
          Check whether the two prinicpals are exactly the same in terms of
-@@ -1511,6 +1617,265 @@
+@@ -1511,6 +1616,265 @@
          return None
  
      ##
@@ -669,7 +661,7 @@
      # HTTP
      ##
  
-@@ -1558,7 +1923,7 @@
+@@ -1558,7 +1922,7 @@
      """
      DAV resource with no children.
      """
@@ -678,7 +670,7 @@
          return succeed(None)
  
  class DAVPrincipalResource (DAVLeafResource):
-@@ -1712,6 +2077,37 @@
+@@ -1712,6 +2076,37 @@
  davxml.registerElement(TwistedACLInheritable)
  davxml.ACE.allowed_children[(twisted_dav_namespace, "inheritable")] = (0, 1)
  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061108/5273ef86/attachment.html


More information about the calendarserver-changes mailing list