[CalendarServer-changes] [5896] CalDAVTester/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed Jul 14 08:33:34 PDT 2010


Revision: 5896
          http://trac.macosforge.org/projects/calendarserver/changeset/5896
Author:   glyph at apple.com
Date:     2010-07-14 08:33:32 -0700 (Wed, 14 Jul 2010)
Log Message:
-----------
More thorough dropbox access control coverage (should work with either implicit or explicit setting of ACLs)

Modified Paths:
--------------
    CalDAVTester/trunk/Resource/CalDAV/dropbox/1.ics
    CalDAVTester/trunk/scripts/tests/CalDAV/dropbox.xml

Added Paths:
-----------
    CalDAVTester/trunk/Resource/CalDAV/dropbox/11.xml
    CalDAVTester/trunk/Resource/CalDAV/dropbox/4.ics

Modified: CalDAVTester/trunk/Resource/CalDAV/dropbox/1.ics
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/dropbox/1.ics	2010-07-14 11:50:41 UTC (rev 5895)
+++ CalDAVTester/trunk/Resource/CalDAV/dropbox/1.ics	2010-07-14 15:33:32 UTC (rev 5896)
@@ -31,6 +31,5 @@
 ATTENDEE;CN=$username1:;PARTSTAT=ACCEPTED:$cuaddr1:
 ATTENDEE;CN=$username2:;PARTSTAT=NEEDS-ACTION:$cuaddr2:
 ATTACH;VALUE=URI:$host:$dropboxpath1:/ABCEFG/caldavd.plist
-X-APPLE-DROPBOX:$dropboxpath1:/ABCEFG
 END:VEVENT
 END:VCALENDAR

