summary refs log tree commit diff
path: root/scripts-dev/convert_server_keys.py (unfollow)
<
Commit message (Collapse)AuthorFilesLines
2021-04-22Fix mypy check failAndrew Morgan1-3/+1
2021-04-16Fix old-style uses of self.make_request in dinum test codeAndrew Morgan8-73/+43
2021-04-16lintAndrew Morgan3-24/+8
2021-03-23Port "Allow providing credentials to HTTPS_PROXY (#9657)" from mainline (#95)Andrew Morgan4-34/+183
* Allow providing credentials to HTTPS_PROXY (#9657) Addresses https://github.com/matrix-org/synapse-dinsic/issues/70 This PR causes `ProxyAgent` to attempt to extract credentials from an `HTTPS_PROXY` env var. If credentials are found, a `Proxy-Authorization` header ([details](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization)) is sent to the proxy server to authenticate against it. The headers are *not* passed to the remote server. Also added some type hints. * lint
2021-03-23Stabilise all knock-related unstable identifiers that would be in state (#96)Andrew Morgan2-5/+10
2021-03-22Port "Add support for no_proxy and case insensitive env variables" from ↵Andrew Morgan48-154/+398
mainline to dinsic (#93) This PR is simply porting https://github.com/matrix-org/synapse/pull/9372 to dinsic. I also had to bring in https://github.com/matrix-org/synapse/pull/8821 and https://github.com/matrix-org/synapse/pull/9084 for this code to work properly - a sign that we should merge mainline into dinsic again soon.
2021-03-19Remove extraneous print (#94)Andrew Morgan1-1/+0
2021-03-19Fix the pipeline to use knock v7 Complement branch (#92)Andrew Morgan1-3/+3
2021-03-19Cap mypy tests at twisted==20.3.0 (#90)Andrew Morgan1-0/+3
2021-03-18Change knock room version to v7 (#88)Andrew Morgan5-18/+18
2021-03-02Allow knock->knock transitions (#86)Andrew Morgan1-2/+0
Small change to the event auth rules that allows transitioning from knock->knock (in case you want to update your knock reason, or change profile information etc). Coincides with the same commit in [the mainline PR](https://github.com/matrix-org/synapse/pull/6739) and [this update on MSC2403](https://github.com/matrix-org/matrix-doc/pull/2403/commits/49a72862a93d814219968cff814ff63926181645).
2021-03-01change check_threepid_can_be_invited to async (#85)Mathieu Velten1-5/+2
2021-02-19Add a config option to prioritise local users in user directory search ↵Andrew Morgan4-9/+158
results (#84) * Add a config option to prioritise local users in user directory search results (#9383) This PR adds a homeserver config option, `user_directory.prefer_local_users`, that when enabled will show local users higher in user directory search results than remote users. This option is off by default. Note that turning this on doesn't necessarily mean that remote users will always be put below local users, but they should be assuming all other ranking factors (search query match, profile information present etc) are identical. This is useful for, say, University networks that are openly federating, but want to prioritise local students and staff in the user directory over other random users. * Don't mix simple and english psql query types
2021-02-17Send a ver query parameter for make_knock (#83)Andrew Morgan4-7/+33
This informs the remote server of the room versions we support. If the room we're trying to knock on has a version that is not one of our supported room versions, the remote server will return an unsupported room version error. Noticed in https://github.com/matrix-org/matrix-doc/pull/2403#discussion_r577042144 Ported from https://github.com/matrix-org/synapse/pull/6739
2021-02-16 1.27.0Erik Johnston4-11/+23
2021-02-15Add rustc to Docker image build environment (#9405)Dan Callahan2-0/+3
This is needed to build the cryptography library, since it does not provide wheels for ARMv7. Fixes #9403 Signed-off-by: Dan Callahan <danc@element.io>
2021-02-11Clarify when new ratelimiting was added. v1.27.0rc2Patrick Cloke1-1/+1
2021-02-11Update changelog.Patrick Cloke1-2/+2
2021-02-111.27.0rc2Patrick Cloke6-5/+23
2021-02-11Backout changes for automatically calculating the public baseurl. (#9313)Patrick Cloke16-41/+97
This breaks some people's configurations (if their Client-Server API is not accessed via port 443).
2021-02-10Show knock rooms in the public room directory and inform clients they can be ↵Andrew Morgan2-6/+10
knocked on (#82) This PR implements the ["Changes regarding the Public Rooms Directory"](https://github.com/Sorunome/matrix-doc/blob/soru/knock/proposals/2403-knock.md#changes-regarding-the-public-rooms-directory) section of knocking MSC2403. Specifically, it: * Allows rooms with `join_rule` "knock" to be returned by the query behind the public rooms directory * Adds the field `join_rule` to each room entry returned by a public rooms directory query, so clients can know whether to attempt a join or knock on a room This PR is a clone of [the mainline PR](https://github.com/matrix-org/synapse/pull/9359). Complement tests for this change: https://github.com/matrix-org/complement/pull/72.
2021-02-09Add knocking support (#81)Andrew Morgan34-117/+1567
Implement knocking as defined by https://github.com/matrix-org/matrix-doc/pull/2403 This is the base knocking stuff, taken from https://github.com/matrix-org/synapse/pull/6739 and does not include any public room directory changes. While knocking hasn't merged yet on mainline due to waiting on getting Complement into Synapse's CI, the code has been well-tested.
2021-02-09Add XWiki OIDC provider example. (#9324)Thomas Mortagne1-0/+22
2021-02-09Remove unneeded type constraints on 3rd party protocol lookup responsesBrendan Abolivier2-3/+1
2021-02-09Add complement running monolith synapse to buildkite pipeline (#80)Andrew Morgan1-0/+36
2021-02-09Fix Python Old-Deps CI step (#79)Andrew Morgan4-5/+12
* Fix the Python 3.5 old-deps build. (#9146) setuptools 51.0.0 dropped support for Python 3.5. * Fix Python 3.5 old deps build by using a compatible pip version. (#9217) Co-authored-by: Dan Callahan <danc@element.io> pip 21.0 stopped supporting Python 3.5. Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-02-08Type hints and validation improvements. (#9321)Patrick Cloke6-79/+177
* Adds type hints to the groups servlet and stringutils code. * Assert the maximum length of some input values for spec compliance.
2021-02-08Handle additional errors when previewing URLs. (#9333)Patrick Cloke3-30/+145
* Handle the case of lxml not finding a document tree. * Parse the document encoding from the XML tag.
2021-02-05Update type hints for Cursor to match PEP 249. (#9299)Jonathan de Jong5-17/+47
2021-02-05Update installation instructions on Fedora (#9322)Dan Callahan2-17/+4
Signed-off-by: Joseph Arnault <computerdude90042@outlook.com> Signed-off-by: Dan Callahan <danc@element.io> Co-authored-by: compu42 <56663749+compu42@users.noreply.github.com>
2021-02-04Add check_media_file_for_spam spam checker hookErik Johnston6-6/+210
2021-02-04Correct `matrix-synapse.service` reference in TURN howto docs. (#9308)dykstranet2-1/+2
2021-02-04Handle empty rooms when generating email notifications. (#9257)Patrick Cloke3-39/+226
Fixes some exceptions if the room state isn't quite as expected. If the expected state events aren't found, try to find them in the historical room state. If they still aren't found, fallback to a reasonable, although ugly, value.
2021-02-04Fix escaping of braces in OIDC sample config. (#9317)Patrick Cloke3-10/+11
This fixes the Jinja2 templates for the mapping provider.
2021-02-04Add experimental support for PyPy. (#9123)Jonathan de Jong4-8/+15
* Adds proper dependencies. * Minor fixes in database layer.
2021-02-03Add debug logging to DNS SRV requests. (#9305)Marcus2-0/+8
2021-02-03Social login UI polish (#9301)Richard van der Hoff15-81/+240
2021-02-03Clarify documentation about escaping URLs in templates. (#9310)Patrick Cloke3-20/+9
2021-02-03Add debug for OIDC flow (#9307)Richard van der Hoff2-15/+26
2021-02-03social login Fix username validation javascript (#9297)Richard van der Hoff3-21/+85
* fix validation and don't use built-in validation UI Co-authored-by: Bruno Windels <brunow@element.io>
2021-02-03Fix formatting for "bad session" error during sso registration flow (#9296)Richard van der Hoff2-3/+17
2021-02-03config: Add detail to auto_join_rooms comment (#9291)dykstranet3-0/+5
config: Add detail to auto_join_rooms comment Signed-off-by: Gary Dykstra <gary@dykstranet.com>
2021-02-03Typo fix in a comment: subequently -> subsequently. (#8988)Tim Gates1-1/+1
2021-02-03Convert blacklisted IPv4 addresses to compatible IPv6 addresses. (#9240)Patrick Cloke5-28/+160
Also add a few more IP ranges to the default blacklist.
2021-02-03Honour ratelimit flag for application services for invite ratelimiting (#9302)Erik Johnston4-51/+13
2021-02-02social login: add noopener to terms link (#9300)Richard van der Hoff2-1/+2
2021-02-02Update changelog v1.27.0rc1Erik Johnston1-0/+2
2021-02-02 1.27.0rc1Erik Johnston53-58/+71
2021-02-02Add an admin API to get the current room state (#9168)Travis Ralston6-1/+88
This could arguably replace the existing admin API for `/members`, however that is out of scope of this change. This sort of endpoint is ideal for moderation use cases as well as other applications, such as needing to retrieve various bits of information about a room to perform a task (like syncing power levels between two places). This endpoint exposes nothing more than an admin would be able to access with a `select *` query on their database.
2021-02-02Put SAML callback URI under /_synapse/client. (#9289)Richard van der Hoff10-13/+25
2021-02-01Put OIDC callback URI under /_synapse/client. (#9288)Richard van der Hoff11-28/+46
2021-02-01Add an OpenID example config for Gitea. (#9134)Oliver Hanikel2-0/+35
2021-02-01fix broken HTML tagRichard van der Hoff1-1/+1
2021-02-01make primary button not wider than viewportBruno Windels1-0/+1
2021-02-01Collect terms consent from the user during SSO registration (#9276)Richard van der Hoff9-0/+230
2021-02-01Improve styling and wording of SSO UIA templates (#9286)Richard van der Hoff6-25/+81
fixes #9171
2021-02-01Refactor email summary generation. (#9260)Patrick Cloke3-122/+204
* Fixes a case where no summary text was returned. * The use of messages_from_person vs. messages_from_person_and_others was tweaked to depend on whether there was 1 sender or multiple senders, not based on if there was 1 room or multiple rooms.
2021-02-01Improve styling and wording of SSO error templates (#9287)Richard van der Hoff5-60/+101
2021-02-01Make importing display name and email optional (#9277)Richard van der Hoff5-13/+82
2021-02-01Add phone home stats for encrypted messages. (#9283)Jan Christian Grünhage3-2/+64
Signed-off-by: Jan Christian Grünhage <jan.christian@gruenhage.xyz>
2021-02-01Prevent email UIA failures from raising a LoginError (#9265)Andrew Morgan2-10/+1
Context, Fixes: https://github.com/matrix-org/synapse/issues/9263 In the past to fix an issue with old Riots re-requesting threepid validation tokens, we raised a `LoginError` during UIA instead of `InteractiveAuthIncompleteError`. This is now breaking the way Tchap logs in - which isn't standard, but also isn't disallowed by the spec. An easy fix is just to remove the 4 year old workaround.
2021-02-01Replace username picker with a template (#9275)Richard van der Hoff15-204/+429
There's some prelimiary work here to pull out the construction of a jinja environment to a separate function. I wanted to load the template at display time rather than load time, so that it's easy to update on the fly. Honestly, I think we should do this with all our templates: the risk of ending up with malformed templates is far outweighed by the improved turnaround time for an admin trying to update them.
2021-02-01Improve styling and wording of SSO redirect confirm template (#9272)Richard van der Hoff11-30/+200
2021-02-01Fix SSO on workers (#9271)Richard van der Hoff8-65/+93
Fixes #8966. * Factor out build_synapse_client_resource_tree Start a function which will mount resources common to all workers. * Move sso init into build_synapse_client_resource_tree ... so that we don't have to do it for each worker * Fix SSO-login-via-a-worker Expose the SSO login endpoints on workers, like the documentation says. * Update workers config for new endpoints Add documentation for endpoints recently added (#8942, #9017, #9262) * remove submit_token from workers endpoints list this *doesn't* work on workers (yet). * changelog * Add a comment about the odd path for SAML2Resource
2021-02-01Split out a separate endpoint to complete SSO registration (#9262)Richard van der Hoff7-26/+145
There are going to be a couple of paths to get to the final step of SSO reg, and I want the URL in the browser to consistent. So, let's move the final step onto a separate path, which we redirect to.
2021-01-30Fixes for PyPy compatibility (#9270)Ivan Shapovalov2-1/+3
* synapse.app.base: only call gc.freeze() on CPython gc.freeze() is an implementation detail of CPython garbage collector, and notably does not exist on PyPy. Rather than playing whack-a-mole and skipping the call when under PyPy, simply restrict it to CPython because the whole gc module is implementation-defined. Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
2021-01-29Ratelimit invites by room and target user (#9258)Erik Johnston9-4/+192
2021-01-29Fix Debian builds on Xenial (#9254)Dan Callahan4-1/+11
Adds note about updating dh-virtualenv once we drop support for Xenial. We can't update now, because it needs debhelper 12, while Xenial only backports 10. Signed-off-by: Dan Callahan <danc@element.io>
2021-01-29Remove riot email registration backwards compatibility hackAndrew Morgan1-10/+0
This was causing a LoginError to be propagated up to the registration servlet, which was expecting a InteractiveAuthIncompleteError in order to store a password_hash from the client for the session. DINUM relies on this happening. More info here: https://github.com/matrix-org/synapse/issues/9263
2021-01-29Fix typo in UPGRADE.rstDenis Kasak1-2/+2
2021-01-28Ratelimit 3PID /requestToken API (#9238)Erik Johnston11-14/+159
2021-01-28Cache config options in SSL verification (#9255)Erik Johnston2-4/+10
Reading from the config object is *slow*.
2021-01-28FIXUP: linterDavid Teller3-2/+9
2021-01-28Add type hints to E2E handler. (#9232)Patrick Cloke7-177/+198
This finishes adding type hints to the `synapse.handlers` module.
2021-01-28FIXUP: Making get_event_context a bit more paranoidDavid Teller3-4/+10
2021-01-28FIXUP: Removing awaitableDavid Teller1-3/+3
2021-01-28FIXUP: DocDavid Teller1-0/+6
2021-01-28FIXUP: Now testing that the user is admin!David Teller3-6/+38
2021-01-28FIXUP: Don't filter events at all for admin/v1/rooms/.../context/...David Teller2-25/+10
2021-01-28FIXUP: Documenting /_synapse/admin/v1/rooms/<room_id>/context/<event_id>David Teller1-0/+119
2021-01-28New API /_synapse/admin/rooms/{roomId}/context/{eventId}David Teller6-8/+136
Signed-off-by: David Teller <davidt@element.io>
2021-01-27Add notes on integrating with Facebook for SSO login. (#9244)Richard van der Hoff2-5/+49
2021-01-27Add 'brand' field to MSC2858 response (#9242)Richard van der Hoff10-32/+55
We've decided to add a 'brand' field to help clients decide how to style the buttons. Also, fix up the allowed characters for idp_id, while I'm in the area.
2021-01-27Support for scraping email addresses from OIDC providers (#9245)Richard van der Hoff4-30/+53
2021-01-27Update debian changelog. v1.26.0-deb github/release-v1.26.0 release-v1.26.0Patrick Cloke1-2/+6
2021-01-27Check if a user is in the room before sending a PowerLevel event on their ↵Pankaj Yadav2-1/+12
behalf (#9235)
2021-01-27Move note above changes. v1.26.0Patrick Cloke1-2/+2
2021-01-27Clean-up the template loading code. (#9200)Patrick Cloke12-38/+96
* Enables autoescape by default for HTML files. * Adds a new read_template method for reading a single template. * Some logic clean-up.
2021-01-27Copy the upgrade note to 1.26.0.Patrick Cloke1-3/+7
2021-01-271.26.0Patrick Cloke2-1/+7
2021-01-27Add a note to changelog about redis usage (#9227)Erik Johnston3-1/+11
2021-01-27Implement MSC2858 support (#9183)Richard van der Hoff9-21/+230
Fixes #8928.
2021-01-27Pass a dict, instead of None, to modules if a None config is specified in ↵Andrew Morgan2-1/+3
the homeserver config (#9229) If a Synapse module's config block were empty in YAML, thus being translated to a `Nonetype` in Python, then some modules could fail as that None ends up getting passed to their `parse_config` method. Modules are expected to accept a `dict` instead. This PR ensures that if the user does end up specifying an empty config block (such as what [the default oidc config in the sample config](https://github.com/matrix-org/synapse/blob/5310808d3bebd17275355ecd474bc013e8c7462d/docs/sample_config.yaml#L1816-L1845) states) then `None` is not passed to the module. An empty dict is passed instead. This code assumes that no existing modules are relying on receiving a `None` config block, but I'd really hope that they aren't.
2021-01-26Add type hints to various handlers. (#9223)Patrick Cloke14-138/+205
With this change all handlers except the e2e_* ones have type hints enabled.
2021-01-26Do not require the CAS service URL setting (use public_baseurl instead). (#9199)Patrick Cloke5-16/+10
The current configuration is handled for backwards compatibility, but is considered deprecated.
2021-01-26Precompute joined hosts and store in Redis (#9198)Erik Johnston11-49/+265
2021-01-26Try to recover from unknown encodings when previewing media. (#9164)Patrick Cloke3-10/+64
Treat unknown encodings (according to lxml) as UTF-8 when generating a preview for HTML documents. This isn't fully accurate, but will hopefully give a reasonable title and summary.
2021-01-26Update isort to v5.7.0 (#9222)Andrew Morgan2-1/+2
This new version no longer has the problem of adding/removing a blank line in `.pyi` files, which black disagrees with. This would cause `isort` to slightly modify `.pyi` files, before `black` would subsequently modify back directly afterwards. Relevant `isort` issue: https://github.com/pycqa/isort/issues/1284
2021-01-26Periodically send pings to detect dead Redis connections (#9218)Erik Johnston4-57/+107
This is done by creating a custom `RedisFactory` subclass that periodically pings all connections in its pool. We also ensure that the `replyTimeout` param is non-null, so that we timeout waiting for the reply to those pings (and thus triggering a reconnect).
2021-01-26Fix get forward extremities queryJason Robinson1-1/+1
Signed-off-by: Jason Robinson <jasonr@matrix.org>
2021-01-26Make natural join inner joinJason Robinson1-2/+2
Co-authored-by: Erik Johnston <erik@matrix.org>
2021-01-25Don't error if deleting a non-existent pusher. (#9121)Patrick Cloke2-1/+4
2021-01-25Add an admin API for shadow-banning users. (#9209)Patrick Cloke8-7/+164
This expands the current shadow-banning feature to be usable via the admin API and adds documentation for it. A shadow-banned users receives successful responses to their client-server API requests, but the events are not propagated into rooms. Shadow-banning a user should be used as a tool of last resort and may lead to confusing or broken behaviour for the client.
2021-01-25Fix Python 3.5 old deps build by using a compatible pip version. (#9217)Patrick Cloke3-8/+11
Co-authored-by: Dan Callahan <danc@element.io> pip 21.0 stopped supporting Python 3.5.
2021-01-25Fix Python 3.5 old deps build by using a compatible pip version. (#9217)Patrick Cloke3-8/+11
Co-authored-by: Dan Callahan <danc@element.io> pip 21.0 stopped supporting Python 3.5.
2021-01-25Tweak changes. v1.26.0rc2Patrick Cloke1-2/+2
2021-01-251.26.0rc2Patrick Cloke7-6/+18
2021-01-25Handle missing content keys when calculating presentable names. (#9165)Patrick Cloke4-16/+242
Treat the content as untrusted and do not assume it is of the proper form.
2021-01-23Add depth and received_ts to forward_extremities admin API responseJason Robinson2-2/+9
Also add a warning on the admin API documentation. Signed-off-by: Jason Robinson <jasonr@matrix.org>
2021-01-22Fix chain cover update to handle events with duplicate auth events (#9210)Erik Johnston3-1/+14
2021-01-22Bump psycopg2 version (#9204)Erik Johnston3-3/+4
As we use `execute_values` with the `fetch` parameter.
2021-01-21Return a 404 if no valid thumbnail is found. (#9163)Patrick Cloke4-82/+183
If no thumbnail of the requested type exists, return a 404 instead of erroring. This doesn't quite match the spec (which does not define what happens if no thumbnail can be found), but is consistent with what Synapse already does.
2021-01-21Align the directories linted in CI with the defaults in scripts-dev/lint.sh ↵Andrew Morgan3-2/+5
(#9191) The lists of source directories to lint between `tox.ini` and `lint.sh` became out of sync. This PR tightens them up and adds some comments reminding any future readers to keep the list in sync.
2021-01-21Speed up chain cover calculation (#9176)Erik Johnston3-55/+161
2021-01-21Increase perf of handling concurrent use of StreamIDGenerators. (#9190)Erik Johnston2-8/+14
We have seen a failure mode here where if there are many in flight unfinished IDs then marking an ID as finished takes a lot of CPU (as calling deque.remove iterates over the list)
2021-01-21Add schema update to fix existing DBs affected by #9193 (#9195)Erik Johnston3-1/+20
2021-01-21Fix receipts or account data not being sent down sync (#9193)Erik Johnston5-7/+62
Introduced in #9104 This wasn't picked up by the tests as this is all fine the first time you run Synapse (after upgrading), but then when you restart the wrong value is pulled from `stream_positions`.
2021-01-21Use execute_batch in more places (#9188)Erik Johnston12-31/+26
* Use execute_batch in more places * Newsfile
2021-01-21Add tests for List Users Admin API (#9045)Dirk Klimpel3-30/+215
2021-01-21Add a parameter to enable/disable freeze feature (#78)Mathieu Velten2-1/+10
2021-01-21Add a check for duplicate IdP ids (#9184)Richard van der Hoff2-0/+12
2021-01-21Prefix idp_id with "oidc-" (#9189)Richard van der Hoff4-9/+35
... to avoid clashes with other SSO mechanisms
2021-01-21Use execute_batch instead of executemany in places (#9181)Erik Johnston3-12/+12
`execute_batch` does fewer round trips in postgres than `executemany`, but does not give a correct `txn.rowcount` result after.
2021-01-20Specify that the long description is rST in the package metadata. (#9180)Patrick Cloke2-0/+2
This avoids a warning when uploading packages to PyPI via twine.
2021-01-20Fix a typo in the release notes.Patrick Cloke1-1/+1
2021-01-20Fix reStructuredText formatting.Patrick Cloke1-1/+1
2021-01-20Point people to the upgrade notes. v1.26.0rc1Patrick Cloke1-0/+4
2021-01-20Formatting.Patrick Cloke1-1/+1
2021-01-20SQL formatting in UPGRADE.Patrick Cloke1-0/+4
2021-01-20Add upgrade notes about chain cover.Patrick Cloke1-8/+12
2021-01-20Include upgrade notes.Patrick Cloke1-0/+42
2021-01-20Re-run towncrier.Patrick Cloke4-4/+2
2021-01-20Tighten the restrictions on `idp_id` (#9177)Richard van der Hoff2-3/+10
2021-01-20Support icons for Identity Providers (#9154)Richard van der Hoff19-91/+146
2021-01-20Various improvements to the federation client. (#9129)Patrick Cloke2-58/+68
* Type hints for `FederationClient`. * Using `async` functions instead of returning `Awaitable` instances.
2021-01-20docs: Add link to Matrix VoIP tester for turn-howto (#9135)rht2-0/+7
Signed-off-by: rht <rhtbot@protonmail.com>
2021-01-20Give `public_baseurl` a default value (#9159)Richard van der Hoff14-83/+48
2021-01-20Reword confusing sentence in CHANGES.Patrick Cloke1-1/+1
2021-01-20Fix tenses in CHANGES.Patrick Cloke1-5/+5
2021-01-20Re-arrange CHANGES.md.Patrick Cloke1-10/+10
2021-01-201.26.0rc1Patrick Cloke76-75/+83
2021-01-20Use the account handler in additional places. (#9166)Patrick Cloke3-2/+5
2021-01-19Validate the server name for the /publicRooms endpoint. (#9161)Patrick Cloke2-2/+18
If a remote server name is provided, ensure it is something reasonable before making remote connections to it.
2021-01-19Replace 'perspectives' config block with 'trusted_key_servers' in docker ↵Andrew Morgan2-6/+5
homeserver.yaml template (#9157)
2021-01-19Fix error messages from OIDC config parsing (#9153)Richard van der Hoff2-10/+16
Make sure we report the correct config path for errors in the OIDC configs.
2021-01-19Ensure we read account validity templates from custom template dir if ↵Andrew Morgan2-1/+55
provided (#77)
2021-01-18Change check_3pid_allowed to async (#76)Mathieu Velten1-13/+10
2021-01-18Quote pip install with brackets to avoid shell interpretation. (#9151)Patrick Cloke3-2/+3
2021-01-18Allow moving account data and receipts streams off master (#9104)Erik Johnston27-280/+855
2021-01-18Enforce all replication HTTP clients calls use kwargs (#9144)Erik Johnston2-1/+2
2021-01-18Properly raise an exception when the body exceeds the max size. (#9145)Patrick Cloke3-2/+3
...instead of just creating the exception object and doing nothing with it.
2021-01-18Fix bugs in handling clientRedirectUrl, and improve OIDC tests (#9127, #9128)Richard van der Hoff9-86/+189
* Factor out a common TestHtmlParser Looks like I'm doing this in a few different places. * Improve OIDC login test Complete the OIDC login flow, rather than giving up halfway through. * Ensure that OIDC login works with multiple OIDC providers * Fix bugs in handling clientRedirectUrl - don't drop duplicate query-params, or params with no value - allow utf-8 in query-params
2021-01-18Fix the Python 3.5 old-deps build. (#9146)Patrick Cloke2-0/+4
setuptools 51.0.0 dropped support for Python 3.5.
2021-01-18Ensure the user ID is serialized in the payload instead of used as an ↵Patrick Cloke2-1/+2
instance name. (#9130)
2021-01-18link to the scalability blog post from workers.mdMatthew Hodgson1-0/+3
2021-01-15Fix test failure due to bad mergeRichard van der Hoff1-1/+3
0dd2649c1 (#9112) changed the signature of `auth_via_oidc`. Meanwhile, 26d10331e (#9091) introduced a new test which relied on the old signature of `auth_via_oidc`. The two branches were never tested together until they landed in develop.
2021-01-15Make chain cover index bg update go faster (#9124)Erik Johnston3-181/+366
We do this by allowing a single iteration to process multiple rooms at a time, as there are often a lot of really tiny rooms, which can massively slow things down.
2021-01-15Ensure we store pusher data as text (#9117)Richard van der Hoff2-3/+3
I don't think there's any need to use canonicaljson here. Fixes: #4475.
2021-01-15Land support for multiple OIDC providers (#9110)Richard van der Hoff7-382/+456
This is the final step for supporting multiple OIDC providers concurrently. First of all, we reorganise the config so that you can specify a list of OIDC providers, instead of a single one. Before: oidc_config: enabled: true issuer: "https://oidc_provider" # etc After: oidc_providers: - idp_id: prov1 issuer: "https://oidc_provider" - idp_id: prov2 issuer: "https://another_oidc_provider" The old format is still grandfathered in. With that done, it's then simply a matter of having OidcHandler instantiate a new OidcProvider for each configured provider.
2021-01-15Add an admin API endpoint to protect media. (#9086)Patrick Cloke4-18/+79
Protecting media stops it from being quarantined when e.g. all media in a room is quarantined. This is useful for sticker packs and other media that is uploaded by server administrators, but used by many people.
2021-01-15Avoid raising the body exceeded error multiple times. (#9108)Patrick Cloke4-3/+115
Previously this code generated unreferenced `Deferred` instances which caused "Unhandled Deferreds" errors to appear in error situations.
2021-01-15Remote dependency on distutils (#9125)Richard van der Hoff6-8/+33
`distutils` is pretty much deprecated these days, and replaced with `setuptools`. It's also annoying because it's you can't `pip install` it, and it's hard to figure out which debian package we should depend on to make sure it's there. Since we only use it for a tiny function anyway, let's just vendor said function into our codebase.
2021-01-15Add type hints to media rest resources. (#9093)Patrick Cloke13-165/+286
2021-01-15Improve UsernamePickerTestCase (#9112)Richard van der Hoff5-125/+114
* make the OIDC bits of the test work at a higher level - via the REST api instead of poking the OIDCHandler directly. * Move it to test_login.py, where I think it fits better.
2021-01-15Store an IdP ID in the OIDC session (#9109)Richard van der Hoff4-10/+42
Again in preparation for handling more than one OIDC provider, add a new caveat to the macaroon used as an OIDC session cookie, which remembers which OIDC provider we are talking to. In future, when we get a callback, we'll need it to make sure we talk to the right IdP. As part of this, I'm adding an idp_id and idp_name field to the OIDC configuration object. They aren't yet documented, and we'll just use the old values by default.
2021-01-15Add some extra notes for getting Synapse running on macOS. (#8997)Eric Eastwood4-1/+25
2021-01-14Fix event chain bg update. (#9118)Erik Johnston3-1/+10
We passed in a graph to `sorted_topologically` which didn't have an entry for each node (as we dropped nodes with no edges).
2021-01-14Fix perf of get_cross_signing_keys (#9116)Erik Johnston3-14/+30
2021-01-14Fix chain cover background update to work with split out event persisters ↵Erik Johnston5-29/+38
(#9115)
2021-01-14Fix get destinations to catch up query. (#9114)Erik Johnston2-13/+12
t was doing a sequential scan on `destination_rooms`, which took minutes.
2021-01-14Add background update for add chain cover index (#9029)Erik Johnston7-18/+360
2021-01-14Split OidcProvider out of OidcHandler (#9107)Richard van der Hoff4-144/+197
The idea here is that we will have an instance of OidcProvider for each configured IdP, with OidcHandler just doing the marshalling of them. For now it's still hardcoded with a single provider.
2021-01-14Fix wrong arguments being passed to BlacklistingAgentWrapper (#9098)Tim Leung2-1/+1
A reactor was being passed instead of a whitelist for the BlacklistingAgentWrapper used by the WellyKnownResolver. This coulld cause exceptions when attempting to connect to IP addresses that are blacklisted, but in reality this did not have any observable affect since this code is not used for IP literals.
2021-01-13Move `complete_sso_ui_auth` into SSOHandlerRichard van der Hoff2-28/+13
since we're hacking on this code anyway, may as well move it out of the cluttered AuthHandler.
2021-01-13Add a test for wrong user returned by SSORichard van der Hoff1-0/+27
2021-01-13Give the user a better error when they present bad SSO credsRichard van der Hoff5-5/+65
If a user tries to do UI Auth via SSO, but uses the wrong account on the SSO IdP, try to give them a better error. Previously, the UIA would claim to be successful, but then the operation in question would simply fail with "auth fail". Instead, serve up an error page which explains the failure.
2021-01-13Add a test for UI-Auth-via-SSO (#9082)Richard van der Hoff4-42/+227
* Add complete test for UI-Auth-via-SSO. * review comments
2021-01-13Reduce scope of exception handler. (#9106)Patrick Cloke2-5/+6
Removes a bare `except Exception` clause and replaces it with catching a specific exception around the portion that might throw.
2021-01-13Add jsonschema verification for the oidc provider configRichard van der Hoff1-0/+50