[CalendarServer-changes] [11518] CalendarServer/trunk/twistedcaldav/directory
source_changes at macosforge.org
source_changes at macosforge.org
Mon Jul 15 17:51:35 PDT 2013
Revision: 11518
http://trac.calendarserver.org//changeset/11518
Author: sagen at apple.com
Date: 2013-07-15 17:51:35 -0700 (Mon, 15 Jul 2013)
Log Message:
-----------
Update the live directory unit tests which run only if there is a local OD master populated with the test users. This also exercises LDAP.
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py
CalendarServer/trunk/twistedcaldav/directory/test/test_livedirectory.py
Modified: CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py 2013-07-15 23:20:38 UTC (rev 11517)
+++ CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py 2013-07-16 00:51:35 UTC (rev 11518)
@@ -1065,10 +1065,7 @@
# If restrictToGroup is in effect, all guids which are not a member
# of that group are disabled (overriding the augments db).
- if (
- self.restrictedGUIDs is not None and
- config.Scheduling.iMIP.Username != recordShortName
- ):
+ if (self.restrictedGUIDs is not None):
unrestricted = recordGUID in self.restrictedGUIDs
else:
unrestricted = True
Modified: CalendarServer/trunk/twistedcaldav/directory/test/test_livedirectory.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/test/test_livedirectory.py 2013-07-15 23:20:38 UTC (rev 11517)
+++ CalendarServer/trunk/twistedcaldav/directory/test/test_livedirectory.py 2013-07-16 00:51:35 UTC (rev 11518)
@@ -20,9 +20,11 @@
try:
import ldap
+ import socket
testServer = "localhost"
- base = "dc=example,dc=com"
+ base = ",".join(["dc=%s" % (p,) for p in socket.gethostname().split(".")])
+ print("Using base: %s" % (base,))
try:
cxn = ldap.open(testServer)
@@ -162,12 +164,28 @@
"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
+ "mapping" : { # maps internal record names to LDAP
+ "recordName": "uid",
+ "fullName" : "cn",
+ "emailAddresses" : ["mail"], # multiple LDAP fields supported
+ "firstName" : "givenName",
+ "lastName" : "sn",
+ },
},
"groups": {
"rdn": "cn=groups",
"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"], # multiple LDAP fields supported
+ "firstName" : "givenName",
+ "lastName" : "sn",
+ },
},
},
"groupSchema": {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130715/a215e857/attachment.html>
More information about the calendarserver-changes
mailing list