Skip to content

Commit fe554f6

Browse files
committed
Make supported-triggers mandatory
1 parent 2a43501 commit fe554f6

File tree

5 files changed

+94
-71
lines changed

5 files changed

+94
-71
lines changed

content.mkd

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,16 @@ This section describes how a client can detect
129129

130130
## Collection Properties
131131

132-
To provide information about WebDAV-Push support, new collection properties are defined.
132+
To provide information about WebDAV-Push support, new properties are defined. A WebDAV-Push server is REQUIRED to provide the `transports`, `topic` and `supported-triggers` properties for collections that support WebDAV-Push.
133133

134134
The `transports` element contains push transports are supported by the server (one child element per transport). Within the scope of this document, the only supported transport is `web-push` (see {{transport-web-push}}).
135135

136136
The `topic` is a globally unique identifier for the collection. A specific collection could be reachable at different URLs, but it can only have one push topic. A server could for instance use a server-internal ID that is not going to change or a random UUID per collection.
137137

138-
[^todo] The `supported-triggers` element contains supported trigger methods (see {{content-updates}} and {{property-updates}}). Do we even need it? Is it optional? Default value? Specify all depths, max depths?
138+
The `supported-triggers` element contains at least one of the following elements:
139+
140+
- `content-update` if the collection supports push notifications on content updates ({{content-updates}}). It contains a `{DAV:}sync-level` property that indicates the maximum supported depth.
141+
- `property-update` if the collection supports push notifications on property updates ({{property-updates}}). It contains a `{DAV:}depth` property that indicates the maximum supported depth.
139142

140143
Clients can use WebDAV `PROPFIND` to retrieve these properties. Example:
141144

@@ -155,7 +158,7 @@ HTTP/1.1 207 Multi-Status
155158
{::include xml/sample-propfind-multistatus.xml}
156159
~~~
157160

158-
In this case, the requested collection supports WebDAV-Push in general (because it has a push topic). It supports the Web Push transport (without additional specific information).
161+
In this case, the requested collection supports WebDAV-Push in general (because it has a push topic). It supports the Web Push transport. [^todo vapid key] Push notifications can be requested for content updates of internal members.
159162

160163
The comment shows how support for some other (not yet defined) transport could be advertised together with additional specific information that is required to use it.
161164

xml/sample-propfind-multistatus-with-vapid.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
</P:web-push>
99
</P:transports>
1010
<P:topic>O7M1nQ7cKkKTKsoS_j6Z3w</P:topic>
11+
<P:supported-triggers>
12+
<P:content-update>
13+
<sync-level>infinite</sync-level>
14+
</P:content-update>
15+
</P:supported-triggers>
1116
</prop>
1217
</response>
1318
</multistatus>

xml/sample-propfind-multistatus.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<prop>
55
<P:transports>
66
<P:web-push />
7-
87
<!-- Not covered by this document:
98
<X:some-other-transport>
109
<X:some-parameter>...</X:some-parameter>
@@ -13,7 +12,9 @@
1312
</P:transports>
1413
<P:topic>O7M1nQ7cKkKTKsoS_j6Z3w</P:topic>
1514
<P:supported-triggers>
16-
<P:content-update />
15+
<P:content-update>
16+
<sync-level>1</sync-level>
17+
</P:content-update>
1718
</P:supported-triggers>
1819
</prop>
1920
</response>

xml/validate-samples.rng

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,17 @@
1010
</choice>
1111
</start>
1212

13-
<define name="multistatus" ns="DAV:">
13+
<define name="multistatus" ns="DAV:"> <!-- defined in WebDAV, here only for valiation of samples -->
1414
<element name="multistatus">
1515
<element name="response">
1616
<element name="href">
1717
<text/>
1818
</element>
1919
<element name="prop">
2020
<interleave>
21-
<optional>
22-
<ref name="prop-transports"/>
23-
</optional>
24-
<optional>
25-
<ref name="prop-topic"/>
26-
</optional>
27-
<optional>
28-
<ref name="prop-supported-triggers"/>
29-
</optional>
21+
<ref name="prop-transports"/>
22+
<ref name="prop-topic"/>
23+
<ref name="prop-supported-triggers"/>
3024
</interleave>
3125
</element>
3226
</element>

xml/webdav-push.rng

Lines changed: 76 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<!-- New WebDAV Collection Properties -->
44

5+
<!-- available push transports -->
56
<define name="prop-transports">
6-
<!-- available push transports -->
77
<element name="transports">
88
<choice>
99
<ref name="web-push-transport"/>
@@ -12,69 +12,63 @@
1212
</element>
1313
</define>
1414

15+
<!-- push topic -->
1516
<define name="prop-topic">
16-
<!-- push topic -->
1717
<element name="topic">
1818
<text/>
1919
</element>
2020
</define>
2121

