<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[12483] CalendarServer/trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/12483">12483</a></dd>
<dt>Author</dt> <dd>sagen@apple.com</dd>
<dt>Date</dt> <dd>2014-01-30 13:20:16 -0800 (Thu, 30 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Starting work on directory proxy service</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkcalendarservertapcaldavpy">CalendarServer/trunk/calendarserver/tap/caldav.py</a></li>
<li><a href="#CalendarServertrunktwistedpluginscaldavpy">CalendarServer/trunk/twisted/plugins/caldav.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavstdconfigpy">CalendarServer/trunk/twistedcaldav/stdconfig.py</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>CalendarServer/trunk/txdav/dps/</li>
<li><a href="#CalendarServertrunktxdavdps__init__py">CalendarServer/trunk/txdav/dps/__init__.py</a></li>
<li><a href="#CalendarServertrunktxdavdpsprotocolpy">CalendarServer/trunk/txdav/dps/protocol.py</a></li>
<li><a href="#CalendarServertrunktxdavdpsservicepy">CalendarServer/trunk/txdav/dps/service.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkcalendarservertapcaldavpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tap/caldav.py (12482 => 12483)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tap/caldav.py        2014-01-30 18:51:26 UTC (rev 12482)
+++ CalendarServer/trunk/calendarserver/tap/caldav.py        2014-01-30 21:20:16 UTC (rev 12483)
</span><span class="lines">@@ -520,6 +520,27 @@
</span><span class="cx">             )
</span><span class="cx">             self.monitor.addProcessObject(process, PARENT_ENVIRONMENT)
</span><span class="cx"> 
</span><ins>+        if (
+             config.DirectoryProxy.Enabled and
+             config.DirectoryProxy.SocketPath != &quot;&quot;
+         ):
+             log.info(&quot;Adding directory proxy service&quot;)

