Abstract
This specification provides a mechanism whereby subscriptions to external resources can be handled by the server.
This specification updates IETF RFC 4791 to add new properties for the MKCOL request.
Introduction
The motivation for this specification was initially to handle external subscriptions to calendar data. However, any resource which allows subscriptions might make use of this specification.
Currently subscriptions to calendar feeds are handled by calendar clients. There are a number of disadvantages to this approach: users have to subscribe from multiple devices and the subscription cannot affect scheduling handled by the server.
This specification defines a mechanism whereby the server will subscribe to the feed and make it visible in the user’s home.
The advantages are popular feeds can be cached by the server and the user only has to make a single subscription.
Serverside Subscriptions
1. Scope
This specification provides a mechanism whereby subscriptions to external resources can be handled by the server.
This specification updates IETF RFC 4791 to add new properties for the MKCOL request.
2. Normative references
The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.
IETF RFC 2119, S. BRADNER. Key words for use in RFCs to Indicate Requirement Levels. 1997. RFC Publisher. https://www.rfc-editor.org/info/rfc2119.
IETF RFC 2434, T. NARTEN and H. ALVESTRAND. Guidelines for Writing an IANA Considerations Section in RFCs. 1998. RFC Publisher. https://www.rfc-editor.org/info/rfc2434.
IETF RFC 2518, Y. GOLAND, E. WHITEHEAD, A. FAIZI, S. CARTER and D. JENSEN. HTTP Extensions for Distributed Authoring — WEBDAV. 1999. RFC Publisher. https://www.rfc-editor.org/info/rfc2518.
IETF RFC 3339, G. KLYNE and C. NEWMAN. Date and Time on the Internet: Timestamps. 2002. RFC Publisher. https://www.rfc-editor.org/info/rfc3339.
IETF RFC 3688, M. MEALLING. The IETF XML Registry. 2004. RFC Publisher. https://www.rfc-editor.org/info/rfc3688.
IETF RFC 3986, T. BERNERS-LEE, R. FIELDING and L. MASINTER. Uniform Resource Identifier (URI): Generic Syntax. 2005. RFC Publisher. https://www.rfc-editor.org/info/rfc3986.
IETF RFC 4791, C. DABOO, B. DESRUISSEAUX and L. DUSSEAULT. Calendaring Extensions to WebDAV (CalDAV). 2007. RFC Publisher. https://www.rfc-editor.org/info/rfc4791.
IETF RFC 5545, B. DESRUISSEAUX (ed.). Internet Calendaring and Scheduling Core Object Specification (iCalendar). 2009. RFC Publisher. https://www.rfc-editor.org/info/rfc5545.
IETF RFC 5546, C. DABOO (ed.). iCalendar Transport-Independent Interoperability Protocol (iTIP). 2009. RFC Publisher. https://www.rfc-editor.org/info/rfc5546.
IETF RFC 5988, M. NOTTINGHAM. Web Linking. 2010. RFC Publisher. https://www.rfc-editor.org/info/rfc5988.
IETF RFC 7240, J. SNELL. Prefer Header for HTTP. 2014. RFC Publisher. https://www.rfc-editor.org/info/rfc7240.
W3C REC-xml-20060816, EVE MALER, FRANÇOIS YERGEAU, JEAN PAOLI, MICHAEL SPERBERG-MCQUEEN and TIM BRAY (eds.). Extensible Markup Language (XML) 1.0 (Fourth Edition). 2006. World Wide Web Consortium. https://www.w3.org/TR/2006/REC-xml-20060816/.
3. Terms and definitions
No terms and definitions are listed in this document.
4. Conventions
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in IETF RFC 2119.
5. CalDAV Subscriptions
5.1. Request
A client will subscribe to a URL by performing a MKCOL request with resource type elements of at least DAV:collection and DAV:subscription. For a calendar subscription there will also be a caldav calendar element.
This is an example of the MKCOL request and response from a server that supports extended MKCOL.
>> Request <<
POST /caldav/user/mike/calendars/parrots HTTP/1.1
Host: example.com
Content-Type: text/calendar; component=VEVENT; method=REQUEST
Content-Length: xxxx
<?xml version="1.0" encoding="utf-8" ?>
<D:mkcol xmlns:D="DAV:"
xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:set>
<D:prop>
<D:resourcetype>
<D:collection/>
<C:calendar/>
<D:subscription/>
</D:resourcetype>
<D:displayname>Parrot Events</D:displayname>
<D:subscription-href
>http://example.org/parrot-events.ics<
/D:subscription-href>
<D:subscription-deletions-suppressed
>true</D:subscription-deletions-suppressed>
<D:subscription-suggested-refresh-interval
>PT1H</D:subscription-suggested-refresh-interval>
</D:prop>
</D:set>
</D:mkcol>
>> Response <<
HTTP/1.1 200 OK
6. New DAV and CALDAV properties
6.1. DAV:subscription
Name
subscription
Namespace
DAV
Purpose
To indicate that the resource is a subscription to an external resource which is managed by the server.
Conformance
When this is specified the request MUST also contain at least a DAV:subscription-href element as defined in this specification.
Description
The DAV:specification resource type element is used to indicate a collection that is a subscription. A subscription MUST report the DAV:subscription XML element in the value of the DAV: resourcetype property.
Definition
<!ELEMENT subscription empty>
6.2. DAV:subscription-href
Name
subscription-href
Namespace
DAV
Purpose
Provides the url for the external subscription.
Conformance
This property MUST be defined on any collection which has a resource-type containing a DAV:subscription element.
Definition
<!ELEMENT vpoll-max-items (#PCDATA)>
PCDATA value: a urlExample
<D:subscription-href xmlns:D="DAV"
>https://example.com/events.ics</D:subscription-href>
6.3. DAV:subscription-deletions-suppressed
Name
subscription-deletions-suppressed
Namespace
DAV
Purpose
To indicate that resources that no longer appear in the feed should be retained by the server.
Conformance
This property MAY be defined on any subscription.
Description
Many feeds provide only the current active set of resources. For example, a calendar feed may only contain events from the current date onwards - while many subscribers would like to retain a copy of all events received over time.
This property indicates that the server SHOULD retain resources that disappear from the feed. Services MAY define some mechanism to indicate that a particular resource SHOULD be removed. For example this specification suggests setting a status of DELETED on a calendar event.
Definition
<!ELEMENT subscription-deletions-suppressed empty>
6.4. DAV:subscription-disabled
Name
subscription-disabled
Namespace
DAV
Purpose
To indicate that subscription has been disabled.
Conformance
This property MUST be reported for any disabled subscription.
Description
A server MAY choose to disable a subscription if there is an excessive number of errors when attempting to synchronize with the target This property indicates to the client that the subscription has been disabled.
There is no explicit action that can be taken to reenable a subscription. However, on subsequent requests a client may indicate a refresh is desired which MAY have the effect of reenabling the subscription.
Definition
<!ELEMENT subscription-enabled empty>
6.5. DAV:subscription-next-refresh-interval
Name
subscription-next-refresh-interval
Namespace
DAV
Purpose
To indicate the time interval till the next refresh of a subscription.
Conformance
This property MUST be reported for any active subscription.
Description
This provides a time period to the next refresh. It uses the period format defined in IETF RFC 3339.
Definition
<!ELEMENT subscription-next-refresh-interval (#PCDATA)>
PCDATA value: a duration valueExample
<D:subscription-next-refresh-interval xmlns:D="DAV"
>PT30M</D:subscription-next-refresh-interval>
6.6. DAV:subscription-suggested-refresh-interval
Name
subscription-suggested-refresh-interval
Namespace
DAV
Purpose
To indicate the desired time interval between refreshes of a subscription.
Conformance
This property MUST be reported for any active subscription.
Description
This provides a suggested time period between refresh. It uses the period format defined in RFC 3339.
Definition
<!ELEMENT subscription-suggested-refresh-interval (#PCDATA)>
PCDATA value: a duration valueExample
<D:subscription-suggested-refresh-interval xmlns:D="DAV"
>PT30M</D:subscription-suggested-refresh-interval>
7. Refreshing and Reenabling the subscription
When creating the subscription the client may indicate to the server a desired refresh interval using the subscription-suggested-refresh-interval property.
The client may indicate to the server that a refresh of the data is desired by using the PROPPATCH method to set the subscription-next-refresh-interval to 0, e.g. “PT0S”.
A server MAY choose to always ignore the attempted refresh or to ignore the patch if it appears too often.
If the server decides to initiate a refresh it MAY choose to respond with a 102 HTTP status indicating that it is still waiting for the data or a 202 HTTP status to indicate the request was accepted.
8. Response Delays
Implementations of this feature may have an outboard or background process handling the actual synchronization of the data. The target may be hosted on a slow service or the data may be very large.
All these factors may lead to a significant delay in having data ready for delivery to the client.
The following approaches are more or less appropriate for handling requests:
Return with available data
This is the normal behavior. The subscription looks like a regular collection so the server can respond to the normal requests with whatever data is available.
Wait for completion
If the synchronization process is active the server may just choose to wait. This risks a request timeout if the data synchronization takes a significant amount of time.
Return 102 status(es)
The server may choose to wait but periodically send a 102 response to keep the connection alive.
Return 202 status
This is probably the best response. There is no need to indicate where the client should go to retrieve the data. All it needs to do is retry the operation after an appropriate delay.
9. CalDAV service Considerations
As mentioned above, this feature is particularly useful for CalDAV servers and clients. There are some specific considerations.
9.1. Deleted events
If subscription-deletions-suppressed is specified then the server SHOULD retain all events. However, the server MAY choose to remove old events once they become older than the CALDAV:min-date-time property as specified in IETF RFC 4791, Section 5.2.6.
9.2. CalDAV restrictions
A server SHOULD apply all appropriate restrictions on events obtained from a subscription. In particular the CALDAV:min-date-time and CALDAV:max-date-time properties as specified in IETF RFC 4791, Section 5.2.6 and IETF RFC 4791, Section 5.2.7 SHOULD be applied.
Additionally the CALDAV:max-resource-size property restricts the size of events and the CALDAV:max-instances property the number of instances.
9.3. Invitations in Subscriptions
Any reason not to allow them?
10. Security Considerations
Servers implementing this feature need to be aware of the risks entailed in using the URIs provided as values to subscription-href. See IETF RFC 3986 for a discussion of the security considerations relating to URIs.
11. Privacy Considerations
Properties with a “URI” value type can expose their users to privacy leaks as any network access of the URI data can be tracked. Clients SHOULD NOT automatically download data referenced by the URI without explicit instruction from users. This specification does not introduce any additional privacy concerns beyond those described in IETF RFC 5545.
13. Acknowledgements
The author would also like to thank the members of the Calendaring and Scheduling Consortium Calendar Sharing technical committee and the following individuals for contributing their ideas and support.
…
The authors would also like to thank CalConnect, the Calendaring and Scheduling Consortium, for advice with this specification.