[CalendarServer-changes] [13920] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed Aug 27 10:15:02 PDT 2014


Revision: 13920
          http://trac.calendarserver.org//changeset/13920
Author:   sagen at apple.com
Date:     2014-08-27 10:15:01 -0700 (Wed, 27 Aug 2014)
Log Message:
-----------
"type" -> "serviceType"

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tap/util.py
    CalendarServer/trunk/twistedcaldav/authkerb.py

Modified: CalendarServer/trunk/calendarserver/tap/util.py
===================================================================
--- CalendarServer/trunk/calendarserver/tap/util.py	2014-08-26 20:03:59 UTC (rev 13919)
+++ CalendarServer/trunk/calendarserver/tap/util.py	2014-08-27 17:15:01 UTC (rev 13920)
@@ -416,7 +416,7 @@
                     principal = schemeConfig["ServicePrincipal"]
                     if not principal:
                         credFactory = NegotiateCredentialFactory(
-                            type="HTTP",
+                            serviceType="HTTP",
                             hostname=config.ServerHostName,
                         )
                     else:

Modified: CalendarServer/trunk/twistedcaldav/authkerb.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/authkerb.py	2014-08-26 20:03:59 UTC (rev 13919)
+++ CalendarServer/trunk/twistedcaldav/authkerb.py	2014-08-27 17:15:01 UTC (rev 13920)
@@ -48,6 +48,7 @@
 
 from twext.python.log import Logger
 
+
 class KerberosCredentialFactoryBase(object):
     """
     Code common to Kerberos-based credential factories.
@@ -56,26 +57,26 @@
 
     implements(ICredentialFactory)
 
-    def __init__(self, principal=None, type=None, hostname=None):
+    def __init__(self, principal=None, serviceType=None, hostname=None):
         """
 
         @param principal:  full Kerberos principal (e.g., 'HTTP/server.example.com at EXAMPLE.COM'). If C{None}
             then the type and hostname arguments are used instead.
-        @type service:     str
-        @param type:       service type for Kerberos (e.g., 'HTTP'). Must be C{None} if principal used.
-        @type type:        str
+        @type principal:     str
+        @param serviceType:       service type for Kerberos (e.g., 'HTTP'). Must be C{None} if principal used.
+        @type serviceType:        str
         @param hostname:   hostname for this server. Must be C{None} if principal used.
         @type hostname:    str
         """
 
         # Only certain combinations of arguments allowed
-        assert (principal and not type and not hostname) or (not principal and type and hostname)
+        assert (principal and not serviceType and not hostname) or (not principal and serviceType and hostname)
 
         if not principal:
             # Look up the Kerberos principal given the service type and hostname, and extract
             # the realm and a service principal value for later use.
             try:
-                principal = kerberos.getServerPrincipalDetails(type, hostname)
+                principal = kerberos.getServerPrincipalDetails(serviceType, hostname)
             except kerberos.KrbError, ex:
                 self.log.error("getServerPrincipalDetails: %s" % (ex[0],))
                 raise ValueError('Authentication System Failure: %s' % (ex[0],))
@@ -137,26 +138,26 @@
 
     scheme = 'basic'
 
-    def __init__(self, principal=None, type=None, hostname=None):
+    def __init__(self, principal=None, serviceType=None, hostname=None):
         """
 
         @param principal:  full Kerberos principal (e.g., 'HTTP/server.example.com at EXAMPLE.COM'). If C{None}
             then the type and hostname arguments are used instead.
-        @type service:     str
-        @param type:       service type for Kerberos (e.g., 'HTTP'). Must be C{None} if principal used.
-        @type type:        str
+        @type principal:     str
+        @param serviceType:       service type for Kerberos (e.g., 'HTTP'). Must be C{None} if principal used.
+        @type serviceType:        str
         @param hostname:   hostname for this server. Must be C{None} if principal used.
         @type hostname:    str
         """
 
-        super(BasicKerberosCredentialFactory, self).__init__(principal, type, hostname)
+        super(BasicKerberosCredentialFactory, self).__init__(principal, serviceType, hostname)
 
 
     def getChallenge(self, _ignore_peer):
         return succeed({'realm': self.realm})
 
 
-    def decode(self, response, request): #@UnusedVariable
+    def decode(self, response, request):  # @UnusedVariable
         try:
             creds = (response + '===').decode('base64')
         except:
@@ -220,19 +221,19 @@
 
     scheme = 'negotiate'
 
-    def __init__(self, principal=None, type=None, hostname=None):
+    def __init__(self, principal=None, serviceType=None, hostname=None):
         """
 
         @param principal:  full Kerberos principal (e.g., 'HTTP/server.example.com at EXAMPLE.COM'). If C{None}
             then the type and hostname arguments are used instead.
-        @type service:     str
-        @param type:       service type for Kerberos (e.g., 'HTTP'). Must be C{None} if principal used.
-        @type type:        str
+        @type principal:     str
+        @param serviceType:       service type for Kerberos (e.g., 'HTTP'). Must be C{None} if principal used.
+        @type serviceType:        str
         @param hostname:   hostname for this server. Must be C{None} if principal used.
         @type hostname:    str
         """
 
-        super(NegotiateCredentialFactory, self).__init__(principal, type, hostname)
+        super(NegotiateCredentialFactory, self).__init__(principal, serviceType, hostname)
 
 
     def getChallenge(self, _ignore_peer):
@@ -301,7 +302,7 @@
 
         wwwauth = '%s %s' % (self.scheme, response)
 
-        def responseFilterAddWWWAuthenticate(request, response): #@UnusedVariable
+        def responseFilterAddWWWAuthenticate(request, response):  # @UnusedVariable
             if response.code != responsecode.UNAUTHORIZED:
                 response.headers.addRawHeader('www-authenticate', wwwauth)
             return response
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140827/940b7c7b/attachment-0001.html>


More information about the calendarserver-changes mailing list