-
Notifications
You must be signed in to change notification settings - Fork 50
/
source.html
692 lines (629 loc) · 57.7 KB
/
source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
<!DOCTYPE html>
<html lang="en" dir="ltr" typeof="bibo:Document" prefix="bibo: http://purl.org/ontology/bibo/ w3p: http://www.w3.org/2001/02pd/rec54#">
<head>
<meta lang="" property="dc:language" content="en">
<title>WebSub</title>
<meta charset="utf-8">
<link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/W3C-WD">
<script src='https://www.w3.org/Tools/respec/respec-w3c-common' async class='remove'>
</script>
<script class='remove'>
var respecConfig = {
specStatus: "ED",
publishDate: "2017-12-19",
shortName: "websub",
editors: [{
name: "Julien Genestoux",
company: "Invited Expert",
url: "https://www.ouvre-boite.com/",
w3cid: "49792"
}, {
name: "Aaron Parecki",
company: "Invited Expert",
url: "https://aaronparecki.com/",
w3cid: "59996"
}],
authors: [{
name: "Julien Genestoux"
}],
previousMaturity: "PR",
previousPublishDate: "2017-10-03",
edDraftURI: "https://websub.net/draft",
testSuiteURI: "https://websub.rocks/",
implementationReportURI: "https://websub.net/implementation-reports",
errata: "https://websub.net/errata",
wg: "Social Web Working Group",
wgURI: "https://www.w3.org/Social/WG",
wgPublicList: "public-socialweb",
wgPatentURI: "https://www.w3.org/2004/01/pp-impl/72531/status",
otherLinks: [{
key: 'Past Authors',
data: [
{
value: 'Brad Fitzpatrick',
href: 'https://bradfitz.com/'
},
{
value: 'Brett Slatkin',
href: 'http://www.onebigfluke.com/'
},
{
value: 'Martin Atkins',
href: 'http://martin.atkins.me.uk/'
}
]
},
{
key: 'Repository',
data: [
{
value: 'GitHub',
href: 'https://github.com/w3c/websub'
},
{
value: 'Issues',
href: 'https://github.com/w3c/websub/issues'
},
{
value: 'Commits',
href: 'https://github.com/w3c/websub/commits/master'
}
]
}],
localBiblio: {
"PubSubHubbub-Core-0.3": {
title: "PubSubHubbub Core 0.3 -- Working Draft",
href: "https://pubsubhubbub.github.io/PubSubHubbub/pubsubhubbub-core-0.3.html",
authors: [
"B. Fitzpatrick", "B. Slatkin", "M. Atkins"
]
},
"PubSubHubbub-Core-0.4": {
title: "PubSubHubbub Core 0.4 -- Working Draft",
href: "https://pubsubhubbub.github.io/PubSubHubbub/pubsubhubbub-core-0.4.html",
authors: [
"B. Fitzpatrick", "B. Slatkin", "M. Atkins", "J. Genestoux"
]
},
"XEP-0060": {
title: "Publish-Subscribe",
href: "http://www.xmpp.org/extensions/xep-0060.html",
authors: [
"Peter Millard", "Peter Saint-Andre", "Ralph Meijer"
],
status: "Draft",
publisher: "XMPP Standards Foundation"
},
"RSS-2.0": {
title: "RSS 2.0",
href: "http://www.rssboard.org/rss-specification",
authors: ["Dave Winer"],
status: "Stable",
publisher: "RSS Board"
},
"FIPS-PUB-180-4": {
title: "Secure Hash Standard (SHS)",
href: "http://dx.doi.org/10.6028/NIST.FIPS.180-4",
authors: ["National Institute of Standards and Technology"],
publisher: "U.S. Department of Commerce"
},
"URL": {
title: "URL Standard",
href: "https://url.spec.whatwg.org/",
authors: ["Anne van Kesteren"],
status: "Living Standard",
publisher: "WHATWG"
}
}
};
</script>
<link rel="pingback" href="https://webmention.io/w3c/xmlrpc">
<link rel="webmention" href="https://webmention.io/w3c/webmention">
</head>
<body>
<section id="abstract">
<p>WebSub provides a common mechanism for communication between publishers of any kind of Web content and their subscribers, based on HTTP web hooks. Subscription requests are relayed through hubs, which validate and verify the request. Hubs then distribute new and updated content to subscribers when it becomes available. WebSub was previously known as PubSubHubbub.</p>
</section>
<section id="sotd"></section>
<section id="definitions">
<h2>Definitions</h2>
<dl>
<dt><dfn>Topic</dfn></dt>
<dd>An HTTP [[!RFC7230]] (or HTTPS [[!RFC2818]]) resource URL. The unit to which one can subscribe to changes.</dd>
<dt><dfn>Hub ("the hub")</dfn></dt>
<dd>The server (URL [[!URL]]) which implements both sides of this protocol. Any hub MAY implement its own policies on who can use it.</dd>
<dt><dfn>Publisher</dfn></dt>
<dd>An owner of a topic. Notifies the hub when the topic feed has been updated. As in almost all pubsub systems, the publisher is unaware of the subscribers, if any. Other pubsub systems might call the publisher the "source".</dd>
<dt><dfn>Subscriber</dfn></dt>
<dd>An entity (person or program) that wants to be notified of changes on a topic. The subscriber must be directly network-accessible and is identified by its Subscriber Callback URL. </dd>
<dt><dfn>Subscription</dfn></dt>
<dd>A unique relation to a topic by a subscriber that indicates it should receive updates for that topic. A subscription's unique key is the tuple (Topic URL, Subscriber Callback URL). Subscriptions may (at the hub's decision) have expiration times akin to DHCP leases which must be periodically renewed. </dd>
<dt><dfn>Subscriber Callback URL</dfn></dt>
<dd>The URL [[!URL]] at which a subscriber wishes to receive content distribution requests. </dd>
<dt><dfn>Event</dfn></dt>
<dd>An event that causes updates to multiple topics. For each event that happens (e.g. "Brad posted to the Linux Community."), multiple topics could be affected (e.g. "Brad posted." and "Linux community has new post"). Publisher events cause topics to be updated and the hub looks up all subscriptions for affected topics, delivering the content to subscribers. </dd>
<dt><dfn>Content Distribution Notification</dfn> / <dfn>(Content Distribution Request)</dfn></dt>
<dd>A payload describing how a topic's contents have changed, or the full updated content. Depending on the topic's content type, the difference (or "delta") may be computed by the hub and sent to all subscribers. </dd>
</dl>
</section>
<section id="high-level-protocol-flow">
<h2>High-level protocol flow</h2>
<p>(This section is non-normative.)</p>
<svg xmlns="http://www.w3.org/2000/svg" width="624" height="422"><style>.a{fill:white;}.b{fill:black;}.c{fill:none;stroke-dasharray:10;stroke:black;}.d{fill:none;}.e{fill:white;stroke-dasharray:;stroke-width:3;stroke:black;}.f{fill:black;font-weight:bold;}.g{fill:none;stroke-dasharray:;stroke:black;}</style><rect width="624" height="422" class="a"/><text font-family="sans-serif" font-size="16.5pt" text-decoration="normal" x="199.4" y="24.5" dominant-baseline="alphabetic" class="b"> WebSub Flow Diagram</text><path paint-order="fill stroke markers" d="M60.9 95.9L60.9 422.6" class="c"/><path paint-order="fill stroke markers" d="M323.1 95.9L323.1 422.6" class="c"/><path paint-order="fill stroke markers" d="M585.2 95.9L585.2 422.6" class="c"/><path paint-order="fill stroke markers" d="M8.2 51.8L113.7 51.8 113.7 95.9 8.2 95.9 8.2 51.8Z" class="e"/><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="25.9" y="79.6" dominant-baseline="alphabetic" class="b"> Subscriber</text><path paint-order="fill stroke markers" d="M274.8 51.8L371.4 51.8 371.4 95.9 274.8 95.9 274.8 51.8Z" class="e"/><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="292.5" y="79.6" dominant-baseline="alphabetic" class="b"> Publisher</text><path paint-order="fill stroke markers" d="M554 51.8L616.4 51.8 616.4 95.9 554 95.9 554 51.8Z" class="e"/><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="571.8" y="79.6" dominant-baseline="alphabetic" class="b"> Hub</text><rect x="89.6" y="128.6" width="196.4" height="21.2" class="a"/><rect x="89.6" y="144.9" width="204.9" height="21.2" class="a"/><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="92" y="143.3" dominant-baseline="alphabetic" class="b"> Subscriber discovers the </text><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="256.6" y="143.3" dominant-baseline="alphabetic" class="f"> hub</text><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="283.5" y="143.3" dominant-baseline="alphabetic" class="b"/><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="92" y="159.6" dominant-baseline="alphabetic" class="b"> advertised by publisher's </text><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="257" y="159.6" dominant-baseline="alphabetic" class="f"> topic</text><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="292" y="159.6" dominant-baseline="alphabetic" class="b"/><path paint-order="fill stroke markers" d="M60.9 166.1L323.1 166.1" class="g"/><path paint-order="stroke fill markers" d="M309.5 159.3L323.1 166.1 309.5 172.9Z" class="b"/><rect x="80.3" y="190.6" width="485.6" height="21.2" class="a"/><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="82.7" y="205.3" dominant-baseline="alphabetic" class="b"> Subscriber makes a POST to the </text><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="301.1" y="205.3" dominant-baseline="alphabetic" class="f">hub</text> <text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="331" y="205.3" dominant-baseline="alphabetic" class="b">to subscribe to updates about </text><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="528.4" y="205.3" dominant-baseline="alphabetic" class="f">topic</text><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="563.4" y="205.3" dominant-baseline="alphabetic" class="b"/><path paint-order="fill stroke markers" d="M60.9 211.9L585.2 211.9" class="g"/><path paint-order="stroke fill markers" d="M571.6 205.1L585.2 211.9 571.6 218.7Z" class="b"/><rect x="163.8" y="236.4" width="318.6" height="21.2" class="a"/><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="166.2" y="251.1" dominant-baseline="alphabetic" class="b"> Hub verifies the subscription attempt with a GET</text><path paint-order="fill stroke markers" d="M585.2 257.6L60.9 257.6" style="fill:none;stroke-dasharray:7;stroke:black"/><path paint-order="stroke fill markers" d="M74.5 250.8L60.9 257.6 74.5 264.4Z" class="b"/><rect x="368.2" y="282.1" width="171.9" height="21.2" class="a"/><rect x="368.2" y="298.4" width="100.3" height="21.2" class="a"/><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="370.6" y="296.8" dominant-baseline="alphabetic" class="b"> Publisher notifies the </text><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="510.8" y="296.8" dominant-baseline="alphabetic" class="f"> hub</text><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="537.7" y="296.8" dominant-baseline="alphabetic" class="b"/><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="370.6" y="313.1" dominant-baseline="alphabetic" class="b"> of new content</text><path paint-order="fill stroke markers" d="M323.1 319.7L585.2 319.7" class="g"/><path paint-order="stroke fill markers" d="M571.6 312.9L585.2 319.7 571.6 326.5Z" class="b"/><rect x="105.1" y="344.2" width="435.9" height="21.2" class="a"/><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="107.6" y="358.9" dominant-baseline="alphabetic" class="b"> Hub delivers the contents of </text><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="293.4" y="358.9" dominant-baseline="alphabetic" class="f"> topic</text><text font-family="sans-serif" font-size="11pt" text-decoration="normal" x="330" y="358.9" dominant-baseline="alphabetic" class="b">to each subscriber with a POST</text><path paint-order="fill stroke markers" d="M585.2 365.4L60.9 365.4" class="g"/><path paint-order="stroke fill markers" d="M74.5 358.6L60.9 365.4 74.5 372.2Z" class="b"/></svg>
<!-- SVG generated at https://sequencediagram.org/index.html?initialData=C4S2BsFMAIHVIEYGUCuDoDFwHsDu0AREAQwHMAnYgWwCgaAFNcEAZwAtJyAeAWlQRYBjciAScAXPyEix5aABNWg7ADdOLaMA7QAVDrZo9AHQB2xeWvKgWkedAQBPaAAcmrDuQDkGvcGzOQQT0aKWFRTh4APgAJNEk0aXC5KmIAa0gNYmh6AHkkABVNbE1tPQMEPSLoFgSwsSqUZ3liYAzoYgRsFGBdHT8AoJ0Q2plOXh5YhHFoSehLEAAzEDatGBqBMOdQbBN24FaqLehcMDZ26ABxAFF8hjd2CJi4xgRmB7kTbFAlldL9Qx0pmwC2gJkg+GUJlaUJokyioVG5Gms3kkGYlg0q2gkOhwA0wN6-UClT80EgxEEZ3WiVkx1O51yBSAA -->
<ul>
<li>Subscribers discover the hub of a topic URL, and makes a POST to one or more of the advertised hubs in order to receive updates when the topic changes.</li>
<li>Publishers notify their hub(s) URLs when their topic(s) change.</li>
<li>When the hub identifies a change in the topic, it sends a content distribution notification to all registered subscribers.</li>
</ul>
<p>Earlier versions of this protocol were called PubSubHubbub:</p>
<ul>
<li>Working Draft 0.3 [[PubSubHubbub-Core-0.3]]</li>
<li>Working Draft 0.4 [[PubSubHubbub-Core-0.4]]</li>
</ul>
</section>
<section>
<h2>Conformance</h2>
<p>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]].</p>
<section>
<h3>Conformance Classes</h3>
<p>WebSub describes three roles: publishers, subscribers and hubs. This section describes the conformance criteria for each role.</p>
<h4>Publishers</h4>
<ul>
<li>A conforming publisher MUST advertise topic and hub URLs for a given resource URL as described in <a href="#discovery">Discovery</a>.</li>
</ul>
<h4>Subscribers</h4>
<p>A conforming subscriber:</p>
<ul>
<li>MUST support each discovery mechanism in the specified order to discover the topic and hub URLs as described in <a href="#discovery">Discovery</a>.</li>
<li>MUST send a subscription request as described in <a href="#subscriber-sends-subscription-request">Subscriber Sends Subscription Request</a>.</li>
<li>MAY request a specific lease duration</li>
<li>MAY include a secret in the subscription request, and if it does, then MUST use the secret to verify the signature in the <a href="#authenticated-content-distribution">content distribution request</a>.</li>
<li>MUST acknowledge a content distribution request with an HTTP 2xx status code.</li>
<li>MAY request that a subscription is deactivated using the "unsubscribe" mechanism.</li>
</ul>
<h4>Hubs</h4>
<p>A conforming hub:</p>
<ul>
<li>MUST accept a subscription request with the parameters <code>hub.callback</code>, <code>hub.mode</code> and <code>hub.topic</code>.</li>
<li>MUST accept a subscription request with a <code>hub.secret</code> parameter.</li>
<li>MAY respect the requested lease duration in subscription requests.</li>
<li>MUST allow subscribers to re-request already active subscriptions.</li>
<li>MUST support unsubscription requests.</li>
<li>MUST send content distribution requests with a matching content type of the topic URL. (See <a href="#content-negotiation">Content Negotiation</a>)</li>
<li>MAY reduce the payload of the content distribution to a diff of the contents for supported formats as described in <a href="#content-distribution">Content Distribution</a>.</li>
<li>MUST send a <code>X-Hub-Signature</code> header if the subscription was made with a <code>hub.secret</code> as described in <a href="#authenticated-content-distribution">Authenticated Content Distribution</a>.</li>
</ul>
</section>
<section>
<h3>Candidate Recommendation Exit Criteria</h3>
<p>This specification exited the CR stage with at least two independent, interoperable implementations of each feature. Each feature may have been implemented by a different set of products. There was no requirement that all features be implemented by a single product. For the purposes of this criterion, we define the following terms:</p>
<section>
<h4>Publisher</h4>
<p>A WebSub Publisher is an implementation that advertises a topic and hub URL on one or more resource URLs. The conformance criteria are described in <a href="#conformance-classes">Conformance Classes</a> above.</p>
</section>
<section>
<h4>Subscriber</h4>
<p>A WebSub Subscriber is an implementation that discovers the hub and topic URL given a resource URL, subscribes to updates at the hub, and accepts content distribution requests from the hub. The subscriber MAY support <a href="#authenticated-content-distribution">authenticated content distribution</a>. The conformance criteria are described in <a href="#conformance-classes">Conformance Classes</a> above.</p>
</section>
<section>
<h4>Hub</h4>
<p>A WebSub Hub is an implementation that handles subscription requests and distributes the content to subscribers when the corresponding topic URL has been updated. Hubs MUST support subscription requests with a secret and deliver <a href="#authenticated-content-distribution">authenticated requests</a> when requested. Hubs MUST deliver the full contents of the topic URL in the request, and MAY reduce the payload to a diff if the content type supports it. The conformance criteria are described in <a href="#conformance-classes">Conformance Classes</a> above.</p>
</section>
<section>
<h4>Independent</h4>
<p>Each implementation must be developed by a different party and cannot share, reuse, or derive from code used by another qualifying implementation. Sections of code that have no bearing on the implementation of this specification are exempt from this requirement.</p>
</section>
<section>
<h4>Interoperable</h4>
<p>A Subscriber and Hub implementation are considered interoperable for a specific feature when the Hub takes the defined action that the Subscriber requests, the Subscriber gets the expected response from a Hub according to the feature, and the Hub sends the expected response to the Subscriber.</p>
</section>
<section>
<h4>Feature</h4>
<p>For the purposes of evaluating exit criteria, each of the following is considered a feature:</p>
<ul>
<li>Discovering the hub and topic URLs by looking at the HTTP headers of the resource URL.</li>
<li>Discovering the hub and topic URLs by looking at the contents of the resource URL as an XML document.</li>
<li>Discovering the hub and topic URLs by looking at the contents of the resource URL as an HTML document.</li>
<li>Subscribing to the hub with a callback URL.</li>
<li>Subscribing to the hub and requesting a specific lease duration.</li>
<li>Subscribing to the hub with a secret and handling authenticated content distribution.</li>
<li>Requesting that a subscription is deactivated by sending an unsubscribe request.</li>
<li>The Subscriber acknowledges a pending subscription on a validation request.</li>
<li>The Subscriber rejects a subscription validation request for an invalid topic URL.</li>
<li>The Subscriber returns an HTTP 2xx response when the payload is delivered.</li>
<li>The Subscriber verifies the signature for authenticated content distribution requests.</li>
<li>The Subscriber rejects the distribution request if the signature does not validate.</li>
<li>The Subscriber rejects the distribution request when no signature is present if the subscription was made with a secret.</li>
<li>The Hub respects the requested lease duration during a subscription request.</li>
<li>The Hub allows Subscribers to re-request already active subscriptions, extending the lease duration.</li>
<li>The Hub sends the full contents of the topic URL in the distribution request.</li>
<li>The Hub sends a diff of the topic URL for the formats that support it.</li>
<li>The Hub sends a valid signature for subscriptions that were made with a secret.</li>
</ul>
</section>
</section>
</section>
<section id="discovery">
<h2>Discovery</h2>
<p>The discovery mechanism aims at identifying at least 2 URLs.</p>
<ul>
<li>The URL of one or more hubs designated by the publisher. If more than one hub URL is specified, it is expected that the publisher notifies each hub, so the subscriber may subscribe to one or more of them.</li>
<li>The canonical URL for the topic to which subscribers are expected to use for subscriptions.</li>
</ul>
<p class="note">Publishers may wish to advertise and publish to more than one hub for fault tolerance and redundancy. If one hub fails to propagate an update to the document, then using multiple independent hubs is a way to increase the likelihood of delivery to subscribers. As such, subscribers may subscribe to one or more of the advertised hubs.</p>
<p>The protocol currently supports the following discovery mechanisms. Publishers MUST implement at least one of them:</p>
<ul>
<li>Link Headers [[!RFC5988]]: the publisher SHOULD include at least one Link Header [[!RFC5988]] with <samp>rel=hub</samp> (a hub link header) as well as exactly one Link Header [[!RFC5988]] with <samp>rel=self</samp> (the self link header)</li>
<li>If the topic is an XML based feed, publishers SHOULD use embedded link elements as described in Appendix B of Web Linking [[!RFC5988]]. Similarly, for HTML pages, publishers SHOULD use embedded link elements as described in Appendix A of Web Linking [[!RFC5988]].</li>
</ul>
<p class="note">Since <samp><link></samp> has been limited to being placed in the <samp><head></samp> for many years, some consuming code might only check the <samp><head></samp>. Therefore it is more robust to place the <samp><link></samp> tags only in the HTML <samp><head></samp> rather than in the <samp><body></samp>.</p>
<pre class="example">GET /feed HTTP/1.1
Host: example.com
HTTP/1.1 200 Ok
Content-type: text/html
Link: <https://hub.example.com/>; rel="hub"
Link: <http://example.com/feed>; rel="self"
<!doctype html>
<html>
<head>
<link rel="hub" href="https://hub.example.com/">
<link rel="self" href="http://example.com/feed">
</head>
<body>
...
</body>
</html>
</pre>
<p>When perfoming discovery, subscribers MUST implement all two discovery mechanisms in the following order, stopping at the first match:</p>
<ol>
<li>Issue a GET or HEAD request to retrieve the topic URL. Subscribers MUST check for HTTP Link headers first.</li>
<li>In the absence of HTTP Link headers, and if the topic is an XML based feed or an HTML page, subscribers MUST check for embedded link elements.</li>
</ol>
<section id="content-negotiation">
<h3>Content Negotiation</h3>
<p>
For practical purposes, it is important that the <samp>rel=self</samp> URL only offers a single representation. As the hub has no way of knowing what Media Type ([[RFC6838]]) or language may have been requested by the subscriber upon discovery, it would not be able to deliver the content using the appropriate representation of the document.
</p>
<p>
It is, however, possible to perform content negotiation by returning an appropriate <samp>rel=self</samp> URL according to the HTTP headers used in the initial discovery request. For example, a request to <samp>/feed</samp> with an <samp>Accept</samp> header containing <samp>application/json</samp> could return a <samp>rel=self</samp> value of <samp>/feed.json</samp>.
</p>
<p>The example below illustrates how a topic URL can return different <samp>Link</samp> headers depending on the <samp>Accept</samp> header that was sent.</p>
<pre class="example">GET /feed HTTP/1.1
Host: example.com
Accept: application/json
HTTP/1.1 200 Ok
Content-type: application/json
Link: </feed.json>; rel="self"
Link: <https://hub.example.com/>; rel="hub"
{
"items": [...]
}</pre>
<pre class="example">GET /feed HTTP/1.1
Host: example.com
Accept: text/html
HTTP/1.1 200 Ok
Content-type: text/html
Link: </feed.html>; rel="self"
Link: <https://hub.example.com/>; rel="hub"
<html>
...</pre>
<p>Similarly, the technique can also be used to return a different <samp>rel=self</samp> URL depending on the language requested by the <samp>Accept-Language</samp> header.</p>
<pre class="example">GET /feed HTTP/1.1
Host: example.com
Accept-Language: de-DE
HTTP/1.1 200 Ok
Content-type: application/json
Link: </feed-de.json>; rel="self"
Link: <https://hub.example.com/>; rel="hub"
{
"items": [...]
}</pre>
</pre>
</section>
</section>
<section id="subscribing-and-unsubscribing">
<h2>Subscribing and Unsubscribing</h2>
<p>Subscribing to a topic URL consists of four parts that may occur immediately in sequence or have a delay.</p>
<ul>
<li>Subscriber requests a subscription at the hub</li>
<li>The hub validates the subscription with the publisher (OPTIONAL)</li>
<li>The hub confirms the subscription was actually requested by the subscriber</li>
<li>The hub periodically reconfirms the subscription is still active (OPTIONAL)</li>
</ul>
<p>Unsubscribing works in the same way, except with a single parameter changed to indicate the desire to unsubscribe. Also, the Hub will not validate unsubscription requests with the publisher.</p>
<section id="subscriber-sends-subscription-request">
<h3>Subscriber Sends Subscription Request</h3>
<p>Subscription is initiated by the subscriber making an HTTPS or HTTP POST [[!RFC7231]] request to the hub URL. This request MUST have a Content-Type header of <samp>application/x-www-form-urlencoded</samp> (described in Section 4.10.22.6 [[!HTML5]]), MUST use UTF-8 [[!Encoding]] as the document character encoding, and MUST use the following parameters in its body, formatted accordingly:</p>
<dl>
<dt>hub.callback</dt>
<dd>REQUIRED. The subscriber's callback URL where content distribution notifications should be delivered. The callback URL SHOULD be an unguessable URL that is unique per subscription. ([[capability-urls]])</dd>
<dt>hub.mode</dt>
<dd>REQUIRED. The literal string "subscribe" or "unsubscribe", depending on the goal of the request.</dd>
<dt>hub.topic</dt>
<dd>REQUIRED. The topic URL that the subscriber wishes to subscribe to or unsubscribe from. Note that this MUST be the "self" URL found during the discovery step, which may be different from the URL that was used to make the discovery request.</dd>
<dt>hub.lease_seconds</dt>
<dd>OPTIONAL. Number of seconds for which the subscriber would like to have the subscription active, given as a positive decimal integer. Hubs MAY choose to respect this value or not, depending on their own policies, and MAY set a default value if the subscriber omits the parameter. This parameter MAY be present for unsubscription requests and MUST be ignored by the hub in that case.</dd>
<dt>hub.secret</dt>
<dd>OPTIONAL. A subscriber-provided cryptographically random unique secret string that will be used to compute an HMAC digest for <a href="#authenticated-content-distribution">authorized content distribution</a>. If not supplied, the HMAC digest will not be present for content distribution requests. This parameter SHOULD only be specified when the request was made over HTTPS [[!RFC2818]]. This parameter MUST be less than 200 bytes in length.</dd>
</dl>
<p>Subscribers MAY also include additional HTTP [[!RFC7230]] request parameters, as well as HTTP [[!RFC7230]] Headers if they are required by the hub.</p>
<p>Hubs MUST ignore additional request parameters they do not understand.</p>
<p>Hubs MUST allow subscribers to re-request subscriptions that are already activated. Each subsequent request to a hub to subscribe or unsubscribe MUST override the previous subscription state for a specific topic URL and callback URL combination, but only once the action is verified (<a href="#hub-verifies-intent">Section 4.3</a>). If verification fails, the subscription state MUST be left unchanged. This is required so subscribers can renew their subscriptions before the lease seconds period is over without any interruption. The subscriber MAY use a new hub.secret value in a future subscription, and MAY make a new subscription without a hub.secret.</p>
<section id="subscription-parameter-details">
<h4>Subscription Parameter Details</h4>
<p>The topic and callback URLs MAY use HTTP [[!RFC7230]] or HTTPS [[!RFC2818]] schemes. The topic URL MUST be the one advertised by the publisher in a Self Link Header during the discovery phase. (See <a href="#discovery">Section 3 </a>). Hubs MAY refuse subscriptions if the topic URL does not correspond to the one advertised by the publisher. The topic URL can otherwise be free-form following the URL spec [[!URL]]. Hubs MUST always decode non-reserved characters for these URL parameters; see section 1.2 on <em>"Percent-encoded bytes"</em> in [[!URL]].</p>
<p>The callback URL SHOULD be an unguessable unique URL ([[capability-urls]]) and SHOULD use HTTPS [[!RFC7230]]. The callback URL acts as authentication from the hub to the subscriber when confirming subscriptions and delivering the content. Additionally, the callback SHOULD be unique (not re-used for multiple hubs) and changed when subscriptions are renewed.</p>
<p>The callback URL MAY contain arbitrary query string parameters (e.g., <samp>?foo=bar&red=fish</samp>). Hubs MUST preserve the query string during subscription verification by appending new parameters to the end of the list using the <samp>&</samp> (ampersand) character to join. Existing parameters with names that overlap with those used by verification requests will not be overwritten. When sending the content distribution request, the hub will make a POST request to the callback URL including any query string parameters in the URL portion of the request, not as POST body parameters.</p>
</section>
<section id="subscription-response-details">
<h4>Subscription Response Details</h4>
<p>If the hub URL supports WebSub and is able to handle the subscription or unsubscription request, it MUST respond to a subscription request with an HTTP [[!RFC7231]] 202 "Accepted" response to indicate that the request was received and will now be verified (<a href="#hub-verifies-intent">Section 5.3</a>) and validated (<a href="#subscription-validation">Section 5.2</a>) by the hub. The hub SHOULD perform the verification and validation of intent as soon as possible.</p>
<p>If a hub finds any errors in the subscription request, an appropriate HTTP [[!RFC7231]] error response code (4xx or 5xx) MUST be returned. In the event of an error, hubs SHOULD return a description of the error in the response body as plain text, used to assist the client developer in understanding the error. This is not meant to be shown to the end user. Hubs MAY decide to reject some callback URLs or topic URLs based on their own policies (e.g., domain authorization, topic URL port numbers). However, since verification and validation of intent are asynchronous steps that logically begin after the HTTP response has been returned, the HTTP response MUST NOT depend on the process or outcome of verification or validation.</p>
<p>If the hub URL is not able to handle subscription or unsubscription requests, it MAY redirect to another hub which supports WebSub. It does so by yielding an HTTP [[!RFC7231]] 307 (temporary redirect) or 308 (permanent redirect) response. It MUST also include at least a HTTP [[!RFC7230]] Location Header containing a preferred URL reference for the hub to use by the subscriber. The subscriber is expected to retry the subscription or unsubscription at the new hub URL.</p>
</section>
</section>
<section id="subscription-validation">
<h3>Subscription Validation</h3>
<p>Subscriptions MAY be validated by the Hubs who may require more details to accept or refuse a subscription. The Hub MAY also check with the publisher whether the subscription should be accepted.</p>
<p>If (and when) the subscription is accepted, the hub MUST perform the <a href="#hub-verifies-intent">verification of intent </a> of the subscriber.</p>
<p>If (and when) the subscription is denied, the hub MUST inform the subscriber by sending an HTTP [[!RFC7231]] (or HTTPS [[!RFC2818]]) GET request to the subscriber's callback URL as given in the subscription request. This request has the following query string arguments appended (format described in Section 4 of [[!URL]]):</p>
<dl>
<dt>hub.mode</dt>
<dd>REQUIRED. The literal string "denied".</dd>
<dt>hub.topic</dt>
<dd>REQUIRED. The topic URL given in the corresponding subscription request.</dd>
<dt>hub.reason</dt>
<dd>OPTIONAL. The hub may include a reason for which the subscription has been denied.</dd>
</dl>
<p>The subscription MAY be denied by the hub at any point (even if it was previously accepted). The Subscriber SHOULD then consider that the subscription is not possible anymore.</p>
</section>
<section id="hub-verifies-intent">
<h3>Hub Verifies Intent of the Subscriber</h3>
<p>In order to prevent an attacker from creating unwanted subscriptions on behalf of a subscriber (or unsubscribing desired ones), a hub must ensure that the subscriber did indeed send the subscription request.</p>
<p>The hub verifies a subscription request by sending an HTTP [[!RFC7231]] (or HTTPS [[!RFC2818]]) GET request to the subscriber's callback URL as given in the subscription request. This request has the following query string arguments appended (format described in Section 4 of [[!URL]]):</p>
<dl>
<dt><samp>hub.mode</samp></dt>
<dd>REQUIRED. The literal string "<samp>subscribe</samp>" or "<samp>unsubscribe</samp>", which matches the original request to the hub from the subscriber.</dd>
<dt><samp>hub.topic</samp></dt>
<dd>REQUIRED. The topic URL given in the corresponding subscription request.</dd>
<dt><samp>hub.challenge</samp></dt>
<dd>REQUIRED. A hub-generated, random string that MUST be echoed by the subscriber to verify the subscription.</dd>
<dt><samp>hub.lease_seconds</samp></dt>
<dd>REQUIRED/OPTIONAL. The hub-determined number of seconds that the subscription will stay active before expiring, measured from the time the verification request was made from the hub to the subscriber. Hubs MUST supply this parameter when <samp>hub.mode</samp> is set to "subscribe". This parameter MAY be present when <samp>hub.mode</samp> is "unsubscribe" and MUST be ignored by subscribers in that case.</dd>
</dl>
<section id="verification-details">
<h4>Verification Details</h4>
<p>The subscriber MUST confirm that the <samp>hub.topic</samp> corresponds to a pending subscription or unsubscription that it wishes to carry out. If so, the subscriber MUST respond with an HTTP success (2xx) code with a response body equal to the <samp>hub.challenge</samp> parameter. If the subscriber does not agree with the action, the subscriber MUST respond with a 404 "Not Found" response.</p>
<p>The hub MUST consider other server response codes (3xx, 4xx, 5xx) to mean that the verification request has failed. If the subscriber returns an HTTP [[!RFC7231]] success (2xx) but the content body does not match the <samp>hub.challenge</samp> parameter, the hub MUST also consider verification to have failed.</p>
<p>Hubs MAY make the <samp>hub.lease_seconds</samp> equal to the value the subscriber passed in their subscription request but MAY change the value depending on the hub's policies. To sustain a subscription, the subscriber MUST re-request the subscription on the hub before <samp>hub.lease_seconds</samp> seconds has elapsed.</p>
<p>Hubs MUST enforce lease expirations, and MUST NOT issue perpetual lease durations.</p>
</section>
</section>
<p class="note">The spec uses GET vs POST to differentiate between the confirmation/denial of the subscription request and delivering the content. While this is not considered "best practice" from a web architecture perspective, it does make implementation of the callback URL simpler. Since the POST body of the content distribution request may be any arbitrary content type and only includes the actual content of the document, using the GET vs POST distinction to switch between handling these two modes makes implementations simpler.</p>
</section>
<section id="publishing">
<h2>Publishing</h2>
<p>The publisher MUST inform the hubs it previously designated when a topic has been updated. The hub and the publisher can agree on any mechanism, as long as the hub is eventually able send the updated payload to the subscribers.</p>
<p class="note">The specific mechanism for the publisher to inform the hub is left unspecified. For example, some existing public hubs <a href="https://documentation.superfeedr.com/publishers.html#ping">[1]</a> <a href="https://pubsubhubbub.appspot.com/">[2]</a> <a href="https://switchboard.p3k.io/docs">[3]</a> ask publishers to send a POST request with the keys <span style="white-space: nowrap">hub.mode="publish"</span> and <span style="white-space: nowrap">hub.url=(the URL of the resource that was updated)</span>.</p>
<section id="subscription-migration">
<h3>Subscription Migration</h3>
<p>If the publisher wishes to migrate existing subscriptions to a new topic URL, it can do so using HTTP redirects.</p>
<ul>
<li>The previous topic URL should send a redirect to the new topic URL. This will provide a seamless transition for any HTTP client that did not use WebSub but instead was polling the topic URL.</li>
<li>When existing WebSub subscriptions expire, subscribers will attempt to renew the subscription. The first step of renewing a subscription is to fetch the topic URL, which means the subscriber will encounter the redirect and end up at the new topic URL.</li>
<li>At the new topic URL, the subscriber will see the new <code>rel=self</code> URL and the new hub, and will subscribe to the new topic URL at the new hub.</li>
</ul>
<p>This does not require any participation on the part of the previous hub, and works whether or not the publisher changes hubs as well.</p>
</section>
</section>
<section id="content-distribution">
<h2>Content Distribution</h2>
<p>A content distribution request is sent from the Hub to the Subscriber when new content is available for a topic URL. The request is an HTTP [[!RFC7231]] (or HTTPS [[!RFC2818]]) POST request from the hub to the subscriber's callback URL. The HTTP body of the POST request MUST include the payload of the content distribution notification. The content distribution request MUST have a <samp>Content-Type</samp> Header corresponding to the <samp>Content-Type</samp> of the topic, and MUST contain the full contents of the topic URL, with an exception allowed as described below.
</p>
<p>For Atom ([[RFC4287]]) and RSS ([[RSS-2.0]]) feeds, the hub MAY remove already-delivered <code>atom:entry</code> or <code>rss:item</code> elements from the feed.
</p>
<p>The request MUST include at least one Link Header [[!RFC5988]] with <samp>rel=hub</samp> pointing to a Hub associated with the topic being updated. It MUST also include one Link Header [[!RFC5988]] with <samp>rel=self</samp> set to the canonical URL of the topic being updated. The Hub SHOULD combine these headers into a single Link Header [[!RFC5988]]. All these URLs are those resulting from the discovery process (<a href="#discovery">Section 3</a>). The subscriber MUST NOT use these Link headers to identify the subscription corresponding to the content distribution request, because the Link headers are metadata associated with the topic content, not with any particular subscription. For example, the topic URL in the content distribution request may be different from the topic URL that was originally subscribed to.
</p>
<p>The subscriber's callback URL MUST return an HTTP [[!RFC7231]] 2xx response code to indicate a success. The subscriber's callback URL MAY return an HTTP 410 code to indicate that the subscription has been deleted, and the hub MAY terminate the subscription if it receives that code as a response. The hub MUST consider all other subscriber response codes as failures; that means subscribers MUST NOT use HTTP redirects for moving subscriptions. Subscribers SHOULD respond to content distribution requests as quickly as possible; their success response code SHOULD only indicate receipt of the message, not acknowledgment that it was successfully processed by the subscriber. The response body from the subscriber MUST be ignored by the hub. Hubs SHOULD retry content distribution requests up to self-imposed limits on the number of times and the overall time period to retry. When the failing delivery exceeds the hub's limits, the hub stops attempting to deliver that nofication. The hub MUST keep the subscription active until the end of the lease duration, and if a new update is published to the topic, MUST continue to retry delivery to the previously-failing subscriber.
</p>
<section id="authenticated-content-distribution">
<h2 id="signing-content">Authenticated Content Distribution</h2>
<p>If the subscriber supplied a value for <samp>hub.secret</samp> in their subscription request, the hub MUST generate an HMAC signature of the payload and include that signature in the request headers of the content distribution request. The <samp>X-Hub-Signature</samp> header's value MUST be in the form <samp>method=signature</samp> where <samp>method</samp> is one of the recognized algorithm names and <samp>signature</samp> is the hexadecimal representation of the signature. The signature MUST be computed using the HMAC algorithm [[!RFC6151]] with the request body as the data and the <samp>hub.secret</samp> as the key.</p>
<section id="recognized-algorithm-names">
<h3>Recognized algorithm names</h3>
<p>The following algorithms are the initially registered algorithm names, based on the contents of the [[FIPS-PUB-180-4]] registry at the time of publishing.</p>
<dl>
<dt>sha1</dt>
<dd>The SHA-1 algorithm as specified in Section 6.1 of [[FIPS-PUB-180-4]]</dd>
<dt>sha256</dt>
<dd>The SHA-256 algorithm as specified in Section 6.2 of [[FIPS-PUB-180-4]]</dd>
<dt>sha384</dt>
<dd>The SHA-384 algorithm as specified in Section 6.5 of [[FIPS-PUB-180-4]]</dd>
<dt>sha512</dt>
<dd>The SHA-512 algorithm as specified in Section 6.4 of [[FIPS-PUB-180-4]]</dd>
</dl>
<p>In the future, an extension may be specified allowing subscribers to indicate which algorithms they can use for validation. As of this writing, most hubs sign with SHA-1, despite its known cryptographic weakness, in order to be interoperable with older subscribers.</p>
</section>
<section id="signature-validation">
<h3>Signature validation</h3>
<p>When subscribers receive a content distribution request with the <samp>X-Hub-Signature</samp> header specified, they SHOULD recompute the signature with the shared secret using the same method (provided in the <samp>X-Hub-Signature</samp> header) as the hub. If the signature does not match, subscribers MUST locally ignore the message as invalid. Subscribers MAY still acknowledge this request with a 2xx response code in order to be able to process the message asynchronously and/or prevent brute-force attempts of the signature. Using this technique along with HTTPS [[!RFC2818]] for subscription requests enables simple subscribers to receive authenticated content distribution requests from hubs without the need for subscribers to run an HTTPS [[!RFC2818]] server.</p>
<p>Please note however that this signature only ensures that the payload was not forged. Since the request also includes headers, these should not be considered as safe by the subscriber, unless of course the subscriber uses HTTPS [[!RFC2818]] callbacks.</p>
</section>
</section>
</section>
<section id="security-considerations">
<h2>Security Considerations</h2>
<p>Here is a summary of security considerations. It is important to note that WebSub is a server-to-server protocol which relies only on HTTP. It is strongly recommended to use HTTPS for all requests.</p>
<section>
<h3>Discovery</h3>
<p>The decision about whether a subscriber should look for <samp><link></samp> elements inside a page's <samp><body></samp> (as well as the <samp><head></samp>) is not straightforward, and there is currently no clear consensus. One reason to ignore the <samp><body></samp> during discovery is that some web sites might (perhaps accidentally) allow users to post content containing <samp><link></samp> elements, though the working group does not know of any specific examples of such sites. If WebSub discovery uses such <samp><link></samp> elements, a user contributing to such sites could potentially maliciously cause all subscribers to use an alternate hub which later delivers malicious content. Given this potential attack, it may be prudent to do discovery only in the <samp><head></samp> of HTML documents.</p>
</section>
<section>
<h3>Subscriptions</h3>
<p>First, subscribers SHOULD always favor the HTTPS URL for hubs (even if the URL is advertised as HTTP). Second, subscribers SHOULD use unique unguessable capability URLs for the callbacks, as well as make them available via HTTPS. Finally, subscribers SHOULD use a <samp>hub.secret</samp> when subscribing to allow signature of the content distribution.</p>
<p>Hubs SHOULD enforce short lived <samp>hub.lease_seconds</samp> (10 days is a good default). When performing intent verification, the hub SHOULD use a random, single-use <samp>hub.challenge</samp>.</p>
</section>
<section>
<h3>Distribution</h3>
<p>The Hub MUST use the exact callback used by the subscriber (including the use of HTTPS). Hubs MUST sign their requests using the <samp>hub.secret</samp> supplied by subscribers if requested.</p>
<p>If the subscriber included a hub.secret in the subscription request, the subscriber SHOULD validate the hub's provided signature, and if they do so, they MUST use the server's stated signature mechanism, and discard requests which fail the test.</p>
<p>If a subscriber does not use a secure callback URL (HTTPS), or if it is suspected that the TLS transport between the hub and subscriber may be compromised, then the integrity of the content delivery notification is only protected by the <samp>hub.secret</samp> and the hashing algorithm used. In this case, an appropriate hashing algorithm should be used based on the security requirements of the application. As SHA-1 has been demonstrated to be compromised as of the date of this publication, a minimum of SHA-256 should be used.</samp></p>
</section>
<section id="security-and-privacy-review">
<h3>Security and Privacy Review</h3>
<p>These questions provide an overview of security and privacy considerations for this specification as guided by Self-Review Questionnaire: Security and Privacy ([[security-privacy-questionnaire]]).</p>
<dl>
<dt>Does this specification deal with personally-identifiable information?</dt>
<dd>The only potentially personally-identifiable information involved are topic and callback URLs.</dd>
<dt>Does this specification deal with high-value data?</dt>
<dd>No, there is no authentication or other credentials involved.</dd>
<dt>Does this specification introduce new state for an origin that persists across browsing sessions?</dt>
<dd>No.</dd>
<dt>Does this specification expose persistent, cross-origin state to the web?</dt>
<dd>The WebSub subscriber should create a resource with information about the topic to which it subscribes.</dd>
<dt>Does this specification expose any other data to an origin that it doesn't currently have access to?</dt>
<dd>No.</dd>
<dt>Does this specification enable new script execution/loading mechanisms?</dt>
<dd>No.</dd>
<dt>Does this specification allow an origin access to a user's location?</dt>
<dd>No.</dd>
<dt>Does this specification allow an origin access to sensors on a user's device?</dt>
<dd>No.</dd>
<dt>Does this specification allow an origin access to aspects of a user's local computing environment?</dt>
<dd>No.</dd>
<dt>Does this specification allow an origin access to other devices?</dt>
<dd>No.</dd>
<dt>Does this specification allow an origin some measure of control over a user agent's native UI?</dt>
<dd>No.</dd>
<dt>Does this specification expose temporary identifiers to the web?</dt>
<dd>No.</dd>
<dt>Does this specification distinguish between behavior in first-party and third-party contexts?</dt>
<dd>No.</dd>
<dt>How should this specification work in the context of a user agent's "incognito" mode?</dt>
<dd>WebSub is a server to server protocol, in which "incognito" mode does not have a meaning.</dd>
<dt>Does this specification persist data to a user's local device?</dt>
<dd>No.</dd>
<dt>Does this specification allow downgrading default security characteristics?</dt>
<dd>No.</dd>
</dl>
</section>
</section>
<section class="appendix informative">
<h2>Acknowledgements</h2>
<p>The editors wish to thank the authors of PubSubHubbub, the IndieWeb community, and other implementers for their support, encouragement and enthusiasm. In particular, the editors wish to thank
<a href="https://bradfitz.com/">Brad Fitzpatrick</a>,
<a href="http://www.onebigfluke.com/">Brett Slatkin</a>,
<a href="http://martin.atkins.me.uk/">Martin Atkins</a>,
<a href="http://rhiaro.co.uk/">Amy Guy</a>,
<a href="https://barryfrost.com/">Barry Frost</a>,
<a href="https://ben.thatmustbe.me/">Benjamin Roberts</a>,
<a href="https://zeonfederated.com/">Eugen Rochko</a>,
<a href="https://github.com/twitch-jordanpotter">Jordan Potter</a>,
<a href="https://notiz.blog/">Matthias Pfefferle</a>,
<a href="https://unicyclic.com/mal/">Malcolm Blaney</a>,
<a href="https://ma.rtendevri.es/">Marten de Vries</a>,
<a href="http://hawke.org/sandro/">Sandro Hawke</a>,
<a href="http://tantek.com/">Tantek Çelik</a>,
and
<a href="https://eighty-twenty.org/">Tony Garnock-Jones</a>.
</section>
<section class="appendix informative">
<h2>Change Log</h2>
<section>
<h3>Changes from 03 October 2017 PR to this version</h3>
<ul>
<li>Added link to content negotiation section from corresponding item in conformance criteria</li>
<li>Updated reference name from "WHATWG-URL" to "[[URL]]", but does not change the actual reference.</li>
<li>Rephrase sentence on hub URL discovery to better clarify which URLs are being talked about, and use "notify" instead of "ping"</li>
<li>Correct "mime-type" to "Media Type" and add informative reference to RFC.</li>
<li>Rephrase summary of "subscribing and unsubscribing" to explicitly mention the actor of each step</li>
<li>Clarify sending the POST request to the subscriber's callback URL</li>
<li>Add reference to HTTPS when previously only HTTP was mentioned in cases where an HTTPS URL may be used</li>
<li>Clarify when hub.lease_seconds parameter is required or optional</li>
<li>Reword section on subscription migration to make it more clear</li>
<li>Move note about publisher->hub notification outside of the subscription migration section</li>
<li>Remove references to "notification" as a standalone term, replaced by "content distribution request" or "content distribution notification" as appropriate</li>
<li>Update CR exit criteria text to past tense</li>
<li>Added explanatory text about why a publisher may advertise multiple hubs</li>
<li>Replaced sentence in section 8 to better describe the situation "the topic URL in the content distribution request may be different from the topic URL that was originally subscribed to"</li>
<li>Dropped at-risk limitation of the link tag in the head</li>
<li>Added security consideration for discovery related to link rel discovery in body vs head</li>
<li>Dropped unused feature of the hub rejecting the subscription and providing an alternate topic URL</li>
<li>Added sequence diagram in high-level overview section, and minor updates to phrasing of that section</li>
<li>Added acknowledgements</li>
<li>Note that hubs may set a default value for lease_seconds</li>
</ul>
</section>
<section>
<h3>Changes from 11 April 2017 CR to 03 October 2017 PR</h3>
<ul>
<li>Adds informative guidelines for how publishers can migrate subscribers to a new topic URL</li>
<li>Allow subscribers to reject invalid signatures with response codes other than 2xx</li>
<li>Suggest subscribers return HTTP 410 if a subscription has been deleted</li>
<li>Add informative note about the lack of specification of publisher-hub relationship</li>
<li>Drop at-risk <code>.host-meta</code> discovery feature due to lack of implementations (<a href="https://github.com/w3c/websub/issues/97">Issue #97</a>)</li>
<li>Add text to note the subscriber's <code>hub.secret</code> should be cryptographically random and unique</li>
<li>Clarify that failed delivery of notifications should not delete the subscription before the lease duration ends (<a href="https://github.com/w3c/websub/issues/119">Issue #119</a>)</li>
<li>Replaced note about referring to FIPS document for algorithm extensions with a note that says a proper WebSub extension should be defined in the future that enables negotiation of the hashing algorithm between subscribers and hubs</li>
<li>Add example of returning a different rel=self URL depending on the HTTP <code>Accept-Language</code> header</li>
<li>Add a note in Security Considerations about the hashing algorithm protecting against a compromised TLS channel</li>
<li>Clarify security consideration section regarding signature validation</li>
<li>Moved "at risk" section out of the "sotd" section which was causing a respec error</li>
<li>Replaced hyperlink to FIPS PUB 180-4 with an in-page reference</li>
</ul>
</section>
<section>
<h3>Changes from 24 November WD to 11 April 2017 CR</h3>
<ul>
<li>Clarified wording on supported algorithms for authenticated distribution</li>
<li>Only allow <code><link></code> tags in the HTML <head> element</li>
<li>Added conformance criteria and CR exit criteria</li>
<li>Added examples of discovery request and response</li>
<li>Added example of using different <code>rel=self</code> URLs to support content negotiation</li>
<li>Added a security considerations section</li>
<li>Updated references to WHATWG-URL instead of HTML 4</li>
<li>Replaced abstract with updated description</li>
</ul>
</section>
<section>
<h3>Changes from 20 October FPWD to 24 November 2016</h3>
<ul>
<li>Added informative reference to previous versions of the spec, PubSubHubbub 0.3 and 0.4</li>
<li>Split discovery section into separate publisher and subscriber sections</li>
<li>Clarify that publishers can use any available discovery method, and subscribers must support all</li>
<li>Marked host-meta discovery method At Risk due to no known implementations, and fixed reference to Host Meta spec instead of the previous reference to Well-Known</li>
<li>Recommend using Capability URLs as the subscriber's callback URLs for security and authenticating the notification delivery</li>
<li>Recommend not reusing callback URLs on subscription renewals</li>
<li>Clarify that the <code>hub.topic</code> must be the <code>self</code> URL that was discovered</li>
<li>Dropped the recommendation of including the <code>From</code> header on subscription requests</li>
<li>Clarify that the hub response to subscription requests must not depend on the verification or validation</li>
<li>Hubs must enforce lease expirations</li>
<li>Clarify that the notification payload should contain the full contents of the topic URL</li>
<li>Recommend that hubs should retry failed notification delivery up to self-imposed limits</li>
<li>Clarify that future defined signature methods in FIPS PUB 180-4 are allowed</li>
<li>Added informative note about the use of GET vs POST at the callback URL</li>
<li>Renamed the spec to WebSub</li>
</ul>
</section>
</section>
<script>
// After text is selected (mouseup), find the closest element that has an ID
// attribute, and update the browser location bar to include that as the fragment
document.body.onmouseup = function(){
var selection;
if(selection=window.getSelection()) {
var range = selection.getRangeAt(0);
var el = range.startContainer;
while((el=el.parentElement) && !el.attributes["id"]);
var hash = el.attributes["id"].value;
if(history.replaceState) {
history.replaceState(null, null, "#"+hash);
}
}
};
</script>
</body>
</html>