Mercurial > prosody-modules
annotate mod_muc_hats_adhoc/README.markdown @ 5193:2bb29ece216b
mod_http_oauth2: Implement stateless dynamic client registration
Replaces previous explicit registration that required either the
additional module mod_adhoc_oauth2_client or manually editing the
database. That method was enough to have something to test with, but
would not probably not scale easily.
Dynamic client registration allows creating clients on the fly, which
may be even easier in theory.
In order to not allow basically unauthenticated writes to the database,
we implement a stateless model here.
per_host_key := HMAC(config -> oauth2_registration_key, hostname)
client_id := JWT { client metadata } signed with per_host_key
client_secret := HMAC(per_host_key, client_id)
This should ensure everything we need to know is part of the client_id,
allowing redirects etc to be validated, and the client_secret can be
validated with only the client_id and the per_host_key.
A nonce injected into the client_id JWT should ensure nobody can submit
the same client metadata and retrieve the same client_secret
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 03 Mar 2023 21:14:19 +0100 |
parents | e9e41e75c5a0 |
children |
rev | line source |
---|---|
3948
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
1 --- |
3949
f02885673215
mod_muc_hats_adhoc/README: Change summary to mention ad-hoc commands
Kim Alvefur <zash@zash.se>
parents:
3948
diff
changeset
|
2 summary: Ad-hoc commands for managing MUC hats |
3948
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
3 --- |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
4 |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
5 # Introduction |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
6 |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
7 This module provides an internal API (i.e. to other modules) to manage |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
8 'hats' for users in MUC rooms. |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
9 |
3950
e9e41e75c5a0
mod_muc_hats_*/README: Linkify XEP references
Kim Alvefur <zash@zash.se>
parents:
3949
diff
changeset
|
10 Hats (first defined in [XEP-0317], currently deferred) are additional identifiers |
3948
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
11 that can be attached to users in a group chat. For example in an educational |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
12 context, you may have a 'Teacher' hat that allows students to identify their |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
13 teachers. |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
14 |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
15 Hats consist of a machine-readable unique identifier (a URI), and optionally |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
16 a human-readable label. |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
17 |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
18 This module provides ad-hoc commands for MUC service admins to add/remove hats |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
19 to/from users in MUC rooms. It depends (automatically) on mod_muc_hats_api. |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
20 |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
21 ## Configuration |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
22 |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
23 ``` |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
24 Component "conference.example.com" "muc" |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
25 modules_enabled = { "muc_hats_adhoc" } |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
26 ``` |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
27 |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
28 ## Usage |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
29 |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
30 To successfully use the module you will need to use an XMPP client that is |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
31 capable of sending commands to a specific host (e.g. via the service discovery |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
32 browser in Gajim, Psi/Psi+ and other clients), and you'll find the commands |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
33 on the MUC host. |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
34 |
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
35 Also note that the display of hats in clients is currently non-existent, but |
3950
e9e41e75c5a0
mod_muc_hats_*/README: Linkify XEP references
Kim Alvefur <zash@zash.se>
parents:
3949
diff
changeset
|
36 will hopefully improve after [XEP-0317] is resurrected or replaced. |
3948
11825788a452
mod_muc_hats_adhoc: Ad-hoc commands for adding/removing MUC hats
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
37 |