Software /
code /
prosody
Annotate
spec/scansion/pubsub_max_items.scs @ 13493:933c669628a3
scansion: Add roster groups setting to pubsub form in tests
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 12 Jun 2024 23:14:55 +0200 |
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> | |
13493
933c669628a3
scansion: Add roster groups setting to pubsub form in tests
Kim Alvefur <zash@zash.se>
parents:
12966
diff
changeset
|
72 <field type="list-multi" var="pubsub#roster_groups_allowed" label="Roster groups allowed to subscribe"/> |
9833 | 73 <field var="pubsub#publish_model" label="Specify the publisher model" type="list-single"> |
74 <option label="publishers"> | |
75 <value>publishers</value> | |
76 </option> | |
77 <option label="subscribers"> | |
78 <value>subscribers</value> | |
79 </option> | |
80 <option label="open"> | |
81 <value>open</value> | |
82 </option> | |
83 <value>publishers</value> | |
84 </field> | |
11854
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
85 <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
|
86 <option label='never'> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
87 <value>never</value> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
88 </option> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
89 <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
|
90 <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
|
91 </option> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
92 <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
|
93 <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
|
94 </option> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
95 <value>never</value> |
b605cbd5f13b
mod_pubsub,mod_pep: Implement 'send_last_published_item' option #1436
Kim Alvefur <zash@zash.se>
parents:
11768
diff
changeset
|
96 </field> |
9833 | 97 <field var="pubsub#deliver_notifications" label="Whether to deliver event notifications" type="boolean"> |
98 <value>1</value> | |
99 </field> | |
100 <field var="pubsub#deliver_payloads" label="Whether to deliver payloads with event notifications" type="boolean"> | |
101 <value>1</value> | |
102 </field> | |
103 <field var="pubsub#notification_type" label="Specify the delivery style for notifications" type="list-single"> | |
104 <option label="Messages of type normal"> | |
105 <value>normal</value> | |
106 </option> | |
107 <option label="Messages of type headline"> | |
108 <value>headline</value> | |
109 </option> | |
110 <value>headline</value> | |
111 </field> | |
112 <field var="pubsub#notify_delete" label="Whether to notify subscribers when the node is deleted" type="boolean"> | |
113 <value>1</value> | |
114 </field> | |
115 <field var="pubsub#notify_retract" label="Whether to notify subscribers when items are removed from the node" type="boolean"> | |
116 <value>1</value> | |
117 </field> | |
12966
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
118 <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
|
119 <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
|
120 <value>owner</value> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
121 </option> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
122 <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
|
123 <value>publisher</value> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
124 </option> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
125 <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
|
126 <value>none</value> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
127 </option> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
128 <value>none</value> |
7465d3c5679d
scansion: Fix tests failing after addition of pubsub#itemreply config field
Matthew Wild <mwild1@gmail.com>
parents:
11856
diff
changeset
|
129 </field> |
9833 | 130 </x> |
131 </configure> | |
132 </pubsub> | |
133 </iq> | |
134 | |
135 Alice sends: | |
136 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":pfWBQ2MNIq8ieul57Qp7" type="set"> | |
137 <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
|
138 <publish node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"> |
9833 | 139 <item id="20e9eb9e-8acb-436e-a486-40e80400faf1"> |
140 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">foo</foo> | |
141 </item> | |
142 </publish> | |
143 </pubsub> | |
144 </iq> | |
145 | |
146 Alice receives: | |
147 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":pfWBQ2MNIq8ieul57Qp7"> | |
148 <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
|
149 <publish node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"> |
9833 | 150 <item id="20e9eb9e-8acb-436e-a486-40e80400faf1"/> |
151 </publish> | |
152 </pubsub> | |
153 </iq> | |
154 | |
155 Alice sends: | |
156 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":Q5TLT6nsW0HHdkDgrPPe" type="set"> | |
157 <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
|
158 <publish node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"> |
9833 | 159 <item id="4b94623d-1127-41c0-ac47-e283fd890557"> |
160 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">bar</foo> | |
161 </item> | |
162 </publish> | |
163 </pubsub> | |
164 </iq> | |
165 | |
166 Alice receives: | |
167 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":Q5TLT6nsW0HHdkDgrPPe"> | |
168 <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
|
169 <publish node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"> |
9833 | 170 <item id="4b94623d-1127-41c0-ac47-e283fd890557"/> |
171 </publish> | |
172 </pubsub> | |
173 </iq> | |
174 | |
175 Alice sends: | |
176 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":3nvB2E20p1iuM6lOPaP6" type="get"> | |
177 <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
|
178 <items node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06" max_items="1"/> |
9833 | 179 </pubsub> |
180 </iq> | |
181 | |
182 Alice receives: | |
183 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":3nvB2E20p1iuM6lOPaP6"> | |
184 <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
|
185 <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
|
186 <item publisher="${Alice's JID}" xmlns="http://jabber.org/protocol/pubsub" id="4b94623d-1127-41c0-ac47-e283fd890557"> |
9833 | 187 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">bar</foo> |
188 </item> | |
189 </items> | |
190 </pubsub> | |
191 </iq> | |
192 | |
193 Alice sends: | |
194 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":XQdyK54iyOKiJvUoX9t_" type="get"> | |
195 <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
|
196 <items node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"/> |
9833 | 197 </pubsub> |
198 </iq> | |
199 | |
200 Alice receives: | |
201 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":XQdyK54iyOKiJvUoX9t_"> | |
202 <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
|
203 <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
|
204 <item xmlns="http://jabber.org/protocol/pubsub" publisher="${Alice's JID}" id="20e9eb9e-8acb-436e-a486-40e80400faf1"> |
9833 | 205 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">foo</foo> |
206 </item> | |
11714
d783716103c1
mod_pubsub: Fix inclusion of publisher (fixes #1399)
Kim Alvefur <zash@zash.se>
parents:
11631
diff
changeset
|
207 <item xmlns="http://jabber.org/protocol/pubsub" publisher="${Alice's JID}" id="4b94623d-1127-41c0-ac47-e283fd890557"> |
9833 | 208 <foo xmlns="https://zombofant.net/xmlns/aioxmpp#test">bar</foo> |
209 </item> | |
210 </items> | |
211 </pubsub> | |
212 </iq> | |
213 | |
214 Alice sends: | |
215 <iq xmlns:stream="http://etherx.jabber.org/streams" to="pubsub.localhost" id=":ySGQOz5tnyWT82idwJZP" type="set"> | |
216 <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
|
217 <delete node="5549ea47-ea53-4cc1-9e7c-37842fe4bc06"/> |
9833 | 218 </pubsub> |
219 </iq> | |
220 | |
221 Alice receives: | |
222 <iq xmlns:stream="http://etherx.jabber.org/streams" to="${Alice's full JID}" from="pubsub.localhost" type="result" id=":ySGQOz5tnyWT82idwJZP"/> | |
223 |