<!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>[13841] 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/13841">13841</a></dd>
<dt>Author</dt> <dd>sagen@apple.com</dd>
<dt>Date</dt> <dd>2014-08-05 16:11:29 -0700 (Tue, 05 Aug 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Clean up directory service config; allow specifying of LDAP RDN and attribute mapping</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkcalendarservertoolsutilpy">CalendarServer/trunk/calendarserver/tools/util.py</a></li>
<li><a href="#CalendarServertrunkconfcaldavdtestplist">CalendarServer/trunk/conf/caldavd-test.plist</a></li>
<li><a href="#CalendarServertrunkrequirementsstabletxt">CalendarServer/trunk/requirements-stable.txt</a></li>
<li><a href="#CalendarServertrunktwistedcaldavstdconfigpy">CalendarServer/trunk/twistedcaldav/stdconfig.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavtesttest_configpy">CalendarServer/trunk/twistedcaldav/test/test_config.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavupgradepy">CalendarServer/trunk/twistedcaldav/upgrade.py</a></li>
<li><a href="#CalendarServertrunktxdavwhogroupspy">CalendarServer/trunk/txdav/who/groups.py</a></li>
<li><a href="#CalendarServertrunktxdavwhoutilpy">CalendarServer/trunk/txdav/who/util.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkcalendarservertoolsutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/util.py (13840 => 13841)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/util.py        2014-08-05 22:49:28 UTC (rev 13840)
+++ CalendarServer/trunk/calendarserver/tools/util.py        2014-08-05 23:11:29 UTC (rev 13841)
</span><span class="lines">@@ -69,146 +69,6 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-# def getDirectory(config=config):
-
-# class MyDirectoryService (AggregateDirectoryService):
-# def getPrincipalCollection(self):
-# if not hasattr(self, "_principalCollection"):
-
-# if config.Notifications.Enabled:
-# # FIXME: NotifierFactory needs reference to the store in order
-# # to get a txn in order to create a Work item
-# notifierFactory = NotifierFactory(
-# None, config.ServerHostName,
-# config.Notifications.CoalesceSeconds,
-# )
-# else:
-# notifierFactory = None
-
-# # Need a data store
-# _newStore = CommonDataStore(FilePath(config.DocumentRoot),
-# notifierFactory, self, True, False)
-# if notifierFactory is not None:
-# notifierFactory.store = _newStore
-
-# #
-# # Instantiating a DirectoryCalendarHomeProvisioningResource with a directory
-# # will register it with the directory (still smells like a hack).
-# #
-# # We need that in order to locate calendar homes via the directory.
-# #
-# from twistedcaldav.directory.calendar import DirectoryCalendarHomeProvisioningResource
-# DirectoryCalendarHomeProvisioningResource(self, "/calendars/", _newStore)
-
-# from twistedcaldav.directory.principal import DirectoryPrincipalProvisioningResource
-# self._principalCollection = DirectoryPrincipalProvisioningResource("/principals/", self)
-
-# return self._principalCollection
-
-# def setPrincipalCollection(self, coll):
-# # See principal.py line 237: self.directory.principalCollection = self
-# pass
-
-# principalCollection = property(getPrincipalCollection, setPrincipalCollection)
-
-# def calendarHomeForRecord(self, record):
-# principal = self.principalCollection.principalForRecord(record)
-# if principal:
-# try:
-# return principal.calendarHome()
-# except AttributeError:
-# pass
-# return None
-
-# def calendarHomeForShortName(self, recordType, shortName):
-# principal = self.principalCollection.principalForShortName(recordType, shortName)
-# if principal:
-# return principal.calendarHome()
-# return None
-
-# def principalForCalendarUserAddress(self, cua):
-# return self.principalCollection.principalForCalendarUserAddress(cua)
-
-# def principalForUID(self, uid):
-# return self.principalCollection.principalForUID(uid)
-
-# # Load augment/proxy db classes now
-# if config.AugmentService.type:
-# augmentClass = namedClass(config.AugmentService.type)
-# augmentService = augmentClass(**config.AugmentService.params)
-# else:
-# augmentService = None
-
-# proxydbClass = namedClass(config.ProxyDBService.type)
-# calendaruserproxy.ProxyDBService = proxydbClass(**config.ProxyDBService.params)
-
-# # Wait for directory service to become available
-# BaseDirectoryService = namedClass(config.DirectoryService.type)
-# config.DirectoryService.params.augmentService = augmentService
-# directory = BaseDirectoryService(config.DirectoryService.params)
-# while not directory.isAvailable():
-# sleep(5)
-
-# directories = [directory]
-
-# if config.ResourceService.Enabled:
-# resourceClass = namedClass(config.ResourceService.type)
-# config.ResourceService.params.augmentService = augmentService
-# resourceDirectory = resourceClass(config.ResourceService.params)
-# resourceDirectory.realmName = directory.realmName
-# directories.append(resourceDirectory)
-
-# aggregate = MyDirectoryService(directories, None)
-# aggregate.augmentService = augmentService
-
-# #
-# # Wire up the resource hierarchy
-# #
-# principalCollection = aggregate.getPrincipalCollection()
-# root = RootResource(
-# config.DocumentRoot,
-# principalCollections=(principalCollection,),
-# )
-# root.putChild("principals", principalCollection)
-
-# # Need a data store
-# _newStore = CommonDataStore(FilePath(config.DocumentRoot), None, aggregate, True, False)
-
-# from twistedcaldav.directory.calendar import DirectoryCalendarHomeProvisioningResource
-# calendarCollection = DirectoryCalendarHomeProvisioningResource(
-# aggregate, "/calendars/",
-# _newStore,
-# )
-# root.putChild("calendars", calendarCollection)
-
-# return aggregate
-
-
-
-# class DummyDirectoryService (DirectoryService):
-# realmName = ""
-# baseGUID = "51856FD4-5023-4890-94FE-4356C4AAC3E4"
-# def recordTypes(self):
-# return ()
-
-
-# def listRecords(self):
-# return ()
-
-
-# def recordWithShortName(self):
-# return None
-
-# dummyDirectoryRecord = DirectoryRecord(
-# service=DummyDirectoryService(),
-# recordType="dummy",
-# guid="8EF0892F-7CB6-4B8E-B294-7C5A5321136A",
-# shortNames=("dummy",),
-# fullName="Dummy McDummerson",
-# firstName="Dummy",
-# lastName="McDummerson",
-# )
-
</del><span class="cx"> class UsageError (StandardError):
</span><span class="cx"> pass
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunkconfcaldavdtestplist"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/conf/caldavd-test.plist (13840 => 13841)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/conf/caldavd-test.plist        2014-08-05 22:49:28 UTC (rev 13840)
+++ CalendarServer/trunk/conf/caldavd-test.plist        2014-08-05 23:11:29 UTC (rev 13841)
</span><span class="lines">@@ -196,7 +196,7 @@
</span><span class="cx"> <key>DirectoryService</key>
</span><span class="cx"> <dict>
</span><span class="cx"> <key>type</key>
</span><del>- <string>twistedcaldav.directory.xmlfile.XMLDirectoryService</string>
</del><ins>+ <string>xml</string>
</ins><span class="cx">
</span><span class="cx"> <key>params</key>
</span><span class="cx"> <dict>
</span><span class="lines">@@ -210,14 +210,12 @@
</span><span class="cx"> <key>DirectoryService</key>
</span><span class="cx"> <dict>
</span><span class="cx"> <key>type</key>
</span><del>- <string>twistedcaldav.directory.appleopendirectory.OpenDirectoryService</string>
</del><ins>+ <string>opendirectory</string>
</ins><span class="cx">
</span><span class="cx"> <key>params</key>
</span><span class="cx"> <dict>
</span><span class="cx"> <key>node</key>
</span><span class="cx"> <string>/Search</string>
</span><del>- <key>cacheTimeout</key>
- <integer>10</integer>
</del><span class="cx"> </dict>
</span><span class="cx"> </dict>
</span><span class="cx"> -->
</span><span class="lines">@@ -227,7 +225,7 @@
</span><span class="cx"> <key>DirectoryService</key>
</span><span class="cx"> <dict>
</span><span class="cx"> <key>type</key>
</span><del>- <string>twistedcaldav.directory.ldapdirectory.LdapDirectoryService</string>
</del><ins>+ <string>ldap</string>
</ins><span class="cx">
</span><span class="cx"> <key>params</key>
</span><span class="cx"> <dict>
</span><span class="lines">@@ -235,137 +233,58 @@
</span><span class="cx"> <array>
</span><span class="cx"> <string>users</string>
</span><span class="cx"> <string>groups</string>
</span><del>- <string>locations</string>
- <string>resources</string>
</del><span class="cx"> </array>
</span><del>- <key>cacheTimeout</key>
- <integer>10</integer>
</del><span class="cx"> <key>uri</key>
</span><del>- <string>ldap://ldapserver.example.com/</string>
- <key>tls</key>
- <false/>
- <key>tlsCACertFile</key>
- <string></string>
- <key>tlsCACertDir</key>
- <string></string>
- <key>tlsRequireCert</key>
- <string>never</string>
</del><ins>+ <string>ldap://server.example.com/</string>
</ins><span class="cx"> <key>credentials</key>
</span><span class="cx"> <dict>
</span><span class="cx"> <key>dn</key>
</span><span class="cx"> <string>uid=admin,ou=people,o=example.com</string>
</span><span class="cx"> <key>password</key>
</span><del>- <string>PASSWORD</string>
</del><ins>+ <string></string>
</ins><span class="cx"> </dict>
</span><span class="cx"> <key>rdnSchema</key>
</span><span class="cx"> <dict>
</span><span class="cx"> <key>base</key>
</span><del>- <string>o=example.com</string>
- <key>guidAttr</key>
- <string>GUID</string>
</del><ins>+ <string>dc=server,dc=example,dc=com</string>
</ins><span class="cx"> <key>users</key>
</span><del>- <dict>
- <key>rdn</key>
- <string>ou=people</string>
- <key>mapping</key>
- <dict>
- <key>recordName</key>
- <string>uid</string>
- <key>fullName</key>
- <string>cn</string>
- <key>emailAddresses</key>
- <array>
- <string>mail</string>
- <string>mailAlias</string>
- </array>
- <key>firstName</key>
- <string>givenName</string>
- <key>lastName</key>
- <string>sn</string>
- </dict>
- </dict>
</del><ins>+ <string>cn=users</string>
</ins><span class="cx"> <key>groups</key>
</span><del>- <dict>
- <key>rdn</key>
- <string>ou=groups</string>
- <key>mapping</key>
- <dict>
- <key>recordName</key>
- <string>cn</string>
- <key>fullName</key>
- <string>cn</string>
- <key>emailAddresses</key>
- <array>
- <string>mail</string>
- <string>mailAlias</string>
- </array>
- </dict>
- </dict>
</del><ins>+ <string>cn=groups</string>
</ins><span class="cx"> <key>locations</key>
</span><del>- <dict>
- <key>rdn</key>
- <string>ou=locations</string>
- <key>associatedAddressAttr</key>
- <string></string>
- <key>mapping</key>
- <dict>
- <key>recordName</key>
- <string>cn</string>
- <key>fullName</key>
- <string>cn</string>
- </dict>
- </dict>
</del><ins>+ <string>cn=locations</string>
</ins><span class="cx"> <key>resources</key>
</span><del>- <dict>
- <key>rdn</key>
- <string>ou=resources</string>
- <key>mapping</key>
- <dict>
- <key>recordName</key>
- <string>cn</string>
- <key>fullName</key>
- <string>cn</string>
- </dict>
- </dict>
</del><ins>+ <string>cn=resources</string>
</ins><span class="cx"> <key>addresses</key>
</span><del>- <dict>
- <key>rdn</key>
- <string>ou=buildings</string>
- <key>geoAttr</key>
- <string></string>
- <key>streetAddressAttr</key>
- <string></string>
- <key>mapping</key>
- <dict>
- <key>recordName</key>
- <string>cn</string>
- <key>fullName</key>
- <string>cn</string>
- </dict>
- </dict>
</del><ins>+ <string>cn=addresses</string>
</ins><span class="cx"> </dict>
</span><del>- <key>groupSchema</key>
</del><ins>+ <key>mapping</key>
</ins><span class="cx"> <dict>
</span><del>- <key>membersAttr</key>
- <string>uniqueMember</string>
- <key>nestedGroupsAttr</key>
- <string></string>
- <key>memberIdAttr</key>
- <string></string>
</del><ins>+ <key>uid</key>
+ <array>
+ <string>apple-generateduid</string>
+ </array>
+ <key>guid</key>
+ <array>
+ <string>apple-generateduid</string>
+ </array>
+ <key>shortNames</key>
+ <array>
+ <string>uid</string>
+ </array>
+ <key>fullNames</key>
+ <array>
+ <string>cn</string>
+ </array>
+ <key>emailAddresses</key>
+ <array>
+ <string>mail</string>
+ </array>
+ <key>memberDNs</key>
+ <array>
+ <string>uniqueMember</string>
+ </array>
</ins><span class="cx"> </dict>
</span><del>- <key>resourceSchema</key>
- <dict>
- <key>resourceInfoAttr</key>
- <string></string>
- <key>autoScheduleAttr</key>
- <string></string>
- <key>autoScheduleEnabledValue</key>
- <string></string>
- <key>proxyAttr</key>
- <string></string>
- <key>readOnlyProxyAttr</key>
- <string></string>
- </dict>
</del><span class="cx"> </dict>
</span><span class="cx"> </dict>
</span><span class="cx"> -->
</span><span class="lines">@@ -380,7 +299,7 @@
</span><span class="cx"> <key>Enabled</key>
</span><span class="cx"> <true/>
</span><span class="cx"> <key>type</key>
</span><del>- <string>twistedcaldav.directory.xmlfile.XMLDirectoryService</string>
</del><ins>+ <string>xml</string>
</ins><span class="cx">
</span><span class="cx"> <key>params</key>
</span><span class="cx"> <dict>
</span><span class="lines">@@ -436,36 +355,6 @@
</span><span class="cx"> </dict>
</span><span class="cx"> -->
</span><span class="cx">
</span><del>- <!-- Sqlite ProxyDB Service -->
- <key>ProxyDBService</key>
- <dict>
- <key>type</key>
- <string>twistedcaldav.directory.calendaruserproxy.ProxySqliteDB</string>
-
- <key>params</key>
- <dict>
- <key>dbpath</key>
- <string>proxies.sqlite</string>
- </dict>
- </dict>
-
- <!-- PostgreSQL ProxyDB Service -->
- <!--
- <key>ProxyDBService</key>
- <dict>
- <key>type</key>
- <string>twistedcaldav.directory.calendaruserproxy.ProxyPostgreSQLDB</string>
-
- <key>params</key>
- <dict>
- <key>host</key>
- <string>localhost</string>
- <key>database</key>
- <string>proxies</string>
- </dict>
- </dict>
- -->
-
</del><span class="cx"> <key>ProxyLoadFromFile</key>
</span><span class="cx"> <string>./conf/auth/proxies-test.xml</string>
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunkrequirementsstabletxt"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/requirements-stable.txt (13840 => 13841)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/requirements-stable.txt        2014-08-05 22:49:28 UTC (rev 13840)
+++ CalendarServer/trunk/requirements-stable.txt        2014-08-05 23:11:29 UTC (rev 13841)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> # For CalendarServer development, don't try to get these projects from PyPI; use svn.
</span><span class="cx">
</span><span class="cx"> -e .
</span><del>--e svn+http://svn.calendarserver.org/repository/calendarserver/twext/trunk@13835#egg=twextpy
</del><ins>+-e svn+http://svn.calendarserver.org/repository/calendarserver/twext/trunk@13840#egg=twextpy
</ins><span class="cx"> -e svn+http://svn.calendarserver.org/repository/calendarserver/PyKerberos/trunk@13420#egg=kerberos
</span><span class="cx"> -e svn+http://svn.calendarserver.org/repository/calendarserver/PyCalendar/trunk@13802#egg=pycalendar
</span><span class="cx">
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavstdconfigpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py (13840 => 13841)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/stdconfig.py        2014-08-05 22:49:28 UTC (rev 13840)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py        2014-08-05 23:11:29 UTC (rev 13841)
</span><span class="lines">@@ -49,133 +49,48 @@
</span><span class="cx"> DEFAULT_CONFIG_FILE = "/etc/caldavd/caldavd.plist"
</span><span class="cx">
</span><span class="cx"> DEFAULT_SERVICE_PARAMS = {
</span><del>- "twistedcaldav.directory.xmlfile.XMLDirectoryService": {
- "xmlFile": "accounts.xml",
</del><ins>+ "xml": {
</ins><span class="cx"> "recordTypes": ("users", "groups"),
</span><del>- "statSeconds": 15,
</del><ins>+ "xmlFile": "accounts.xml",
</ins><span class="cx"> },
</span><del>- "twistedcaldav.directory.appleopendirectory.OpenDirectoryService": {
- "node": "/Search",
- "cacheTimeout": 1, # Minutes
- "batchSize": 100, # for splitting up large queries
- "negativeCaching": False,
- "restrictEnabledRecords": False,
- "restrictToGroup": "",
</del><ins>+ "opendirectory": {
</ins><span class="cx"> "recordTypes": ("users", "groups"),
</span><ins>+ "node": "/Search",
</ins><span class="cx"> },
</span><del>- "twistedcaldav.directory.ldapdirectory.LdapDirectoryService": {
- "cacheTimeout": 1, # Minutes
- "negativeCaching": False,
- "warningThresholdSeconds": 3,
- "batchSize": 500, # for splitting up large queries
- "requestTimeoutSeconds": 10,
- "requestResultsLimit": 200,
- "optimizeMultiName": False,
- "queryLocationsImplicitly": True,
- "restrictEnabledRecords": False,
- "restrictToGroup": "",
</del><ins>+ "ldap": {
</ins><span class="cx"> "recordTypes": ("users", "groups"),
</span><span class="cx"> "uri": "ldap://localhost/",
</span><del>- "tls": False,
- "tlsCACertFile": None,
- "tlsCACertDir": None,
- "tlsRequireCert": None, # never, allow, try, demand, hard
</del><span class="cx"> "credentials": {
</span><span class="cx"> "dn": None,
</span><span class="cx"> "password": None,
</span><span class="cx"> },
</span><del>- "authMethod": "LDAP",
</del><span class="cx"> "rdnSchema": {
</span><span class="cx"> "base": "dc=example,dc=com",
</span><del>- "guidAttr": "entryUUID",
- "users": {
- "rdn": "ou=People",
- "attr": "uid", # used only to synthesize email address
- "emailSuffix": None, # used only to synthesize email address
- "filter": None, # additional filter for this type
- "loginEnabledAttr": "", # attribute controlling login
- "loginEnabledValue": "yes", # "True" value of above attribute
- "calendarEnabledAttr": "", # attribute controlling enabledForCalendaring
- "calendarEnabledValue": "yes", # "True" value of above attribute
- "mapping": { # maps internal record names to LDAP
- "recordName": "uid",
- "fullName": "cn",
- "emailAddresses": ["mail"],
- "firstName": "givenName",
- "lastName": "sn",
- },
- },
- "groups": {
- "rdn": "ou=Group",
- "attr": "cn", # used only to synthesize email address
- "emailSuffix": None, # used only to synthesize email address
- "filter": None, # additional filter for this type
- "mapping": { # maps internal record names to LDAP
- "recordName": "cn",
- "fullName": "cn",
- "emailAddresses": ["mail"],
- "firstName": "givenName",
- "lastName": "sn",
- },
- },
- "locations": {
- "rdn": "ou=Places",
- "attr": "cn", # used only to synthesize email address
- "emailSuffix": None, # used only to synthesize email address
- "filter": None, # additional filter for this type
- "calendarEnabledAttr": "", # attribute controlling enabledForCalendaring
- "calendarEnabledValue": "yes", # "True" value of above attribute
- "mapping": { # maps internal record names to LDAP
- "recordName": "cn",
- "fullName": "cn",
- "emailAddresses": ["mail"],
- "firstName": "givenName",
- "lastName": "sn",
- },
- },
- "resources": {
- "rdn": "ou=Resources",
- "attr": "cn", # used only to synthesize email address
- "emailSuffix": None, # used only to synthesize email address
- "filter": None, # additional filter for this type
- "calendarEnabledAttr": "", # attribute controlling enabledForCalendaring
- "calendarEnabledValue": "yes", # "True" value of above attribute
- "mapping": { # maps internal record names to LDAP
- "recordName": "cn",
- "fullName": "cn",
- "emailAddresses": ["mail"],
- "firstName": "givenName",
- "lastName": "sn",
- },
- },
</del><ins>+ "users": "cn=users",
+ "groups": "cn=groups",
+ "locations": "cn=locations",
+ "resources": "cn=resources",
+ "addresses": "cn=addresses",
</ins><span class="cx"> },
</span><del>- "groupSchema": {
- "membersAttr": "member", # how members are specified
- "nestedGroupsAttr": None, # how nested groups are specified
- "memberIdAttr": None, # which attribute the above refer to
- },
- "resourceSchema": {
- "resourceInfoAttr": None, # contains location/resource info
- "autoAcceptGroupAttr": None, # auto accept group
- },
- "poddingSchema": {
- "serverIdAttr": None, # maps to augments server-id
- },
</del><ins>+ "mapping": {
+ "uid": ["apple-generateduid", ],
+ "guid": ["apple-generateduid", ],
+ "shortNames": ["uid", ],
+ "fullNames": ["cn", ],
+ "emailAddresses": ["mail", ],
+ "memberDNs": ["uniqueMember", ],
+ }
</ins><span class="cx"> },
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> DEFAULT_RESOURCE_PARAMS = {
</span><del>- "twistedcaldav.directory.xmlfile.XMLDirectoryService": {
- "xmlFile": "resources.xml",
</del><ins>+ "xml": {
</ins><span class="cx"> "recordTypes": ("locations", "resources", "addresses"),
</span><ins>+ "xmlFile": "resources.xml",
</ins><span class="cx"> },
</span><del>- "twistedcaldav.directory.appleopendirectory.OpenDirectoryService": {
</del><ins>+ "opendirectory": {
+ "recordTypes": ("locations", "resources", "addresses"),
</ins><span class="cx"> "node": "/Search",
</span><del>- "cacheTimeout": 1, # Minutes
- "negativeCaching": False,
- "restrictEnabledRecords": False,
- "restrictToGroup": "",
- "recordTypes": ("locations", "resources"),
</del><span class="cx"> },
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -195,20 +110,7 @@
</span><span class="cx"> },
</span><span class="cx"> }
</span><span class="cx">
</span><del>-DEFAULT_PROXYDB_PARAMS = {
- "twistedcaldav.directory.calendaruserproxy.ProxySqliteDB": {
- "dbpath": "proxies.sqlite",
- },
- "twistedcaldav.directory.calendaruserproxy.ProxyPostgreSQLDB": {
- "host": "localhost",
- "database": "proxies",
- "user": "",
- "password": "",
- "dbtype": "",
- },
-}
</del><span class="cx">
</span><del>-
</del><span class="cx"> directoryAddressBookBackingServiceDefaultParams = {
</span><span class="cx"> "twistedcaldav.directory.xmlfile.XMLDirectoryService": {
</span><span class="cx"> "xmlFile": "/etc/carddavd/accounts.xml",
</span><span class="lines">@@ -371,7 +273,7 @@
</span><span class="cx"> # Set to URL path of wiki authentication service, e.g. "/auth", in order
</span><span class="cx"> # to use javascript authentication dialog. Empty string indicates standard
</span><span class="cx"> # browser authentication dialog should be used.
</span><del>- "WebCalendarAuthPath" : "",
</del><ins>+ "WebCalendarAuthPath": "",
</ins><span class="cx">
</span><span class="cx"> # Define mappings of URLs to file system objects (directories or files)
</span><span class="cx"> "Aliases": [],
</span><span class="lines">@@ -384,8 +286,8 @@
</span><span class="cx"> #
</span><span class="cx"> "DirectoryService": {
</span><span class="cx"> "Enabled": True,
</span><del>- "type": "twistedcaldav.directory.xmlfile.XMLDirectoryService",
- "params": DEFAULT_SERVICE_PARAMS["twistedcaldav.directory.xmlfile.XMLDirectoryService"],
</del><ins>+ "type": "xml",
+ "params": DEFAULT_SERVICE_PARAMS["xml"],
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> "DirectoryRealmName": "",
</span><span class="lines">@@ -398,8 +300,8 @@
</span><span class="cx"> #
</span><span class="cx"> "ResourceService": {
</span><span class="cx"> "Enabled": True,
</span><del>- "type": "twistedcaldav.directory.xmlfile.XMLDirectoryService",
- "params": DEFAULT_RESOURCE_PARAMS["twistedcaldav.directory.xmlfile.XMLDirectoryService"],
</del><ins>+ "type": "xml",
+ "params": DEFAULT_RESOURCE_PARAMS["xml"],
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> #
</span><span class="lines">@@ -409,16 +311,12 @@
</span><span class="cx"> #
</span><span class="cx"> "AugmentService": {
</span><span class="cx"> "type": "twistedcaldav.directory.augment.AugmentXMLDB",
</span><del>- "params" : DEFAULT_AUGMENT_PARAMS["twistedcaldav.directory.augment.AugmentXMLDB"],
</del><ins>+ "params": DEFAULT_AUGMENT_PARAMS["twistedcaldav.directory.augment.AugmentXMLDB"],
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> #
</span><span class="cx"> # Proxies
</span><span class="cx"> #
</span><del>- "ProxyDBService": {
- "type": "twistedcaldav.directory.calendaruserproxy.ProxySqliteDB",
- "params": DEFAULT_PROXYDB_PARAMS["twistedcaldav.directory.calendaruserproxy.ProxySqliteDB"],
- },
</del><span class="cx"> "ProxyLoadFromFile": "", # Allows for initialization of the proxy database from an XML file
</span><span class="cx">
</span><span class="cx"> #
</span><span class="lines">@@ -1472,15 +1370,6 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><del>-def _postUpdateProxyDBService(configDict, reloading=False):
- if configDict.ProxyDBService.type in DEFAULT_PROXYDB_PARAMS:
- for param in tuple(configDict.ProxyDBService.params):
- if param not in DEFAULT_PROXYDB_PARAMS[configDict.ProxyDBService.type]:
- log.warn("Parameter %s is not supported by service %s" % (param, configDict.ProxyDBService.type))
- del configDict.ProxyDBService.params[param]
-
-
-
</del><span class="cx"> def _updateACLs(configDict, reloading=False):
</span><span class="cx"> #
</span><span class="cx"> # Base resource ACLs
</span><span class="lines">@@ -1766,7 +1655,6 @@
</span><span class="cx"> _postUpdateDirectoryService,
</span><span class="cx"> _postUpdateResourceService,
</span><span class="cx"> _postUpdateAugmentService,
</span><del>- _postUpdateProxyDBService,
</del><span class="cx"> _updateACLs,
</span><span class="cx"> _updateRejectClients,
</span><span class="cx"> _updateLogLevels,
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavtesttest_configpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/test/test_config.py (13840 => 13841)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/test/test_config.py        2014-08-05 22:49:28 UTC (rev 13840)
+++ CalendarServer/trunk/twistedcaldav/test/test_config.py        2014-08-05 23:11:29 UTC (rev 13841)
</span><span class="lines">@@ -230,51 +230,51 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def testDirectoryService_noChange(self):
</span><del>- self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.xmlfile.XMLDirectoryService")
</del><ins>+ self.assertEquals(config.DirectoryService.type, "xml")
</ins><span class="cx"> self.assertEquals(config.DirectoryService.params.xmlFile, "accounts.xml")
</span><span class="cx">
</span><span class="cx"> config.update({"DirectoryService": {}})
</span><span class="cx">
</span><del>- self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.xmlfile.XMLDirectoryService")
</del><ins>+ self.assertEquals(config.DirectoryService.type, "xml")
</ins><span class="cx"> self.assertEquals(config.DirectoryService.params.xmlFile, "accounts.xml")
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def testDirectoryService_sameType(self):
</span><del>- self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.xmlfile.XMLDirectoryService")
</del><ins>+ self.assertEquals(config.DirectoryService.type, "xml")
</ins><span class="cx"> self.assertEquals(config.DirectoryService.params.xmlFile, "accounts.xml")
</span><span class="cx">
</span><del>- config.update({"DirectoryService": {"type": "twistedcaldav.directory.xmlfile.XMLDirectoryService"}})
</del><ins>+ config.update({"DirectoryService": {"type": "xml"}})
</ins><span class="cx">
</span><del>- self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.xmlfile.XMLDirectoryService")
</del><ins>+ self.assertEquals(config.DirectoryService.type, "xml")
</ins><span class="cx"> self.assertEquals(config.DirectoryService.params.xmlFile, "accounts.xml")
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def testDirectoryService_newType(self):
</span><del>- self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.xmlfile.XMLDirectoryService")
</del><ins>+ self.assertEquals(config.DirectoryService.type, "xml")
</ins><span class="cx"> self.assertEquals(config.DirectoryService.params.xmlFile, "accounts.xml")
</span><span class="cx">
</span><del>- config.update({"DirectoryService": {"type": "twistedcaldav.directory.appleopendirectory.OpenDirectoryService"}})
</del><ins>+ config.update({"DirectoryService": {"type": "opendirectory"}})
</ins><span class="cx">
</span><del>- self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.appleopendirectory.OpenDirectoryService")
</del><ins>+ self.assertEquals(config.DirectoryService.type, "opendirectory")
</ins><span class="cx"> self.assertNotIn("xmlFile", config.DirectoryService.params)
</span><span class="cx"> self.assertEquals(config.DirectoryService.params.node, "/Search")
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def testDirectoryService_newParam(self):
</span><del>- self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.xmlfile.XMLDirectoryService")
</del><ins>+ self.assertEquals(config.DirectoryService.type, "xml")
</ins><span class="cx"> self.assertEquals(config.DirectoryService.params.xmlFile, "accounts.xml")
</span><span class="cx">
</span><del>- config.update({"DirectoryService": {"type": "twistedcaldav.directory.appleopendirectory.OpenDirectoryService"}})
</del><ins>+ config.update({"DirectoryService": {"type": "opendirectory"}})
</ins><span class="cx">
</span><del>- self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.appleopendirectory.OpenDirectoryService")
</del><ins>+ self.assertEquals(config.DirectoryService.type, "opendirectory")
</ins><span class="cx"> self.assertEquals(config.DirectoryService.params.node, "/Search")
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> def testDirectoryService_unknownType(self):
</span><del>- self.assertEquals(config.DirectoryService.type, "twistedcaldav.directory.xmlfile.XMLDirectoryService")
</del><ins>+ self.assertEquals(config.DirectoryService.type, "xml")
</ins><span class="cx"> self.assertEquals(config.DirectoryService.params.xmlFile, "accounts.xml")
</span><span class="cx">
</span><del>- config.update({"DirectoryService": {"type": "twistedcaldav.test.test_config.SuperDuperAwesomeService"}})
</del><ins>+ config.update({"DirectoryService": {"type": "unknown"}})
</ins><span class="cx">
</span><span class="cx"> # self.assertEquals(
</span><span class="cx"> # config.DirectoryService.params,
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavupgradepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/upgrade.py (13840 => 13841)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/upgrade.py        2014-08-05 22:49:28 UTC (rev 13840)
+++ CalendarServer/trunk/twistedcaldav/upgrade.py        2014-08-05 23:11:29 UTC (rev 13841)
</span><span class="lines">@@ -1149,25 +1149,6 @@
</span><span class="cx"> # Write stub file as indicator loading is done
</span><span class="cx"> FilePath(loadDoneFilePath).touch()
</span><span class="cx">
</span><del>-
- # # Populate the group membership cache
- # if (self.config.GroupCaching.Enabled and
- # self.config.GroupCaching.EnableUpdater):
- # proxydb = calendaruserproxy.ProxyDBService
- # if proxydb is None:
- # proxydbClass = namedClass(self.config.ProxyDBService.type)
- # proxydb = proxydbClass(**self.config.ProxyDBService.params)
-
- # # MOVE2WHO FIXME: port to new group cacher
- # updater = GroupMembershipCacheUpdater(proxydb,
- # directory,
- # self.config.GroupCaching.UpdateSeconds,
- # self.config.GroupCaching.ExpireSeconds,
- # self.config.GroupCaching.LockSeconds,
- # namespace=self.config.GroupCaching.MemcachedPool,
- # useExternalProxies=self.config.GroupCaching.UseExternalProxies)
- # yield updater.updateCache(fast=True)
-
</del><span class="cx"> # Process old inbox items
</span><span class="cx"> self.store.setMigrating(True)
</span><span class="cx"> yield self.processInboxItems()
</span></span></pre></div>
<a id="CalendarServertrunktxdavwhogroupspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/who/groups.py (13840 => 13841)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/who/groups.py        2014-08-05 22:49:28 UTC (rev 13840)
+++ CalendarServer/trunk/txdav/who/groups.py        2014-08-05 23:11:29 UTC (rev 13841)
</span><span class="lines">@@ -67,7 +67,6 @@
</span><span class="cx"> groupCacher = getattr(self.transaction, "_groupCacher", None)
</span><span class="cx"> if groupCacher is not None:
</span><span class="cx">
</span><del>- # New implementation
</del><span class="cx"> try:
</span><span class="cx"> yield groupCacher.update(self.transaction)
</span><span class="cx"> except Exception, e:
</span></span></pre></div>
<a id="CalendarServertrunktxdavwhoutilpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/who/util.py (13840 => 13841)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/who/util.py        2014-08-05 22:49:28 UTC (rev 13840)
+++ CalendarServer/trunk/txdav/who/util.py        2014-08-05 23:11:29 UTC (rev 13841)
</span><span class="lines">@@ -23,9 +23,9 @@
</span><span class="cx"> FieldName as BaseFieldName, RecordType, DirectoryConfigurationError
</span><span class="cx"> )
</span><span class="cx"> from twext.who.ldap import (
</span><del>- DirectoryService as LDAPDirectoryService, LDAPAttribute,
</del><ins>+ DirectoryService as LDAPDirectoryService,
</ins><span class="cx"> FieldName as LDAPFieldName,
</span><del>- RecordTypeSchema, LDAPObjectClass
</del><ins>+ RecordTypeSchema
</ins><span class="cx"> )
</span><span class="cx"> from twext.who.util import ConstantsContainer
</span><span class="cx"> from twisted.cred.credentials import UsernamePassword
</span><span class="lines">@@ -131,62 +131,40 @@
</span><span class="cx"> )
</span><span class="cx"> else:
</span><span class="cx"> creds = None
</span><ins>+ mapping = params.mapping
</ins><span class="cx"> directory = LDAPDirectoryService(
</span><span class="cx"> params.uri,
</span><span class="cx"> params.rdnSchema.base,
</span><span class="cx"> credentials=creds,
</span><span class="cx"> fieldNameToAttributesMap=MappingProxyType({
</span><del>- BaseFieldName.uid: ("apple-generateduid",),
- BaseFieldName.guid: ("apple-generateduid",),
- BaseFieldName.shortNames: (LDAPAttribute.uid.value,),
- BaseFieldName.fullNames: (LDAPAttribute.cn.value,),
- BaseFieldName.emailAddresses: (LDAPAttribute.mail.value,),
- BaseFieldName.password: (LDAPAttribute.userPassword.value,),
- LDAPFieldName.memberDNs: (LDAPAttribute.uniqueMember.value,),
</del><ins>+ BaseFieldName.uid: mapping.uid,
+ BaseFieldName.guid: mapping.guid,
+ BaseFieldName.shortNames: mapping.shortNames,
+ BaseFieldName.fullNames: mapping.fullNames,
+ BaseFieldName.emailAddresses: mapping.emailAddresses,
+ LDAPFieldName.memberDNs: mapping.memberDNs,
</ins><span class="cx"> }),
</span><span class="cx"> recordTypeSchemas=MappingProxyType({
</span><span class="cx"> RecordType.user: RecordTypeSchema(
</span><del>- relativeDN=u"ou=People",
-
- # (objectClass=inetOrgPerson)
- attributes=(
- (
- LDAPAttribute.objectClass.value,
- LDAPObjectClass.inetOrgPerson.value,
- ),
- ),
</del><ins>+ relativeDN=params.rdnSchema.users,
+ attributes=(),
</ins><span class="cx"> ),
</span><del>-
</del><span class="cx"> RecordType.group: RecordTypeSchema(
</span><del>- relativeDN=u"ou=Groups",
-
- # (objectClass=groupOfNames)
- attributes=(
- (
- LDAPAttribute.objectClass.value,
- LDAPObjectClass.groupOfUniqueNames.value,
- ),
- ),
</del><ins>+ relativeDN=params.rdnSchema.groups,
+ attributes=(),
</ins><span class="cx"> ),
</span><del>-
</del><span class="cx"> CalRecordType.location: RecordTypeSchema(
</span><del>- relativeDN=u"ou=places",
-
</del><ins>+ relativeDN=params.rdnSchema.locations,
</ins><span class="cx"> attributes=(),
</span><span class="cx"> ),
</span><del>-
</del><span class="cx"> CalRecordType.resource: RecordTypeSchema(
</span><del>- relativeDN=u"ou=resources",
-
</del><ins>+ relativeDN=params.rdnSchema.resources,
</ins><span class="cx"> attributes=(),
</span><span class="cx"> ),
</span><del>-
</del><span class="cx"> CalRecordType.address: RecordTypeSchema(
</span><del>- relativeDN=u"ou=buildings",
-
</del><ins>+ relativeDN=params.rdnSchema.addresses,
</ins><span class="cx"> attributes=(),
</span><span class="cx"> ),
</span><del>-
</del><span class="cx"> })
</span><span class="cx"> )
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>