annotate mod_delegation.wiki @ 514:9427318ae72d default tip

added page for mod_delegation
author Goffi <goffi@goffi.org>
date Thu, 07 May 2015 23:31:20 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
514
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
1 #summary XEP-0355 (Namespace Delegation) implementation
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
2 #labels Stage-Alpha
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
3
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
4 = Introduction =
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
5
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
6 Namespace Delegation is an extension which allows server to delegate some features handling to an entity/component.
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
7 Typical use case is an external PEP service, but it can be used more generally when your prefered server lack one internal feature and you found an external component which can do it.
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
8
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
9 = Details =
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
10
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
11 You can have all the details by reading the [http://xmpp.org/extensions/xep-0355.html XEP-0355]. Only the admin mode is implemented so far.
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
12
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
13 If you use it with a component, you need to patch core/mod_component.lua to fire a new signal. To do it, copy the following patch in a, for example, /tmp/component.patch file:
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
14 {{{
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
15 diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
16 --- a/plugins/mod_component.lua
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
17 +++ b/plugins/mod_component.lua
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
18 @@ -85,6 +85,7 @@
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
19 session.type = "component";
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
20 module:log("info", "External component successfully authenticated");
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
21 session.send(st.stanza("handshake"));
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
22 + module:fire_event("component-authenticated", { session = session });
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
23
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
24 return true;
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
25 end
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
26 }}}
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
27
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
28 Then, at the root of prosody, enter:
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
29
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
30 {{{patch -p1 < /tmp/component.patch}}}
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
31
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
32 = Usage =
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
33
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
34 To use the module, like usual add *"delegation"* to your modules_enabled. Note that if you use it with a local component, you also need to activate the module in your component section:
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
35
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
36 {{{
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
37 modules_enabled = {
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
38 [...]
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
39
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
40 "delegation";
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
41 }
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
42
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
43 [...]
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
44
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
45 Component "youcomponent.yourdomain.tld"
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
46 component_secret = "yourpassword"
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
47 modules_enabled = {"delegation"}
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
48 }}}
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
49
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
50 then specify delegated namespaces *in your host section* like that:
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
51
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
52 {{{
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
53 VirtualHost "yourdomain.tld"
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
54
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
55 delegations = {
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
56 ["urn:xmpp:mam:0"] = {
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
57 filtering = {"node"};
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
58 jid = "pubsub.yourdomain.tld";
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
59 },
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
60 ["http://jabber.org/protocol/pubsub"] = {
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
61 jid = "pubsub.yourdomain.tld";
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
62 },
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
63 }
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
64 }}}
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
65
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
66 Here all MAM requests with a "node" attribute (i.e. all MAM pubsub request) will be delegated to pubsub.yourdomain.tld. Similarly, all pubsub request to the host (i.e. the PEP requests) will be delegated to pubsub.yourdomain.tld.
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
67
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
68 */!\ Be extra careful when you give a delegation to an entity/component, it's a powerful access, only do it if you absoly trust the component/entity, and you know where the software is coming from*
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
69
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
70 = Configuration =
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
71 The configuration is done with a table which map delegated namespace to namespace data.
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
72 Namespace data MUST have a *jid* (in the form *jid = "delegated@domain.tld"*) and MAY have an additional *filtering* array. If filtering is present, request with attributes in the array will be delegated, other will be treated normally (i.e. by Prosody).
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
73
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
74 If your are not a developper, the delegated namespace(s)/attribute(s) are most probably specified with the external component/entity you want to use.
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
75
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
76 = Compatibility =
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
77 ||dev||Need a patched core/mod_component.lua (see above)||
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
78 ||0.9||Need a patched core/mod_component.lua (see above)||
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
79
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
80 = Note =
9427318ae72d added page for mod_delegation
Goffi <goffi@goffi.org>
parents:
diff changeset
81 This module is often used with mod_privilege (c.f. XEP for more details)