annotate mod_muc_badge/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 a646fcb45334
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3141
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
1 ---
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
2 depends:
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
3 - 'mod\_http'
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
4 - 'mod\_muc'
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
5 provides:
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
6 - http
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
7 title: 'mod\_muc\_badge'
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
8 ---
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
9
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
10 # Introduction
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
11
3143
1f0d269a7cf0 mod_muc_badge/README: More words
Kim Alvefur <zash@zash.se>
parents: 3142
diff changeset
12 This module generates a badge for MUC rooms at a HTTP URL like
3295
4a77c9c2a1cd mod_muc_badge/README: Correct the example URL to account for default 'http_host'
Kim Alvefur <zash@zash.se>
parents: 3145
diff changeset
13 `https://conference.example.com:5281/muc_badge/room@conference.example.org`
3142
feefc29a1ef4 mod_muc_badge/README: Fix prematurely committed text
Kim Alvefur <zash@zash.se>
parents: 3141
diff changeset
14 containing the number of occupants.
feefc29a1ef4 mod_muc_badge/README: Fix prematurely committed text
Kim Alvefur <zash@zash.se>
parents: 3141
diff changeset
15
feefc29a1ef4 mod_muc_badge/README: Fix prematurely committed text
Kim Alvefur <zash@zash.se>
parents: 3141
diff changeset
16 Inspiration
feefc29a1ef4 mod_muc_badge/README: Fix prematurely committed text
Kim Alvefur <zash@zash.se>
parents: 3141
diff changeset
17 : <https://opkode.com/blog/xmpp-chat-badge/>
3141
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
18
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
19 # Configuration
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
20
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
21 Option Type Default
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
22 ------------------ -------- --------------------------
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
23 `badge_count` string `"%d online"`
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
24 `badge_template` string A SVG image (see source)
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
25
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
26 The template must be valid XML. If it contains `{label}` then this is
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
27 replaced by `badge_label`, similarly, `{count}` is substituted by
774845606d73 mod_muc_badge: Generates a SVG badge with the number of occupants in rooms
Kim Alvefur <zash@zash.se>
parents:
diff changeset
28 `badge_count` with `%d` changed to the number of occupants.
3142
feefc29a1ef4 mod_muc_badge/README: Fix prematurely committed text
Kim Alvefur <zash@zash.se>
parents: 3141
diff changeset
29
feefc29a1ef4 mod_muc_badge/README: Fix prematurely committed text
Kim Alvefur <zash@zash.se>
parents: 3141
diff changeset
30 Details of the HTTP URL is determined by [standard Prosody HTTP server
feefc29a1ef4 mod_muc_badge/README: Fix prematurely committed text
Kim Alvefur <zash@zash.se>
parents: 3141
diff changeset
31 configuration][doc:http].
3145
a3afab416271 mod_muc_badge/README: Add a possible future thing to do
Kim Alvefur <zash@zash.se>
parents: 3144
diff changeset
32
3296
a1ef6a46841e mod_muc_badge/README: Add an example
Kim Alvefur <zash@zash.se>
parents: 3295
diff changeset
33 # Example
a1ef6a46841e mod_muc_badge/README: Add an example
Kim Alvefur <zash@zash.se>
parents: 3295
diff changeset
34
a1ef6a46841e mod_muc_badge/README: Add an example
Kim Alvefur <zash@zash.se>
parents: 3295
diff changeset
35 ```lua
a1ef6a46841e mod_muc_badge/README: Add an example
Kim Alvefur <zash@zash.se>
parents: 3295
diff changeset
36 Component "conference.example.com" "muc"
a1ef6a46841e mod_muc_badge/README: Add an example
Kim Alvefur <zash@zash.se>
parents: 3295
diff changeset
37 modules_enabled = {
a1ef6a46841e mod_muc_badge/README: Add an example
Kim Alvefur <zash@zash.se>
parents: 3295
diff changeset
38 "muc_badge"
a1ef6a46841e mod_muc_badge/README: Add an example
Kim Alvefur <zash@zash.se>
parents: 3295
diff changeset
39 }
a1ef6a46841e mod_muc_badge/README: Add an example
Kim Alvefur <zash@zash.se>
parents: 3295
diff changeset
40 ```