Recipes
Four jobs a small server's owner does
again and again, each one performed
by the lab and read back, so every
recipe ends in proof rather than in
hope. Tokens below are the ones your
own logins produced (chapter 4); the
room is the lab's Hobby Club
(!MvRSxCPghox--9v33vm6GHee9eraBdJaVfa4mUBI-fg,
alias #hobby-club:lab.local).
Add a user, with registration closed
The standing way a closed server grows. Evidence: t13.
- Ask the admin endpoint for a
nonce:
GET /_synapse/admin/v1/register. - Compute the reply: HMAC-SHA1,
keyed by the config's
registration_shared_secret, over the fields joined by NUL bytes — nonce, username, password, and the wordadminornotadmin. (On Synapse 1.164.1 the last word isnotadmin; the lab met an older write-up sayinguserand was refused withHMAC incorrect.) POSTnonce, username, password,admin: false, and the hash to the same address.- Proof: the reply names the new user ID, and the new user can log in (chapter 4's call) — carol could, once the lab's own rate-limit wait expired.
Make a moderator (and check they are one)
Evidence: t10.
GETthe room'sstate/m.room.power_levelsand keep the whole document.- Add one entry to its
usersmap:"@bob:lab.local": 50. PUTthe whole document back to the same address. The reply is the new state event's ID.- Proof:
GETthe state again — ideally as bob — and see the 50 in theusersmap. Fifty buys kicking, banning and tending room state; it does not buy rewriting the power levels themselves (that is priced at 100).
Open a room's doors — and close them again
Evidence: t09.
PUTto the room'sstate/m.room.join_rulesthe body{"join_rule":"public"}.- Proof:
GETthe same state; it must saypublic. - To close the doors,
PUT{"join_rule":"invite"}and read backinvite. - Treat step 2 as the recipe's point, not its garnish: the lab performed the round trip precisely so the read-back habit is the one that survives.
Find a room by its alias, and see who is in it
Evidence: t05 and t06.
GET /_matrix/client/v3/directory/room/%23hobby-club%3Alab.local(the alias, URL-escaped). The reply gives the room ID and the servers that know the room.GETthe room'sjoined_memberswith any member's token.- Proof: the reply lists the
joined users with their display
names — alice and bob, in the lab —
which is also the fastest health
check a room has: if the list is
not who you expect, the room's
recent history is where to look,
and the
messagescall from chapter 4 shows it.