[CalendarServer-changes] [12423] CalendarServer/trunk/twistedcaldav
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 12 11:18:10 PDT 2014
Revision: 12423
http://trac.calendarserver.org//changeset/12423
Author: gaya at apple.com
Date: 2014-01-22 13:37:31 -0800 (Wed, 22 Jan 2014)
Log Message:
-----------
Remove unused GlobalAddressBook and related code
Modified Paths:
--------------
CalDAVTester/trunk/scripts/server/serverinfo-pod.xml
CalDAVTester/trunk/scripts/server/serverinfo-template.xml
CalDAVTester/trunk/scripts/server/serverinfo.xml
CalendarServer/trunk/calendarserver/tools/test/test_principals.py
CalendarServer/trunk/twistedcaldav/resource.py
CalendarServer/trunk/twistedcaldav/stdconfig.py
CalendarServer/trunk/twistedcaldav/storebridge.py
Removed Paths:
-------------
CalDAVTester/trunk/scripts/tests/CardDAV/global-addressbook.xml
Modified: CalDAVTester/trunk/scripts/server/serverinfo-pod.xml
===================================================================
--- CalDAVTester/trunk/scripts/server/serverinfo-pod.xml 2014-01-22 20:29:15 UTC (rev 12422)
+++ CalDAVTester/trunk/scripts/server/serverinfo-pod.xml 2014-01-22 21:37:31 UTC (rev 12423)
@@ -110,7 +110,6 @@
<!-- CardDAV specific extension -->
<feature>carddav</feature> <!-- Basic CardDAV feature enabler -->
<feature>default-addressbook</feature> <!-- Default address book behavior -->
- <!-- <feature>global-addressbook</feature> --> <!-- Global address book for each user -->
<feature>shared-addressbooks</feature> <!-- Shared address books extension -->
<!-- <feature>directory-gateway</feature> --> <!-- Directory gateway extension -->
@@ -341,12 +340,6 @@
<value>$root:directory/</value>
</substitution>
- <!-- global-addressbook name -->
- <substitution>
- <key>$global_addressbook:</key>
- <value>global-addressbook</value>
- </substitution>
-
<!-- POST add-member URI suffix -->
<substitution>
<key>$add-member:</key>
Modified: CalDAVTester/trunk/scripts/server/serverinfo-template.xml
===================================================================
--- CalDAVTester/trunk/scripts/server/serverinfo-template.xml 2014-01-22 20:29:15 UTC (rev 12422)
+++ CalDAVTester/trunk/scripts/server/serverinfo-template.xml 2014-01-22 21:37:31 UTC (rev 12423)
@@ -105,7 +105,6 @@
<!-- CardDAV specific extension -->
<feature>carddav</feature> <!-- Basic CardDAV feature enabler -->
<feature>default-addressbook</feature> <!-- Default address book behavior -->
- <!-- <feature>global-addressbook</feature> --> <!-- Global address book for each user -->
<!-- <feature>shared-addressbooks</feature> --> <!-- Shared address books extension -->
<!-- <feature>directory-gateway</feature> --> <!-- Directory gateway extension -->
@@ -336,12 +335,6 @@
<value>$root:directory/</value>
</substitution>
- <!-- global-addressbook name -->
- <substitution>
- <key>$global_addressbook:</key>
- <value>global-addressbook</value>
- </substitution>
-
<!-- POST add-member URI suffix -->
<substitution>
<key>$add-member:</key>
Modified: CalDAVTester/trunk/scripts/server/serverinfo.xml
===================================================================
--- CalDAVTester/trunk/scripts/server/serverinfo.xml 2014-01-22 20:29:15 UTC (rev 12422)
+++ CalDAVTester/trunk/scripts/server/serverinfo.xml 2014-01-22 21:37:31 UTC (rev 12423)
@@ -105,7 +105,6 @@
<!-- CardDAV specific extension -->
<feature>carddav</feature> <!-- Basic CardDAV feature enabler -->
<feature>default-addressbook</feature> <!-- Default address book behavior -->
- <!-- <feature>global-addressbook</feature> --> <!-- Global address book for each user -->
<feature>shared-addressbooks</feature> <!-- Shared address books extension -->
<!-- <feature>directory-gateway</feature> --> <!-- Directory gateway extension -->
@@ -342,12 +341,6 @@
<value>$root:directory/</value>
</substitution>
- <!-- global-addressbook name -->
- <substitution>
- <key>$global_addressbook:</key>
- <value>global-addressbook</value>
- </substitution>
-
<!-- POST add-member URI suffix -->
<substitution>
<key>$add-member:</key>
Deleted: CalDAVTester/trunk/scripts/tests/CardDAV/global-addressbook.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CardDAV/global-addressbook.xml 2014-01-22 20:29:15 UTC (rev 12422)
+++ CalDAVTester/trunk/scripts/tests/CardDAV/global-addressbook.xml 2014-01-22 21:37:31 UTC (rev 12423)
@@ -1,297 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-
-<!DOCTYPE caldavtest SYSTEM "caldavtest.dtd">
-
-<!--
- Copyright (c) 2006-2013 Apple Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- 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 "AS IS" 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.
- -->
-
-<caldavtest>
- <description>Test global addressbook</description>
-
- <require-feature>
- <feature>carddav</feature>
- <feature>global-addressbook</feature>
- </require-feature>
-
- <start/>
-
- <test-suite name='Resourcetype'>
- <test name='1'>
- <description>PROPFIND of resourcetype</description>
- <request>
- <method>PROPFIND</method>
- <ruri>$addressbookhome1:/$global_addressbook:/</ruri>
- <header>
- <name>Depth</name>
- <value>0</value>
- </header>
- <data>
- <content-type>text/xml; charset=utf-8</content-type>
- <filepath>Resource/Common/PROPFIND/resourcetype.xml</filepath>
- </data>
- <verify>
- <callback>propfindValues</callback>
- <arg>
- <name>props</name>
- <value>{DAV:}resourcetype$.*shared[^-].*</value>
- </arg>
- </verify>
- </request>
- </test>
- </test-suite>
-
- <test-suite name='Changes by multiple users'>
- <test name='1' ignore='no'>
- <description>initial query - grab token</description>
- <request print-response='no'>
- <method>REPORT</method>
- <ruri>$addressbookhome1:/$global_addressbook:/</ruri>
- <header>
- <name>Depth</name>
- <value>1</value>
- </header>
- <data>
- <content-type>text/xml; charset=utf-8</content-type>
- <filepath>Resource/CardDAV/global-addressbook/1.xml</filepath>
- </data>
- <verify>
- <callback>multistatusItems</callback>
- <arg>
- <name>okhrefs</name>
- </arg>
- </verify>
- <grabelement>
- <name>/{DAV:}multistatus/{DAV:}sync-token</name>
- <variable>$synctoken1-1:</variable>
- </grabelement>
- </request>
- </test>
- <test name='2' ignore='no'>
- <description>initial query - grab token</description>
- <request user="$userid2:" pswd="$pswd2:" print-response='no'>
- <method>REPORT</method>
- <ruri>$addressbookhome2:/$global_addressbook:/</ruri>
- <header>
- <name>Depth</name>
- <value>1</value>
- </header>
- <data>
- <content-type>text/xml; charset=utf-8</content-type>
- <filepath>Resource/CardDAV/global-addressbook/1.xml</filepath>
- </data>
- <verify>
- <callback>multistatusItems</callback>
- <arg>
- <name>okhrefs</name>
- </arg>
- </verify>
- <grabelement>
- <name>/{DAV:}multistatus/{DAV:}sync-token</name>
- <variable>$synctoken2-1:</variable>
- </grabelement>
- </request>
- </test>
- <test name='3' ignore='no'>
- <description>new resource</description>
- <request end-delete="yes">
- <method>PUT</method>
- <ruri>$addressbookhome1:/$global_addressbook:/1.vcf</ruri>
- <data>
- <content-type>text/vcard; charset=utf-8</content-type>
- <filepath>Resource/CardDAV/global-addressbook/2.vcf</filepath>
- </data>
- <verify>
- <callback>statusCode</callback>
- </verify>
- </request>
- </test>
- <test name='4' ignore='no'>
- <description>sync change</description>
- <request print-response='no'>
- <method>REPORT</method>
- <ruri>$addressbookhome1:/$global_addressbook:/</ruri>
- <header>
- <name>Depth</name>
- <value>1</value>
- </header>
- <data substitutions='yes'>
- <content-type>text/xml; charset=utf-8</content-type>
- <filepath>Resource/CardDAV/global-addressbook/3.xml</filepath>
- </data>
- <verify>
- <callback>multistatusItems</callback>
- <arg>
- <name>okhrefs</name>
- <value>1.vcf</value>
- </arg>
- </verify>
- <grabelement>
- <name>/{DAV:}multistatus/{DAV:}sync-token</name>
- <variable>$synctoken1-2:</variable>
- </grabelement>
- </request>
- </test>
- <test name='5' ignore='no'>
- <description>sync change</description>
- <request user="$userid2:" pswd="$pswd2:" print-response='no'>
- <method>REPORT</method>
- <ruri>$addressbookhome2:/$global_addressbook:/</ruri>
- <header>
- <name>Depth</name>
- <value>1</value>
- </header>
- <data substitutions='yes'>
- <content-type>text/xml; charset=utf-8</content-type>
- <filepath>Resource/CardDAV/global-addressbook/4.xml</filepath>
- </data>
- <verify>
- <callback>multistatusItems</callback>
- <arg>
- <name>okhrefs</name>
- <value>1.vcf</value>
- </arg>
- </verify>
- <grabelement>
- <name>/{DAV:}multistatus/{DAV:}sync-token</name>
- <variable>$synctoken2-2:</variable>
- </grabelement>
- </request>
- </test>
- <test name='6' ignore='no'>
- <description>new resource #2</description>
- <request user="$userid2:" pswd="$pswd2:" end-delete="yes">
- <method>PUT</method>
- <ruri>$addressbookhome2:/$global_addressbook:/2.vcf</ruri>
- <data>
- <content-type>text/vcard; charset=utf-8</content-type>
- <filepath>Resource/CardDAV/global-addressbook/5.vcf</filepath>
- </data>
- <verify>
- <callback>statusCode</callback>
- </verify>
- </request>
- </test>
- <test name='7' ignore='no'>
- <description>sync change</description>
- <request print-response='no'>
- <method>REPORT</method>
- <ruri>$addressbookhome1:/$global_addressbook:/</ruri>
- <header>
- <name>Depth</name>
- <value>1</value>
- </header>
- <data substitutions='yes'>
- <content-type>text/xml; charset=utf-8</content-type>
- <filepath>Resource/CardDAV/global-addressbook/6.xml</filepath>
- </data>
- <verify>
- <callback>multistatusItems</callback>
- <arg>
- <name>okhrefs</name>
- <value>2.vcf</value>
- </arg>
- </verify>
- <grabelement>
- <name>/{DAV:}multistatus/{DAV:}sync-token</name>
- <variable>$synctoken1-3:</variable>
- </grabelement>
- </request>
- </test>
- <test name='5' ignore='no'>
- <description>sync change</description>
- <request user="$userid2:" pswd="$pswd2:" print-response='no'>
- <method>REPORT</method>
- <ruri>$addressbookhome2:/$global_addressbook:/</ruri>
- <header>
- <name>Depth</name>
- <value>1</value>
- </header>
- <data substitutions='yes'>
- <content-type>text/xml; charset=utf-8</content-type>
- <filepath>Resource/CardDAV/global-addressbook/7.xml</filepath>
- </data>
- <verify>
- <callback>multistatusItems</callback>
- <arg>
- <name>okhrefs</name>
- <value>2.vcf</value>
- </arg>
- </verify>
- <grabelement>
- <name>/{DAV:}multistatus/{DAV:}sync-token</name>
- <variable>$synctoken2-3:</variable>
- </grabelement>
- </request>
- </test>
- </test-suite>
-
- <test-suite name='Resource-ID'>
- <require-feature>
- <feature>resource-id</feature>
- </require-feature>
- <test name='1' ignore='no'>
- <description>Check property for user 1</description>
- <request print-response='no'>
- <method>PROPFIND</method>
- <ruri>$addressbookhome1:/$global_addressbook:/</ruri>
- <header>
- <name>Depth</name>
- <value>0</value>
- </header>
- <data>
- <content-type>text/xml; charset=utf-8</content-type>
- <filepath>Resource/Common/PROPFIND/resourceid.xml</filepath>
- </data>
- <verify>
- <callback>propfindItems</callback>
- <arg>
- <name>okprops</name>
- <value>{DAV:}resource-id</value>
- </arg>
- </verify>
- <grabproperty>
- <property>{DAV:}resource-id</property>
- <variable>$resourceid:</variable>
- </grabproperty>
- </request>
- </test>
- <test name='2' ignore='no'>
- <description>Check property for user 2</description>
- <request user="$userid2:" pswd="$pswd2:" print-response='no'>
- <method>PROPFIND</method>
- <ruri>$addressbookhome2:/$global_addressbook:/</ruri>
- <header>
- <name>Depth</name>
- <value>0</value>
- </header>
- <data>
- <content-type>text/xml; charset=utf-8</content-type>
- <filepath>Resource/Common/PROPFIND/resourceid.xml</filepath>
- </data>
- <verify>
- <callback>propfindItems</callback>
- <arg>
- <name>okprops</name>
- <value>{DAV:}resource-id$$resourceid:</value>
- </arg>
- </verify>
- </request>
- </test>
- </test-suite>
-
- <end/>
-
-</caldavtest>
Modified: CalendarServer/trunk/calendarserver/tools/test/test_principals.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/test/test_principals.py 2014-01-22 20:29:15 UTC (rev 12422)
+++ CalendarServer/trunk/calendarserver/tools/test/test_principals.py 2014-01-22 21:37:31 UTC (rev 12423)
@@ -41,8 +41,6 @@
# Since this test operates on proxy db, we need to assign the service:
calendaruserproxy.ProxyDBService = calendaruserproxy.ProxySqliteDB(os.path.abspath(self.mktemp()))
- config.GlobalAddressBook.Enabled = False
-
testRoot = os.path.join(os.path.dirname(__file__), "principals")
templateName = os.path.join(testRoot, "caldavd.plist")
templateFile = open(templateName)
Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py 2014-01-22 20:29:15 UTC (rev 12422)
+++ CalendarServer/trunk/twistedcaldav/resource.py 2014-01-22 21:37:31 UTC (rev 12423)
@@ -2793,10 +2793,7 @@
from twistedcaldav.notifications import NotificationCollectionResource
self._provisionedChildren["notification"] = NotificationCollectionResource
- if config.GlobalAddressBook.Enabled:
- self._provisionedLinks[config.GlobalAddressBook.Name] = "/addressbooks/public/global/addressbook/"
-
def makeNewStore(self):
return self._associatedTransaction.addressbookHomeWithUID(self.name, create=True), False # Don't care about created
@@ -2908,50 +2905,6 @@
-class GlobalAddressBookResource (ReadOnlyResourceMixIn, CalDAVResource):
- """
- Global address book. All we care about is making sure permissions are setup.
- """
-
- def resourceType(self):
- return element.ResourceType.sharedaddressbook #@UndefinedVariable
-
-
- def defaultAccessControlList(self):
-
- aces = (
- element.ACE(
- element.Principal(element.Authenticated()),
- element.Grant(
- element.Privilege(element.Read()),
- element.Privilege(element.ReadCurrentUserPrivilegeSet()),
- element.Privilege(element.Write()),
- ),
- element.Protected(),
- TwistedACLInheritable(),
- ),
- )
-
- if config.GlobalAddressBook.EnableAnonymousReadAccess:
- aces += (
- element.ACE(
- element.Principal(element.Unauthenticated()),
- element.Grant(
- element.Privilege(element.Read()),
- ),
- element.Protected(),
- TwistedACLInheritable(),
- ),
- )
- return element.ACL(*aces)
-
-
- def accessControlList(self, request, inheritance=True, expanding=False, inherited_aces=None):
- # Permissions here are fixed, and are not subject to inheritance rules, etc.
- return succeed(self.defaultAccessControlList())
-
-
-
class AuthenticationWrapper(SuperAuthenticationWrapper):
""" AuthenticationWrapper implementation which allows overriding
@@ -2983,7 +2936,6 @@
req.credentialFactories = factories
-
##
# Utilities
##
Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/stdconfig.py 2014-01-22 20:29:15 UTC (rev 12422)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py 2014-01-22 21:37:31 UTC (rev 12423)
@@ -646,12 +646,6 @@
"EnableSearchAddressBook": False, # /directory resource exists
"AnonymousDirectoryAddressBookAccess": False, # Anonymous users may access directory address book
- "GlobalAddressBook": {
- "Enabled": False,
- "Name": "global-addressbook",
- "EnableAnonymousReadAccess": False,
- },
-
# /XXX CardDAV
#
Modified: CalendarServer/trunk/twistedcaldav/storebridge.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/storebridge.py 2014-01-22 20:29:15 UTC (rev 12422)
+++ CalendarServer/trunk/twistedcaldav/storebridge.py 2014-01-22 21:37:31 UTC (rev 12423)
@@ -52,8 +52,7 @@
TooManyInstancesError
from twistedcaldav.memcachelock import MemcacheLockTimeoutError
from twistedcaldav.notifications import NotificationCollectionResource, NotificationResource
-from twistedcaldav.resource import CalDAVResource, GlobalAddressBookResource, \
- DefaultAlarmPropertyMixin
+from twistedcaldav.resource import CalDAVResource, DefaultAlarmPropertyMixin
from twistedcaldav.scheduling_store.caldav.resource import ScheduleInboxResource
from twistedcaldav.sharing import invitationBindStatusToXMLMap, \
invitationBindModeToXMLMap
@@ -3424,14 +3423,6 @@
-class GlobalAddressBookCollectionResource(GlobalAddressBookResource, AddressBookCollectionResource):
- """
- Wrapper around a L{txdav.carddav.iaddressbook.IAddressBook}.
- """
- pass
-
-
-
class AddressBookObjectResource(_CommonObjectResource):
"""
A resource wrapping a addressbook object.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/a72c0737/attachment.html>
More information about the calendarserver-changes
mailing list