Added: CalDAVTester/trunk/Resource/CalDAV/dropbox/11.xml
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/dropbox/11.xml	                        (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/dropbox/11.xml	2010-07-14 15:33:32 UTC (rev 5896)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<D:acl xmlns:D="DAV:">
+    <D:ace>
+        <D:principal>
+            <D:href>$principaluri2:</D:href>
+        </D:principal>
+        <D:grant>
+            <D:privilege><D:all/></D:privilege>
+        </D:grant>
+    </D:ace>
+</D:acl>

Added: CalDAVTester/trunk/Resource/CalDAV/dropbox/4.ics
===================================================================
--- CalDAVTester/trunk/Resource/CalDAV/dropbox/4.ics	                        (rev 0)
+++ CalDAVTester/trunk/Resource/CalDAV/dropbox/4.ics	2010-07-14 15:33:32 UTC (rev 5896)
@@ -0,0 +1,36 @@
+BEGIN:VCALENDAR
+CALSCALE:GREGORIAN
+PRODID:-//Example Inc.//Example Calendar//EN
+VERSION:2.0
+BEGIN:VTIMEZONE
+LAST-MODIFIED:20040110T032845Z
+TZID:US/Eastern
+BEGIN:DAYLIGHT
+DTSTART:20000404T020000
+RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4
+TZNAME:EDT
+TZOFFSETFROM:-0500
+TZOFFSETTO:-0400
+END:DAYLIGHT
+BEGIN:STANDARD
+DTSTART:20001026T020000
+RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
+TZNAME:EST
+TZOFFSETFROM:-0400
+TZOFFSETTO:-0500
+END:STANDARD
+END:VTIMEZONE
+BEGIN:VEVENT
+DTSTAMP:20051222T205953Z
+CREATED:20060101T150000Z
+DTSTART;TZID=US/Eastern:20060101T100000
+DURATION:PT1H
+SUMMARY:event 1
+UID:event1 at ninevah.local
+ORGANIZER;CN=$username1::$cuaddr1:
+ATTENDEE;CN=$username1:;PARTSTAT=ACCEPTED:$cuaddr1:
+ATTENDEE;CN=$username2:;PARTSTAT=NEEDS-ACTION:$cuaddr2:
+ATTACH;VALUE=URI:$host:$dropboxpath1:/ABCEFG/caldavd.plist
+X-APPLE-DROPBOX:$dropboxpath1:/ABCEFG
+END:VEVENT
+END:VCALENDAR

Modified: CalDAVTester/trunk/scripts/tests/CalDAV/dropbox.xml
===================================================================
--- CalDAVTester/trunk/scripts/tests/CalDAV/dropbox.xml	2010-07-14 11:50:41 UTC (rev 5895)
+++ CalDAVTester/trunk/scripts/tests/CalDAV/dropbox.xml	2010-07-14 15:33:32 UTC (rev 5896)
@@ -26,7 +26,7 @@
 	</require-feature>
 
 	<start>
-		<request print-response='yes' user="$userid1:" pswd="$pswd1:"
+		<request user="$userid1:" pswd="$pswd1:"
 			end-delete='yes'>
 			<method>PUT</method>
 			<ruri>$calendarpath1:/1.ics</ruri>
@@ -236,6 +236,154 @@
 				</verify>
 			</request>
 		</test>
+		<test name='9'>
+			<description>PUT new as unauthorized user</description>
+			<request user="$userid3:" pswd="$pswd3:">
+				<method>PUT</method>
+				<ruri>$dropboxpath1:/ABCEFG/other.attachment</ruri>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/CalDAV/dropbox/2.xml</filepath>
+				</data>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>403</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='10'>
+			<description>DELETE as unauthorized user</description>
+			<request user="$userid3:" pswd="$pswd3:">
+				<method>DELETE</method>
+				<ruri>$dropboxpath1:/ABCEFG/test.xml</ruri>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>403</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='11'>
+			<description>PUT as attendee (without permission)</description>
+			<request user="$userid2:" pswd="$pswd2:">
+				<method>PUT</method>
+				<ruri>$dropboxpath1:/ABCEFG/other.attachment</ruri>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/CalDAV/dropbox/2.xml</filepath>
+				</data>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>403</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='12'>
+			<description>DELETE as attendee (without permission)</description>
+			<request user="$userid2:" pswd="$pswd2:">
+				<method>PUT</method>
+				<ruri>$dropboxpath1:/ABCEFG/test.xml</ruri>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/CalDAV/dropbox/2.xml</filepath>
+				</data>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>403</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='13'>
+			<description>Grant write permission to attendee.</description>
+			<request print-response='yes' user="$userid1:" pswd="$pswd1:">
+				<method>PUT</method>
+				<ruri>$calendarpath1:/1.ics</ruri>
+				<data>
+					<content-type>text/calendar; charset=utf-8</content-type>
+					<filepath>Resource/CalDAV/dropbox/4.ics</filepath>
+				</data>
+			</request>
+			<request>
+				<method>ACL</method>
+				<ruri>$dropboxpath1:/ABCEFG/</ruri>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/CalDAV/dropbox/11.xml</filepath>
+				</data>
+				<verify>
+					<callback>statusCode</callback>
+				</verify>
+			</request>
+		</test>
+		<test name='14'>
+			<description>PUT new as attendee (with permission)</description>
+			<request user="$userid2:" pswd="$pswd2:">
+				<method>PUT</method>
+				<ruri>$dropboxpath1:/ABCEFG/other.attachment</ruri>
+				<data>
+					<content-type>text/xml; charset=utf-8</content-type>
+					<filepath>Resource/CalDAV/dropbox/2.xml</filepath>
+				</data>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>201</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='15'>
+			<description>DELETE as attendee (with permission)</description>
+			<request user="$userid2:" pswd="$pswd2:">
+				<method>DELETE</method>
+				<ruri>$dropboxpath1:/ABCEFG/other.attachment</ruri>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>204</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
+		<test name='16'>
+			<description>DELETE as authorized user</description>
+			<request>
+				<method>DELETE</method>
+				<ruri>$dropboxpath1:/ABCEFG/test.xml</ruri>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>204</value>
+					</arg>
+				</verify>
+			</request>
+			<!-- and make sure it was actually deleted -->
+			<request>
+				<method>GET</method>
+				<ruri>$dropboxpath1:/ABCEFG/test.xml</ruri>
+				<verify>
+					<callback>statusCode</callback>
+					<arg>
+						<name>status</name>
+						<value>404</value>
+					</arg>
+				</verify>
+			</request>
+		</test>
 	</test-suite>
 	<test-suite name='Drop Box Home Restrictions'>
 		<test name='1'>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100714/0fd8bc00/attachment.html>


More information about the calendarserver-changes mailing list