[CalendarServer-changes] [471] CalendarServer/trunk/lib-patches/Twisted

source_changes at macosforge.org source_changes at macosforge.org
Wed Nov 15 11:58:49 PST 2006


Revision: 471
          http://trac.macosforge.org/projects/calendarserver/changeset/471
Author:   cdaboo at apple.com
Date:     2006-11-15 11:58:49 -0800 (Wed, 15 Nov 2006)

Log Message:
-----------
Rename to proper matching file name.

Added Paths:
-----------
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.auth.patch

Removed Paths:
-------------
    CalendarServer/trunk/lib-patches/Twisted/twisted.dav.auth.patch

Deleted: CalendarServer/trunk/lib-patches/Twisted/twisted.dav.auth.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.dav.auth.patch	2006-11-15 19:46:32 UTC (rev 470)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.dav.auth.patch	2006-11-15 19:58:49 UTC (rev 471)
@@ -1,66 +0,0 @@
-Index: twisted/web2/dav/auth.py
-===================================================================
---- twisted/web2/dav/auth.py	(revision 18545)
-+++ twisted/web2/dav/auth.py	(working copy)
-@@ -40,7 +40,7 @@
- 
-     def requestAvatar(self, avatarId, mind, *interfaces):
-         if IPrincipal in interfaces:
--            return IPrincipal, davxml.Principal(davxml.HRef(avatarId))
-+            return IPrincipal, davxml.Principal(davxml.HRef(avatarId[0])), davxml.Principal(davxml.HRef(avatarId[1]))
-         
-         raise NotImplementedError("Only IPrincipal interface is supported")
- 
-@@ -52,9 +52,23 @@
- class PrincipalCredentials(object):
-     implements(IPrincipalCredentials)
- 
--    def __init__(self, principal, principalURI, credentials):
--        self.principal = principal
--        self.principalURI = principalURI
-+    def __init__(self, authnPrincipal, authnURI, authzPrincipal, authzURI, credentials):
-+        """
-+        Initialize with both authentication and authorization values. Note that in most cases theses will be the same
-+        since HTTP auth makes no distinction between the two - but we may be layering some addition auth on top of this
-+        (.e.g.. proxy auth, cookies, forms etc) that make result in authentication and authorization being different.
-+
-+        @param authnPrincipal: L{IDAVPrincipalResource} for the authenticated principal.
-+        @param authnURI: C{str} containing the URI of the authenticated principal.
-+        @param authzPrincipal: L{IDAVPrincipalResource} for the authorized principal.
-+        @param authzURI: C{str} containing the URI of the authorized principal.
-+        @param credentials: L{IPrincipalCredentials} for the authentication credentials.
-+        """
-+        
-+        self.authnPrincipal = authnPrincipal
-+        self.authnURI = authnURI
-+        self.authzPrincipal = authzPrincipal
-+        self.authzURI = authzURI
-         self.credentials = credentials
- 
-     def checkPassword(self, password):
-@@ -66,19 +80,20 @@
- 
-     credentialInterfaces = (IPrincipalCredentials,)
- 
--    def _cbPasswordMatch(self, matched, principalURI):
-+    def _cbPasswordMatch(self, matched, principalURIs):
-         if matched:
--            return principalURI
-+            # We return both URIs
-+            return principalURIs
-         else:
-             raise error.UnauthorizedLogin(
--                "Bad credentials for: %s" % (principalURI,))
-+                "Bad credentials for: %s" % (principalURIs[0],))
- 
-     def requestAvatarId(self, credentials):
-         pcreds = IPrincipalCredentials(credentials)
--        pswd = str(pcreds.principal.readDeadProperty(TwistedPasswordProperty))
-+        pswd = str(pcreds.authnPrincipal.readDeadProperty(TwistedPasswordProperty))
- 
-         d = defer.maybeDeferred(credentials.checkPassword, pswd)
--        d.addCallback(self._cbPasswordMatch, pcreds.principalURI)
-+        d.addCallback(self._cbPasswordMatch, (pcreds.authnURI, pcreds.authzURI,))
-         return d
- 
- ##

Copied: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.auth.patch (from rev 465, CalendarServer/trunk/lib-patches/Twisted/twisted.dav.auth.patch)
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.auth.patch	                        (rev 0)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.auth.patch	2006-11-15 19:58:49 UTC (rev 471)
@@ -0,0 +1,66 @@
+Index: twisted/web2/dav/auth.py
+===================================================================
+--- twisted/web2/dav/auth.py	(revision 18545)
++++ twisted/web2/dav/auth.py	(working copy)
+@@ -40,7 +40,7 @@
+ 
+     def requestAvatar(self, avatarId, mind, *interfaces):
+         if IPrincipal in interfaces:
+-            return IPrincipal, davxml.Principal(davxml.HRef(avatarId))
++            return IPrincipal, davxml.Principal(davxml.HRef(avatarId[0])), davxml.Principal(davxml.HRef(avatarId[1]))
+         
+         raise NotImplementedError("Only IPrincipal interface is supported")
+ 
+@@ -52,9 +52,23 @@
+ class PrincipalCredentials(object):
+     implements(IPrincipalCredentials)
+ 
+-    def __init__(self, principal, principalURI, credentials):
+-        self.principal = principal
+-        self.principalURI = principalURI
++    def __init__(self, authnPrincipal, authnURI, authzPrincipal, authzURI, credentials):
++        """
++        Initialize with both authentication and authorization values. Note that in most cases theses will be the same
++        since HTTP auth makes no distinction between the two - but we may be layering some addition auth on top of this
++        (.e.g.. proxy auth, cookies, forms etc) that make result in authentication and authorization being different.
++
++        @param authnPrincipal: L{IDAVPrincipalResource} for the authenticated principal.
++        @param authnURI: C{str} containing the URI of the authenticated principal.
++        @param authzPrincipal: L{IDAVPrincipalResource} for the authorized principal.
++        @param authzURI: C{str} containing the URI of the authorized principal.
++        @param credentials: L{IPrincipalCredentials} for the authentication credentials.
++        """
++        
++        self.authnPrincipal = authnPrincipal
++        self.authnURI = authnURI
++        self.authzPrincipal = authzPrincipal
++        self.authzURI = authzURI
+         self.credentials = credentials
+ 
+     def checkPassword(self, password):
+@@ -66,19 +80,20 @@
+ 
+     credentialInterfaces = (IPrincipalCredentials,)
+ 
+-    def _cbPasswordMatch(self, matched, principalURI):
++    def _cbPasswordMatch(self, matched, principalURIs):
+         if matched:
+-            return principalURI
++            # We return both URIs
++            return principalURIs
+         else:
+             raise error.UnauthorizedLogin(
+-                "Bad credentials for: %s" % (principalURI,))
++                "Bad credentials for: %s" % (principalURIs[0],))
+ 
+     def requestAvatarId(self, credentials):
+         pcreds = IPrincipalCredentials(credentials)
+-        pswd = str(pcreds.principal.readDeadProperty(TwistedPasswordProperty))
++        pswd = str(pcreds.authnPrincipal.readDeadProperty(TwistedPasswordProperty))
+ 
+         d = defer.maybeDeferred(credentials.checkPassword, pswd)
+-        d.addCallback(self._cbPasswordMatch, pcreds.principalURI)
++        d.addCallback(self._cbPasswordMatch, (pcreds.authnURI, pcreds.authzURI,))
+         return d
+ 
+ ##

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


More information about the calendarserver-changes mailing list