Skip to content

Commit 34f51dd

Browse files
authored
Update VAPID + Message Encryption requirements (#71)
* Add and require content-encoding; remove redundant samples * Adapt key names and types
1 parent a09753f commit 34f51dd

File tree

6 files changed

+24
-45
lines changed

6 files changed

+24
-45
lines changed

content.mkd

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ POST https://example.com/webdav/collection/
229229
Content-Type: application/xml; charset="utf-8"
230230
231231
<?xml version="1.0" encoding="utf-8" ?>
232-
{::include xml/sample-registration.xml}
232+
{::include xml/sample-push-register.xml}
233233
234234
HTTP/1.1 201 Created
235235
Location: https://example.com/webdav/subscriptions/io6Efei4ooph
@@ -386,18 +386,12 @@ The `web-push-subscription` element represents the public information of a Web P
386386

387387
It contains exactly one `push-resource` element, which contains an absolute URI that identifies the endpoint where Web Push notifications are sent to. The push resource is used as the unique identifier for the subscription.
388388

389-
Example:
390-
391-
~~~
392-
{::include xml/sample-web-push-subscription.xml}
393-
~~~
394-
395389

396390
## VAPID
397391

398392
VAPID binds push subscriptions to the specific WebDAV-Push server.
399393

400-
A WebDAV-Push server which supports VAPID stores a key pair. The server exposes an additional transport property `server-public-key` (within the `web-push` element), which contains the VAPID public key in uncompressed form and base64url encoded. Its attribute `type="p256dh"` MUST be added to allow different key types in the future. See {{collection-properties}} for an example.
394+
A WebDAV-Push server which supports VAPID stores a key pair. The server exposes an additional transport property `vapid-public-key` (within the `web-push` element), which contains the VAPID public key in uncompressed form and base64url encoded. Its attribute `type="p256ecdsa"` MUST be added to allow different key types in the future. See {{collection-properties}} for an example.
401395

402396
If available, the client SHOULD use this key to create a restricted subscription at the push service.
403397

@@ -408,17 +402,11 @@ When the server sends a push message, it includes a corresponding `Authorization
408402

409403
Message encryption hides details of push messages from the push services. Before creating the subscription, the client generates a key pair as defined in {{RFC8291}}.
410404

411-
When the client then registers this subscription at the server, it includes additional subscription properties:
405+
When the client then registers this subscription at the server, it includes these subscription properties:
412406

413407
* `client-public-key` – public key of the user agent's key pair in uncompressed form and base64url encoded; attribute `type="p256dh"` MUST be added to allow different key types in the future
414408
* `auth-secret` – authentication secret
415409

416-
Example for a subscription registration requesting message encryption:
417-
418-
~~~
419-
{::include xml/sample-registration-with-encryption.xml}
420-
~~~
421-
422410
The server uses these data to encrypt the payload and send it to the push service. The client then decrypts the payload again.
423411

424412

xml/sample-propfind-multistatus.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<prop>
55
<P:transports>
66
<P:web-push>
7-
<P:server-public-key type="p256dh">BA1Hxzyi1RUM1b5wjxsn7nGxAszw2u61m164i3MrAIxHF6YK5h4SDYic-dRuU_RCPCfA5aq9ojSwk5Y2EmClBPs</P:server-public-key>
7+
<P:vapid-public-key type="p256ecdsa">BA1Hxzyi1RUM1b5wjxsn7nGxAszw2u61m164i3MrAIxHF6YK5h4SDYic-dRuU_RCPCfA5aq9ojSwk5Y2EmClBPs</P:vapid-public-key>
88
</P:web-push>
99
<!-- Not covered by this document:
1010
<X:some-other-transport>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
<subscription>
33
<web-push-subscription>
44
<push-resource>https://up.example.net/yohd4yai5Phiz1wi</push-resource>
5+
<content-encoding>aes128gcm</content-encoding>
6+
<subscription-public-key type="p256dh">BCVxsr7N_eNgVRqvHtD0zTZsEc6-VV-JvLexhqUzORcxaOzi6-AYWXvTBHm4bjyPjs7Vd8pZGH6SRpkNtoIAiw4</subscription-public-key>
7+
<auth-secret>BTBZMqHH6r4Tts7J_aSIgg</auth-secret>
58
</web-push-subscription>
69
</subscription>
710
<trigger>

xml/sample-registration-with-encryption.xml

Lines changed: 0 additions & 17 deletions
This file was deleted.

xml/sample-web-push-subscription.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

xml/webdav-push.rng

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@
145145
<element name="web-push">
146146
<!-- VAPID key -->
147147
<optional>
148-
<element name="server-public-key">
148+
<element name="vapid-public-key">
149149
<attribute name="type">
150150
<choice>
151-
<value>p256dh</value>
151+
<value>p256ecdsa</value>
152152
<!-- or other type / not covered by this schema -->
153153
</choice>
154154
</attribute>
@@ -160,13 +160,21 @@
160160

161161
<define name="web-push-subscription">
162162
<element name="web-push-subscription">
163-
<element name="push-resource">
164-
<text/> <!-- push resource (absolute URI) -->
165-
</element>
163+
<interleave>
164+
<!-- push resource (absolute URI) -->
165+
<element name="push-resource">
166+
<text/>
167+
</element>
166168

167-
<!-- message encryption -->
168-
<optional>
169-
<element name="client-public-key">
169+
<!-- message encryption -->
170+
<element name="content-encoding">
171+
<choice>
172+
<value>aes128gcm</value> <!-- defined in RFC8188 -->
173+
<!-- or other encoding / not covered by this schema -->
174+
</choice>
175+
</element>
176+
177+
<element name="subscription-public-key">
170178
<attribute name="type">
171179
<choice>
172180
<value>p256dh</value>
@@ -179,7 +187,7 @@
179187
<element name="auth-secret">
180188
<text/>
181189
</element>
182-
</optional>
190+
</interleave>
183191
</element>
184192
</define>
185193

0 commit comments

Comments
 (0)