[CalendarServer-changes] [64] CalendarServer/branches/users/cdaboo/acl-merge/twistedcaldav/resource.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Aug 25 09:26:37 PDT 2006


Revision: 64
Author:   cdaboo at apple.com
Date:     2006-08-25 09:26:35 -0700 (Fri, 25 Aug 2006)

Log Message:
-----------
Remove old authenticator api. Minor clean-up to properly raise exceptions instead of return them.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/acl-merge/twistedcaldav/resource.py

Modified: CalendarServer/branches/users/cdaboo/acl-merge/twistedcaldav/resource.py
===================================================================
--- CalendarServer/branches/users/cdaboo/acl-merge/twistedcaldav/resource.py	2006-08-25 16:14:57 UTC (rev 63)
+++ CalendarServer/branches/users/cdaboo/acl-merge/twistedcaldav/resource.py	2006-08-25 16:26:35 UTC (rev 64)
@@ -51,10 +51,9 @@
 from twisted.web2.dav.http import ErrorResponse
 from twisted.web2.dav.resource import DAVResource
 from twisted.web2.dav.resource import TwistedACLInheritable
-from twisted.web2.dav.util import parentForURL
+from twisted.web2.dav.util import parentForURL, unimplemented
 
 import twistedcaldav
-from twistedcaldav import authkerb
 from twistedcaldav import caldavxml
 from twistedcaldav.icaldav import ICalDAVResource, ICalendarPrincipalResource, ICalendarSchedulingCollectionResource
 from twistedcaldav.caldavxml import caldav_namespace
@@ -65,30 +64,6 @@
 else:
     serverVersion = twisted.web2.server.VERSION + " TwistedCalDAV/?"
 
-# Need to replace global DAVResource authenticator with the one we want for our server
-def getAuthenticator(self, request):
-    """
-    See L{DAVResource.getAuthenticator}.
-    
-    This implementation picks a suitable authorizer from a list of available auth mechanisms.
-    
-    TODO: We need some way to input a 'realm' to the authorizer. Right now it is empty.
-    """
-
-    validAuths = [auth.BasicAuthorizer]
-    #validAuths = [auth.DigestAuthorizer]
-    #validAuths = [auth.BasicAuthorizer, auth.DigestAuthorizer]
-    #validAuths = [authkerb.BasicKerberosAuthorizer]
-    #validAuths = [authkerb.NegotiateAuthorizer]
-    for authert in validAuths:
-        auther = authert("")
-        if auther.validForRequest(request):
-            return auther
-    else:
-        return None
-
-DAVResource.getAuthenticator = getAuthenticator
-
 class CalDAVResource (DAVResource):
     """
     CalDAV resource.
@@ -238,7 +213,7 @@
         override it.
         """
         # FIXME: Can this be implemented genericly by using findChildren()?
-        return NotImplementedError("Subclass must implement findCalendarCollections()")
+        unimplemented(self)
 
     def findCalendarCollectionsWithPrivileges(self, depth, privileges, request):
         """
@@ -247,7 +222,7 @@
         override it.
         """
         # FIXME: Can this be implemented genericly by using findChildren()?
-        return NotImplementedError("Subclass must implement findCalendarCollectionsWithPrivileges()")
+        unimplemented(self)
 
     def createCalendar(self, request):
         """
@@ -255,7 +230,7 @@
         This implementation raises L{NotImplementedError}; a subclass must
         override it.
         """
-        return NotImplementedError("Subclass must implement createCalendar()")
+        unimplemented(self)
 
     def iCalendar(self, name=None):
         """

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


More information about the calendarserver-changes mailing list