<!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>[12422] CalendarServer/branches/newdirectory</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/12422">12422</a></dd>
<dt>Author</dt> <dd>wsanchez@apple.com</dd>
<dt>Date</dt> <dd>2014-01-22 12:29:15 -0800 (Wed, 22 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>FIrst pass</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesnewdirectorycalendarservertaputilpy">CalendarServer/branches/newdirectory/calendarserver/tap/util.py</a></li>
<li><a href="#CalendarServerbranchesnewdirectorytwistedcaldavdirectorydirectorypy">CalendarServer/branches/newdirectory/twistedcaldav/directory/directory.py</a></li>
<li><a href="#CalendarServerbranchesnewdirectorytwistedcaldavstdconfigpy">CalendarServer/branches/newdirectory/twistedcaldav/stdconfig.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServerbranchesnewdirectorycalendarservertaputilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/newdirectory/calendarserver/tap/util.py (12421 => 12422)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/newdirectory/calendarserver/tap/util.py        2014-01-22 19:11:53 UTC (rev 12421)
+++ CalendarServer/branches/newdirectory/calendarserver/tap/util.py        2014-01-22 20:29:15 UTC (rev 12422)
</span><span class="lines">@@ -28,79 +28,87 @@
</span><span class="cx"> 
</span><span class="cx"> import errno
</span><span class="cx"> import os
</span><del>-from time import sleep
</del><ins>+# from time import sleep
</ins><span class="cx"> from socket import fromfd, AF_UNIX, SOCK_STREAM, socketpair
</span><span class="cx"> import psutil
</span><ins>+from urllib import quote
</ins><span class="cx"> 
</span><span class="cx"> from twext.python.filepath import CachingFilePath as FilePath
</span><span class="cx"> from twext.python.log import Logger
</span><del>-from txweb2.auth.basic import BasicCredentialFactory
-from txweb2.dav import auth
-from txweb2.http_headers import Headers
-from txweb2.resource import Resource
-from txweb2.static import File as FileResource
</del><ins>+from twisted.python.usage import UsageError
+from twext.enterprise.ienterprise import POSTGRES_DIALECT
+from twext.enterprise.ienterprise import ORACLE_DIALECT
+from twext.enterprise.adbapi2 import (
+    ConnectionPool, ConnectionPoolConnection, ConnectionPoolClient
+)
+from twext.who.aggregate import AggregateDirectoryService
</ins><span class="cx"> 
</span><span class="cx"> from twisted.application.service import Service
</span><span class="cx"> from twisted.cred.portal import Portal
</span><del>-from twisted.internet.defer import inlineCallbacks, returnValue, Deferred, succeed
</del><ins>+from twisted.internet.defer import (
+    inlineCallbacks, returnValue, Deferred, succeed
+)
</ins><span class="cx"> from twisted.internet import reactor as _reactor
</span><span class="cx"> from twisted.internet.reactor import addSystemEventTrigger
</span><span class="cx"> from twisted.internet.tcp import Connection
</span><span class="cx"> from twisted.python.reflect import namedClass
</span><span class="cx"> # from twisted.python.failure import Failure
</span><span class="cx"> 
</span><ins>+from txweb2.auth.basic import BasicCredentialFactory
+from txweb2.dav import auth
+from txweb2.http_headers import Headers
+from txweb2.resource import Resource
+from txweb2.static import File as FileResource
+
+from txdav.base.datastore.dbapiclient import DBAPIConnector, OracleConnector
+from txdav.base.datastore.dbapiclient import postgresPreflight
+from txdav.base.datastore.subpostgres import PostgresService
+from txdav.common.datastore.podding.resource import ConduitResource
+from txdav.common.datastore.sql import CommonDataStore as CommonSQLDataStore
+from txdav.common.datastore.file import CommonDataStore as CommonFileDataStore
+from txdav.common.datastore.sql import current_sql_schema
+from txdav.common.datastore.upgrade.sql.upgrade import NotAllowedToUpgrade
+from txdav.caldav.datastore.scheduling.ischedule.dkim import (
+    DKIMUtils, DomainKeyResource
+)
+from txdav.caldav.datastore.scheduling.ischedule.resource import (
+    IScheduleInboxResource
+)
+
+from twistedcaldav.config import ConfigurationError
</ins><span class="cx"> from twistedcaldav.bind import doBind
</span><span class="cx"> from twistedcaldav.cache import CacheStoreNotifierFactory
</span><span class="cx"> from twistedcaldav.directory import calendaruserproxy
</span><span class="cx"> from twistedcaldav.directory.addressbook import DirectoryAddressBookHomeProvisioningResource
</span><del>-from twistedcaldav.directory.aggregate import AggregateDirectoryService
</del><ins>+# from twistedcaldav.directory.aggregate import AggregateDirectoryService
</ins><span class="cx"> from twistedcaldav.directory.calendar import DirectoryCalendarHomeProvisioningResource
</span><span class="cx"> from twistedcaldav.directory.digest import QopDigestCredentialFactory
</span><del>-from twistedcaldav.directory.directory import GroupMembershipCache
</del><ins>+# from twistedcaldav.directory.directory import GroupMembershipCache
</ins><span class="cx"> from twistedcaldav.directory.principal import DirectoryPrincipalProvisioningResource
</span><del>-from twistedcaldav.directory.wiki import WikiDirectoryService
-from calendarserver.push.notifier import NotifierFactory
-from calendarserver.push.applepush import APNSubscriptionResource
-from twistedcaldav.directorybackedaddressbook import DirectoryBackedAddressBookResource
</del><ins>+# from twistedcaldav.directory.wiki import WikiDirectoryService
+from twistedcaldav.directorybackedaddressbook import (
+    DirectoryBackedAddressBookResource
+)
</ins><span class="cx"> from twistedcaldav.resource import AuthenticationWrapper
</span><del>-from txdav.caldav.datastore.scheduling.ischedule.dkim import DKIMUtils, DomainKeyResource
-from txdav.caldav.datastore.scheduling.ischedule.resource import IScheduleInboxResource
</del><span class="cx"> from twistedcaldav.simpleresource import SimpleResource, SimpleRedirectResource
</span><span class="cx"> from twistedcaldav.timezones import TimezoneCache
</span><span class="cx"> from twistedcaldav.timezoneservice import TimezoneServiceResource
</span><span class="cx"> from twistedcaldav.timezonestdservice import TimezoneStdServiceResource
</span><del>-from twext.enterprise.ienterprise import POSTGRES_DIALECT
-from twext.enterprise.ienterprise import ORACLE_DIALECT
-from twext.enterprise.adbapi2 import ConnectionPool, ConnectionPoolConnection
</del><span class="cx"> 
</span><del>-
</del><span class="cx"> try:
</span><span class="cx">     from twistedcaldav.authkerb import NegotiateCredentialFactory
</span><del>-    NegotiateCredentialFactory  # pacify pyflakes
</del><span class="cx"> except ImportError:
</span><span class="cx">     NegotiateCredentialFactory = None
</span><span class="cx"> 
</span><del>-from twext.enterprise.adbapi2 import ConnectionPoolClient
-from txdav.base.datastore.dbapiclient import DBAPIConnector, OracleConnector
-from txdav.base.datastore.dbapiclient import postgresPreflight
-from txdav.base.datastore.subpostgres import PostgresService
-
</del><ins>+from calendarserver.push.notifier import NotifierFactory
+from calendarserver.push.applepush import APNSubscriptionResource
</ins><span class="cx"> from calendarserver.accesslog import DirectoryLogWrapperResource
</span><span class="cx"> from calendarserver.provision.root import RootResource
</span><span class="cx"> from calendarserver.tools.util import checkDirectory
</span><span class="cx"> from calendarserver.webadmin.resource import WebAdminResource
</span><span class="cx"> from calendarserver.webcal.resource import WebCalendarResource
</span><span class="cx"> 
</span><del>-from txdav.common.datastore.podding.resource import ConduitResource
-from txdav.common.datastore.sql import CommonDataStore as CommonSQLDataStore
-from txdav.common.datastore.file import CommonDataStore as CommonFileDataStore
-from txdav.common.datastore.sql import current_sql_schema
-from txdav.common.datastore.upgrade.sql.upgrade import NotAllowedToUpgrade
-from twext.python.filepath import CachingFilePath
-from urllib import quote
-from twisted.python.usage import UsageError
</del><span class="cx"> 
</span><del>-
</del><span class="cx"> log = Logger()
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -122,7 +130,7 @@
</span><span class="cx"> 
</span><span class="cx">     @rtype: L{PostgresService}
</span><span class="cx">     &quot;&quot;&quot;
</span><del>-    dbRoot = CachingFilePath(config.DatabaseRoot)
</del><ins>+    dbRoot = FilePath(config.DatabaseRoot)
</ins><span class="cx">     # Construct a PostgresService exactly as the parent would, so that we
</span><span class="cx">     # can establish connection information.
</span><span class="cx">     return PostgresService(
</span><span class="lines">@@ -237,7 +245,7 @@
</span><span class="cx">         notifierFactories[&quot;cache&quot;] = CacheStoreNotifierFactory()
</span><span class="cx"> 
</span><span class="cx">     if directoryService is None:
</span><del>-        directoryService = directoryFromConfig(config)
</del><ins>+        directoryService = directoryServiceFromConfig(config)
</ins><span class="cx"> 
</span><span class="cx">     quota = config.UserQuota
</span><span class="cx">     if quota == 0:
</span><span class="lines">@@ -281,93 +289,109 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-def directoryFromConfig(config):
</del><ins>+def directoryServiceFromSubConfig(subConfig):
+    name = subConfig[&quot;name&quot;]
+
+    log.info(&quot;Setting up {0} directory service.&quot;.format(name))
+
+    if name == &quot;XML&quot;:
+        directoryClass = namedClass(&quot;twext.who.xml.DirectoryService&quot;)
+        filePath = FilePath(subConfig[&quot;path&quot;])
+        reloadInterval = int(
+            subConfig.get(&quot;reloadInterval&quot;, directoryClass.reloadInterval)
+        )
+        directory = directoryClass(filePath)
+        directory.reloadInterval = reloadInterval
+
+    else:
+        raise ConfigurationError(
+            &quot;Unknown directory service name: {0}&quot;.format(name)
+        )
+
+
+
+def directoryServiceFromConfig(config):
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Create an L{AggregateDirectoryService} from the given configuration.
</span><span class="cx">     &quot;&quot;&quot;
</span><del>-    #
-    # Setup the Augment Service
-    #
-    if config.AugmentService.type:
-        augmentClass = namedClass(config.AugmentService.type)
-        log.info(&quot;Configuring augment service of type: {augmentClass}&quot;,
-            augmentClass=augmentClass)
-        try:
-            augmentService = augmentClass(**config.AugmentService.params)
-        except IOError:
-            log.error(&quot;Could not start augment service&quot;)
-            raise
-    else:
-        augmentService = None
</del><ins>+    # #
+    # # Setup the Augment Service
+    # #
+    # if config.AugmentService.type:
+    #     augmentClass = namedClass(config.AugmentService.type)
+    #     log.info(&quot;Configuring augment service of type: {augmentClass}&quot;,
+    #         augmentClass=augmentClass)
+    #     try:
+    #         augmentService = augmentClass(**config.AugmentService.params)
+    #     except IOError:
+    #         log.error(&quot;Could not start augment service&quot;)
+    #         raise
+    # else:
+    #     augmentService = None
</ins><span class="cx"> 
</span><del>-    #
-    # Setup the group membership cacher
-    #
-    if config.GroupCaching.Enabled:
-        groupMembershipCache = GroupMembershipCache(
-            config.GroupCaching.MemcachedPool,
-            expireSeconds=config.GroupCaching.ExpireSeconds)
-    else:
-        groupMembershipCache = None
</del><ins>+    # #
+    # # Setup the group membership cacher
+    # #
+    # if config.GroupCaching.Enabled:
+    #     groupMembershipCache = GroupMembershipCache(
+    #         config.GroupCaching.MemcachedPool,
+    #         expireSeconds=config.GroupCaching.ExpireSeconds)
+    # else:
+    #     groupMembershipCache = None
</ins><span class="cx"> 
</span><ins>+    # config.DirectoryService.params.augmentService = augmentService
+    # config.DirectoryService.params.groupMembershipCache = groupMembershipCache
+
</ins><span class="cx">     #
</span><span class="cx">     # Setup the Directory
</span><span class="cx">     #
</span><del>-    directories = []
</del><ins>+    services = []
</ins><span class="cx"> 
</span><del>-    directoryClass = namedClass(config.DirectoryService.type)
-    principalResourceClass = DirectoryPrincipalProvisioningResource
</del><ins>+    baseService = directoryServiceFromSubConfig(config.DirectoryService)
+    services.append(baseService)
</ins><span class="cx"> 
</span><del>-    log.info(&quot;Configuring directory service of type: {directoryType}&quot;,
-        directoryType=config.DirectoryService.type)
</del><ins>+    # # Wait for the directory to become available
+    # while not baseService.isAvailable():
+    #     sleep(5)
</ins><span class="cx"> 
</span><del>-    config.DirectoryService.params.augmentService = augmentService
-    config.DirectoryService.params.groupMembershipCache = groupMembershipCache
-    baseDirectory = directoryClass(config.DirectoryService.params)
</del><ins>+    # #
+    # # Setup the Locations and Resources Service
+    # #
+    # if config.ResourceService.Enabled:
+    #     resourceClass = namedClass(config.ResourceService.type)
</ins><span class="cx"> 
</span><del>-    # Wait for the directory to become available
-    while not baseDirectory.isAvailable():
-        sleep(5)
</del><ins>+    #     log.info(&quot;Configuring resource service of type: {resourceClass}&quot;,
+    #         resourceClass=resourceClass)
</ins><span class="cx"> 
</span><del>-    directories.append(baseDirectory)
</del><ins>+    #     # config.ResourceService.params.augmentService = augmentService
+    #     # config.ResourceService.params.groupMembershipCache = groupMembershipCache
+    #     resourceDirectory = resourceClass(config.ResourceService.params)
+    #     resourceDirectory.realmName = baseDirectory.realmName
+    #     directories.append(resourceDirectory)
</ins><span class="cx"> 
</span><del>-    #
-    # Setup the Locations and Resources Service
-    #
-    if config.ResourceService.Enabled:
-        resourceClass = namedClass(config.ResourceService.type)
</del><ins>+    # #
+    # # Add wiki directory service
+    # #
+    # if config.Authentication.Wiki.Enabled:
+    #     wikiDirectory = WikiDirectoryService()
+    #     wikiDirectory.realmName = baseDirectory.realmName
+    #     directories.append(wikiDirectory)
</ins><span class="cx"> 
</span><del>-        log.info(&quot;Configuring resource service of type: {resourceClass}&quot;,
-            resourceClass=resourceClass)
-
-        config.ResourceService.params.augmentService = augmentService
-        config.ResourceService.params.groupMembershipCache = groupMembershipCache
-        resourceDirectory = resourceClass(config.ResourceService.params)
-        resourceDirectory.realmName = baseDirectory.realmName
-        directories.append(resourceDirectory)
-
</del><span class="cx">     #
</span><del>-    # Add wiki directory service
</del><ins>+    # Use system-wide realm on OSX
</ins><span class="cx">     #
</span><del>-    if config.Authentication.Wiki.Enabled:
-        wikiDirectory = WikiDirectoryService()
-        wikiDirectory.realmName = baseDirectory.realmName
-        directories.append(wikiDirectory)
</del><ins>+    # try:
+    #     import ServerFoundation
+    #     realmName = ServerFoundation.XSAuthenticator.defaultRealm().encode(&quot;utf-8&quot;)
+    # except ImportError:
+    #     pass
</ins><span class="cx"> 
</span><del>-    directory = AggregateDirectoryService(directories, groupMembershipCache)
</del><ins>+    aggregateService = AggregateDirectoryService(
+        baseService.realmName, services
+    )
+    DirectoryPrincipalProvisioningResource(&quot;/principals/&quot;, aggregateService)
</ins><span class="cx"> 
</span><del>-    #
-    # Use system-wide realm on OSX
-    #
-    try:
-        import ServerFoundation
-        realmName = ServerFoundation.XSAuthenticator.defaultRealm().encode(&quot;utf-8&quot;)
-        directory.setRealm(realmName)
-    except ImportError:
-        pass
-    log.info(&quot;Setting up principal collection: {cls}&quot;, cls=principalResourceClass)
-    principalResourceClass(&quot;/principals/&quot;, directory)
-    return directory
</del><ins>+    return aggregateService
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServerbranchesnewdirectorytwistedcaldavdirectorydirectorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/newdirectory/twistedcaldav/directory/directory.py (12421 => 12422)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/newdirectory/twistedcaldav/directory/directory.py        2014-01-22 19:11:53 UTC (rev 12421)
+++ CalendarServer/branches/newdirectory/twistedcaldav/directory/directory.py        2014-01-22 20:29:15 UTC (rev 12422)
</span><span class="lines">@@ -15,6 +15,7 @@
</span><span class="cx"> # limitations under the License.
</span><span class="cx"> ##
</span><span class="cx"> 
</span><ins>+raise NotImplementedError(&quot;!!!!! die !!!!!&quot;)
</ins><span class="cx"> 
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="cx"> Generic directory service classes.
</span></span></pre></div>
<a id="CalendarServerbranchesnewdirectorytwistedcaldavstdconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/newdirectory/twistedcaldav/stdconfig.py (12421 => 12422)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/newdirectory/twistedcaldav/stdconfig.py        2014-01-22 19:11:53 UTC (rev 12421)
+++ CalendarServer/branches/newdirectory/twistedcaldav/stdconfig.py        2014-01-22 20:29:15 UTC (rev 12422)
</span><span class="lines">@@ -48,120 +48,120 @@
</span><span class="cx"> else:
</span><span class="cx">     DEFAULT_CONFIG_FILE = &quot;/etc/caldavd/caldavd.plist&quot;
</span><span class="cx"> 
</span><del>-DEFAULT_SERVICE_PARAMS = {
-    &quot;twistedcaldav.directory.xmlfile.XMLDirectoryService&quot;: {
</del><ins>+DEFAULT_SERVICE_CONFIG = {
+    &quot;XML&quot;: {
</ins><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><del>-    &quot;twistedcaldav.directory.appleopendirectory.OpenDirectoryService&quot;: {
-        &quot;node&quot;: &quot;/Search&quot;,
-        &quot;cacheTimeout&quot;: 1, # Minutes
-        &quot;batchSize&quot;: 100, # for splitting up large queries
-        &quot;negativeCaching&quot;: False,
-        &quot;restrictEnabledRecords&quot;: False,
-        &quot;restrictToGroup&quot;: &quot;&quot;,
-        &quot;recordTypes&quot;: (&quot;users&quot;, &quot;groups&quot;),
-    },
-    &quot;twistedcaldav.directory.ldapdirectory.LdapDirectoryService&quot;: {
-        &quot;cacheTimeout&quot;: 1, # Minutes
-        &quot;negativeCaching&quot;: False,
-        &quot;warningThresholdSeconds&quot;: 3,
-        &quot;batchSize&quot;: 500, # for splitting up large queries
-        &quot;requestTimeoutSeconds&quot; : 10,
-        &quot;requestResultsLimit&quot; : 200,
-        &quot;optimizeMultiName&quot; : False,
-        &quot;queryLocationsImplicitly&quot;: True,
-        &quot;restrictEnabledRecords&quot;: False,
-        &quot;restrictToGroup&quot;: &quot;&quot;,
-        &quot;recordTypes&quot;: (&quot;users&quot;, &quot;groups&quot;),
-        &quot;uri&quot;: &quot;ldap://localhost/&quot;,
-        &quot;tls&quot;: False,
-        &quot;tlsCACertFile&quot;: None,
-        &quot;tlsCACertDir&quot;: None,
-        &quot;tlsRequireCert&quot;: None, # never, allow, try, demand, hard
-        &quot;credentials&quot;: {
-            &quot;dn&quot;: None,
-            &quot;password&quot;: None,
-        },
-        &quot;authMethod&quot;: &quot;LDAP&quot;,
-        &quot;rdnSchema&quot;: {
-            &quot;base&quot;: &quot;dc=example,dc=com&quot;,
-            &quot;guidAttr&quot;: &quot;entryUUID&quot;,
-            &quot;users&quot;: {
-                &quot;rdn&quot;: &quot;ou=People&quot;,
-                &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
-                    &quot;recordName&quot;: &quot;uid&quot;,
-                    &quot;fullName&quot; : &quot;cn&quot;,
-                    &quot;emailAddresses&quot; : [&quot;mail&quot;],
-                    &quot;firstName&quot; : &quot;givenName&quot;,
-                    &quot;lastName&quot; : &quot;sn&quot;,
-                },
-            },
-            &quot;groups&quot;: {
-                &quot;rdn&quot;: &quot;ou=Group&quot;,
-                &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
-                    &quot;recordName&quot;: &quot;cn&quot;,
-                    &quot;fullName&quot; : &quot;cn&quot;,
-                    &quot;emailAddresses&quot; : [&quot;mail&quot;],
-                    &quot;firstName&quot; : &quot;givenName&quot;,
-                    &quot;lastName&quot; : &quot;sn&quot;,
-                },
-            },
-            &quot;locations&quot;: {
-                &quot;rdn&quot;: &quot;ou=Places&quot;,
-                &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
-                    &quot;recordName&quot;: &quot;cn&quot;,
-                    &quot;fullName&quot; : &quot;cn&quot;,
-                    &quot;emailAddresses&quot; : [&quot;mail&quot;],
-                    &quot;firstName&quot; : &quot;givenName&quot;,
-                    &quot;lastName&quot; : &quot;sn&quot;,
-                },
-            },
-            &quot;resources&quot;: {
-                &quot;rdn&quot;: &quot;ou=Resources&quot;,
-                &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
-                    &quot;recordName&quot;: &quot;cn&quot;,
-                    &quot;fullName&quot; : &quot;cn&quot;,
-                    &quot;emailAddresses&quot; : [&quot;mail&quot;],
-                    &quot;firstName&quot; : &quot;givenName&quot;,
-                    &quot;lastName&quot; : &quot;sn&quot;,
-                },
-            },
-        },
-        &quot;groupSchema&quot;: {
-            &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
-        },
-        &quot;resourceSchema&quot;: {
-            &quot;resourceInfoAttr&quot;: None, # contains location/resource info
-            &quot;autoAcceptGroupAttr&quot;: None, # auto accept group
-        },
-        &quot;poddingSchema&quot;: {
-            &quot;serverIdAttr&quot;: None, # maps to augments server-id
-        },
-    },
</del><ins>+    # &quot;twistedcaldav.directory.appleopendirectory.OpenDirectoryService&quot;: {
+    #     &quot;node&quot;: &quot;/Search&quot;,
+    #     &quot;cacheTimeout&quot;: 1, # Minutes
+    #     &quot;batchSize&quot;: 100, # for splitting up large queries
+    #     &quot;negativeCaching&quot;: False,
+    #     &quot;restrictEnabledRecords&quot;: False,
+    #     &quot;restrictToGroup&quot;: &quot;&quot;,
+    #     &quot;recordTypes&quot;: (&quot;users&quot;, &quot;groups&quot;),
+    # },
+    # &quot;twistedcaldav.directory.ldapdirectory.LdapDirectoryService&quot;: {
+    #     &quot;cacheTimeout&quot;: 1, # Minutes
+    #     &quot;negativeCaching&quot;: False,
+    #     &quot;warningThresholdSeconds&quot;: 3,
+    #     &quot;batchSize&quot;: 500, # for splitting up large queries
+    #     &quot;requestTimeoutSeconds&quot; : 10,
+    #     &quot;requestResultsLimit&quot; : 200,
+    #     &quot;optimizeMultiName&quot; : False,
+    #     &quot;queryLocationsImplicitly&quot;: True,
+    #     &quot;restrictEnabledRecords&quot;: False,
+    #     &quot;restrictToGroup&quot;: &quot;&quot;,
+    #     &quot;recordTypes&quot;: (&quot;users&quot;, &quot;groups&quot;),
+    #     &quot;uri&quot;: &quot;ldap://localhost/&quot;,
+    #     &quot;tls&quot;: False,
+    #     &quot;tlsCACertFile&quot;: None,
+    #     &quot;tlsCACertDir&quot;: None,
+    #     &quot;tlsRequireCert&quot;: None, # never, allow, try, demand, hard
+    #     &quot;credentials&quot;: {
+    #         &quot;dn&quot;: None,
+    #         &quot;password&quot;: None,
+    #     },
+    #     &quot;authMethod&quot;: &quot;LDAP&quot;,
+    #     &quot;rdnSchema&quot;: {
+    #         &quot;base&quot;: &quot;dc=example,dc=com&quot;,
+    #         &quot;guidAttr&quot;: &quot;entryUUID&quot;,
+    #         &quot;users&quot;: {
+    #             &quot;rdn&quot;: &quot;ou=People&quot;,
+    #             &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
+    #                 &quot;recordName&quot;: &quot;uid&quot;,
+    #                 &quot;fullName&quot; : &quot;cn&quot;,
+    #                 &quot;emailAddresses&quot; : [&quot;mail&quot;],
+    #                 &quot;firstName&quot; : &quot;givenName&quot;,
+    #                 &quot;lastName&quot; : &quot;sn&quot;,
+    #             },
+    #         },
+    #         &quot;groups&quot;: {
+    #             &quot;rdn&quot;: &quot;ou=Group&quot;,
+    #             &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
+    #                 &quot;recordName&quot;: &quot;cn&quot;,
+    #                 &quot;fullName&quot; : &quot;cn&quot;,
+    #                 &quot;emailAddresses&quot; : [&quot;mail&quot;],
+    #                 &quot;firstName&quot; : &quot;givenName&quot;,
+    #                 &quot;lastName&quot; : &quot;sn&quot;,
+    #             },
+    #         },
+    #         &quot;locations&quot;: {
+    #             &quot;rdn&quot;: &quot;ou=Places&quot;,
+    #             &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
+    #                 &quot;recordName&quot;: &quot;cn&quot;,
+    #                 &quot;fullName&quot; : &quot;cn&quot;,
+    #                 &quot;emailAddresses&quot; : [&quot;mail&quot;],
+    #                 &quot;firstName&quot; : &quot;givenName&quot;,
+    #                 &quot;lastName&quot; : &quot;sn&quot;,
+    #             },
+    #         },
+    #         &quot;resources&quot;: {
+    #             &quot;rdn&quot;: &quot;ou=Resources&quot;,
+    #             &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
+    #                 &quot;recordName&quot;: &quot;cn&quot;,
+    #                 &quot;fullName&quot; : &quot;cn&quot;,
+    #                 &quot;emailAddresses&quot; : [&quot;mail&quot;],
+    #                 &quot;firstName&quot; : &quot;givenName&quot;,
+    #                 &quot;lastName&quot; : &quot;sn&quot;,
+    #             },
+    #         },
+    #     },
+    #     &quot;groupSchema&quot;: {
+    #         &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
+    #     },
+    #     &quot;resourceSchema&quot;: {
+    #         &quot;resourceInfoAttr&quot;: None, # contains location/resource info
+    #         &quot;autoAcceptGroupAttr&quot;: None, # auto accept group
+    #     },
+    #     &quot;poddingSchema&quot;: {
+    #         &quot;serverIdAttr&quot;: None, # maps to augments server-id
+    #     },
+    # },
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> DEFAULT_RESOURCE_PARAMS = {
</span><span class="lines">@@ -372,8 +372,8 @@
</span><span class="cx">     #    users, groups, locations and resources) to the server.
</span><span class="cx">     #
</span><span class="cx">     &quot;DirectoryService&quot;: {
</span><del>-        &quot;type&quot;: &quot;twistedcaldav.directory.xmlfile.XMLDirectoryService&quot;,
-        &quot;params&quot;: DEFAULT_SERVICE_PARAMS[&quot;twistedcaldav.directory.xmlfile.XMLDirectoryService&quot;],
</del><ins>+        &quot;name&quot;: &quot;XML&quot;,
+        &quot;config&quot;: DEFAULT_SERVICE_CONFIG[&quot;XML&quot;],
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     #
</span></span></pre>
</div>
</div>

</body>
</html>