+             dpsArgv = [
+                 sys.executable,
+                 sys.argv[0],
+             ]
+             if config.UserName:
+                 dpsArgv.extend((&quot;-u&quot;, config.UserName))
+             if config.GroupName:
+                 dpsArgv.extend((&quot;-g&quot;, config.GroupName))
+             dpsArgv.extend((
+                 &quot;--reactor=%s&quot; % (config.Twisted.reactor,),
+                 &quot;-n&quot;, &quot;caldav_directoryproxy&quot;,
+                 &quot;-f&quot;, self.configPath,
+             ))
+             self.monitor.addProcess(&quot;directoryproxy&quot;, dpsArgv,
+                 env=PARENT_ENVIRONMENT)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> class WorkSchedulingService(Service):
</span></span></pre></div>
<a id="CalendarServertrunktwistedpluginscaldavpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twisted/plugins/caldav.py (12482 => 12483)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twisted/plugins/caldav.py        2014-01-30 18:51:26 UTC (rev 12482)
+++ CalendarServer/trunk/twisted/plugins/caldav.py        2014-01-30 21:20:16 UTC (rev 12483)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx"> from twisted.internet.protocol import Factory
</span><span class="cx"> Factory.noisy = False
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx"> def serviceMakerProperty(propname):
</span><span class="cx">     def getProperty(self):
</span><span class="cx">         return getattr(reflect.namedClass(self.serviceMakerClass), propname)
</span><span class="lines">@@ -50,3 +51,4 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> TwistedCalDAV = TAP(&quot;calendarserver.tap.caldav.CalDAVServiceMaker&quot;)
</span><ins>+DirectoryProxy = TAP(&quot;txdav.dps.service.DirectoryProxyServiceMaker&quot;)
</ins></span></pre></div>
<a id="CalendarServertrunktwistedcaldavstdconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py (12482 => 12483)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/stdconfig.py        2014-01-30 18:51:26 UTC (rev 12482)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py        2014-01-30 21:20:16 UTC (rev 12483)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> 
</span><span class="cx"> from twisted.python.runtime import platform
</span><span class="cx"> 
</span><del>-from plistlib import PlistParser #@UnresolvedImport
</del><ins>+from plistlib import PlistParser  # @UnresolvedImport
</ins><span class="cx"> from twext.python.log import Logger, InvalidLogLevelError, LogLevel
</span><span class="cx"> from txweb2.dav.resource import TwistedACLInheritable
</span><span class="cx"> 
</span><span class="lines">@@ -52,25 +52,25 @@
</span><span class="cx">     &quot;twistedcaldav.directory.xmlfile.XMLDirectoryService&quot;: {
</span><span class="cx">         &quot;xmlFile&quot;: &quot;accounts.xml&quot;,
</span><span class="cx">         &quot;recordTypes&quot;: (&quot;users&quot;, &quot;groups&quot;),
</span><del>-        &quot;statSeconds&quot; : 15,
</del><ins>+        &quot;statSeconds&quot;: 15,
</ins><span class="cx">     },
</span><span class="cx">     &quot;twistedcaldav.directory.appleopendirectory.OpenDirectoryService&quot;: {
</span><span class="cx">         &quot;node&quot;: &quot;/Search&quot;,
</span><del>-        &quot;cacheTimeout&quot;: 1, # Minutes
-        &quot;batchSize&quot;: 100, # for splitting up large queries
</del><ins>+        &quot;cacheTimeout&quot;: 1,  # Minutes
+        &quot;batchSize&quot;: 100,  # for splitting up large queries
</ins><span class="cx">         &quot;negativeCaching&quot;: False,
</span><span class="cx">         &quot;restrictEnabledRecords&quot;: False,
</span><span class="cx">         &quot;restrictToGroup&quot;: &quot;&quot;,
</span><span class="cx">         &quot;recordTypes&quot;: (&quot;users&quot;, &quot;groups&quot;),
</span><span class="cx">     },
</span><span class="cx">     &quot;twistedcaldav.directory.ldapdirectory.LdapDirectoryService&quot;: {
</span><del>-        &quot;cacheTimeout&quot;: 1, # Minutes
</del><ins>+        &quot;cacheTimeout&quot;: 1,  # Minutes
</ins><span class="cx">         &quot;negativeCaching&quot;: False,
</span><span class="cx">         &quot;warningThresholdSeconds&quot;: 3,
</span><del>-        &quot;batchSize&quot;: 500, # for splitting up large queries
-        &quot;requestTimeoutSeconds&quot; : 10,
-        &quot;requestResultsLimit&quot; : 200,
-        &quot;optimizeMultiName&quot; : False,
</del><ins>+        &quot;batchSize&quot;: 500,  # for splitting up large queries
+        &quot;requestTimeoutSeconds&quot;: 10,
+        &quot;requestResultsLimit&quot;: 200,
+        &quot;optimizeMultiName&quot;: False,
</ins><span class="cx">         &quot;queryLocationsImplicitly&quot;: True,
</span><span class="cx">         &quot;restrictEnabledRecords&quot;: False,
</span><span class="cx">         &quot;restrictToGroup&quot;: &quot;&quot;,
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx">         &quot;tls&quot;: False,
</span><span class="cx">         &quot;tlsCACertFile&quot;: None,
</span><span class="cx">         &quot;tlsCACertDir&quot;: None,
</span><del>-        &quot;tlsRequireCert&quot;: None, # never, allow, try, demand, hard
</del><ins>+        &quot;tlsRequireCert&quot;: None,  # never, allow, try, demand, hard
</ins><span class="cx">         &quot;credentials&quot;: {
</span><span class="cx">             &quot;dn&quot;: None,
</span><span class="cx">             &quot;password&quot;: None,
</span><span class="lines">@@ -90,76 +90,76 @@
</span><span class="cx">             &quot;guidAttr&quot;: &quot;entryUUID&quot;,
</span><span class="cx">             &quot;users&quot;: {
</span><span class="cx">                 &quot;rdn&quot;: &quot;ou=People&quot;,
</span><del>-                &quot;attr&quot;: &quot;uid&quot;, # used only to synthesize email address
-                &quot;emailSuffix&quot;: None, # used only to synthesize email address
-                &quot;filter&quot;: None, # additional filter for this type
-                &quot;loginEnabledAttr&quot; : &quot;&quot;, # attribute controlling login
-                &quot;loginEnabledValue&quot; : &quot;yes&quot;, # &quot;True&quot; value of above attribute
-                &quot;calendarEnabledAttr&quot; : &quot;&quot;, # attribute controlling enabledForCalendaring
-                &quot;calendarEnabledValue&quot; : &quot;yes&quot;, # &quot;True&quot; value of above attribute
-                &quot;mapping&quot; : { # maps internal record names to LDAP
</del><ins>+                &quot;attr&quot;: &quot;uid&quot;,  # used only to synthesize email address
+                &quot;emailSuffix&quot;: None,  # used only to synthesize email address
+                &quot;filter&quot;: None,  # additional filter for this type
+                &quot;loginEnabledAttr&quot;: &quot;&quot;,  # attribute controlling login
+                &quot;loginEnabledValue&quot;: &quot;yes&quot;,  # &quot;True&quot; value of above attribute
+                &quot;calendarEnabledAttr&quot;: &quot;&quot;,  # attribute controlling enabledForCalendaring
+                &quot;calendarEnabledValue&quot;: &quot;yes&quot;,  # &quot;True&quot; value of above attribute
+                &quot;mapping&quot;: {  # maps internal record names to LDAP
</ins><span class="cx">                     &quot;recordName&quot;: &quot;uid&quot;,
</span><del>-                    &quot;fullName&quot; : &quot;cn&quot;,
-                    &quot;emailAddresses&quot; : [&quot;mail&quot;],
-                    &quot;firstName&quot; : &quot;givenName&quot;,
-                    &quot;lastName&quot; : &quot;sn&quot;,
</del><ins>+                    &quot;fullName&quot;: &quot;cn&quot;,
+                    &quot;emailAddresses&quot;: [&quot;mail&quot;],
+                    &quot;firstName&quot;: &quot;givenName&quot;,
+                    &quot;lastName&quot;: &quot;sn&quot;,
</ins><span class="cx">                 },
</span><span class="cx">             },
</span><span class="cx">             &quot;groups&quot;: {
</span><span class="cx">                 &quot;rdn&quot;: &quot;ou=Group&quot;,
</span><del>-                &quot;attr&quot;: &quot;cn&quot;, # used only to synthesize email address
-                &quot;emailSuffix&quot;: None, # used only to synthesize email address
-                &quot;filter&quot;: None, # additional filter for this type
-                &quot;mapping&quot; : { # maps internal record names to LDAP
</del><ins>+                &quot;attr&quot;: &quot;cn&quot;,  # used only to synthesize email address
+                &quot;emailSuffix&quot;: None,  # used only to synthesize email address
+                &quot;filter&quot;: None,  # additional filter for this type
+                &quot;mapping&quot;: {  # maps internal record names to LDAP
</ins><span class="cx">                     &quot;recordName&quot;: &quot;cn&quot;,
</span><del>-                    &quot;fullName&quot; : &quot;cn&quot;,
-                    &quot;emailAddresses&quot; : [&quot;mail&quot;],
-                    &quot;firstName&quot; : &quot;givenName&quot;,
-                    &quot;lastName&quot; : &quot;sn&quot;,
</del><ins>+                    &quot;fullName&quot;: &quot;cn&quot;,
+                    &quot;emailAddresses&quot;: [&quot;mail&quot;],
+                    &quot;firstName&quot;: &quot;givenName&quot;,
+                    &quot;lastName&quot;: &quot;sn&quot;,
</ins><span class="cx">                 },
</span><span class="cx">             },
</span><span class="cx">             &quot;locations&quot;: {
</span><span class="cx">                 &quot;rdn&quot;: &quot;ou=Places&quot;,
</span><del>-                &quot;attr&quot;: &quot;cn&quot;, # used only to synthesize email address
-                &quot;emailSuffix&quot;: None, # used only to synthesize email address
-                &quot;filter&quot;: None, # additional filter for this type
-                &quot;calendarEnabledAttr&quot; : &quot;&quot;, # attribute controlling enabledForCalendaring
-                &quot;calendarEnabledValue&quot; : &quot;yes&quot;, # &quot;True&quot; value of above attribute
-                &quot;mapping&quot; : { # maps internal record names to LDAP
</del><ins>+                &quot;attr&quot;: &quot;cn&quot;,  # used only to synthesize email address
+                &quot;emailSuffix&quot;: None,  # used only to synthesize email address
+                &quot;filter&quot;: None,  # additional filter for this type
+                &quot;calendarEnabledAttr&quot;: &quot;&quot;,  # attribute controlling enabledForCalendaring
+                &quot;calendarEnabledValue&quot;: &quot;yes&quot;,  # &quot;True&quot; value of above attribute
+                &quot;mapping&quot;: {  # maps internal record names to LDAP
</ins><span class="cx">                     &quot;recordName&quot;: &quot;cn&quot;,
</span><del>-                    &quot;fullName&quot; : &quot;cn&quot;,
-                    &quot;emailAddresses&quot; : [&quot;mail&quot;],
-                    &quot;firstName&quot; : &quot;givenName&quot;,
-                    &quot;lastName&quot; : &quot;sn&quot;,
</del><ins>+                    &quot;fullName&quot;: &quot;cn&quot;,
+                    &quot;emailAddresses&quot;: [&quot;mail&quot;],
+                    &quot;firstName&quot;: &quot;givenName&quot;,
+                    &quot;lastName&quot;: &quot;sn&quot;,
</ins><span class="cx">                 },
</span><span class="cx">             },
</span><span class="cx">             &quot;resources&quot;: {
</span><span class="cx">                 &quot;rdn&quot;: &quot;ou=Resources&quot;,
</span><del>-                &quot;attr&quot;: &quot;cn&quot;, # used only to synthesize email address
-                &quot;emailSuffix&quot;: None, # used only to synthesize email address
-                &quot;filter&quot;: None, # additional filter for this type
-                &quot;calendarEnabledAttr&quot; : &quot;&quot;, # attribute controlling enabledForCalendaring
-                &quot;calendarEnabledValue&quot; : &quot;yes&quot;, # &quot;True&quot; value of above attribute
-                &quot;mapping&quot; : { # maps internal record names to LDAP
</del><ins>+                &quot;attr&quot;: &quot;cn&quot;,  # used only to synthesize email address
+                &quot;emailSuffix&quot;: None,  # used only to synthesize email address
+                &quot;filter&quot;: None,  # additional filter for this type
+                &quot;calendarEnabledAttr&quot;: &quot;&quot;,  # attribute controlling enabledForCalendaring
+                &quot;calendarEnabledValue&quot;: &quot;yes&quot;,  # &quot;True&quot; value of above attribute
+                &quot;mapping&quot;: {  # maps internal record names to LDAP
</ins><span class="cx">                     &quot;recordName&quot;: &quot;cn&quot;,
</span><del>-                    &quot;fullName&quot; : &quot;cn&quot;,
-                    &quot;emailAddresses&quot; : [&quot;mail&quot;],
-                    &quot;firstName&quot; : &quot;givenName&quot;,
-                    &quot;lastName&quot; : &quot;sn&quot;,
</del><ins>+                    &quot;fullName&quot;: &quot;cn&quot;,
+                    &quot;emailAddresses&quot;: [&quot;mail&quot;],
+                    &quot;firstName&quot;: &quot;givenName&quot;,
+                    &quot;lastName&quot;: &quot;sn&quot;,
</ins><span class="cx">                 },
</span><span class="cx">             },
</span><span class="cx">         },
</span><span class="cx">         &quot;groupSchema&quot;: {
</span><del>-            &quot;membersAttr&quot;: &quot;member&quot;, # how members are specified
-            &quot;nestedGroupsAttr&quot;: None, # how nested groups are specified
-            &quot;memberIdAttr&quot;: None, # which attribute the above refer to
</del><ins>+            &quot;membersAttr&quot;: &quot;member&quot;,  # how members are specified
+            &quot;nestedGroupsAttr&quot;: None,  # how nested groups are specified
+            &quot;memberIdAttr&quot;: None,  # which attribute the above refer to
</ins><span class="cx">         },
</span><span class="cx">         &quot;resourceSchema&quot;: {
</span><del>-            &quot;resourceInfoAttr&quot;: None, # contains location/resource info
-            &quot;autoAcceptGroupAttr&quot;: None, # auto accept group
</del><ins>+            &quot;resourceInfoAttr&quot;: None,  # contains location/resource info
+            &quot;autoAcceptGroupAttr&quot;: None,  # auto accept group
</ins><span class="cx">         },
</span><span class="cx">         &quot;poddingSchema&quot;: {
</span><del>-            &quot;serverIdAttr&quot;: None, # maps to augments server-id
</del><ins>+            &quot;serverIdAttr&quot;: None,  # maps to augments server-id
</ins><span class="cx">         },
</span><span class="cx">     },
</span><span class="cx"> }
</span><span class="lines">@@ -167,22 +167,22 @@
</span><span class="cx"> DEFAULT_RESOURCE_PARAMS = {
</span><span class="cx">     &quot;twistedcaldav.directory.xmlfile.XMLDirectoryService&quot;: {
</span><span class="cx">         &quot;xmlFile&quot;: &quot;resources.xml&quot;,
</span><del>-        &quot;recordTypes&quot; : (&quot;locations&quot;, &quot;resources&quot;, &quot;addresses&quot;),
</del><ins>+        &quot;recordTypes&quot;: (&quot;locations&quot;, &quot;resources&quot;, &quot;addresses&quot;),
</ins><span class="cx">     },
</span><span class="cx">     &quot;twistedcaldav.directory.appleopendirectory.OpenDirectoryService&quot;: {
</span><span class="cx">         &quot;node&quot;: &quot;/Search&quot;,
</span><del>-        &quot;cacheTimeout&quot;: 1, # Minutes
</del><ins>+        &quot;cacheTimeout&quot;: 1,  # Minutes
</ins><span class="cx">         &quot;negativeCaching&quot;: False,
</span><span class="cx">         &quot;restrictEnabledRecords&quot;: False,
</span><span class="cx">         &quot;restrictToGroup&quot;: &quot;&quot;,
</span><del>-        &quot;recordTypes&quot; : (&quot;locations&quot;, &quot;resources&quot;),
</del><ins>+        &quot;recordTypes&quot;: (&quot;locations&quot;, &quot;resources&quot;),
</ins><span class="cx">     },
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> DEFAULT_AUGMENT_PARAMS = {
</span><span class="cx">     &quot;twistedcaldav.directory.augment.AugmentXMLDB&quot;: {
</span><span class="cx">         &quot;xmlFiles&quot;: [&quot;augments.xml&quot;, ],
</span><del>-        &quot;statSeconds&quot; : 15,
</del><ins>+        &quot;statSeconds&quot;: 15,
</ins><span class="cx">     },
</span><span class="cx">     &quot;twistedcaldav.directory.augment.AugmentSqliteDB&quot;: {
</span><span class="cx">         &quot;dbpath&quot;: &quot;augments.sqlite&quot;,
</span><span class="lines">@@ -229,8 +229,8 @@
</span><span class="cx">         &quot;standardizeSyntheticUIDs&quot;: False,
</span><span class="cx">         &quot;addDSAttrXProperties&quot;: False,
</span><span class="cx">         &quot;appleInternalServer&quot;: False,
</span><del>-        &quot;additionalAttributes&quot; : [],
-        &quot;allowedAttributes&quot; : [],
</del><ins>+        &quot;additionalAttributes&quot;: [],
+        &quot;allowedAttributes&quot;: [],
</ins><span class="cx">     },
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -248,14 +248,16 @@
</span><span class="cx">     #
</span><span class="cx">     &quot;ServerHostName&quot;: &quot;&quot;, # Network host name.
</span><span class="cx">     &quot;HTTPPort&quot;: 0, # HTTP port (0 to disable HTTP)
</span><del>-    &quot;SSLPort&quot; : 0, # SSL port (0 to disable HTTPS)
-    &quot;EnableSSL&quot; : False, # Whether to listen on SSL port(s)
-    &quot;RedirectHTTPToHTTPS&quot; : False, # If True, all nonSSL requests redirected to an SSL Port
-    &quot;SSLMethod&quot; : &quot;SSLv3_METHOD&quot;, # SSLv2_METHOD, SSLv3_METHOD, SSLv23_METHOD, TLSv1_METHOD
-    &quot;SSLCiphers&quot; : &quot;ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM&quot;,
-    &quot;StrictTransportSecuritySeconds&quot; : 7 * 24 * 60 * 60, # max-age value for
-        # Strict-Transport-Security header; set to 0 to disable header.
</del><ins>+    &quot;SSLPort&quot;: 0, # SSL port (0 to disable HTTPS)
+    &quot;EnableSSL&quot;: False, # Whether to listen on SSL port(s)
+    &quot;RedirectHTTPToHTTPS&quot;: False, # If True, all nonSSL requests redirected to an SSL Port
+    &quot;SSLMethod&quot;: &quot;SSLv3_METHOD&quot;, # SSLv2_METHOD, SSLv3_METHOD, SSLv23_METHOD, TLSv1_METHOD
+    &quot;SSLCiphers&quot;: &quot;ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM&quot;,
</ins><span class="cx"> 
</span><ins>+    # Max-age value for Strict-Transport-Security header; set to 0 to
+    # disable header.
+    &quot;StrictTransportSecuritySeconds&quot;: 7 * 24 * 60 * 60,
+
</ins><span class="cx">     #
</span><span class="cx">     # Network address configuration information
</span><span class="cx">     #
</span><span class="lines">@@ -264,54 +266,54 @@
</span><span class="cx">     &quot;BindAddresses&quot;: [], # List of IP addresses to bind to [empty = all]
</span><span class="cx">     &quot;BindHTTPPorts&quot;: [], # List of port numbers to bind to for HTTP
</span><span class="cx">                            # [empty = same as &quot;Port&quot;]
</span><del>-    &quot;BindSSLPorts&quot; : [], # List of port numbers to bind to for SSL
</del><ins>+    &quot;BindSSLPorts&quot;: [], # List of port numbers to bind to for SSL
</ins><span class="cx">                            # [empty = same as &quot;SSLPort&quot;]
</span><del>-    &quot;InheritFDs&quot;   : [], # File descriptors to inherit for HTTP requests
</del><ins>+    &quot;InheritFDs&quot;: [], # File descriptors to inherit for HTTP requests
</ins><span class="cx">                            # (empty = don't inherit)
</span><span class="cx">     &quot;InheritSSLFDs&quot;: [], # File descriptors to inherit for HTTPS requests
</span><span class="cx">                            # (empty = don't inherit)
</span><del>-    &quot;MetaFD&quot;       : 0, # Inherited file descriptor to call recvmsg() on to
</del><ins>+    &quot;MetaFD&quot;: 0, # Inherited file descriptor to call recvmsg() on to
</ins><span class="cx">                            # receive sockets (none = don't inherit)
</span><span class="cx"> 
</span><del>-    &quot;UseMetaFD&quot;    : True, # Use a 'meta' FD, i.e. an FD to transmit other FDs
</del><ins>+    &quot;UseMetaFD&quot;: True, # Use a 'meta' FD, i.e. an FD to transmit other FDs
</ins><span class="cx">                            # to slave processes.
</span><span class="cx"> 
</span><del>-    &quot;UseDatabase&quot;  : True, # True: database; False: files
</del><ins>+    &quot;UseDatabase&quot;: True, # True: database; False: files
</ins><span class="cx"> 
</span><del>-    &quot;TransactionTimeoutSeconds&quot; : 0, # Timeout transactions that take longer than
</del><ins>+    &quot;TransactionTimeoutSeconds&quot;: 0, # Timeout transactions that take longer than
</ins><span class="cx">                               # the specified number of seconds. Zero means
</span><span class="cx">                               # no timeouts
</span><span class="cx"> 
</span><del>-    &quot;DBType&quot;       : &quot;&quot;, # 2 possible values: empty, meaning 'spawn postgres
</del><ins>+    &quot;DBType&quot;: &quot;&quot;, # 2 possible values: empty, meaning 'spawn postgres
</ins><span class="cx">                            # yourself', or 'postgres', meaning 'connect to a
</span><span class="cx">                            # postgres database as specified by the 'DSN'
</span><span class="cx">                            # configuration key.  Will support more values in
</span><span class="cx">                            # the future.
</span><span class="cx"> 
</span><del>-    &quot;SpawnedDBUser&quot; : &quot;caldav&quot;, # The username to use when DBType is empty
</del><ins>+    &quot;SpawnedDBUser&quot;: &quot;caldav&quot;, # The username to use when DBType is empty
</ins><span class="cx"> 
</span><del>-    &quot;DBImportFile&quot; : &quot;&quot;, # File path to SQL file to import at startup (includes schema)
</del><ins>+    &quot;DBImportFile&quot;: &quot;&quot;, # File path to SQL file to import at startup (includes schema)
</ins><span class="cx"> 
</span><del>-    &quot;DSN&quot;          : &quot;&quot;, # Data Source Name.  Used to connect to an external
</del><ins>+    &quot;DSN&quot;: &quot;&quot;, # Data Source Name.  Used to connect to an external
</ins><span class="cx">                            # database if DBType is non-empty.  Format varies
</span><span class="cx">                            # depending on database type.
</span><span class="cx"> 
</span><del>-    &quot;DBAMPFD&quot;      : 0, # Internally used by database to tell slave
</del><ins>+    &quot;DBAMPFD&quot;: 0, # Internally used by database to tell slave
</ins><span class="cx">                            # processes to inherit a file descriptor and use it
</span><span class="cx">                            # as an AMP connection over a UNIX socket; see
</span><span class="cx">                            # twext.enterprise.adbapi2.ConnectionPoolConnection
</span><span class="cx"> 
</span><del>-    &quot;SharedConnectionPool&quot; : False, # Use a shared database connection pool in
</del><ins>+    &quot;SharedConnectionPool&quot;: False, # Use a shared database connection pool in
</ins><span class="cx">                                     # the master process, rather than having
</span><span class="cx">                                     # each client make its connections directly.
</span><span class="cx"> 
</span><del>-    &quot;FailIfUpgradeNeeded&quot;  : True, # Set to True to prevent the server or utility
</del><ins>+    &quot;FailIfUpgradeNeeded&quot;: True, # Set to True to prevent the server or utility
</ins><span class="cx">                                    # tools from running if the database needs a schema
</span><span class="cx">                                    # upgrade.
</span><del>-    &quot;StopAfterUpgradeTriggerFile&quot; : &quot;stop_after_upgrade&quot;,   # if this file exists in ConfigRoot, stop
</del><ins>+    &quot;StopAfterUpgradeTriggerFile&quot;: &quot;stop_after_upgrade&quot;,   # if this file exists in ConfigRoot, stop
</ins><span class="cx">                                                             # the service after finishing upgrade phase
</span><span class="cx"> 
</span><del>-    &quot;UpgradeHomePrefix&quot;    : &quot;&quot;,    # When upgrading, only upgrade homes where the owner UID starts with
</del><ins>+    &quot;UpgradeHomePrefix&quot;: &quot;&quot;,    # When upgrading, only upgrade homes where the owner UID starts with
</ins><span class="cx">                                     # with the specified prefix. The upgrade will only be partial and only
</span><span class="cx">                                     # apply to upgrade pieces that affect entire homes. The upgrade will
</span><span class="cx">                                     # need to be run again without this prefix set to complete the overall
</span><span class="lines">@@ -320,42 +322,42 @@
</span><span class="cx">     #
</span><span class="cx">     # Work queue configuration information
</span><span class="cx">     #
</span><del>-    &quot;WorkQueue&quot; : {
</del><ins>+    &quot;WorkQueue&quot;: {
</ins><span class="cx">         &quot;ampPort&quot;: 7654,            # Port used for hosts in a cluster to take to each other
</span><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     #
</span><span class="cx">     # Types of service provided
</span><span class="cx">     #
</span><del>-    &quot;EnableCalDAV&quot;  : True, # Enable CalDAV service
-    &quot;EnableCardDAV&quot; : True, # Enable CardDAV service
</del><ins>+    &quot;EnableCalDAV&quot;: True, # Enable CalDAV service
+    &quot;EnableCardDAV&quot;: True, # Enable CardDAV service
</ins><span class="cx"> 
</span><span class="cx">     #
</span><span class="cx">     # Data store
</span><span class="cx">     #
</span><del>-    &quot;ServerRoot&quot;              : &quot;/var/db/caldavd&quot;,
-    &quot;DataRoot&quot;                : &quot;Data&quot;,
-    &quot;DatabaseRoot&quot;            : &quot;Database&quot;,
-    &quot;AttachmentsRoot&quot;         : &quot;Attachments&quot;,
-    &quot;DocumentRoot&quot;            : &quot;Documents&quot;,
-    &quot;ConfigRoot&quot;              : &quot;Config&quot;,
-    &quot;LogRoot&quot;                 : &quot;/var/log/caldavd&quot;,
-    &quot;RunRoot&quot;                 : &quot;/var/run/caldavd&quot;,
-    &quot;WebCalendarRoot&quot;         : &quot;/Applications/Server.app/Contents/ServerRoot/usr/share/collabd/webcal/public&quot;,
</del><ins>+    &quot;ServerRoot&quot;: &quot;/var/db/caldavd&quot;,
+    &quot;DataRoot&quot;: &quot;Data&quot;,
+    &quot;DatabaseRoot&quot;: &quot;Database&quot;,
+    &quot;AttachmentsRoot&quot;: &quot;Attachments&quot;,
+    &quot;DocumentRoot&quot;: &quot;Documents&quot;,
+    &quot;ConfigRoot&quot;: &quot;Config&quot;,
+    &quot;LogRoot&quot;: &quot;/var/log/caldavd&quot;,
+    &quot;RunRoot&quot;: &quot;/var/run/caldavd&quot;,
+    &quot;WebCalendarRoot&quot;: &quot;/Applications/Server.app/Contents/ServerRoot/usr/share/collabd/webcal/public&quot;,
</ins><span class="cx"> 
</span><span class="cx">     #
</span><span class="cx">     # Quotas
</span><span class="cx">     #
</span><span class="cx"> 
</span><span class="cx">     # Attachments
</span><del>-    &quot;UserQuota&quot;                 : 104857600, # User attachment quota (in bytes)
</del><ins>+    &quot;UserQuota&quot;: 104857600, # User attachment quota (in bytes)
</ins><span class="cx"> 
</span><span class="cx">     # Resource data
</span><del>-    &quot;MaxCollectionsPerHome&quot;     : 50, # Maximum number of calendars/address books allowed in a home
-    &quot;MaxResourcesPerCollection&quot; : 10000, # Maximum number of resources in a calendar/address book
-    &quot;MaxResourceSize&quot;           : 1048576, # Maximum resource size (in bytes)
-    &quot;MaxAttendeesPerInstance&quot;   : 100, # Maximum number of unique attendees
-    &quot;MaxAllowedInstances&quot;       : 3000, # Maximum number of instances the server will index
</del><ins>+    &quot;MaxCollectionsPerHome&quot;: 50, # Maximum number of calendars/address books allowed in a home
+    &quot;MaxResourcesPerCollection&quot;: 10000, # Maximum number of resources in a calendar/address book
+    &quot;MaxResourceSize&quot;: 1048576, # Maximum resource size (in bytes)
+    &quot;MaxAttendeesPerInstance&quot;: 100, # Maximum number of unique attendees
+    &quot;MaxAllowedInstances&quot;: 3000, # Maximum number of instances the server will index
</ins><span class="cx"> 
</span><span class="cx">     # Set to URL path of wiki authentication service, e.g. &quot;/auth&quot;, in order
</span><span class="cx">     # to use javascript authentication dialog.  Empty string indicates standard
</span><span class="lines">@@ -823,6 +825,11 @@
</span><span class="cx">         }
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    &quot;DirectoryProxy&quot;: {
+        &quot;Enabled&quot;: False,
+        &quot;SocketPath&quot;: &quot;directory-proxy.sock&quot;
+    },
+
</ins><span class="cx">     #
</span><span class="cx">     # Support multiple hosts within a domain
</span><span class="cx">     #
</span><span class="lines">@@ -900,7 +907,6 @@
</span><span class="cx">     # processes. If blank, then an AF_INET socket is used instead.
</span><span class="cx">     &quot;ControlSocket&quot;: &quot;caldavd.sock&quot;,
</span><span class="cx"> 
</span><del>-
</del><span class="cx">     # Support for Content-Encoding compression options as specified in
</span><span class="cx">     # RFC2616 Section 3.5
</span><span class="cx">     # Defaults off, because it weakens TLS (CRIME attack).
</span><span class="lines">@@ -1167,6 +1173,7 @@
</span><span class="cx">     (&quot;RunRoot&quot;, &quot;PIDFile&quot;),
</span><span class="cx">     (&quot;RunRoot&quot;, (&quot;Stats&quot;, &quot;UnixStatsSocket&quot;,)),
</span><span class="cx">     (&quot;RunRoot&quot;, &quot;ControlSocket&quot;),
</span><ins>+    (&quot;RunRoot&quot;, (&quot;DirectoryProxy&quot;, &quot;SocketPath&quot;,)),
</ins><span class="cx"> ]
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktxdavdps__init__py"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/txdav/dps/__init__.py (0 => 12483)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/dps/__init__.py                                (rev 0)
+++ CalendarServer/trunk/txdav/dps/__init__.py        2014-01-30 21:20:16 UTC (rev 12483)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+##
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+&quot;&quot;&quot;
+Directory Proxy Service
+&quot;&quot;&quot;
</ins></span></pre></div>
<a id="CalendarServertrunktxdavdpsprotocolpy"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/txdav/dps/protocol.py (0 => 12483)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/dps/protocol.py                                (rev 0)
+++ CalendarServer/trunk/txdav/dps/protocol.py        2014-01-30 21:20:16 UTC (rev 12483)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+##
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+# import twext.who
+from twisted.protocols import amp
+from twisted.internet.defer import succeed
+from twext.python.log import Logger
+
+log = Logger()
+
+
+class DirectoryProxyAMPCommand(amp.Command):
+    &quot;&quot;&quot;
+    A DirectoryProxy command
+    &quot;&quot;&quot;
+    arguments = [('command', amp.String())]
+    response = [('result', amp.String())]
+
+
+
+class DirectoryProxyAMPProtocol(amp.AMP):
+    &quot;&quot;&quot;
+    &quot;&quot;&quot;
+
+    def __init__(self):
+        &quot;&quot;&quot;
+        &quot;&quot;&quot;
+        amp.AMP.__init__(self)
+
+
+    @DirectoryProxyAMPCommand.responder
+    # @inlineCallbacks
+    def testCommandReceived(self, command):
+        &quot;&quot;&quot;
+        Process a command
+
+        @param command: DirectoryProxyAMPCommand
+        @returns: a deferred returning a dict
+        &quot;&quot;&quot;
+        # command = readPlistFromString(command)
+        log.debug(&quot;Command arrived: {cmd}&quot;, cmd=command)
+        response = {&quot;result&quot;: &quot;plugh&quot;, &quot;command&quot;: command}
+        log.debug(&quot;Responding with: {response}&quot;, response=response)
+        # returnValue(dict(result=result))
+        return succeed(response)
+
+
+#
+# A test AMP client
+#
+
+command = &quot;xyzzy&quot;
+
+
+def makeRequest():
+    from twisted.internet import reactor
+    from twisted.internet.protocol import ClientCreator
+
+    creator = ClientCreator(reactor, amp.AMP)
+    d = creator.connectUNIX(&quot;data/Logs/state/directory-proxy.sock&quot;)
+
+    def connected(ampProto):
+        return ampProto.callRemote(DirectoryProxyAMPCommand, command=command)
+    d.addCallback(connected)
+
+    def resulted(result):
+        return result['result']
+    d.addCallback(resulted)
+
+    def done(result):
+        print('Done: %s' % (result,))
+        reactor.stop()
+    d.addCallback(done)
+    reactor.run()
+
+if __name__ == '__main__':
+    makeRequest()
+
</ins></span></pre></div>
<a id="CalendarServertrunktxdavdpsservicepy"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/txdav/dps/service.py (0 => 12483)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/dps/service.py                                (rev 0)
+++ CalendarServer/trunk/txdav/dps/service.py        2014-01-30 21:20:16 UTC (rev 12483)
</span><span class="lines">@@ -0,0 +1,154 @@
</span><ins>+##
+# Copyright (c) 2014 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+import twext.who
+from twisted.python.usage import Options, UsageError
+from twisted.plugin import IPlugin
+from twisted.application import service
+from zope.interface import implements
+from twistedcaldav.config import config
+from twistedcaldav.stdconfig import DEFAULT_CONFIG, DEFAULT_CONFIG_FILE
+from twisted.application.strports import service as strPortsService
+from twisted.internet.protocol import Factory
+from twext.python.log import Logger
+
+from .protocol import DirectoryProxyAMPProtocol
+
+log = Logger()
+
+
+class DirectoryProxyAMPFactory(Factory):
+    &quot;&quot;&quot;
+    &quot;&quot;&quot;
+    protocol = DirectoryProxyAMPProtocol
+
+
+    def buildProtocol(self, addr):
+        return DirectoryProxyAMPProtocol()
+
+
+
+class DirectoryProxyOptions(Options):
+    optParameters = [[
+        &quot;config&quot;, &quot;f&quot;, DEFAULT_CONFIG_FILE, &quot;Path to configuration file.&quot;
+    ]]
+
+
+    def __init__(self, *args, **kwargs):
+        super(DirectoryProxyOptions, self).__init__(*args, **kwargs)
+
+        self.overrides = {}
+
+
+    def _coerceOption(self, configDict, key, value):
+        &quot;&quot;&quot;
+        Coerce the given C{val} to type of C{configDict[key]}
+        &quot;&quot;&quot;
+        if key in configDict:
+            if isinstance(configDict[key], bool):
+                value = value == &quot;True&quot;
+
+            elif isinstance(configDict[key], (int, float, long)):
+                value = type(configDict[key])(value)
+
+            elif isinstance(configDict[key], (list, tuple)):
+                value = value.split(',')
+
+            elif isinstance(configDict[key], dict):
+                raise UsageError(
+                    &quot;Dict options not supported on the command line&quot;
+                )
+
+            elif value == 'None':
+                value = None
+
+        return value
+
+
+    def _setOverride(self, configDict, path, value, overrideDict):
+        &quot;&quot;&quot;
+        Set the value at path in configDict
+        &quot;&quot;&quot;
+        key = path[0]
+
+        if len(path) == 1:
+            overrideDict[key] = self._coerceOption(configDict, key, value)
+            return
+
+        if key in configDict:
+            if not isinstance(configDict[key], dict):
+                raise UsageError(
+                    &quot;Found intermediate path element that is not a dictionary&quot;
+                )
+
+            if key not in overrideDict:
+                overrideDict[key] = {}
+
+            self._setOverride(
+                configDict[key], path[1:],
+                value, overrideDict[key]
+            )
+
+
+    def opt_option(self, option):
+        &quot;&quot;&quot;
+        Set an option to override a value in the config file. True, False, int,
+        and float options are supported, as well as comma seperated lists. Only
+        one option may be given for each --option flag, however multiple
+        --option flags may be specified.
+        &quot;&quot;&quot;
+
+        if &quot;=&quot; in option:
+            path, value = option.split('=')
+            self._setOverride(
+                DEFAULT_CONFIG,
+                path.split('/'),
+                value,
+                self.overrides
+            )
+        else:
+            self.opt_option('%s=True' % (option,))
+
+    opt_o = opt_option
+
+    def postOptions(self):
+        config.load(self['config'])
+        config.updateDefaults(self.overrides)
+        self.parent['pidfile'] = None
+
+
+class DirectoryProxyServiceMaker(object):
+    implements(IPlugin, service.IServiceMaker)
+
+    tapname = &quot;caldav_directoryproxy&quot;
+    description = &quot;Directory Proxy Service&quot;
+    options = DirectoryProxyOptions
+
+    def makeService(self, options):
+        &quot;&quot;&quot;
+        Return a service
+        &quot;&quot;&quot;
+        try:
+            from setproctitle import setproctitle
+        except ImportError:
+            pass
+        else:
+            setproctitle(&quot;CalendarServer Directory Proxy Service&quot;)
+
+        desc = &quot;unix:{path}:mode=660&quot;.format(
+            path=config.DirectoryProxy.SocketPath
+        )
+        return strPortsService(desc, DirectoryProxyAMPFactory())
</ins></span></pre>
</div>
</div>

</body>
</html>