From 3a2bd6c6e2ee23079d9cf802198740bf6a289b1b Mon Sep 17 00:00:00 2001 From: squahtx Date: Wed, 31 Aug 2022 12:55:41 +0000 Subject: deploy: 6f80fe1e1bbb6cab3ce605b2023e0488e2d80d52 --- latest/admin_api/register_api.html | 15 ++++++++++++++- latest/admin_api/rooms.html | 6 +++++- latest/admin_api/user_admin_api.html | 10 ++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) (limited to 'latest/admin_api') diff --git a/latest/admin_api/register_api.html b/latest/admin_api/register_api.html index 15a90bef7c..fe939cd554 100644 --- a/latest/admin_api/register_api.html +++ b/latest/admin_api/register_api.html @@ -184,7 +184,20 @@ set the displayname (optional, username by default).

The MAC is the hex digest output of the HMAC-SHA1 algorithm, with the key being the shared secret and the content being the nonce, user, password, either the string "admin" or "notadmin", and optionally the user_type -each separated by NULs. For an example of generation in Python:

+each separated by NULs.

+

Here is an easy way to generate the HMAC digest if you have Bash and OpenSSL:

+
# Update these values and then paste this code block into a bash terminal
+nonce='thisisanonce'
+username='pepper_roni'
+password='pizza'
+admin='admin'
+secret='shared_secret'
+
+printf '%s\0%s\0%s\0%s' "$nonce" "$username" "$password" "$admin" |
+  openssl sha1 -hmac "$secret" |
+  awk '{print $2}'
+
+

For an example of generation in Python:

import hmac, hashlib
 
 def generate_mac(nonce, user, password, admin=False, user_type=None):
diff --git a/latest/admin_api/rooms.html b/latest/admin_api/rooms.html
index 63a6cbb491..347dc8eac5 100644
--- a/latest/admin_api/rooms.html
+++ b/latest/admin_api/rooms.html
@@ -436,6 +436,8 @@ end of the list.

  • state_events - Total number of state_events of a room. Complexity of the room.
  • room_type - The type of the room taken from the room's creation event; for example "m.space" if the room is a space. If the room does not define a type, the value will be null.
  • +
  • forgotten - Whether all local users have +forgotten the room.
  • The API is:

    GET /_synapse/admin/v1/rooms/<room_id>
    @@ -459,9 +461,11 @@ If the room does not define a type, the value will be null.
       "guest_access": null,
       "history_visibility": "shared",
       "state_events": 93534,
    -  "room_type": "m.space"
    +  "room_type": "m.space",
    +  "forgotten": false
     }
     
    +

    Changed in Synapse 1.66: Added the forgotten key to the response body.

    Room Members API

    The Room Members admin API allows server admins to get a list of all members of a room.

    The response includes the following fields:

    diff --git a/latest/admin_api/user_admin_api.html b/latest/admin_api/user_admin_api.html index e45ffaed23..9d1fb25231 100644 --- a/latest/admin_api/user_admin_api.html +++ b/latest/admin_api/user_admin_api.html @@ -799,6 +799,7 @@ same.

    "device_id": "QBUAZIFURK", "display_name": "android", "last_seen_ip": "1.2.3.4", + "last_seen_user_agent": "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0", "last_seen_ts": 1474491775024, "user_id": "<user_id>" }, @@ -806,6 +807,7 @@ same.

    "device_id": "AUIECTSRND", "display_name": "ios", "last_seen_ip": "1.2.3.5", + "last_seen_user_agent": "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0", "last_seen_ts": 1474491775025, "user_id": "<user_id>" } @@ -830,6 +832,8 @@ Device objects contain the following fields:

    Absent if no name has been set.
  • last_seen_ip - The IP address where this device was last seen. (May be a few minutes out of date, for efficiency reasons).
  • +
  • last_seen_user_agent - The user agent of the device when it was last seen. +(May be a few minutes out of date, for efficiency reasons).
  • last_seen_ts - The timestamp (in milliseconds since the unix epoch) when this devices was last seen. (May be a few minutes out of date, for efficiency reasons).
  • user_id - Owner of device.
  • @@ -872,6 +876,7 @@ any access token associated with them.

    "device_id": "<device_id>", "display_name": "android", "last_seen_ip": "1.2.3.4", + "last_seen_user_agent": "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0", "last_seen_ts": 1474491775024, "user_id": "<user_id>" } @@ -889,7 +894,12 @@ any access token associated with them.

  • display_name - Display name set by the user for this device. Absent if no name has been set.
  • last_seen_ip - The IP address where this device was last seen. +(May be a few minutes out of date, for efficiency reasons). +
      +
    • last_seen_user_agent - The user agent of the device when it was last seen. (May be a few minutes out of date, for efficiency reasons).
    • +
    +
  • last_seen_ts - The timestamp (in milliseconds since the unix epoch) when this devices was last seen. (May be a few minutes out of date, for efficiency reasons).
  • user_id - Owner of device.
  • -- cgit 1.5.1