Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit e529fa7

Browse files
committed
Merge commit '4325be1a5' into anoa/dinsic_release_1_21_x
* commit '4325be1a5': Fix missing null character check on guest_access room state Fixed a bug with reactivating users with the admin API (#8362) Admin API for reported events (#8217) Fix wording of deprecation notice in changelog Deprecation warning for synapse admin api being accessible under /_matrix Create function to check for long names in devices (#8364) Add a comment re #1691 Fix a bad merge from release-v1.20.0. (#8354) Admin API for querying rooms where a user is a member (#8306) Catch-up after Federation Outage (bonus): Catch-up on Synapse Startup (#8322) Simplify super() calls to Python 3 syntax. (#8344) Allow appservice users to /login (#8320) Update test logging to be able to accept braces (#8335) Move lint dependencies to extras_require (#8330)
2 parents 419595b + 4325be1 commit e529fa7

File tree

167 files changed

+1606
-323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+1606
-323
lines changed

CHANGES.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
Synapse 1.20.0 (2020-09-22)
22
===========================
33

4-
No significant changes.
4+
No significant changes since v1.20.0rc5.
5+
6+
Removal warning
7+
---------------
58

9+
Historically, the [Synapse Admin
10+
API](https://github.com/matrix-org/synapse/tree/master/docs) has been
11+
accessible under the `/_matrix/client/api/v1/admin`,
12+
`/_matrix/client/unstable/admin`, `/_matrix/client/r0/admin` and
13+
`/_synapse/admin` prefixes. In a future release, we will be dropping support
14+
for accessing Synapse's Admin API using the `/_matrix/client/*` prefixes. This
15+
makes it easier for homeserver admins to lock down external access to the Admin
16+
API endpoints.
617

718
Synapse 1.20.0rc5 (2020-09-18)
819
==============================

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ https://help.github.com/articles/using-pull-requests/) to ask us to pull your
1717
changes into our repo.
1818

1919
Some other points to follow:
20-
20+
2121
* Please base your changes on the `develop` branch.
22-
22+
2323
* Please follow the [code style requirements](#code-style).
2424

2525
* Please include a [changelog entry](#changelog) with each PR.
@@ -46,7 +46,7 @@ locally. You'll need python 3.6 or later, and to install a number of tools:
4646

4747
```
4848
# Install the dependencies
49-
pip install -U black flake8 flake8-comprehensions isort
49+
pip install -e ".[lint]"
5050
5151
# Run the linter script
5252
./scripts-dev/lint.sh

changelog.d/8217.feature

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add an admin API `GET /_synapse/admin/v1/event_reports` to read entries of table `event_reports`. Contributed by @dklimpel.

changelog.d/8230.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix messages over federation being lost until an event is sent into the same room.

changelog.d/8230.misc

-1
This file was deleted.

changelog.d/8247.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix messages over federation being lost until an event is sent into the same room.

changelog.d/8247.misc

-1
This file was deleted.

changelog.d/8258.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix messages over federation being lost until an event is sent into the same room.

changelog.d/8258.misc

-1
This file was deleted.

changelog.d/8306.feature

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add an admin API for querying rooms where a user is a member. Contributed by @dklimpel.

changelog.d/8320.feature

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add `uk.half-shot.msc2778.login.application_service` login type to allow appservices to login.

changelog.d/8322.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix messages over federation being lost until an event is sent into the same room.

changelog.d/8330.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Move lint-related dependencies to package-extra field, update CONTRIBUTING.md to utilise this.

changelog.d/8335.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix test logging to allow braces in log output.

changelog.d/8344.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Simplify `super()` calls to Python 3 syntax.

changelog.d/8354.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bad merge from `release-v1.20.0` branch to `develop`.

changelog.d/8362.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed a regression in v1.19.0 with reactivating users through the admin API.

changelog.d/8364.bugfix

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix a bug where during device registration the length of the device name wasn't
2+
limited.

docs/admin_api/event_reports.rst

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
Show reported events
2+
====================
3+
4+
This API returns information about reported events.
5+
6+
The api is::
7+
8+
GET /_synapse/admin/v1/event_reports?from=0&limit=10
9+
10+
To use it, you will need to authenticate by providing an ``access_token`` for a
11+
server admin: see `README.rst <README.rst>`_.
12+
13+
It returns a JSON body like the following:
14+
15+
.. code:: jsonc
16+
17+
{
18+
"event_reports": [
19+
{
20+
"content": {
21+
"reason": "foo",
22+
"score": -100
23+
},
24+
"event_id": "$bNUFCwGzWca1meCGkjp-zwslF-GfVcXukvRLI1_FaVY",
25+
"event_json": {
26+
"auth_events": [
27+
"$YK4arsKKcc0LRoe700pS8DSjOvUT4NDv0HfInlMFw2M",
28+
"$oggsNXxzPFRE3y53SUNd7nsj69-QzKv03a1RucHu-ws"
29+
],
30+
"content": {
31+
"body": "matrix.org: This Week in Matrix",
32+
"format": "org.matrix.custom.html",
33+
"formatted_body": "<strong>matrix.org</strong>:<br><a href=\"https://matrix.org/blog/\"><strong>This Week in Matrix</strong></a>",
34+
"msgtype": "m.notice"
35+
},
36+
"depth": 546,
37+
"hashes": {
38+
"sha256": "xK1//xnmvHJIOvbgXlkI8eEqdvoMmihVDJ9J4SNlsAw"
39+
},
40+
"origin": "matrix.org",
41+
"origin_server_ts": 1592291711430,
42+
"prev_events": [
43+
"$YK4arsKKcc0LRoe700pS8DSjOvUT4NDv0HfInlMFw2M"
44+
],
45+
"prev_state": [],
46+
"room_id": "!ERAgBpSOcCCuTJqQPk:matrix.org",
47+
"sender": "@foobar:matrix.org",
48+
"signatures": {
49+
"matrix.org": {
50+
"ed25519:a_JaEG": "cs+OUKW/iHx5pEidbWxh0UiNNHwe46Ai9LwNz+Ah16aWDNszVIe2gaAcVZfvNsBhakQTew51tlKmL2kspXk/Dg"
51+
}
52+
},
53+
"type": "m.room.message",
54+
"unsigned": {
55+
"age_ts": 1592291711430,
56+
}
57+
},
58+
"id": 2,
59+
"reason": "foo",
60+
"received_ts": 1570897107409,
61+
"room_alias": "#alias1:matrix.org",
62+
"room_id": "!ERAgBpSOcCCuTJqQPk:matrix.org",
63+
"sender": "@foobar:matrix.org",
64+
"user_id": "@foo:matrix.org"
65+
},
66+
{
67+
"content": {
68+
"reason": "bar",
69+
"score": -100
70+
},
71+
"event_id": "$3IcdZsDaN_En-S1DF4EMCy3v4gNRKeOJs8W5qTOKj4I",
72+
"event_json": {
73+
// hidden items
74+
// see above
75+
},
76+
"id": 3,
77+
"reason": "bar",
78+
"received_ts": 1598889612059,
79+
"room_alias": "#alias2:matrix.org",
80+
"room_id": "!eGvUQuTCkHGVwNMOjv:matrix.org",
81+
"sender": "@foobar:matrix.org",
82+
"user_id": "@bar:matrix.org"
83+
}
84+
],
85+
"next_token": 2,
86+
"total": 4
87+
}
88+
89+
To paginate, check for ``next_token`` and if present, call the endpoint again
90+
with ``from`` set to the value of ``next_token``. This will return a new page.
91+
92+
If the endpoint does not return a ``next_token`` then there are no more
93+
reports to paginate through.
94+
95+
**URL parameters:**
96+
97+
- ``limit``: integer - Is optional but is used for pagination,
98+
denoting the maximum number of items to return in this call. Defaults to ``100``.
99+
- ``from``: integer - Is optional but used for pagination,
100+
denoting the offset in the returned results. This should be treated as an opaque value and
101+
not explicitly set to anything other than the return value of ``next_token`` from a previous call.
102+
Defaults to ``0``.
103+
- ``dir``: string - Direction of event report order. Whether to fetch the most recent first (``b``) or the
104+
oldest first (``f``). Defaults to ``b``.
105+
- ``user_id``: string - Is optional and filters to only return users with user IDs that contain this value.
106+
This is the user who reported the event and wrote the reason.
107+
- ``room_id``: string - Is optional and filters to only return rooms with room IDs that contain this value.
108+
109+
**Response**
110+
111+
The following fields are returned in the JSON response body:
112+
113+
- ``id``: integer - ID of event report.
114+
- ``received_ts``: integer - The timestamp (in milliseconds since the unix epoch) when this report was sent.
115+
- ``room_id``: string - The ID of the room in which the event being reported is located.
116+
- ``event_id``: string - The ID of the reported event.
117+
- ``user_id``: string - This is the user who reported the event and wrote the reason.
118+
- ``reason``: string - Comment made by the ``user_id`` in this report. May be blank.
119+
- ``content``: object - Content of reported event.
120+
121+
- ``reason``: string - Comment made by the ``user_id`` in this report. May be blank.
122+
- ``score``: integer - Content is reported based upon a negative score, where -100 is "most offensive" and 0 is "inoffensive".
123+
124+
- ``sender``: string - This is the ID of the user who sent the original message/event that was reported.
125+
- ``room_alias``: string - The alias of the room. ``null`` if the room does not have a canonical alias set.
126+
- ``event_json``: object - Details of the original event that was reported.
127+
- ``next_token``: integer - Indication for pagination. See above.
128+
- ``total``: integer - Total number of event reports related to the query (``user_id`` and ``room_id``).
129+

docs/admin_api/user_admin_api.rst

+37
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,43 @@ To use it, you will need to authenticate by providing an ``access_token`` for a
304304
server admin: see `README.rst <README.rst>`_.
305305

306306

307+
List room memberships of an user
308+
================================
309+
Gets a list of all ``room_id`` that a specific ``user_id`` is member.
310+
311+
The API is::
312+
313+
GET /_synapse/admin/v1/users/<user_id>/joined_rooms
314+
315+
To use it, you will need to authenticate by providing an ``access_token`` for a
316+
server admin: see `README.rst <README.rst>`_.
317+
318+
A response body like the following is returned:
319+
320+
.. code:: json
321+
322+
{
323+
"joined_rooms": [
324+
"!DuGcnbhHGaSZQoNQR:matrix.org",
325+
"!ZtSaPCawyWtxfWiIy:matrix.org"
326+
],
327+
"total": 2
328+
}
329+
330+
**Parameters**
331+
332+
The following parameters should be set in the URL:
333+
334+
- ``user_id`` - fully qualified: for example, ``@user:server.com``.
335+
336+
**Response**
337+
338+
The following fields are returned in the JSON response body:
339+
340+
- ``joined_rooms`` - An array of ``room_id``.
341+
- ``total`` - Number of rooms.
342+
343+
307344
User devices
308345
============
309346

scripts-dev/definitions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class DefinitionVisitor(ast.NodeVisitor):
1313
def __init__(self):
14-
super(DefinitionVisitor, self).__init__()
14+
super().__init__()
1515
self.functions = {}
1616
self.classes = {}
1717
self.names = {}

scripts-dev/federation_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def get_connection(self, url, proxies=None):
321321
url = urlparse.urlunparse(
322322
("https", netloc, parsed.path, parsed.params, parsed.query, parsed.fragment)
323323
)
324-
return super(MatrixConnectionAdapter, self).get_connection(url, proxies)
324+
return super().get_connection(url, proxies)
325325

326326

327327
if __name__ == "__main__":

0 commit comments

Comments
 (0)