[CalendarServer-changes] [455]
CalendarServer/branches/users/wsanchez/provisioning/lib-patches/
Twisted
source_changes at macosforge.org
source_changes at macosforge.org
Tue Nov 14 18:32:18 PST 2006
Revision: 455
http://trac.macosforge.org/projects/calendarserver/changeset/455
Author: wsanchez at apple.com
Date: 2006-11-14 18:32:17 -0800 (Tue, 14 Nov 2006)
Log Message:
-----------
Modified Paths:
--------------
CalendarServer/branches/users/wsanchez/provisioning/lib-patches/Twisted/twisted.web2.dav.element.rfc4331.patch
CalendarServer/branches/users/wsanchez/provisioning/lib-patches/Twisted/twisted.web2.server.patch
Added Paths:
-----------
CalendarServer/branches/users/wsanchez/provisioning/lib-patches/Twisted/twisted.web2.dav.auth.patch
Removed Paths:
-------------
CalendarServer/branches/users/wsanchez/provisioning/lib-patches/Twisted/twisted.dav.auth.patch
Deleted: CalendarServer/branches/users/wsanchez/provisioning/lib-patches/Twisted/twisted.dav.auth.patch
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning/lib-patches/Twisted/twisted.dav.auth.patch 2006-11-14 21:35:55 UTC (rev 454)
+++ CalendarServer/branches/users/wsanchez/provisioning/lib-patches/Twisted/twisted.dav.auth.patch 2006-11-15 02:32:17 UTC (rev 455)
@@ -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
-
- ##
Added: CalendarServer/branches/users/wsanchez/provisioning/lib-patches/Twisted/twisted.web2.dav.auth.patch
===================================================================
Modified: CalendarServer/branches/users/wsanchez/provisioning/lib-patches/Twisted/twisted.web2.dav.element.rfc4331.patch
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning/lib-patches/Twisted/twisted.web2.dav.element.rfc4331.patch 2006-11-14 21:35:55 UTC (rev 454)
+++ CalendarServer/branches/users/wsanchez/provisioning/lib-patches/Twisted/twisted.web2.dav.element.rfc4331.patch 2006-11-15 02:32:17 UTC (rev 455)
@@ -2,7 +2,7 @@
===================================================================
--- twisted/web2/dav/element/rfc4331.py (revision 0)
+++ twisted/web2/dav/element/rfc4331.py (revision 0)
-@@ -0,0 +1,110 @@
+@@ -0,0 +1,55 @@
+##
+# Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
+#
@@ -58,58 +58,3 @@
+ name = "quota-used-bytes"
+ hidden = True
+ protected = True
-+##
-+# Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
-+#
-+# Permission is hereby granted, free of charge, to any person obtaining a copy
-+# of this software and associated documentation files (the "Software"), to deal
-+# in the Software without restriction, including without limitation the rights
-+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-+# copies of the Software, and to permit persons to whom the Software is
-+# furnished to do so, subject to the following conditions:
-+#
-+# The above copyright notice and this permission notice shall be included in all
-+# copies or substantial portions of the Software.
-+#
-+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-+# SOFTWARE.
-+#
-+# DRI: Cyrus Daboo, cdaboo at apple.com
-+##
-+
-+"""
-+RFC 4331 (Quota and Size Properties for WebDAV Collections) XML Elements
-+
-+This module provides XML element definitions for use with WebDAV.
-+
-+See RFC 4331: http://www.ietf.org/rfc/rfc4331.txt
-+"""
-+
-+from twisted.web2.dav.element.base import WebDAVTextElement
-+
-+##
-+# Section 3 & 4 (Quota Properties)
-+##
-+
-+class QuotaAvailableBytes (WebDAVTextElement):
-+ """
-+ Property which contains the the number of bytes available under the
-+ current quota to store data in a collection (RFC 4331, section 3)
-+ """
-+ name = "quota-available-bytes"
-+ hidden = True
-+ protected = True
-+
-+class QuotaUsedBytes (WebDAVTextElement):
-+ """
-+ Property which contains the the number of bytes used under the
-+ current quota to store data in a collection (RFC 4331, section 4)
-+ """
-+ name = "quota-used-bytes"
-+ hidden = True
-+ protected = True
Modified: CalendarServer/branches/users/wsanchez/provisioning/lib-patches/Twisted/twisted.web2.server.patch
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning/lib-patches/Twisted/twisted.web2.server.patch 2006-11-14 21:35:55 UTC (rev 454)
+++ CalendarServer/branches/users/wsanchez/provisioning/lib-patches/Twisted/twisted.web2.server.patch 2006-11-15 02:32:17 UTC (rev 455)
@@ -124,8 +124,9 @@
def notFound(f):
f.trap(http.HTTPError)
- if f.response.code != responsecode.NOT_FOUND:
+- if f.response.code != responsecode.NOT_FOUND:
- raise f
++ if f.value.response.code != responsecode.NOT_FOUND:
+ return f
return None
@@ -171,7 +172,7 @@
+
+ def notFound(f):
+ f.trap(http.HTTPError)
-+ if f.response.code != responsecode.NOT_FOUND:
++ if f.value.response.code != responsecode.NOT_FOUND:
+ return f
+ return None
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061114/79dd68bc/attachment.html
More information about the calendarserver-changes
mailing list