Mercurial > prosody-modules
annotate mod_deny_omemo/mod_deny_omemo.lua @ 5405:c7a5caad28ef
mod_http_oauth2: Enforce response type encoded in client_id
The client promises to only use this response type, so we should hold
them to that.
This makes it fail earlier if the response type is disabled or the
client is trying to use one that it promised not to use. Better than
failing after login and consent.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 02 May 2023 16:31:25 +0200 |
parents | 2ad35f08bd57 |
children |
rev | line source |
---|---|
3053
2ad35f08bd57
mod_deny_omemo: Prevents publishing and retreival of OMEMO PEP nodes
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 local st = require "util.stanza"; |
2ad35f08bd57
mod_deny_omemo: Prevents publishing and retreival of OMEMO PEP nodes
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 |
2ad35f08bd57
mod_deny_omemo: Prevents publishing and retreival of OMEMO PEP nodes
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 local omemo_namespace_prefix = "eu.siacs.conversations.axolotl." |
2ad35f08bd57
mod_deny_omemo: Prevents publishing and retreival of OMEMO PEP nodes
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 |
2ad35f08bd57
mod_deny_omemo: Prevents publishing and retreival of OMEMO PEP nodes
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 module:hook("iq/bare/http://jabber.org/protocol/pubsub:pubsub", function (event) |
2ad35f08bd57
mod_deny_omemo: Prevents publishing and retreival of OMEMO PEP nodes
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 local origin, stanza = event.origin, event.stanza; |
2ad35f08bd57
mod_deny_omemo: Prevents publishing and retreival of OMEMO PEP nodes
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 |
2ad35f08bd57
mod_deny_omemo: Prevents publishing and retreival of OMEMO PEP nodes
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 local node = stanza.tags[1].tags[1].attr.node; |
2ad35f08bd57
mod_deny_omemo: Prevents publishing and retreival of OMEMO PEP nodes
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 if node and node:sub(1, #omemo_namespace_prefix) == omemo_namespace_prefix then |
2ad35f08bd57
mod_deny_omemo: Prevents publishing and retreival of OMEMO PEP nodes
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 origin.send(st.error_reply(stanza, "cancel", "item-not-found", "OMEMO is disabled")); |
2ad35f08bd57
mod_deny_omemo: Prevents publishing and retreival of OMEMO PEP nodes
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 return true; |
2ad35f08bd57
mod_deny_omemo: Prevents publishing and retreival of OMEMO PEP nodes
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 end |
2ad35f08bd57
mod_deny_omemo: Prevents publishing and retreival of OMEMO PEP nodes
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 end, 10); |