Network Working Group | E. Pot |
Internet-Draft | fruux GmbH |
Expires: December 11, 2015 | C. Daboo |
Apple Inc. | |
June 9, 2015 |
WebDAV: User Notifications
draft-pot-webdav-notifications-01
This specification defines an extension to WebDAV that allows the server to provide notifications to users.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on December 11, 2015.
Copyright (c) 2015 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
It is often useful for servers to communicate arbitrary information to the end-users for a WebDAV system, such as a system status, message of the day or to notify users of changes that were made to shared resources by other users.
This specification defines a generic "notification" mechanism that allows a server to do that. Whilst primarily aimed at CalDAV [RFC4791] and CardDAV [RFC6352] this mechanism has been designed to be adaptable to other applications of WebDAV [RFC4918].
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].
When XML element types in the namespaces "DAV:" is referenced in this document outside of the context of an XML fragment, the string "DAV:" will be prefixed to the element type name.
The DTD samples used in this document are for illustrative purposes only. The conventions and restrictions described in [RFC4918] section 17.
To add support for WebDAV notifications, a server MUST at least have support for WebDAV Class 3 [RFC4918].
WebDAV notifications also defines new properties on principal resources, which are defined in RFC3744 [RFC3744].
When this feature is available, a DAV:notification-URL [DAV:notification-URL] property appears on principal resources for those principals who are able to receive notifications. That property specifies a single DAV:href element whose content refers to a WebDAV collection resource. Notification "messages" are deposited into this collection and can be retrieved by clients and acted on accordingly.
The notification collection referenced by the DAV:notification-URL [DAV:notification-URL] property MUST have a DAV:resourcetype property with DAV:collection and DAV:notifications [DAV:notifications] child elements.
Notification "messages" are XML documents stored as resources in the notification collection. Each XML document contains a DAV:notification [DAV:notification] element as its root. The root element contains a DAV:dtstamp element, and one additional element which represents the type of notification being conveyed in the message. That child element will typically contain additional content that describes the notification.
Each notification resource has a DAV:notificationtype [DAV:notificationtype] property which contains as its single child element an empty element that matches the child element of the notification resource XML document root. Any attributes on the child element in the XML document are also present in the property child element.
Notifications are automatically generated by the server with an appropriate resource stored in the notifications collection of the user to whom the notification is targeted. Clients SHOULD monitor the notification collection looking for new notification resources. When doing so, clients SHOULD look at the DAV:notificationtype [DAV:notificationtype] property to ensure that the notification is of a type that the client can handle. Once a client has handled the notification in whatever way is appropriate it SHOULD delete the notification resource. Clients SHOULD remove notifications being displayed to a user when the notification resource is removed from the notification collection, to enable the user to dismiss a notification on one device and have it automatically removed from others. Clients MUST ignore all notifications for types they do not recognize. Servers MAY delete notification resources on their own if they determine that the notifications are no longer relevant or valid. Servers MAY coalesce notifications as appropriate.
Servers MUST prevent clients from adding resources in the notification collection.
The "application/davnotification+xml" MIME media type MUST be used for transfer of WebDAV notifications.
Content-Type: application/davnotification+xml
This is an example of a Content-Type header:
HTTP GET requests that expect to receive a WebDAV notification resource, SHOULD include an "Accept" header that includes "application/davnotification+xml".
Requests that do not include this header, SHOULD be rejected with a HTTP 406 status code.
This section defines new properties for WebDAV principal resources as defined in RFC3744 [RFC3744]. These properties are likely to be protected but the server MAY allow them to be written by appropriate users.
<!ELEMENT notification-URL (DAV:href)>
The following new WebDAV properties are defined for notification resources.
<!ELEMENT notificationtype ANY> <!-- Child elements are empty but will have appropriate attributes. Any valid notification message child element can appear.-->
<!ELEMENT notifications EMPTY>
<!ELEMENT notification (dtstamp, XXX) > <!-- Any notification type element can appear after DAV:dtstamp -->
<!ELEMENT dtstamp (#PCDATA)> <!-- Value is a date-time in UTZ as per [RFC3339] -->
This section defines a set of common notification types.
The system status notification is used to convey an URI and/or textual description to the user. The assumption is that the URI points to a webpage where the current system status is described in detail, with the provided description being a summary of that. A "type" attribute on the element is used to indicate the importance of the current status notification, and has the values "low", "medium" and "high", representing the increasing level of importance of the message respectively.
Servers might have knowledge of an agent's language preferences, in which case it MAY localise the DAV:description value as appropriate based on the calendar user accessing the notification, but if it does, it SHOULD include an xml:lang attribute on the DAV:description element to indicate what language is being used.
<!ELEMENT systemstatus (DAV:href?, DAV:description?)> <!ATTLIST systemstatus type (low | medium | high) "low"> <!-- One of DAV:href or DAV:description MUST be present -->
<?xml version="1.0" encoding="UTF-8"?> <D:notification xmlns:D="DAV:"> <D:dtstamp>2011-12-09T06:12:53Z</D:dtstamp> <D:systemstatus type="high"> <D:href>http://example.com/emergency_shutdown.html</D:href> <D:description xml:lang='en_US'> Emergency shutdown now </D:description> </D:systemstatus> </D:notification>
<?xml version="1.0" encoding="UTF-8"?> <D:notificationtype xmlns:D="DAV:"> <D:systemstatus type="high" /> </D:notificationtype>
TBD: More?
This document defines a MIME media type for use of WebDAV notifications in an XML format. This media type SHOULD be used for the transfer of WebDAV notifications.
Additional information
The authors would like to thank the members of the Calendaring and Scheduling Consortium's SharingTechnical Committee. In particular, the following individuals have made important contributions to this work: Richard Brigham, John Chaffee, Michael Douglass and Ken Murchison and Dave Thewlis.
This specification originated from work at the Calendaring and Scheduling Consortium, which has supported the development and testing of implementations of the specification.
[RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. |
[RFC3339] | Klyne, G. and C. Newman, "Date and Time on the Internet: Timestamps", RFC 3339, July 2002. |
[RFC4918] | Dusseault, L., "HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)", RFC 4918, June 2007. |
[RFC6352] | Daboo, C., "CardDAV: vCard Extensions to Web Distributed Authoring and Versioning (WebDAV)", RFC 6352, August 2011. |
[RFC7303] | Thompson, H. and C. Lilley, "XML Media Types", RFC 7303, July 2014. |
[RFC3744] | Clemm, G., Reschke, J., Sedlar, E. and J. Whitehead, "Web Distributed Authoring and Versioning (WebDAV) Access Control Protocol", RFC 3744, May 2004. |
[RFC4791] | Daboo, C., Desruisseaux, B. and L. Dusseault, "Calendaring Extensions to WebDAV (CalDAV)", RFC 4791, March 2007. |
An earlier draft of this specification is already widely deployed among both servers and clients.
This specification, informally known as 'caldav-notifications' largely uses the same structure as this specification, but where the "DAV:" xml namespace is used in this specification, the earlier draft uses "http://calendarserver.org/ns/".
It is possible to conform to both that draft and this specification by either creating two different collections, as identified by "notification-URL" in each respective namespace. Alternatively it's possible to use the same resource for both, but use content-negotation using the Accept header to ask the server for a specific representation of a notification.
Changes in -01: