Software /
code /
prosody
Annotate
spec/scansion/pep_nickname.scs @ 12790:24b55f0e2db9 0.12
mod_http: Allow disabling CORS in the http_cors_override option and by default
Fixes #1779.
Due to an oversight in the logic, if the user set 'enabled' to false in an
override, it would disable the item's requested CORS settings, but still apply
Prosody's default CORS policy.
This change ensures that 'enabled = false' will now disable CORS entirely for
the requested item.
Due to the new structure of the code, it was necessary to have a flag to say
whether CORS is to be applied at all. Rather than hard-coding 'true' here, I
chose to add a new option: 'http_default_cors_enabled'. This is a boolean that
allows the operator to disable Prosody's default CORS policy entirely (the one
that is used when a module or config does not override it). This makes it
easier to disable CORS and then selectively enable it only on services you
want it on.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 31 Oct 2022 14:32:02 +0000 |
parent | 11714:d783716103c1 |
child | 12965:edde56b60fd7 |
rev | line source |
---|---|
9339
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 # Publishing a nickname in PEP and receiving a notification |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 [Client] Romeo |
11714
d783716103c1
mod_pubsub: Fix inclusion of publisher (fixes #1399)
Kim Alvefur <zash@zash.se>
parents:
9339
diff
changeset
|
4 jid: romeo@localhost |
9339
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 password: password |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 ----- |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 Romeo connects |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 Romeo sends: |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 <iq id="4" type="set"> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 <pubsub xmlns="http://jabber.org/protocol/pubsub"> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
14 <publish node="http://jabber.org/protocol/nick"> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
15 <item id="current"> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
16 <nickname xmlns="http://jabber.org/protocol/nick"/> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 </item> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
18 </publish> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
19 </pubsub> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
20 </iq> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
21 |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
22 Romeo receives: |
11714
d783716103c1
mod_pubsub: Fix inclusion of publisher (fixes #1399)
Kim Alvefur <zash@zash.se>
parents:
9339
diff
changeset
|
23 <iq id="4" type="result"> |
9339
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
24 <pubsub xmlns="http://jabber.org/protocol/pubsub"> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
25 <publish node="http://jabber.org/protocol/nick"> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
26 <item id="current"/> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
27 </publish> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
28 </pubsub> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
29 </iq> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
30 |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
31 Romeo sends: |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
32 <presence> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
33 <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://code.matthewwild.co.uk/clix/" ver="jC32N+FhQoLrZ7nNQtZK3aqR0Fk="/> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
34 </presence> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
35 |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
36 Romeo receives: |
11714
d783716103c1
mod_pubsub: Fix inclusion of publisher (fixes #1399)
Kim Alvefur <zash@zash.se>
parents:
9339
diff
changeset
|
37 <iq id="disco" from="romeo@localhost" type="get"> |
9339
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
38 <query xmlns="http://jabber.org/protocol/disco#info" node="http://code.matthewwild.co.uk/clix/#jC32N+FhQoLrZ7nNQtZK3aqR0Fk="/> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
39 </iq> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
40 |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
41 Romeo receives: |
11714
d783716103c1
mod_pubsub: Fix inclusion of publisher (fixes #1399)
Kim Alvefur <zash@zash.se>
parents:
9339
diff
changeset
|
42 <presence> |
9339
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
43 <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://code.matthewwild.co.uk/clix/" ver="jC32N+FhQoLrZ7nNQtZK3aqR0Fk="/> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
44 </presence> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
45 |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
46 Romeo sends: |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
47 <iq id="disco" type="result" to="romeo@localhost"> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
48 <query xmlns="http://jabber.org/protocol/disco#info" node="http://code.matthewwild.co.uk/clix/#jC32N+FhQoLrZ7nNQtZK3aqR0Fk="> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
49 <identity type="console" name="clix" category="client"/> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
50 <feature var="http://jabber.org/protocol/disco#items"/> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
51 <feature var="http://jabber.org/protocol/disco#info"/> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
52 <feature var="http://jabber.org/protocol/caps"/> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
53 <feature var="http://jabber.org/protocol/nick+notify"/> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
54 </query> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
55 </iq> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
56 |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
57 Romeo receives: |
11714
d783716103c1
mod_pubsub: Fix inclusion of publisher (fixes #1399)
Kim Alvefur <zash@zash.se>
parents:
9339
diff
changeset
|
58 <message type="headline" from="romeo@localhost"> |
9339
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
59 <event xmlns="http://jabber.org/protocol/pubsub#event"> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
60 <items node="http://jabber.org/protocol/nick"> |
11714
d783716103c1
mod_pubsub: Fix inclusion of publisher (fixes #1399)
Kim Alvefur <zash@zash.se>
parents:
9339
diff
changeset
|
61 <item id="current" publisher="${Romeo's JID}"> |
9339
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
62 <nickname xmlns="http://jabber.org/protocol/nick"/> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
63 </item> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
64 </items> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
65 </event> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
66 </message> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
67 |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
68 Romeo sends: |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
69 <presence type="unavailable"/> |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
70 |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
71 Romeo disconnects |
a35a636481c6
mod_pep: Add test publishing a nickname
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
72 |