Software /
code /
prosody
Annotate
spec/scansion/pubsub_max_items.scs @ 12968:efdb7f2cd578
mod_debug_reset: New module to "reset" a running server (e.g. for testing)
Plan to use this for integration tests.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 23 Mar 2023 14:40:51 +0000 |
parent | 12966:7465d3c5679d |
rev | line source |
---|---|
11768
aa6ab07544c2
mod_pubsub: Add support for limiting result size #1608
Kim Alvefur <zash@zash.se>
parents:
11720
diff
changeset
|
1 # Pubsub: Requesting the Most Recent Items (#1608) |
9833 | 2 |
3 [Client] Alice | |
4 jid: admin@localhost | |
5 password: password | |
6 | |
7 --------- | |
8 | |
9 Alice connects | |
10 | |
11 Alice sends: | |
12 <presence xmlns:stream="http://etherx.jabber.org/streams" id=":7IoqYcT3191rfk_dZGo2"/> | |
13 | |
14 Alice receives: | |
15 <presence xmlns:stream="http://etherx.jabber.org/streams" from="${Alice's full JID}" id=":7IoqYcT3191rfk_dZGo2"/> | |
16 | |
17 Alice sends: | |
18 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":m0SM8Hn5JxP9BJJ_X4Mz" type="set"> | |
19 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
11768
aa6ab07544c2
mod_pubsub: Add support for limiting result size #1608
Kim Alvefur <zash@zash.se>
parents:
11720
diff
changeset
|
20 <create node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"/> |
9833 | 21 </pubsub> |
22 </iq> | |
23 | |
24 Alice receives: | |
25 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":m0SM8Hn5JxP9BJJ_X4Mz"/> | |
26 | |
27 Alice sends: | |
28 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":gwZgEQmzAHcQz-FZOxi-" type="get"> | |
29 <pubsub xmlns="http://jabber.org/protocol/pubsub#owner"> | |
11768
aa6ab07544c2
mod_pubsub: Add support for limiting result size #1608
Kim Alvefur <zash@zash.se>
parents:
11720
diff
changeset
|
30 <configure node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"/> |
9833 | 31 </pubsub> |
32 </iq> | |
33 | |
34 Alice receives: | |
35 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":gwZgEQmzAHcQz-FZOxi-"> | |
36 <pubsub xmlns="http://jabber.org/protocol/pubsub#owner"> | |
11768
aa6ab07544c2
mod_pubsub: Add support for limiting result size #1608
Kim Alvefur <zash@zash.se>
parents:
11720
diff
changeset
|
37 <configure node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"> |
9833 | 38 <x xmlns="jabber:x:data" type="form"> |
39 <field var="FORM_TYPE" type="hidden"> | |
40 <value>http://jabber.org/protocol/pubsub#node_config</value> | |
41 </field> | |
42 <field var="pubsub#title" label="Title" type="text-single"/> | |
43 <field var="pubsub#description" label="Description" type="text-single"/> | |
44 <field var="pubsub#type" label="The type of node data, usually specified by the namespace of the payload (if any)" type="text-single"/> | |
45 <field var="pubsub#max_items" label="Max # of items to persist" type="text-single"> | |
11855
8890eaa69446
mod_pubsub: Prevent max_items from being set to zero
Kim Alvefur <zash@zash.se>
parents:
11854
diff
changeset
|
46 <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="pubsub:integer-or-max"> |
11856
14a679588b7b
mod_pubsub,mod_pep: Advertise maximum number of items via XEP-0122
Kim Alvefur <zash@zash.se>
parents:
11855
diff
changeset
|
47 <range min="1" max="256"/> |
11855
8890eaa69446
mod_pubsub: Prevent max_items from being set to zero
Kim Alvefur <zash@zash.se>
parents:
11854
diff
changeset
|
48 </validate> |
9833 | 49 <value>20</value> |
50 </field> | |
51 <field var="pubsub#persist_items" label="Persist items to storage" type="boolean"> | |
11720
72512c0858b3
mod_pubsub: Explicitly enable persistence by default to preserve behavior
Kim Alvefur <zash@zash.se>
parents:
11714
diff
changeset
|
52 <value>1</value> |
9833 | 53 </field> |
54 <field var="pubsub#access_model" label="Specify the subscriber model" type="list-single"> | |
55 <option label="authorize"> | |
56 <value>authorize</value> | |
57 </option> | |
58 <option label="open"> | |
59 <value>open</value> | |
60 </option> | |
61 <option label="presence"> | |
62 <value>presence</value> | |
63 </option> | |
64 <option label="roster"> | |
65 <value>roster</value> | |
66 </option> | |
67 <option label="whitelist"> | |
68 <value>whitelist</value> | |
69 </option> | |
70 <value>open</value> | |
71 </field> | |
72 <field var="pubsub#publish_model" label="Specify the publisher model" type="list-single"> | |
73 <option label="publishers"> | |
74 <value>publishers</value> | |
75 </option> | |
76 <option label="subscribers"> | |
77 <value>subscribers</value> | |
78 </option> | |
79 <option label="open"> | |
80 <value>open</value> | |
81 </option> | |
82 <value>publishers</value> | |
83 </field> | |
11854
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
84 <field type='list-single' var='pubsub#send_last_published_item'> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
85 <option label='never'> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
86 <value>never</value> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
87 </option> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
88 <option label='on_sub'> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
89 <value>on_sub</value> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
90 </option> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
91 <option label='on_sub_and_presence'> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
92 <value>on_sub_and_presence</value> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
93 </option> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
94 <value>never</value> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
95 </field> |
9833 | 96 <field var="pubsub#deliver_notifications" label="Whether to deliver event notifications" type="boolean"> |
97 <value>1</value> | |
98 </field> | |
99 <field var="pubsub#deliver_payloads" label="Whether to deliver payloads with event notifications" type="boolean"> | |
100 <value>1</value> | |
101 </field> | |
102 <field var="pubsub#notification_type" label="Specify the delivery style for notifications" type="list-single"> | |
103 <option label="Messages of type normal"> | |
104 <value>normal</value> | |
105 </option> | |
106 <option label="Messages of type headline"> | |
107 <value>headline</value> | |
108 </option> | |
109 <value>headline</value> | |
110 </field> | |
111 <field var="pubsub#notify_delete" label="Whether to notify subscribers when the node is deleted" type="boolean"> | |
112 <value>1</value> | |
113 </field> | |
114 <field var="pubsub#notify_retract" label="Whether to notify subscribers when items are removed from the node" type="boolean"> | |
115 <value>1</value> | |
116 </field> | |
12966
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
117 <field label="Specify whose JID to include as the publisher of items" var="pubsub#itemreply" type="list-single"> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
118 <option label="Include the node owner's JID"> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
119 <value>owner</value> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
120 </option> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
121 <option label="Include the item publisher's JID"> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
122 <value>publisher</value> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
123 </option> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
124 <option label="Don't include any JID with items"> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
125 <value>none</value> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
126 </option> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
127 <value>none</value> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
128 </field> |
9833 | 129 </x> |
130 </configure> | |
131 </pubsub> | |
132 </iq> | |
133 | |
134 Alice sends: | |
135 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":pfWBQ2MNIq8ieul57Qp7" type="set"> | |
136 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
11768
aa6ab07544c2
mod_pubsub: Add support for limiting result size #1608
Kim Alvefur <zash@zash.se>
parents:
11720
diff
changeset
|
137 <publish node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"> |
9833 | 138 <item id="20e9eb9e-8acb-436e-a486-40e80400faf1"> |
139 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">foo</foo> | |
140 </item> | |
141 </publish> | |
142 </pubsub> | |
143 </iq> | |
144 | |
145 Alice receives: | |
146 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":pfWBQ2MNIq8ieul57Qp7"> | |
147 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
11768
aa6ab07544c2
mod_pubsub: Add support for limiting result size #1608
Kim Alvefur <zash@zash.se>
parents:
11720
diff
changeset
|
148 <publish node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"> |
9833 | 149 <item id="20e9eb9e-8acb-436e-a486-40e80400faf1"/> |
150 </publish> | |
151 </pubsub> | |
152 </iq> | |
153 | |
154 Alice sends: | |
155 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":Q5TLT6nsW0HHdkDgrPPe" type="set"> | |
156 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
11768
aa6ab07544c2
mod_pubsub: Add support for limiting result size #1608
Kim Alvefur <zash@zash.se>
parents:
11720
diff
changeset
|
157 <publish node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"> |
9833 | 158 <item id="4b94623d-1127-41c0-ac47-e283fd890557"> |
159 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">bar</foo> | |
160 </item> | |
161 </publish> | |
162 </pubsub> | |
163 </iq> | |
164 | |
165 Alice receives: | |
166 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":Q5TLT6nsW0HHdkDgrPPe"> | |
167 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
11768
aa6ab07544c2
mod_pubsub: Add support for limiting result size #1608
Kim Alvefur <zash@zash.se>
parents:
11720
diff
changeset
|
168 <publish node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"> |
9833 | 169 <item id="4b94623d-1127-41c0-ac47-e283fd890557"/> |
170 </publish> | |
171 </pubsub> | |
172 </iq> | |
173 | |
174 Alice sends: | |
175 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":3nvB2E20p1iuM6lOPaP6" type="get"> | |
176 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
11768
aa6ab07544c2
mod_pubsub: Add support for limiting result size #1608
Kim Alvefur <zash@zash.se>
parents:
11720
diff
changeset
|
177 <items node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06" max_items="1"/> |
9833 | 178 </pubsub> |
179 </iq> | |
180 | |
181 Alice receives: | |
182 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":3nvB2E20p1iuM6lOPaP6"> | |
183 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
11768
aa6ab07544c2
mod_pubsub: Add support for limiting result size #1608
Kim Alvefur <zash@zash.se>
parents:
11720
diff
changeset
|
184 <items node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"> |
11714
d783716103c1
mod_pubsub: Fix inclusion of publisher (fixes #1399)
Kim Alvefur <zash@zash.se>
parents:
11631
diff
changeset
|
185 <item publisher="${Alice's JID}" xmlns="http://jabber.org/protocol/pubsub" id="4b94623d-1127-41c0-ac47-e283fd890557"> |
9833 | 186 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">bar</foo> |
187 </item> | |
188 </items> | |
189 </pubsub> | |
190 </iq> | |
191 | |
192 Alice sends: | |
193 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":XQdyK54iyOKiJvUoX9t_" type="get"> | |
194 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
11768
aa6ab07544c2
mod_pubsub: Add support for limiting result size #1608
Kim Alvefur <zash@zash.se>
parents:
11720
diff
changeset
|
195 <items node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"/> |
9833 | 196 </pubsub> |
197 </iq> | |
198 | |
199 Alice receives: | |
200 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":XQdyK54iyOKiJvUoX9t_"> | |
201 <pubsub xmlns="http://jabber.org/protocol/pubsub"> | |
11768
aa6ab07544c2
mod_pubsub: Add support for limiting result size #1608
Kim Alvefur <zash@zash.se>
parents:
11720
diff
changeset
|
202 <items node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"> |
11714
d783716103c1
mod_pubsub: Fix inclusion of publisher (fixes #1399)
Kim Alvefur <zash@zash.se>
parents:
11631
diff
changeset
|
203 <item xmlns="http://jabber.org/protocol/pubsub" publisher="${Alice's JID}" id="20e9eb9e-8acb-436e-a486-40e80400faf1"> |
9833 | 204 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">foo</foo> |
205 </item> | |
11714
d783716103c1
mod_pubsub: Fix inclusion of publisher (fixes #1399)
Kim Alvefur <zash@zash.se>
parents:
11631
diff
changeset
|
206 <item xmlns="http://jabber.org/protocol/pubsub" publisher="${Alice's JID}" id="4b94623d-1127-41c0-ac47-e283fd890557"> |
9833 | 207 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">bar</foo> |
208 </item> | |
209 </items> | |
210 </pubsub> | |
211 </iq> | |
212 | |
213 Alice sends: | |
214 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":ySGQOz5tnyWT82idwJZP" type="set"> | |
215 <pubsub xmlns="http://jabber.org/protocol/pubsub#owner"> | |
11768
aa6ab07544c2
mod_pubsub: Add support for limiting result size #1608
Kim Alvefur <zash@zash.se>
parents:
11720
diff
changeset
|
216 <delete node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"/> |
9833 | 217 </pubsub> |
218 </iq> | |
219 | |
220 Alice receives: | |
221 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":ySGQOz5tnyWT82idwJZP"/> | |
222 |