Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Presenting CalDAV (draft 1)


Published on

A quick and dirty presentation to CalDAV

Published in: Technology
  • Be the first to like this

Presenting CalDAV (draft 1)

  1. 1. CalDAV Quickly presenting RFC4791
  2. 2. Agenda – CalDAV – Storing and getting events – Multiple calendars Queries – – Calendar Infos – Sharing and ACL – Scheduling
  3. 3. CalDAV? CalDAV aka RFC4791 was created to provide a standard protocol for store and retrieve events. It's implemented by: Google, Apple, Oracle Bedework (Rensealer Politechnic Institute) OSAF (OpenSource Apps Foundation) Zimbra
  4. 4. CalDAV It is based on WebDAV, an extension of HTTP. Inherites HTTP advantages Support access control thru WebDAV ACL Has methods for query events Use ETAGS to speed sync
  5. 5. Storing and getting Events are stored in files and folders. Files are named Resource. Each resource has a unique uid, that's usually the resource name
  6. 6. Storing and Getting • Basic actions/method METHOD ACTIONS GET Retrieve an event PUT Put an event on server DEL Remove event or collection (folder) from server HEAD Check existence / Get ETAG for a given event REPORT Query for events by UID, LOCATION, SUMMARY... PROPFIND Check resource property, permissions... ACL Set acl OPTIONS Check which actions can be made on a resource
  7. 7. Storing and getting - GET • GET – Retrieves an event GET /user/calendar/myevent.ics – Returns the ETAG too (eg. “123124321524-1”) – ETAG is a string used for versioning the event: when myevent.ics changes, the ETAG is modified • HEAD – Retrieves the ETAG only, or an error if event is not found
  8. 8. Storing and getting - PUT • PUT – Used for creating and update – Put an event PUT /user/calendar/myevent.ics – Returns the ETAG too (eg. “123124321524-2”) – Thru ETAG is possible to change PUT behaviour (create or update)
  9. 9. Storing and getting – PUT 2 • PUT comando header azione errori PUT If-none-matches: * Crea la risorsa Se una risorsa esiste con lo /user/myfile.ics specificata se stesso nome, viene restituito nessun'altra risorsa è l'errore PRECONDITION presente a FAILED, poiché if-none- quell'indirizzo, usato matches indica che la pre- per creare una nuova condizione per fare il PUT è risorsa sul server. che nessuna risorsa corrisponda a quella che vogliamo creare PUT If-matches: Invia la risorsa PRECONDITION FAILED /user/myfile.ics “12312312-1” specificata viene restituito se la risorsa solamente se è già non esiste. Infatti potrebbe presente una risorsa accadere che il file che allo stesso indirizzo, vogliamo aggiornare sia e la versione di tale cambiato sul server e sia risorsa ha ETAG diverso da quello che ci “12312312-1” aspettiamo
  10. 10. Storing and getting - DEL • DEL – Removes a resource (event or collection) from server – DEL /user/calendar/myevent.ics • MKCALENDAR – Create a calendar collection (folder) on server
  11. 11. Querying - REPORT • REPORT – Used for querying events in a collection – eg. REPORT /user/calendar/ – REPORT body is an XML query describing the events we are looking for • By UID, LOCATION, DESCRIPTION,.. • By time-range (events starting/ending) within a given time-frame
  12. 12. Querying - REPORT Filter events HTTP header REPORT /bernard/work/ HTTP/1.1 <C:filter> Host: Get <C:comp-filter name=quot;VCALENDARquot;> Depth: 1 We're making a <C:comp-filter name=quot;VEVENTquot;> VCALENDARs Content-Type: application/xml; charset=quot;utf-8quot; query. <prop> containing Content-Length: xxxx <C:time-range start=quot;20060104T000000Zquot; VEVENTs describes data that START/END end=quot;20060105T000000Zquot;/> we're asking at between <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?> </C:comp-filter> 04.01.06 server and <C:calendar-query xmlns:D=quot;DAV:quot; </C:comp-filter> 05.01.06 xmlns:C=quot;urn:ietf:params:xml:ns:caldavquot;> </C:filter> <D:prop> </C:calendar-query> <D:getetag/> <C:calendar-data> Describe data we <C:comp name=quot;VCALENDARquot;> want to retrieve: <C:prop name=quot;VERSIONquot;/> <C:comp name=quot;VEVENTquot;> BEGIN:VCALENDAR VERSION:2.0 <C:prop name=quot;SUMMARYquot;/> BEGIN:VEVENT <C:prop name=quot;UIDquot;/> UID:XXXX SUMMARY:XXXX </C:comp> BEGIN:VTIMEZONE <C:comp name=quot;VTIMEZONEquot;/> ... END:VTIMEZONE </C:comp> </C:calendar-data> </D:prop>
  13. 13. Sharing - ACL • PROPFIND method provides a way to get ACLs from a calendar resource / collection • ACLs are defined as in WebDAV with some CalDAV specific permissions A “user” principal is defined by an http URL provided by the server Query XML representation Description PROPFIND /caluser1/calendar/ Query for ACL defined <acl> <D:propfind xmlns:D=quot;DAV:quot;> <ace> <D:prop> <principal> <property> <owner/> </property> </principal> <D:acl/> <grant> <all/> </grant> </D:prop> <inherited> <href>/user</href> </inherited> This ACL is inherited by upper A principal is a special entity </D:propfind> </ace> folder /user defined on server. It can be a user, <ace> a group or a “property” defined on <principal><href>/ucaldav/principals/users/caluser1</href></principal> server. In this case we use the <grant> <all/> </grant> “owner” property defined on the </ace> server <ace> <principal> <authenticated/> </principal> <grant> <ns1:read-free-busy/> <ns1:schedule/> </grant> These privileges are CalDAV <inherited> <href>/user</href> </inherited> specific: allows </ace> •to see free-busy of given user </acl> •to invite him to a meeting