forked from w3c/websub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1213 lines (1079 loc) · 97.3 KB
/
index.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
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!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 charset="utf-8"><meta name="generator" content="ReSpec 19.0.1"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><style>/* --- EXAMPLES --- */
div.example-title {
min-width: 7.5em;
color: #b9ab2d;
}
div.example-title span {
text-transform: uppercase;
}
aside.example, div.example, div.illegal-example {
padding: 0.5em;
margin: 1em 0;
position: relative;
clear: both;
}
div.illegal-example { color: red }
div.illegal-example p { color: black }
aside.example, div.example {
padding: .5em;
border-left-width: .5em;
border-left-style: solid;
border-color: #e0cb52;
background: #fcfaee;
}
aside.example div.example {
border-left-width: .1em;
border-color: #999;
background: #fff;
}
aside.example div.example div.example-title {
color: #999;
}
</style><style>/* --- ISSUES/NOTES --- */
div.issue-title, div.note-title , div.ednote-title, div.warning-title {
padding-right: 1em;
min-width: 7.5em;
color: #b9ab2d;
}
div.issue-title { color: #e05252; }
div.note-title, div.ednote-title { color: #2b2; }
div.warning-title { color: #f22; }
div.issue-title span, div.note-title span, div.ednote-title span, div.warning-title span {
text-transform: uppercase;
}
div.note, div.issue, div.ednote, div.warning {
margin-top: 1em;
margin-bottom: 1em;
}
.note > p:first-child, .ednote > p:first-child, .issue > p:first-child, .warning > p:first-child { margin-top: 0 }
.issue, .note, .ednote, .warning {
padding: .5em;
border-left-width: .5em;
border-left-style: solid;
}
div.issue, div.note , div.ednote, div.warning {
padding: 1em 1.2em 0.5em;
margin: 1em 0;
position: relative;
clear: both;
}
span.note, span.ednote, span.issue, span.warning { padding: .1em .5em .15em; }
.issue {
border-color: #e05252;
background: #fbe9e9;
}
.note, .ednote {
border-color: #52e052;
background: #e9fbe9;
}
.warning {
border-color: #f11;
border-width: .2em;
border-style: solid;
background: #fbe9e9;
}
.warning-title:before{
content: "⚠"; /*U+26A0 WARNING SIGN*/
font-size: 3em;
float: left;
height: 100%;
padding-right: .3em;
vertical-align: top;
margin-top: -0.5em;
}
li.task-list-item {
list-style: none;
}
input.task-list-item-checkbox {
margin: 0 0.35em 0.25em -1.6em;
vertical-align: middle;
}
</style>
<meta lang="" property="dc:language" content="en">
<title>WebSub</title>
<link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/W3C-WD">
<link rel="pingback" href="https://webmention.io/w3c/xmlrpc">
<link rel="webmention" href="https://webmention.io/w3c/webmention">
<style id="respec-mainstyle">/*****************************************************************
* ReSpec 3 CSS
* Robin Berjon - http://berjon.com/
*****************************************************************/
/* Override code highlighter background */
.hljs {
background: transparent !important;
}
/* --- INLINES --- */
h1 abbr,
h2 abbr,
h3 abbr,
h4 abbr,
h5 abbr,
h6 abbr,
a abbr {
border: none;
}
dfn {
font-weight: bold;
}
a.internalDFN {
color: inherit;
border-bottom: 1px solid #99c;
text-decoration: none;
}
a.externalDFN {
color: inherit;
border-bottom: 1px dotted #ccc;
text-decoration: none;
}
a.bibref {
text-decoration: none;
}
cite .bibref {
font-style: normal;
}
code {
color: #c83500;
}
th code {
color: inherit;
}
/* --- TOC --- */
.toc a,
.tof a {
text-decoration: none;
}
a .secno,
a .figno {
color: #000;
}
ul.tof,
ol.tof {
list-style: none outside none;
}
.caption {
margin-top: 0.5em;
font-style: italic;
}
/* --- TABLE --- */
table.simple {
border-spacing: 0;
border-collapse: collapse;
border-bottom: 3px solid #005a9c;
}
.simple th {
background: #005a9c;
color: #fff;
padding: 3px 5px;
text-align: left;
}
.simple th[scope="row"] {
background: inherit;
color: inherit;
border-top: 1px solid #ddd;
}
.simple td {
padding: 3px 10px;
border-top: 1px solid #ddd;
}
.simple tr:nth-child(even) {
background: #f0f6ff;
}
/* --- DL --- */
.section dd > p:first-child {
margin-top: 0;
}
.section dd > p:last-child {
margin-bottom: 0;
}
.section dd {
margin-bottom: 1em;
}
.section dl.attrs dd,
.section dl.eldef dd {
margin-bottom: 0;
}
#issue-summary > ul,
.respec-dfn-list {
column-count: 2;
}
#issue-summary li,
.respec-dfn-list li {
list-style: none;
}
details.respec-tests-details {
margin-left: 1em;
display: inline-block;
vertical-align: top;
}
details.respec-tests-details > * {
padding-right: 2em;
}
details.respec-tests-details[open] {
z-index: 999999;
position: absolute;
border: thin solid #cad3e2;
border-radius: .3em;
background-color: white;
padding-bottom: .5em;
}
details.respec-tests-details[open] > summary {
border-bottom: thin solid #cad3e2;
padding-left: 1em;
margin-bottom: 1em;
line-height: 2em;
}
details.respec-tests-details > ul {
width: 100%;
margin-top: -0.3em;
}
details.respec-tests-details > li {
padding-left: 1em;
}
@media print {
.removeOnSave {
display: none;
}
}
</style><style>/*
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #333;
background: #f8f8f8;
}
.hljs-comment,
.hljs-quote {
color: #998;
font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
color: #333;
font-weight: bold;
}
.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
color: #008080;
}
.hljs-string,
.hljs-doctag {
color: #d14;
}
.hljs-title,
.hljs-section,
.hljs-selector-id {
color: #900;
font-weight: bold;
}
.hljs-subst {
font-weight: normal;
}
.hljs-type,
.hljs-class .hljs-title {
color: #458;
font-weight: bold;
}
.hljs-tag,
.hljs-name,
.hljs-attribute {
color: #000080;
font-weight: normal;
}
.hljs-regexp,
.hljs-link {
color: #009926;
}
.hljs-symbol,
.hljs-bullet {
color: #990073;
}
.hljs-built_in,
.hljs-builtin-name {
color: #0086b3;
}
.hljs-meta {
color: #999;
font-weight: bold;
}
.hljs-deletion {
background: #fdd;
}
.hljs-addition {
background: #dfd;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
</style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2016/W3C-ED"><link rel="canonical" href="https://www.w3.org/TR/websub/"><script id="initialUserConfig" type="application/json">{
"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"
}
},
"publishISODate": "2017-12-19T00:00:00.000Z",
"generatedSubtitle": "Editor's Draft 19 December 2017"
}</script><meta name="description" content="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."></head>
<body aria-busy="false" class="h-entry"><div class="head">
<p>
<a class="logo" href="https://www.w3.org/"><img width="72" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" alt="W3C"></a>
</p>
<p><!--_hyper: 167453307;--></p>
<h1 class="title p-name" id="title">WebSub</h1>
<h2 id="w3c-editor-s-draft-19-december-2017"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time class="dt-published" datetime="2017-12-19">19 December 2017</time></h2>
<dl>
<dt>This version:</dt>
<dd><a class="u-url" href="https://websub.net/draft">https://websub.net/draft</a></dd>
<dt>Latest published version:</dt>
<dd><a href="https://www.w3.org/TR/websub/">https://www.w3.org/TR/websub/</a></dd>
<dt>Latest editor's draft:</dt>
<dd><a href="https://websub.net/draft">https://websub.net/draft</a></dd>
<dt>Test suite:</dt>
<dd><a href="https://websub.rocks/">https://websub.rocks/</a></dd>
<dt>Implementation report:</dt>
<dd><a href="https://websub.net/implementation-reports">https://websub.net/implementation-reports</a></dd>
<dt>Editors:</dt>
<dd class="p-author h-card vcard" data-editor-id="49792"><a class="u-url url p-name fn" href="https://www.ouvre-boite.com/">Julien Genestoux</a>, Invited Expert</dd>
<dd class="p-author h-card vcard" data-editor-id="59996"><a class="u-url url p-name fn" href="https://aaronparecki.com/">Aaron Parecki</a>, Invited Expert</dd>
<dt>Author:</dt>
<dd class="p-author h-card vcard"><span class="p-name fn">Julien Genestoux</span></dd>
<dt>Past Authors:</dt>
<dd>
<a href="https://bradfitz.com/">
Brad Fitzpatrick
</a>
</dd>
<dd>
<a href="http://www.onebigfluke.com/">
Brett Slatkin
</a>
</dd>
<dd>
<a href="http://martin.atkins.me.uk/">
Martin Atkins
</a>
</dd>
<dt>Repository:</dt>
<dd>
<a href="https://github.com/w3c/websub">
Github
</a>
</dd>
<dd>
<a href="https://github.com/w3c/websub/issues">
Issues
</a>
</dd>
<dd>
<a href="https://github.com/w3c/websub/commits/master">
Commits
</a>
</dd>
</dl>
<p>
Please check the <a href="https://websub.net/errata"><strong>errata</strong></a> for any errors or issues
reported since publication.
</p>
<p class="copyright">
<a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ©
2017
<a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup>
(<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
<a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
<a href="https://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>).
<abbr title="World Wide Web Consortium">W3C</abbr> <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
<a rel="license" href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document">permissive document license</a>
rules apply.
</p>
<hr title="Separator for header">
</div>
<section id="abstract" class="introductory"><h2 id="abstract-0">Abstract</h2>
<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" class="introductory"><h2 id="status-of-this-document">Status of This Document</h2>
<p>
<em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision of this technical report can be found in the <a href="https://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports index</a> at https://www.w3.org/TR/.</em>
</p>
<p>
This document was published by the <a href="https://www.w3.org/Social/WG">Social Web Working Group</a> as an Editor's Draft.
Comments regarding this document are welcome. Please send them to
<a href="mailto:public-socialweb@w3.org">public-socialweb@w3.org</a>
(<a href="mailto:public-socialweb-request@w3.org?subject=subscribe">subscribe</a>,
<a href="https://lists.w3.org/Archives/Public/public-socialweb/">archives</a>).
</p>
<p>
Please see the Working Group's <a href="https://websub.net/implementation-reports">implementation
report</a>.
</p>
<p>
Publication as an Editor's Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr>
Membership. This is a draft document and may be updated, replaced or obsoleted by other
documents at any time. It is inappropriate to cite this document as other than work in
progress.
</p>
<p>
This document was produced by
a group
operating under the
<a href="https://www.w3.org/Consortium/Patent-Policy/"><abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
<abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="https://www.w3.org/2004/01/pp-impl/72531/status" rel="disclosure">public list of any patent
disclosures</a>
made in connection with the deliverables of
the group; that page also includes
instructions for disclosing a patent. An individual who has actual knowledge of a patent
which the individual believes contains
<a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with
<a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section
6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
</p>
<p>This document is governed by the <a id="w3c_process_revision" href="https://www.w3.org/2017/Process-20170301/">1 March 2017 <abbr title="World Wide Web Consortium">W3C</abbr> Process Document</a>.
</p>
</section><nav id="toc"><h2 class="introductory" id="table-of-contents">Table of Contents</h2><ol class="toc"><li class="tocline"><a href="#definitions" class="tocxref"><span class="secno">1. </span>Definitions</a></li><li class="tocline"><a href="#high-level-protocol-flow" class="tocxref"><span class="secno">2. </span>High-level protocol flow</a></li><li class="tocline"><a href="#conformance" class="tocxref"><span class="secno">3. </span>Conformance</a><ol class="toc"><li class="tocline"><a href="#conformance-classes" class="tocxref"><span class="secno">3.1 </span>Conformance Classes</a></li><li class="tocline"><a href="#candidate-recommendation-exit-criteria" class="tocxref"><span class="secno">3.2 </span>Candidate Recommendation Exit Criteria</a><ol class="toc"><li class="tocline"><a href="#publisher" class="tocxref"><span class="secno">3.2.1 </span>Publisher</a></li><li class="tocline"><a href="#subscriber" class="tocxref"><span class="secno">3.2.2 </span>Subscriber</a></li><li class="tocline"><a href="#hub" class="tocxref"><span class="secno">3.2.3 </span>Hub</a></li><li class="tocline"><a href="#independent" class="tocxref"><span class="secno">3.2.4 </span>Independent</a></li><li class="tocline"><a href="#interoperable" class="tocxref"><span class="secno">3.2.5 </span>Interoperable</a></li><li class="tocline"><a href="#feature" class="tocxref"><span class="secno">3.2.6 </span>Feature</a></li></ol></li></ol></li><li class="tocline"><a href="#discovery" class="tocxref"><span class="secno">4. </span>Discovery</a><ol class="toc"><li class="tocline"><a href="#content-negotiation" class="tocxref"><span class="secno">4.1 </span>Content Negotiation</a></li></ol></li><li class="tocline"><a href="#subscribing-and-unsubscribing" class="tocxref"><span class="secno">5. </span>Subscribing and Unsubscribing</a><ol class="toc"><li class="tocline"><a href="#subscriber-sends-subscription-request" class="tocxref"><span class="secno">5.1 </span>Subscriber Sends Subscription Request</a><ol class="toc"><li class="tocline"><a href="#subscription-parameter-details" class="tocxref"><span class="secno">5.1.1 </span>Subscription Parameter Details</a></li><li class="tocline"><a href="#subscription-response-details" class="tocxref"><span class="secno">5.1.2 </span>Subscription Response Details</a></li></ol></li><li class="tocline"><a href="#subscription-validation" class="tocxref"><span class="secno">5.2 </span>Subscription Validation</a></li><li class="tocline"><a href="#hub-verifies-intent" class="tocxref"><span class="secno">5.3 </span>Hub Verifies Intent of the Subscriber</a><ol class="toc"><li class="tocline"><a href="#verification-details" class="tocxref"><span class="secno">5.3.1 </span>Verification Details</a></li></ol></li></ol></li><li class="tocline"><a href="#publishing" class="tocxref"><span class="secno">6. </span>Publishing</a><ol class="toc"><li class="tocline"><a href="#subscription-migration" class="tocxref"><span class="secno">6.1 </span>Subscription Migration</a></li></ol></li><li class="tocline"><a href="#content-distribution" class="tocxref"><span class="secno">7. </span>Content Distribution</a><ol class="toc"><li class="tocline"><a href="#signing-content" class="tocxref"><span class="secno">7.1 </span>Authenticated Content Distribution</a><ol class="toc"><li class="tocline"><a href="#recognized-algorithm-names" class="tocxref"><span class="secno">7.1.1 </span>Recognized algorithm names</a></li><li class="tocline"><a href="#signature-validation" class="tocxref"><span class="secno">7.1.2 </span>Signature validation</a></li></ol></li></ol></li><li class="tocline"><a href="#security-considerations" class="tocxref"><span class="secno">8. </span>Security Considerations</a><ol class="toc"><li class="tocline"><a href="#discovery-0" class="tocxref"><span class="secno">8.1 </span>Discovery</a></li><li class="tocline"><a href="#subscriptions" class="tocxref"><span class="secno">8.2 </span>Subscriptions</a></li><li class="tocline"><a href="#distribution" class="tocxref"><span class="secno">8.3 </span>Distribution</a></li><li class="tocline"><a href="#security-and-privacy-review" class="tocxref"><span class="secno">8.4 </span>Security and Privacy Review</a></li></ol></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">A. </span>Acknowledgements</a></li><li class="tocline"><a href="#change-log" class="tocxref"><span class="secno">B. </span>Change Log</a><ol class="toc"><li class="tocline"><a href="#changes-from-03-october-2017-pr-to-this-version" class="tocxref"><span class="secno">B.1 </span>Changes from 03 October 2017 PR to this version</a></li><li class="tocline"><a href="#changes-from-11-april-2017-cr-to-03-october-2017-pr" class="tocxref"><span class="secno">B.2 </span>Changes from 11 April 2017 CR to 03 October 2017 PR</a></li><li class="tocline"><a href="#changes-from-24-november-wd-to-11-april-2017-cr" class="tocxref"><span class="secno">B.3 </span>Changes from 24 November WD to 11 April 2017 CR</a></li><li class="tocline"><a href="#changes-from-20-october-fpwd-to-24-november-2016" class="tocxref"><span class="secno">B.4 </span>Changes from 20 October FPWD to 24 November 2016</a></li></ol></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">C. </span>References</a><ol class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">C.1 </span>Normative references</a></li><li class="tocline"><a href="#informative-references" class="tocxref"><span class="secno">C.2 </span>Informative references</a></li></ol></li></ol></nav>
<section id="definitions">
<!--OddPage--><h2 id="x1-definitions"><span class="secno">1. </span>Definitions</h2>
<dl>
<dt><dfn data-dfn-type="dfn" id="dfn-topic">Topic</dfn></dt>
<dd>An HTTP [<cite><a class="bibref" href="#bib-RFC7230">RFC7230</a></cite>] (or HTTPS [<cite><a class="bibref" href="#bib-RFC2818">RFC2818</a></cite>]) resource URL. The unit to which one can subscribe to changes.</dd>
<dt><dfn data-dfn-type="dfn" id="dfn-hub-the-hub">Hub ("the hub")</dfn></dt>
<dd>The server (URL [<cite><a class="bibref" href="#bib-URL">URL</a></cite>]) which implements both sides of this protocol. Any hub <em class="rfc2119" title="MAY">MAY</em> implement its own policies on who can use it.</dd>
<dt><dfn data-dfn-type="dfn" id="dfn-publisher">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 data-dfn-type="dfn" id="dfn-subscriber">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 data-dfn-type="dfn" id="dfn-subscription">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 data-dfn-type="dfn" id="dfn-subscriber-callback-url">Subscriber Callback URL</dfn></dt>
<dd>The URL [<cite><a class="bibref" href="#bib-URL">URL</a></cite>] at which a subscriber wishes to receive content distribution requests. </dd>
<dt><dfn data-dfn-type="dfn" id="dfn-event">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 data-dfn-type="dfn" id="dfn-content-distribution-notification">Content Distribution Notification</dfn> / <dfn data-dfn-type="dfn" id="dfn-content-distribution-request">(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">
<!--OddPage--><h2 id="x2-high-level-protocol-flow"><span class="secno">2. </span>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"></rect><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><path paint-order="fill stroke markers" d="M323.1 95.9L323.1 422.6" class="c"></path><path paint-order="fill stroke markers" d="M585.2 95.9L585.2 422.6" class="c"></path><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"></path><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"></path><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"></path><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><rect x="89.6" y="144.9" width="204.9" height="21.2" class="a"></rect><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><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"></text><path paint-order="fill stroke markers" d="M60.9 166.1L323.1 166.1" class="g"></path><path paint-order="stroke fill markers" d="M309.5 159.3L323.1 166.1 309.5 172.9Z" class="b"></path><rect x="80.3" y="190.6" width="485.6" height="21.2" class="a"></rect><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"></text><path paint-order="fill stroke markers" d="M60.9 211.9L585.2 211.9" class="g"></path><path paint-order="stroke fill markers" d="M571.6 205.1L585.2 211.9 571.6 218.7Z" class="b"></path><rect x="163.8" y="236.4" width="318.6" height="21.2" class="a"></rect><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><path paint-order="stroke fill markers" d="M74.5 250.8L60.9 257.6 74.5 264.4Z" class="b"></path><rect x="368.2" y="282.1" width="171.9" height="21.2" class="a"></rect><rect x="368.2" y="298.4" width="100.3" height="21.2" class="a"></rect><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><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><path paint-order="stroke fill markers" d="M571.6 312.9L585.2 319.7 571.6 326.5Z" class="b"></path><rect x="105.1" y="344.2" width="435.9" height="21.2" class="a"></rect><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><path paint-order="stroke fill markers" d="M74.5 358.6L60.9 365.4 74.5 372.2Z" class="b"></path></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 [<cite><a class="bibref" href="#bib-PubSubHubbub-Core-0.3">PubSubHubbub-Core-0.3</a></cite>]</li>
<li>Working Draft 0.4 [<cite><a class="bibref" href="#bib-PubSubHubbub-Core-0.4">PubSubHubbub-Core-0.4</a></cite>]</li>
</ul>
</section>
<section id="conformance">
<!--OddPage--><h2 id="x3-conformance"><span class="secno">3. </span>Conformance</h2>
<p>The key words "<em class="rfc2119" title="MUST">MUST</em>", "<em class="rfc2119" title="MUST NOT">MUST NOT</em>", "<em class="rfc2119" title="REQUIRED">REQUIRED</em>", "<em class="rfc2119" title="SHALL">SHALL</em>", "<em class="rfc2119" title="SHALL NOT">SHALL NOT</em>",
"<em class="rfc2119" title="SHOULD">SHOULD</em>", "<em class="rfc2119" title="SHOULD NOT">SHOULD NOT</em>", "<em class="rfc2119" title="RECOMMENDED">RECOMMENDED</em>", "<em class="rfc2119" title="MAY">MAY</em>", and "<em class="rfc2119" title="OPTIONAL">OPTIONAL</em>" in this
document are to be interpreted as described in [<cite><a class="bibref" href="#bib-RFC2119">RFC2119</a></cite>].</p>
<section id="conformance-classes">
<h3 id="x3-1-conformance-classes"><span class="secno">3.1 </span>Conformance Classes</h3>
<p>WebSub describes three roles: publishers, subscribers and hubs. This section describes the conformance criteria for each role.</p>
<h3 id="publishers">Publishers</h3>
<ul>
<li>A conforming publisher <em class="rfc2119" title="MUST">MUST</em> advertise topic and hub URLs for a given resource URL as described in <a href="#discovery">Discovery</a>.</li>
</ul>
<h3 id="subscribers">Subscribers</h3>
<p>A conforming subscriber:</p>
<ul>
<li><em class="rfc2119" title="MUST">MUST</em> 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><em class="rfc2119" title="MUST">MUST</em> send a subscription request as described in <a href="#subscriber-sends-subscription-request">Subscriber Sends Subscription Request</a>.</li>
<li><em class="rfc2119" title="MAY">MAY</em> request a specific lease duration</li>
<li><em class="rfc2119" title="MAY">MAY</em> include a secret in the subscription request, and if it does, then <em class="rfc2119" title="MUST">MUST</em> use the secret to verify the signature in the <a href="#authenticated-content-distribution">content distribution request</a>.</li>
<li><em class="rfc2119" title="MUST">MUST</em> acknowledge a content distribution request with an HTTP 2xx status code.</li>
<li><em class="rfc2119" title="MAY">MAY</em> request that a subscription is deactivated using the "unsubscribe" mechanism.</li>
</ul>
<h4 id="hubs">Hubs</h4>
<p>A conforming hub:</p>
<ul>
<li><em class="rfc2119" title="MUST">MUST</em> accept a subscription request with the parameters <code>hub.callback</code>, <code>hub.mode</code> and <code>hub.topic</code>.</li>
<li><em class="rfc2119" title="MUST">MUST</em> accept a subscription request with a <code>hub.secret</code> parameter.</li>
<li><em class="rfc2119" title="MAY">MAY</em> respect the requested lease duration in subscription requests.</li>
<li><em class="rfc2119" title="MUST">MUST</em> allow subscribers to re-request already active subscriptions.</li>
<li><em class="rfc2119" title="MUST">MUST</em> support unsubscription requests.</li>
<li><em class="rfc2119" title="MUST">MUST</em> send content distribution requests with a matching content type of the topic URL. (See <a href="#content-negotiation">Content Negotiation</a>)</li>
<li><em class="rfc2119" title="MAY">MAY</em> 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><em class="rfc2119" title="MUST">MUST</em> 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 id="candidate-recommendation-exit-criteria">
<h3 id="x3-2-candidate-recommendation-exit-criteria"><span class="secno">3.2 </span>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 id="publisher">
<h4 id="x3-2-1-publisher"><span class="secno">3.2.1 </span>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 id="subscriber">
<h4 id="x3-2-2-subscriber"><span class="secno">3.2.2 </span>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 <em class="rfc2119" title="MAY">MAY</em> 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 id="hub">
<h4 id="x3-2-3-hub"><span class="secno">3.2.3 </span>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 <em class="rfc2119" title="MUST">MUST</em> support subscription requests with a secret and deliver <a href="#authenticated-content-distribution">authenticated requests</a> when requested. Hubs <em class="rfc2119" title="MUST">MUST</em> deliver the full contents of the topic URL in the request, and <em class="rfc2119" title="MAY">MAY</em> 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 id="independent">
<h4 id="x3-2-4-independent"><span class="secno">3.2.4 </span>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 id="interoperable">
<h4 id="x3-2-5-interoperable"><span class="secno">3.2.5 </span>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 id="feature">
<h4 id="x3-2-6-feature"><span class="secno">3.2.6 </span>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">
<!--OddPage--><h2 id="x4-discovery"><span class="secno">4. </span>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>
<div class="note"><div role="heading" class="note-title marker" id="h-note" aria-level="3"><span>Note</span></div><p class="">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 hub is a way to increase the liklihood of delivery to subscribers. As such, subscribers may subscribe to one or more of the advertised hubs.</p></div>
<p>The protocol currently supports the following discovery mechanisms. Publishers <em class="rfc2119" title="MUST">MUST</em> implement at least one of them:</p>
<ul>
<li>Link Headers [<cite><a class="bibref" href="#bib-RFC5988">RFC5988</a></cite>]: the publisher <em class="rfc2119" title="SHOULD">SHOULD</em> include at least one Link Header [<cite><a class="bibref" href="#bib-RFC5988">RFC5988</a></cite>] with <samp>rel=hub</samp> (a hub link header) as well as exactly one Link Header [<cite><a class="bibref" href="#bib-RFC5988">RFC5988</a></cite>] with <samp>rel=self</samp> (the self link header)</li>
<li>If the topic is an XML based feed, publishers <em class="rfc2119" title="SHOULD">SHOULD</em> use embedded link elements as described in Appendix B of Web Linking [<cite><a class="bibref" href="#bib-RFC5988">RFC5988</a></cite>]. Similarly, for HTML pages, publishers <em class="rfc2119" title="SHOULD">SHOULD</em> use embedded link elements as described in Appendix A of Web Linking [<cite><a class="bibref" href="#bib-RFC5988">RFC5988</a></cite>].</li>
</ul>
<div class="note"><div role="heading" class="note-title marker" id="h-note-0" aria-level="3"><span>Note</span></div><p class="">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></div>
<div class="example"><div class="example-title marker"><span>Example 1</span></div><pre class="hljs http" aria-busy="false" aria-live="polite"><span class="hljs-keyword">GET</span> <span class="hljs-string">/feed</span> HTTP/1.1
<span class="hljs-attribute">Host</span>: example.com
<span class="http">HTTP/1.1 <span class="hljs-number">200</span> Ok
<span class="hljs-attribute">Content-type</span>: text/html
<span class="hljs-attribute">Link</span>: <https://hub.example.com/>; rel="hub"
<span class="hljs-attribute">Link</span>: <http://example.com/feed>; rel="self"
<span class="xml"><span class="hljs-meta"><!doctype html></span>
<span class="hljs-tag"><<span class="hljs-name">html</span>></span>
<span class="hljs-tag"><<span class="hljs-name">head</span>></span>
<span class="hljs-tag"><<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"hub"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"https://hub.example.com/"</span>></span>
<span class="hljs-tag"><<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"self"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"http://example.com/feed"</span>></span>
<span class="hljs-tag"></<span class="hljs-name">head</span>></span>
<span class="hljs-tag"><<span class="hljs-name">body</span>></span>
...
<span class="hljs-tag"></<span class="hljs-name">body</span>></span>
<span class="hljs-tag"></<span class="hljs-name">html</span>></span></span></span></pre></div>
<p>When perfoming discovery, subscribers <em class="rfc2119" title="MUST">MUST</em> implement all three 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 <em class="rfc2119" title="MUST">MUST</em> 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 <em class="rfc2119" title="MUST">MUST</em> check for embedded link elements.</li>
</ol>
<section id="content-negotiation">
<h3 id="x4-1-content-negotiation"><span class="secno">4.1 </span>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 ([<cite><a class="bibref" href="#bib-RFC6838">RFC6838</a></cite>]) 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>
<div class="example"><div class="example-title marker"><span>Example 2</span></div><pre class="hljs http" aria-busy="false" aria-live="polite"><span class="hljs-keyword">GET</span> <span class="hljs-string">/feed</span> HTTP/1.1
<span class="hljs-attribute">Host</span>: example.com
<span class="hljs-attribute">Accept</span>: application/json
<span class="http">HTTP/1.1 <span class="hljs-number">200</span> Ok
<span class="hljs-attribute">Content-type</span>: application/json
<span class="hljs-attribute">Link</span>: </feed.json>; rel="self"
<span class="hljs-attribute">Link</span>: <https://hub.example.com/>; rel="hub"
<span class="json">{
<span class="hljs-attr">"items"</span>: [...]
}</span></span></pre></div>
<div class="example"><div class="example-title marker"><span>Example 3</span></div><pre class="hljs http" aria-busy="false" aria-live="polite"><span class="hljs-keyword">GET</span> <span class="hljs-string">/feed</span> HTTP/1.1
<span class="hljs-attribute">Host</span>: example.com
<span class="hljs-attribute">Accept</span>: text/html
<span class="http">HTTP/1.1 <span class="hljs-number">200</span> Ok
<span class="hljs-attribute">Content-type</span>: text/html
<span class="hljs-attribute">Link</span>: </feed.html>; rel="self"
<span class="hljs-attribute">Link</span>: <https://hub.example.com/>; rel="hub"
<span class="xml"><span class="hljs-tag"><<span class="hljs-name">html</span>></span>
...</span></span></pre></div>
<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>
<div class="example"><div class="example-title marker"><span>Example 4</span></div><pre class="hljs http" aria-busy="false" aria-live="polite"><span class="hljs-keyword">GET</span> <span class="hljs-string">/feed</span> HTTP/1.1
<span class="hljs-attribute">Host</span>: example.com
<span class="hljs-attribute">Accept-Language</span>: de-DE
<span class="http">HTTP/1.1 <span class="hljs-number">200</span> Ok
<span class="hljs-attribute">Content-type</span>: text/html
<span class="http"><span class="hljs-attribute">Link</span>: </feed-de.json>; rel="self"
<span class="hljs-attribute">Link</span>: <https://hub.example.com/>; rel="hub"
<span class="json">{
<span class="hljs-attr">"items"</span>: [...]
}</span></span></span></pre></div>
</section>
</section>
<section id="subscribing-and-unsubscribing">
<!--OddPage--><h2 id="x5-subscribing-and-unsubscribing"><span class="secno">5. </span>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 (<em class="rfc2119" title="OPTIONAL">OPTIONAL</em>)</li>
<li>The hub confirms the subscription was actually requested by the subscriber</li>
<li>The hub periodically reconfirms the subscription is still active (<em class="rfc2119" title="OPTIONAL">OPTIONAL</em>)</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 id="x5-1-subscriber-sends-subscription-request"><span class="secno">5.1 </span>Subscriber Sends Subscription Request</h3>
<p>Subscription is initiated by the subscriber making an HTTPS or HTTP POST [<cite><a class="bibref" href="#bib-RFC7231">RFC7231</a></cite>] request to the hub URL. This request <em class="rfc2119" title="MUST">MUST</em> have a Content-Type header of <samp>application/x-www-form-urlencoded</samp> (described in Section 4.10.22.6 [<cite><a class="bibref" href="#bib-HTML5">HTML5</a></cite>]), <em class="rfc2119" title="MUST">MUST</em> use UTF-8 [<cite><a class="bibref" href="#bib-Encoding">Encoding</a></cite>] as the document character encoding, and <em class="rfc2119" title="MUST">MUST</em> use the following parameters in its body, formatted accordingly:</p>
<dl>
<dt>hub.callback</dt>
<dd><em class="rfc2119" title="REQUIRED">REQUIRED</em>. The subscriber's callback URL where content distribution notifications should be delivered. The callback URL <em class="rfc2119" title="SHOULD">SHOULD</em> be an unguessable URL that is unique per subscription. ([<cite><a class="bibref" href="#bib-capability-urls">capability-urls</a></cite>])</dd>
<dt>hub.mode</dt>
<dd><em class="rfc2119" title="REQUIRED">REQUIRED</em>. The literal string "subscribe" or "unsubscribe", depending on the goal of the request.</dd>
<dt>hub.topic</dt>
<dd><em class="rfc2119" title="REQUIRED">REQUIRED</em>. The topic URL that the subscriber wishes to subscribe to or unsubscribe from. Note that this <em class="rfc2119" title="MUST">MUST</em> 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><em class="rfc2119" title="OPTIONAL">OPTIONAL</em>. Number of seconds for which the subscriber would like to have the subscription active, given as a positive decimal integer. Hubs <em class="rfc2119" title="MAY">MAY</em> choose to respect this value or not, depending on their own policies, and <em class="rfc2119" title="MAY">MAY</em> set a default value if the subscriber omits the parameter. This parameter <em class="rfc2119" title="MAY">MAY</em> be present for unsubscription requests and <em class="rfc2119" title="MUST">MUST</em> be ignored by the hub in that case.</dd>
<dt>hub.secret</dt>
<dd><em class="rfc2119" title="OPTIONAL">OPTIONAL</em>. 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 <em class="rfc2119" title="SHOULD">SHOULD</em> only be specified when the request was made over HTTPS [<cite><a class="bibref" href="#bib-RFC2818">RFC2818</a></cite>]. This parameter <em class="rfc2119" title="MUST">MUST</em> be less than 200 bytes in length.</dd>
</dl>
<p>Subscribers <em class="rfc2119" title="MAY">MAY</em> also include additional HTTP [<cite><a class="bibref" href="#bib-RFC7230">RFC7230</a></cite>] request parameters, as well as HTTP [<cite><a class="bibref" href="#bib-RFC7230">RFC7230</a></cite>] Headers if they are required by the hub.</p>
<p>Hubs <em class="rfc2119" title="MUST">MUST</em> ignore additional request parameters they do not understand.</p>
<p>Hubs <em class="rfc2119" title="MUST">MUST</em> allow subscribers to re-request subscriptions that are already activated. Each subsequent request to a hub to subscribe or unsubscribe <em class="rfc2119" title="MUST">MUST</em> 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 <em class="rfc2119" title="MUST">MUST</em> be left unchanged. This is required so subscribers can renew their subscriptions before the lease seconds period is over without any interruption. The subscriber <em class="rfc2119" title="MAY">MAY</em> use a new hub.secret value in a future subscription, and <em class="rfc2119" title="MAY">MAY</em> make a new subscription without a hub.secret.</p>
<section id="subscription-parameter-details">
<h4 id="x5-1-1-subscription-parameter-details"><span class="secno">5.1.1 </span>Subscription Parameter Details</h4>
<p>The topic and callback URLs <em class="rfc2119" title="MAY">MAY</em> use HTTP [<cite><a class="bibref" href="#bib-RFC7230">RFC7230</a></cite>] or HTTPS [<cite><a class="bibref" href="#bib-RFC2818">RFC2818</a></cite>] schemes. The topic URL <em class="rfc2119" title="MUST">MUST</em> be the one advertised by the publisher in a Self Link Header during the discovery phase. (See <a href="#discovery">Section 3 </a>). Hubs <em class="rfc2119" title="MAY">MAY</em> 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 [<cite><a class="bibref" href="#bib-URL">URL</a></cite>]. Hubs <em class="rfc2119" title="MUST">MUST</em> always decode non-reserved characters for these URL parameters; see section 1.2 on <em>"Percent-encoded bytes"</em> in [<cite><a class="bibref" href="#bib-URL">URL</a></cite>].</p>
<p>The callback URL <em class="rfc2119" title="SHOULD">SHOULD</em> be an unguessable unique URL ([<cite><a class="bibref" href="#bib-capability-urls">capability-urls</a></cite>]) and <em class="rfc2119" title="SHOULD">SHOULD</em> use HTTPS [<cite><a class="bibref" href="#bib-RFC7230">RFC7230</a></cite>]. The callback URL acts as authentication from the hub to the subscriber when confirming subscriptions and delivering the content. Additionally, the callback <em class="rfc2119" title="SHOULD">SHOULD</em> be unique (not re-used for multiple hubs) and changed when subscriptions are renewed.</p>
<p>The callback URL <em class="rfc2119" title="MAY">MAY</em> contain arbitrary query string parameters (e.g., <samp>?foo=bar&red=fish</samp>). Hubs <em class="rfc2119" title="MUST">MUST</em> 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 id="x5-1-2-subscription-response-details"><span class="secno">5.1.2 </span>Subscription Response Details</h4>
<p>If the hub URL supports WebSub and is able to handle the subscription or unsubscription request, it <em class="rfc2119" title="MUST">MUST</em> respond to a subscription request with an HTTP [<cite><a class="bibref" href="#bib-RFC7231">RFC7231</a></cite>] 202 "Accepted" response to indicate that the request was received and will now be verified (<a href="#hub-verifies-intent">Section 4.3 </a>) and validated (<a href="#subscription-validation">Section 4.2 </a>) by the hub. The hub <em class="rfc2119" title="SHOULD">SHOULD</em> 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 [<cite><a class="bibref" href="#bib-RFC7231">RFC7231</a></cite>] error response code (4xx or 5xx) <em class="rfc2119" title="MUST">MUST</em> be returned. In the event of an error, hubs <em class="rfc2119" title="SHOULD">SHOULD</em> 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 <em class="rfc2119" title="MAY">MAY</em> 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 <em class="rfc2119" title="MUST NOT">MUST NOT</em> 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 <em class="rfc2119" title="MAY">MAY</em> redirect to another hub which supports WebSub. It does so by yielding an HTTP [<cite><a class="bibref" href="#bib-RFC7231">RFC7231</a></cite>] 307 (temporary redirect) or 308 (permanent redirect) response. It <em class="rfc2119" title="MUST">MUST</em> also include at least a HTTP [<cite><a class="bibref" href="#bib-RFC7230">RFC7230</a></cite>] 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 id="x5-2-subscription-validation"><span class="secno">5.2 </span>Subscription Validation</h3>
<p>Subscriptions <em class="rfc2119" title="MAY">MAY</em> be validated by the Hubs who may require more details to accept or refuse a subscription. The Hub <em class="rfc2119" title="MAY">MAY</em> also check with the publisher whether the subscription should be accepted.</p>
<p>If (and when) the subscription is accepted, the hub <em class="rfc2119" title="MUST">MUST</em> 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 <em class="rfc2119" title="MUST">MUST</em> inform the subscriber by sending an HTTP [<cite><a class="bibref" href="#bib-RFC7231">RFC7231</a></cite>] (or HTTPS [<cite><a class="bibref" href="#bib-RFC2818">RFC2818</a></cite>]) 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 [<cite><a class="bibref" href="#bib-URL">URL</a></cite>]):</p>
<dl>
<dt>hub.mode</dt>
<dd><em class="rfc2119" title="REQUIRED">REQUIRED</em>. The literal string "denied".</dd>
<dt>hub.topic</dt>
<dd><em class="rfc2119" title="REQUIRED">REQUIRED</em>. The topic URL given in the corresponding subscription request.</dd>
<dt>hub.reason</dt>
<dd><em class="rfc2119" title="OPTIONAL">OPTIONAL</em>. The hub may include a reason for which the subscription has been denied.</dd>
</dl>
<p>The subscription <em class="rfc2119" title="MAY">MAY</em> be denied by the hub at any point (even if it was previously accepted). The Subscriber <em class="rfc2119" title="SHOULD">SHOULD</em> then consider that the subscription is not possible anymore.</p>
</section>
<section id="hub-verifies-intent">
<h3 id="x5-3-hub-verifies-intent-of-the-subscriber"><span class="secno">5.3 </span>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 [<cite><a class="bibref" href="#bib-RFC7231">RFC7231</a></cite>] (or HTTPS [<cite><a class="bibref" href="#bib-RFC2818">RFC2818</a></cite>]) 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 [<cite><a class="bibref" href="#bib-URL">URL</a></cite>]):</p>
<dl>
<dt><samp>hub.mode</samp></dt>
<dd><em class="rfc2119" title="REQUIRED">REQUIRED</em>. 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><em class="rfc2119" title="REQUIRED">REQUIRED</em>. The topic URL given in the corresponding subscription request.</dd>
<dt><samp>hub.challenge</samp></dt>
<dd><em class="rfc2119" title="REQUIRED">REQUIRED</em>. A hub-generated, random string that <em class="rfc2119" title="MUST">MUST</em> be echoed by the subscriber to verify the subscription.</dd>
<dt><samp>hub.lease_seconds</samp></dt>
<dd><em class="rfc2119" title="REQUIRED">REQUIRED</em>/<em class="rfc2119" title="OPTIONAL">OPTIONAL</em>. 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 <em class="rfc2119" title="MUST">MUST</em> supply this parameter when <samp>hub.mode</samp> is set to "subscribe". This parameter <em class="rfc2119" title="MAY">MAY</em> be present when <samp>hub.mode</samp> is "unsubscribe" and <em class="rfc2119" title="MUST">MUST</em> be ignored by subscribers in that case.</dd>
</dl>
<section id="verification-details">
<h4 id="x5-3-1-verification-details"><span class="secno">5.3.1 </span>Verification Details</h4>
<p>The subscriber <em class="rfc2119" title="MUST">MUST</em> confirm that the <samp>hub.topic</samp> corresponds to a pending subscription or unsubscription that it wishes to carry out. If so, the subscriber <em class="rfc2119" title="MUST">MUST</em> 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 <em class="rfc2119" title="MUST">MUST</em> respond with a 404 "Not Found" response.</p>
<p>The hub <em class="rfc2119" title="MUST">MUST</em> consider other server response codes (3xx, 4xx, 5xx) to mean that the verification request has failed. If the subscriber returns an HTTP [<cite><a class="bibref" href="#bib-RFC7231">RFC7231</a></cite>] success (2xx) but the content body does not match the <samp>hub.challenge</samp> parameter, the hub <em class="rfc2119" title="MUST">MUST</em> also consider verification to have failed.</p>
<p>Hubs <em class="rfc2119" title="MAY">MAY</em> make the <samp>hub.lease_seconds</samp> equal to the value the subscriber passed in their subscription request but <em class="rfc2119" title="MAY">MAY</em> change the value depending on the hub's policies. To sustain a subscription, the subscriber <em class="rfc2119" title="MUST">MUST</em> re-request the subscription on the hub before <samp>hub.lease_seconds</samp> seconds has elapsed.</p>
<p>Hubs <em class="rfc2119" title="MUST">MUST</em> enforce lease expirations, and <em class="rfc2119" title="MUST NOT">MUST NOT</em> issue perpetual lease durations.</p>
</section>
</section>
<div class="note"><div role="heading" class="note-title marker" id="h-note-1" aria-level="3"><span>Note</span></div><p class="">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></div>
</section>
<section id="publishing">
<!--OddPage--><h2 id="x6-publishing"><span class="secno">6. </span>Publishing</h2>
<p>The publisher <em class="rfc2119" title="MUST">MUST</em> 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>
<div class="note"><div role="heading" class="note-title marker" id="h-note-2" aria-level="3"><span>Note</span></div><p class="">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></div>
<section id="subscription-migration">
<h3 id="x6-1-subscription-migration"><span class="secno">6.1 </span>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">
<!--OddPage--><h2 id="x7-content-distribution"><span class="secno">7. </span>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 [<cite><a class="bibref" href="#bib-RFC7231">RFC7231</a></cite>] (or HTTPS [<cite><a class="bibref" href="#bib-RFC2818">RFC2818</a></cite>]) POST request from the hub to the subscriber's callback URL. The HTTP body of the POST request <em class="rfc2119" title="MUST">MUST</em> include the payload of the content distribution notification. The content distribution request <em class="rfc2119" title="MUST">MUST</em> have a <samp>Content-Type</samp> Header corresponding to the <samp>Content-Type</samp> of the topic, and <em class="rfc2119" title="MUST">MUST</em> contain the full contents of the topic URL, with an exception allowed as described below.
</p>
<p>For Atom ([<cite><a class="bibref" href="#bib-RFC4287">RFC4287</a></cite>]) and RSS ([<cite><a class="bibref" href="#bib-RSS-2.0">RSS-2.0</a></cite>]) feeds, the hub <em class="rfc2119" title="MAY">MAY</em> remove already-delivered <code>atom:entry</code> or <code>rss:item</code> elements from the feed.
</p>
<p>The request <em class="rfc2119" title="MUST">MUST</em> include at least one Link Header [<cite><a class="bibref" href="#bib-RFC5988">RFC5988</a></cite>] with <samp>rel=hub</samp> pointing to a Hub associated with the topic being updated. It <em class="rfc2119" title="MUST">MUST</em> also include one Link Header [<cite><a class="bibref" href="#bib-RFC5988">RFC5988</a></cite>] with <samp>rel=self</samp> set to the canonical URL of the topic being updated. The Hub <em class="rfc2119" title="SHOULD">SHOULD</em> combine these headers into a single Link Header [<cite><a class="bibref" href="#bib-RFC5988">RFC5988</a></cite>]. All these URLs are those resulting from the discovery process (<a href="#discovery">Section 3</a>). The subscriber <em class="rfc2119" title="MUST NOT">MUST NOT</em> 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 <em class="rfc2119" title="MUST">MUST</em> return an HTTP [<cite><a class="bibref" href="#bib-RFC7231">RFC7231</a></cite>] 2xx response code to indicate a success. The subscriber's callback URL <em class="rfc2119" title="MAY">MAY</em> return an HTTP 410 code to indicate that the subscription has been deleted, and the hub <em class="rfc2119" title="MAY">MAY</em> terminate the subscription if it receives that code as a response. The hub <em class="rfc2119" title="MUST">MUST</em> consider all other subscriber response codes as failures; that means subscribers <em class="rfc2119" title="MUST NOT">MUST NOT</em> use HTTP redirects for moving subscriptions. Subscribers <em class="rfc2119" title="SHOULD">SHOULD</em> respond to content distribution requests as quickly as possible; their success response code <em class="rfc2119" title="SHOULD">SHOULD</em> only indicate receipt of the message, not acknowledgment that it was successfully processed by the subscriber. The response body from the subscriber <em class="rfc2119" title="MUST">MUST</em> be ignored by the hub. Hubs <em class="rfc2119" title="SHOULD">SHOULD</em> 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 <em class="rfc2119" title="MUST">MUST</em> keep the subscription active until the end of the lease duration, and if a new update is published to the topic, <em class="rfc2119" title="MUST">MUST</em> continue to retry delivery to the previously-failing subscriber.
</p>
<section id="authenticated-content-distribution">
<h3 id="signing-content"><span class="secno">7.1 </span>Authenticated Content Distribution</h3>
<p>If the subscriber supplied a value for <samp>hub.secret</samp> in their subscription request, the hub <em class="rfc2119" title="MUST">MUST</em> 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 <em class="rfc2119" title="MUST">MUST</em> 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 <em class="rfc2119" title="MUST">MUST</em> be computed using the HMAC algorithm [<cite><a class="bibref" href="#bib-RFC6151">RFC6151</a></cite>] with the request body as the data and the <samp>hub.secret</samp> as the key.</p>
<section id="recognized-algorithm-names">
<h4 id="x7-1-1-recognized-algorithm-names"><span class="secno">7.1.1 </span>Recognized algorithm names</h4>
<p>The following algorithms are the initially registered algorithm names, based on the contents of the [<cite><a class="bibref" href="#bib-FIPS-PUB-180-4">FIPS-PUB-180-4</a></cite>] registry at the time of publishing.</p>
<dl>
<dt>sha1</dt>
<dd>The SHA-1 algorithm as specified in Section 6.1 of [<cite><a class="bibref" href="#bib-FIPS-PUB-180-4">FIPS-PUB-180-4</a></cite>]</dd>
<dt>sha256</dt>
<dd>The SHA-256 algorithm as specified in Section 6.2 of [<cite><a class="bibref" href="#bib-FIPS-PUB-180-4">FIPS-PUB-180-4</a></cite>]</dd>
<dt>sha384</dt>
<dd>The SHA-384 algorithm as specified in Section 6.5 of [<cite><a class="bibref" href="#bib-FIPS-PUB-180-4">FIPS-PUB-180-4</a></cite>]</dd>
<dt>sha512</dt>
<dd>The SHA-512 algorithm as specified in Section 6.4 of [<cite><a class="bibref" href="#bib-FIPS-PUB-180-4">FIPS-PUB-180-4</a></cite>]</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>