22-
23-
<define name="trigger-content-update">
22+
<define name="prop-supported-triggers-content-update">
2423
<element name="content-update">
25-
<optional>
26-
<element ns="DAV:" name="sync-level"> <!-- defined in RFC 6578 -->
27-
<choice>
28-
<value>1</value>
29-
<value>infinite</value>
30-
</choice>
31-
</element>
32-
</optional>
24+
<ref name="prop-dav-sync-level"/>
3325
</element>
3426
</define>
35-
36-
<define name="trigger-property-update">
27+
<define name="prop-supported-triggers-property-update">
3728
<element name="property-update">
38-
<interleave>
39-
<optional>
40-
<element ns="DAV:" name="depth"> <!-- defined in WebDAV (RFC 4918) -->
41-
<choice>
42-
<value>0</value>
43-
<value>1</value>
44-
<value>infinite</value>
45-
</choice>
46-
</element>
47-
</optional>
48-
49-
<optional>
50-
<element ns="DAV:" name="prop"> <!-- defined in WebDAV (RFC 4918) -->
51-
<zeroOrMore>
52-
<element>
53-
<anyName/>
54-
<empty/>
55-
</element>
56-
</zeroOrMore>
57-
</element>
58-
</optional>
59-
</interleave>
29+
<ref name="prop-dav-depth"/>
6030
</element>
6131
</define>
62-
32+
<!-- supported triggers -->
6333
<define name="prop-supported-triggers">
64-
<!-- supported triggers -->
6534
<element name="supported-triggers">
66-
<zeroOrMore>
67-
<ref name="trigger-content-update"/>
68-
</zeroOrMore>
69-
<zeroOrMore>
70-
<ref name="trigger-property-update"/>
71-
</zeroOrMore>
35+
<choice>
36+
<ref name="prop-supported-triggers-content-update"/>
37+
<ref name="prop-supported-triggers-property-update"/>
38+
<interleave>
39+
<ref name="prop-supported-triggers-content-update"/>
40+
<ref name="prop-supported-triggers-property-update"/>
41+
</interleave>
42+
</choice>
7243
</element>
7344
</define>
7445

7546

7647
<!-- Subscription Registration -->
7748

49+
<define name="subscription-registration-trigger-content-update">
50+
<element name="content-update">
51+
<!-- requested depth -->
52+
<ref name="prop-dav-sync-level"/>
53+
</element>
54+
</define>
55+
<define name="subscription-registration-trigger-property-update">
56+
<element name="property-update">
57+
<!-- requested depth -->
58+
<ref name="prop-dav-depth"/>
59+
<!-- interesting properties -->
60+
<optional>
61+
<element ns="DAV:" name="prop"> <!-- list of properties, as in PROPFIND request -->
62+
<zeroOrMore>
63+
<element>
64+
<anyName/>
65+
<empty/>
66+
</element>
67+
</zeroOrMore>
68+
</element>
69+
</optional>
70+
</element>
71+
</define>
7872
<define name="subscription-registration">
7973
<element name="push-register">
8074
<!-- subscription to register -->
@@ -85,17 +79,17 @@
8579
</choice>
8680
</element>
8781

88-
<!-- types of events -->
82+
<!-- events that trigger a push notification -->
8983
<optional>
9084
<element name="trigger">
91-
<interleave>
92-
<optional>
93-
<ref name="trigger-content-update"/>
94-
</optional>
95-
<optional>
96-
<ref name="trigger-property-update"/>
97-
</optional>
98-
</interleave>
85+
<choice>
86+
<ref name="subscription-registration-trigger-content-update"/>
87+
<ref name="subscription-registration-trigger-property-update"/>
88+
<interleave>
89+
<ref name="subscription-registration-trigger-content-update"/>
90+
<ref name="subscription-registration-trigger-property-update"/>
91+
</interleave>
92+
</choice>
9993
</element>
10094
</optional>
10195

@@ -121,9 +115,7 @@
121115
<zeroOrMore>
122116
<element name="content-update">
123117
<optional>
124-
<element ns="DAV:" name="sync-token">
125-
<text/>
126-
</element>
118+
<ref name="prop-dav-sync-token"/>
127119
</optional>
128120
</element>
129121
</zeroOrMore>
@@ -183,4 +175,32 @@
183175
</element>
184176
</define>
185177

178+
179+
<!-- External Properties -->
180+
181+
<define name="prop-dav-depth"> <!-- defined in WebDAV (RFC 4918) -->
182+
<element ns="DAV:" name="depth">
183+
<choice>
184+
<value>0</value>
185+
<value>1</value>
186+
<value>infinite</value>
187+
</choice>
188+
</element>
189+
</define>
190+
191+
<define name="prop-dav-sync-level"> <!-- defined in RFC 6578 -->
192+
<element ns="DAV:" name="sync-level">
193+
<choice>
194+
<value>1</value>
195+
<value>infinite</value>
196+
</choice>
197+
</element>
198+
</define>
199+
200+
<define name="prop-dav-sync-token"> <!-- defined in RFC 6578 -->
201+
<element ns="DAV:" name="sync-token">
202+
<text/>
203+
</element>
204+
</define>
205+
186206
</grammar>

0 commit comments

Comments
 (0)