Mercurial > prosody-modules
annotate mod_adhoc_dataforms_demo/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 | d56cb74a0db8 |
children |
rev | line source |
---|---|
3214
453ec2938153
mod_adhoc_dataforms_demo/README: Set a summary
Kim Alvefur <zash@zash.se>
parents:
3212
diff
changeset
|
1 --- |
3559
d56cb74a0db8
mod_adhoc_dataforms_demo/README: Describe the new multi-step command
Kim Alvefur <zash@zash.se>
parents:
3214
diff
changeset
|
2 summary: 'Module for testing ad-hoc commands and dataforms rendering' |
3214
453ec2938153
mod_adhoc_dataforms_demo/README: Set a summary
Kim Alvefur <zash@zash.se>
parents:
3212
diff
changeset
|
3 --- |
453ec2938153
mod_adhoc_dataforms_demo/README: Set a summary
Kim Alvefur <zash@zash.se>
parents:
3212
diff
changeset
|
4 |
3211
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 # Introduction |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 |
3559
d56cb74a0db8
mod_adhoc_dataforms_demo/README: Describe the new multi-step command
Kim Alvefur <zash@zash.se>
parents:
3214
diff
changeset
|
7 This module provides [Ad-Hoc commands][xep0050] for testing [data |
3211
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 form][xep0004] that includes all kinds of fields. It's meant to help |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 debug both Prosodys |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 [`util.dataforms`][doc:developers:util:dataforms] library and |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 clients, eg seeing how various field types are rendered. |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 # Configuration |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
14 |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
15 Simply add it to [`modules_enabled`][doc:modules_enabled] like any |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
16 other module. |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
18 ``` {.lua} |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
19 modules_enabled = { |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
20 -- All your other modules etc |
3212
69b6910f3bfc
mod_adhoc_test -> mod_adhoc_dataforms_demo
Kim Alvefur <zash@zash.se>
parents:
3211
diff
changeset
|
21 "adhoc_dataforms_demo"; |
3211
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
22 } |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
23 ``` |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
24 |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
25 # Usage |
2969ed764fe8
mod_adhoc_test: A module to test dataforms generation and rendering
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
26 |
3559
d56cb74a0db8
mod_adhoc_dataforms_demo/README: Describe the new multi-step command
Kim Alvefur <zash@zash.se>
parents:
3214
diff
changeset
|
27 In your Ad-Hoc capable client, first look for "Execute command". You |
d56cb74a0db8
mod_adhoc_dataforms_demo/README: Describe the new multi-step command
Kim Alvefur <zash@zash.se>
parents:
3214
diff
changeset
|
28 should see a form with various kinds of fields. |
d56cb74a0db8
mod_adhoc_dataforms_demo/README: Describe the new multi-step command
Kim Alvefur <zash@zash.se>
parents:
3214
diff
changeset
|
29 |
d56cb74a0db8
mod_adhoc_dataforms_demo/README: Describe the new multi-step command
Kim Alvefur <zash@zash.se>
parents:
3214
diff
changeset
|
30 Dataforms Demo |
d56cb74a0db8
mod_adhoc_dataforms_demo/README: Describe the new multi-step command
Kim Alvefur <zash@zash.se>
parents:
3214
diff
changeset
|
31 : A simple command that provides a dataform with every possible field |
d56cb74a0db8
mod_adhoc_dataforms_demo/README: Describe the new multi-step command
Kim Alvefur <zash@zash.se>
parents:
3214
diff
changeset
|
32 type, suitable for testing rending of dataforms. |
d56cb74a0db8
mod_adhoc_dataforms_demo/README: Describe the new multi-step command
Kim Alvefur <zash@zash.se>
parents:
3214
diff
changeset
|
33 |
d56cb74a0db8
mod_adhoc_dataforms_demo/README: Describe the new multi-step command
Kim Alvefur <zash@zash.se>
parents:
3214
diff
changeset
|
34 Multi-step command demo |
d56cb74a0db8
mod_adhoc_dataforms_demo/README: Describe the new multi-step command
Kim Alvefur <zash@zash.se>
parents:
3214
diff
changeset
|
35 : A command that has multiple steps, suitable for testing back and |
d56cb74a0db8
mod_adhoc_dataforms_demo/README: Describe the new multi-step command
Kim Alvefur <zash@zash.se>
parents:
3214
diff
changeset
|
36 forwards navigation. |