Skip to content

Commit 330b8e1

Browse files
committed
invalid-subscription and push-not-available preconditions
1 parent 34f51dd commit 330b8e1

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

content.mkd

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ The `supported-triggers` element contains at least one of the following elements
140140
- `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.
141141
- `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.
142142

143-
Clients can use WebDAV `PROPFIND` to retrieve these properties. Example:
143+
Clients can use WebDAV `PROPFIND` to retrieve these properties.
144+
145+
Example:
144146

145147
~~~
146148
PROPFIND https://example.com/webdav/collection/
@@ -166,7 +168,7 @@ The comment shows how support for some other (not yet defined) transport could b
166168

167169
# Subscription Management
168170

169-
[^todo] Permissions / what to report when user is not allowed to register push.
171+
WebDAV-Push SHOULD only be advertised to clients which are actually allowed to use it.
170172

171173

172174
## Subscription Registration
@@ -214,8 +216,9 @@ Allowed response codes:
214216

215217
* 201 if the subscription was registered and the server wants to return additional information, like encryption details that are only valid for this subscription. Details have to be specified by the particular transport definition.
216218
* 204 if the subscription was registered
217-
* 400 when the request doesn't contain valid information (for instance, missing or invalid `subscription` or neither a content nor a property trigger)
218-
* 403 with precondition `trigger-not-supported` when a requested trigger is not supported by the server or the collection
219+
* 403 with precondition `invalid-subscription` when the request doesn't contain a valid `subscription`
220+
* 403 with precondition `push-not-available` if WebDAV-Push is not available for this collection or if the user is not allowed to register a push subscription for it
221+
* 403 with precondition `trigger-not-supported` when the request doesn't contain a trigger of when a requested trigger is not supported by the server or the collection
219222
* other response code with usual HTTP/WebDAV semantics
220223

221224
When a subscription is registered the first time, the server creates a URL that identifies that registration (registration URL) which can be used to remove the subscription. The server MUST send the registration URL in the `Location` header.

xml/webdav-push.rng

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,18 @@
104104

105105
<!-- XML error conditions (precondition/postcondition) for use with {DAV:}error element -->
106106

107+
<define name="precondition-invalid-subscription">
108+
<element name="invalid-subscription">
109+
<empty/>
110+
</element>
111+
</define>
112+
113+
<define name="precondition-push-not-available">
114+
<element name="push-not-available">
115+
<empty/>
116+
</element>
117+
</define>
118+
107119
<define name="precondition-trigger-not-supported">
108120
<element name="trigger-not-supported">
109121
<empty/>

0 commit comments

Comments
 (0)