summary refs log tree commit diff
path: root/scripts-dev/federation_client.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2021-12-02 15:18:40 +0000
committerGitHub <noreply@github.com>2021-12-02 15:18:40 +0000
commitf61462e1be36a51dbf571076afa8e1930cb182f4 (patch)
treefaee17da9cdf3c7f4a0294d8a7007c84919a0b6b /scripts-dev/federation_client.py
parentAdd MSC3030 experimental client and federation API endpoints to get the close... (diff)
downloadsynapse-f61462e1be36a51dbf571076afa8e1930cb182f4.tar.xz
`scripts-dev/sign_json`: support for signing events (#11486)
Diffstat (limited to 'scripts-dev/federation_client.py')
-rwxr-xr-xscripts-dev/federation_client.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts-dev/federation_client.py b/scripts-dev/federation_client.py
index 6f76c08fcf..c72e19f61d 100755
--- a/scripts-dev/federation_client.py
+++ b/scripts-dev/federation_client.py
@@ -15,6 +15,25 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
+"""
+Script for signing and sending federation requests.
+
+Some tips on doing the join dance with this:
+
+    room_id=...
+    user_id=...
+
+    # make_join
+    federation_client.py "/_matrix/federation/v1/make_join/$room_id/$user_id?ver=5" > make_join.json
+
+    # sign
+    jq -M .event make_join.json | sign_json --sign-event-room-version=$(jq -r .room_version make_join.json) -o signed-join.json
+
+    # send_join
+    federation_client.py -X PUT "/_matrix/federation/v2/send_join/$room_id/x" --body $(<signed-join.json) > send_join.json
+"""
+
 import argparse
 import base64
 import json