summary refs log tree commit diff
path: root/synapse/api (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move methods involving event authentication to EventAuthHandler. (#10268)Patrick Cloke2021-07-011-73/+2
| | | Instead of mixing them with user authentication methods.
* Correct type hints for synapse.event_auth. (#10253)Patrick Cloke2021-06-301-2/+3
|
* Do not recurse into non-spaces in the spaces summary. (#10256)Patrick Cloke2021-06-291-0/+6
| | | | | Previously m.child.room events in non-space rooms would be treated as part of the room graph, but this is no longer supported.
* MSC2918 Refresh tokens implementation (#9450)Quentin Gliech2021-06-241-0/+5
| | | | | | | | | | This implements refresh tokens, as defined by MSC2918 This MSC has been implemented client side in Hydrogen Web: vector-im/hydrogen-web#235 The basics of the MSC works: requesting refresh tokens on login, having the access tokens expire, and using the refresh token to get a new one. Signed-off-by: Quentin Gliech <quentingliech@gmail.com>
* Add endpoints for backfilling history (MSC2716) (#9247)Eric Eastwood2021-06-222-5/+17
| | | Work on https://github.com/matrix-org/matrix-doc/pull/2716
* Update MSC3083 support per changes in the MSC. (#10189)Patrick Cloke2021-06-171-0/+6
| | | Adds a "type" field and generalize "space" to "room_id".
* Make opentracing trace into event persistence (#10134)Richard van der Hoff2021-06-161-2/+2
| | | | | | | | | | | | | | * Trace event persistence When we persist a batch of events, set the parent opentracing span to the that from the request, so that we can trace all the way in. * changelog * When we force tracing, set a baggage item ... so that we can check again later. * Link in both directions between persist_events spans
* Remove support for unstable MSC1772 prefixes. (#10161)Patrick Cloke2021-06-151-3/+0
| | | | The stable prefixes have been supported since v1.34.0. The unstable prefixes are not supported by any known clients.
* Remove the experimental flag for knocking and use stable prefixes / ↵Patrick Cloke2021-06-152-5/+6
| | | | | | | endpoints. (#10167) * Room version 7 for knocking. * Stable prefixes and endpoints (both client and federation) for knocking. * Removes the experimental configuration flag.
* Implement knock feature (#6739)Sorunome2021-06-093-4/+29
| | | | | | This PR aims to implement the knock feature as proposed in https://github.com/matrix-org/matrix-doc/pull/2403 Signed-off-by: Sorunome mail@sorunome.de Signed-off-by: Andrew Morgan andrewm@element.io
* Set opentracing priority before setting other tags (#10092)Richard van der Hoff2021-05-281-4/+4
| | | ... because tags on spans which aren't being sampled get thrown away.
* Remove the experimental spaces enabled flag. (#10063)Patrick Cloke2021-05-261-1/+1
| | | | In lieu of just always enabling the unstable spaces endpoint and unstable room version.
* Support enabling opentracing by user (#9978)Richard van der Hoff2021-05-141-0/+5
| | | | | Add a config option which allows enabling opentracing by user id, eg for debugging requests made by a test user.
* Correctly ratelimit invites when creating a room (#9968)Brendan Abolivier2021-05-121-5/+17
| | | | | * Correctly ratelimit invites when creating a room Also allow ratelimiting for more than one action at a time.
* Fix `m.room_key_request` to-device messages (#9961)Richard van der Hoff2021-05-111-1/+4
| | | fixes #9960
* Follow-up to #9915 to correct the identifier for room types.Patrick Cloke2021-05-051-1/+1
|
* Support stable MSC1772 spaces identifiers. (#9915)Patrick Cloke2021-05-051-0/+3
| | | | Support both the unstable and stable identifiers. A future release will disable the unstable identifiers.
* Improved validation for received requests (#9817)Richard van der Hoff2021-04-231-0/+3
| | | | | | * Simplify `start_listening` callpath * Correctly check the size of uploaded files
* Add type hints to auth and auth_blocking. (#9876)Patrick Cloke2021-04-232-42/+45
|
* Check for space membership during a remote join of a restricted room (#9814)Patrick Cloke2021-04-231-0/+1
| | | | | | When receiving a /send_join request for a room with join rules set to 'restricted', check if the user is a member of the spaces defined in the 'allow' key of the join rules. This only applies to an experimental room version, as defined in MSC3083.
* Port "Allow users to click account renewal links multiple times without ↵Andrew Morgan2021-04-191-2/+4
| | | | | hitting an 'Invalid Token' page #74" from synapse-dinsic (#9832) This attempts to be a direct port of https://github.com/matrix-org/synapse-dinsic/pull/74 to mainline. There was some fiddling required to deal with the changes that have been made to mainline since (mainly dealing with the split of `RegistrationWorkerStore` from `RegistrationStore`, and the changes made to `self.make_request` in test code).
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-149-9/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Require AppserviceRegistrationType (#9548)Will Hunt2021-04-121-0/+5
| | | This change ensures that the appservice registration behaviour follows the spec. We decided to do this for Dendrite, so it made sense to also make a PR for synapse to correct the behaviour.
* Add an experimental room version to support restricted join rules. (#9717)Patrick Cloke2021-03-312-1/+25
| | | Per MSC3083.
* Make RateLimiter class check for ratelimit overrides (#9711)Erik Johnston2021-03-301-45/+55
| | | | | | | This should fix a class of bug where we forget to check if e.g. the appservice shouldn't be ratelimited. We also check the `ratelimit_override` table to check if the user has ratelimiting disabled. That table is really only meant to override the event sender ratelimiting, so we don't use any values from it (as they might not make sense for different rate limits), but we do infer that if ratelimiting is disabled for the user we should disabled all ratelimits. Fixes #9663
* Make it possible to use dmypy (#9692)Erik Johnston2021-03-261-0/+5
| | | | | | | | | Running `dmypy run` will do a `mypy` check while spinning up a daemon that makes rerunning `dmypy run` a lot faster. `dmypy` doesn't support `follow_imports = silent` and has `local_partial_types` enabled, so this PR enables those options and fixes the issues that were newly raised. Note that `local_partial_types` will be enabled by default in upcoming mypy releases.
* Merge branch 'develop' into babolivier/msc3026Brendan Abolivier2021-03-191-0/+6
|\
| * Initial spaces summary API (#9643)Richard van der Hoff2021-03-181-0/+6
| | | | | | This is very bare-bones for now: federation will come soon, while pagination is descoped for now but will come later.
* | Implement MSC3026: busy presence stateBrendan Abolivier2021-03-181-0/+1
|/
* Fix additional type hints from Twisted 21.2.0. (#9591)Patrick Cloke2021-03-121-1/+1
|
* Record the SSO Auth Provider in the login token (#9510)Richard van der Hoff2021-03-041-32/+9
| | | This great big stack of commits is a a whole load of hoop-jumping to make it easier to store additional values in login tokens, and then to actually store the SSO Identity Provider in the login token. (Making use of that data will follow in a subsequent PR.)
* Ratelimit cross-user key sharing requests. (#8957)Patrick Cloke2021-02-192-6/+11
|
* Add type hints to groups code. (#9393)Patrick Cloke2021-02-171-0/+5
|
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-164-19/+24
| | | | | | | - Update black version to the latest - Run black auto formatting over the codebase - Run autoformatting according to [`docs/code_style.md `](https://github.com/matrix-org/synapse/blob/80d6dc9783aa80886a133756028984dbf8920168/docs/code_style.md) - Update `code_style.md` docs around installing black to use the correct version
* Backout changes for automatically calculating the public baseurl. (#9313)Patrick Cloke2021-02-111-0/+2
| | | | This breaks some people's configurations (if their Client-Server API is not accessed via port 443).
* Give `public_baseurl` a default value (#9159)Richard van der Hoff2021-01-201-2/+0
|
* Kill off `HomeServer.get_ip_from_request()` (#9080)Richard van der Hoff2021-01-121-2/+2
| | | Homeserver.get_ip_from_request() used to be a bit more complicated, but now it is totally redundant. Let's get rid of it.
* Remove SynapseRequest.get_user_agent (#9069)Richard van der Hoff2021-01-121-1/+2
| | | | | | | | | | | SynapseRequest is in danger of becoming a bit of a dumping-ground for "useful stuff relating to Requests", which isn't really its intention (its purpose is to override render, finished and connectionLost to set up the LoggingContext and write the right entries to the request log). Putting utility functions inside SynapseRequest means that lots of our code ends up requiring a SynapseRequest when there is nothing synapse-specific about the Request at all, and any old twisted.web.iweb.IRequest will do. This increases code coupling and makes testing more difficult. In short: move get_user_agent out to a utility function.
* Implement MSC2176: Updated redaction rules (#8984)Patrick Cloke2021-01-051-6/+26
| | | | An experimental room version ("org.matrix.msc2176") contains the new redaction rules for testing.
* Merge remote-tracking branch 'origin/erikj/as_mau_block' into developErik Johnston2020-12-181-0/+7
|\
| * Don't MAU limit AS ghost usersErik Johnston2020-12-171-0/+7
| |
* | Try and drop stale extremities. (#8929)Erik Johnston2020-12-181-0/+2
| | | | | | | | If we see stale extremities while persisting events, and notice that they don't change the result of state resolution, we drop them.
* | Do not assume that the contents dictionary includes history_visibility. (#8945)Patrick Cloke2020-12-162-2/+10
| |
* | Honour AS ratelimit settings for /login requests (#8920)Erik Johnston2020-12-111-1/+3
|/ | | | Fixes #8846.
* Add admin API for logging in as a user (#8617)Erik Johnston2020-11-171-4/+29
|
* Add ability for access tokens to belong to one user but grant access to ↵Erik Johnston2020-10-291-67/+46
| | | | | | | | | | another user. (#8616) We do it this way round so that only the "owner" can delete the access token (i.e. `/logout/all` by the "owner" also deletes that token, but `/logout/all` by the "target user" doesn't). A future PR will add an API for creating such a token. When the target user and authenticated entity are different the `Processed request` log line will be logged with a: `{@admin:server as @bob:server} ...`. I'm not convinced by that format (especially since it adds spaces in there, making it harder to use `cut -d ' '` to chop off the start of log lines). Suggestions welcome.
* Fix handling of User-Agent headers with bad utf-8. (#8632)Erik Johnston2020-10-231-3/+1
|
* type annotations for LruCacheRichard van der Hoff2020-10-161-1/+3
|
* Make LruCache register its own metrics (#8561)Richard van der Hoff2020-10-161-3/+1
| | | | | rather than have everything that instantiates an LruCache manage metrics separately, have LruCache do it itself.
* Do not assume that account data is of the correct form. (#8454)Patrick Cloke2020-10-051-0/+5
| | | | This fixes a bug where `m.ignored_user_list` was assumed to be a dict, leading to odd behavior for users who set it to something else.
* Don't push if an user account has expired (#8353)Mathieu Velten2020-09-231-5/+1
|
* Simplify super() calls to Python 3 syntax. (#8344)Patrick Cloke2020-09-182-28/+24
| | | | | | | This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
* Show a confirmation page during user password reset (#8004)Andrew Morgan2020-09-101-0/+1
| | | | | This PR adds a confirmation step to resetting your user password between clicking the link in your email and your password actually being reset. This is to better align our password reset flow with the industry standard of requiring a confirmation from the user after email validation.
* Directly import json from the standard library. (#8259)Patrick Cloke2020-09-081-1/+1
| | | | | By importing from canonicaljson the simplejson module was still being used in some situations. After this change the std lib json is consistenty used throughout Synapse.
* Stop sub-classing object (#8249)Patrick Cloke2020-09-048-26/+26
|
* Do not apply ratelimiting on joins to appservices (#8139)Will Hunt2020-08-211-0/+37
| | | | | | Add new method ratelimiter.can_requester_do_action and ensure that appservices are exempt from being ratelimited. Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: Erik Johnston <erik@matrix.org>
* Stop shadow-banned users from sending invites. (#8095)Patrick Cloke2020-08-201-0/+8
|
* Be stricter about JSON that is accepted by Synapse (#8106)Patrick Cloke2020-08-191-3/+3
|
* Convert stream database to async/await. (#8074)Patrick Cloke2020-08-172-1/+70
|
* Add a shadow-banned flag to users. (#8092)Patrick Cloke2020-08-141-1/+11
|
* Convert synapse.api to async/await (#8031)Patrick Cloke2020-08-063-80/+63
|
* Improve performance of the register endpoint (#8009)Patrick Cloke2020-08-061-1/+3
|
* Convert a synapse.events to async/await. (#7949)Patrick Cloke2020-07-271-1/+1
|
* Convert state resolution to async/await (#7942)Patrick Cloke2020-07-241-4/+8
|
* Ensure that calls to `json.dumps` are compatible with the standard library ↵Patrick Cloke2020-07-151-1/+3
| | | | json. (#7836)
* Improve the type hints of synapse.api.errors. (#7820)Patrick Cloke2020-07-141-55/+73
|
* Do not use canonicaljson to magically handle decoding bytes from JSON. (#7802)Patrick Cloke2020-07-101-4/+2
|
* Fix some spelling mistakes / typos. (#7811)Patrick Cloke2020-07-091-1/+1
|
* isort 5 compatibility (#7786)Will Hunt2020-07-051-2/+1
| | | The CI appears to use the latest version of isort, which is a problem when isort gets a major version bump. Rather than try to pin the version, I've done the necessary to make isort5 happy with synapse.
* Replace all remaining six usage with native Python 3 equivalents (#7704)Dagfinn Ilmari Mannsåker2020-06-163-9/+5
|
* Replace iteritems/itervalues/iterkeys with native versions. (#7692)Patrick Cloke2020-06-152-5/+2
|
* Add option to enable encryption by default for new rooms (#7639)Andrew Morgan2020-06-101-0/+5
| | | | | | | | | Fixes https://github.com/matrix-org/synapse/issues/2431 Adds config option `encryption_enabled_by_default_for_room_type`, which determines whether encryption should be enabled with the default encryption algorithm in private or public rooms upon creation. Whether the room is private or public is decided based upon the room creation preset that is used. Part of this PR is also pulling out all of the individual instances of `m.megolm.v1.aes-sha2` into a constant variable to eliminate typos ala https://github.com/matrix-org/synapse/pull/7637 Based on #7637
* Update to the stable SSO prefix for UI Auth. (#7630)Patrick Cloke2020-06-051-1/+1
|
* Fix type information on `assert_*_is_admin` methods (#7645)Richard van der Hoff2020-06-051-4/+4
| | | These things don't return Deferreds.
* Remove some unused constants. (#7644)Richard van der Hoff2020-06-051-4/+0
|
* Performance improvements and refactor of Ratelimiter (#7595)Andrew Morgan2020-06-051-35/+118
| | | | | | | | | | While working on https://github.com/matrix-org/synapse/issues/5665 I found myself digging into the `Ratelimiter` class and seeing that it was both: * Rather undocumented, and * causing a *lot* of config checks This PR attempts to refactor and comment the `Ratelimiter` class, as well as encourage config file accesses to only be done at instantiation. Best to be reviewed commit-by-commit.
* Implement room version 6 (MSC2240). (#7506)Patrick Cloke2020-05-151-26/+4
|
* Strictly enforce canonicaljson requirements in a new room version (#7381)Patrick Cloke2020-05-141-1/+23
|
* Enforce MSC2209: auth rules for notifications in power level event (#7502)Patrick Cloke2020-05-141-1/+21
| | | | In a new room version, the "notifications" key of power level events are subject to restricted auth rules.
* Allow expired accounts to logout (#7443)Andrew Morgan2020-05-141-17/+33
|
* Allow configuration of Synapse's cache without using synctl or environment ↵Amber Brown2020-05-111-2/+2
| | | | variables (#6391)
* Stop Auth methods from polling the config on every req. (#7420)Andrew Morgan2020-05-062-73/+114
|
* async/await is_server_admin (#7363)Andrew Morgan2020-05-011-5/+4
|
* Stop the master relaying USER_SYNC for other workers (#7318)Richard van der Hoff2020-04-221-0/+2
| | | | | | | Long story short: if we're handling presence on the current worker, we shouldn't be sending USER_SYNC commands over replication. In an attempt to figure out what is going on here, I ended up refactoring some bits of the presencehandler code, so the first 4 commits here are non-functional refactors to move this code slightly closer to sanity. (There's still plenty to do here :/). Suggest reviewing individual commits. Fixes (I hope) #7257.
* Convert http.HTTPStatus objects to their int equivalent (#7188)Andrew Morgan2020-04-031-1/+8
|
* Support SAML in the user interactive authentication workflow. (#7102)Patrick Cloke2020-04-011-0/+1
|
* Allow server admins to define and enforce a password policy (MSC2000). (#7118)Dirk Klimpel2020-03-261-0/+21
|
* Remove special auth and redaction rules for aliases events in experimental ↵Patrick Cloke2020-03-091-4/+5
| | | | room ver. (#7037)
* Allow deleting an alias if the user has sufficient power level (#6986)Patrick Cloke2020-03-041-7/+2
|
* Validate the alt_aliases property of canonical alias events (#6971)Patrick Cloke2020-03-031-0/+1
|
* Publishing/removing from the directory requires a power level greater than ↵Patrick Cloke2020-02-211-5/+5
| | | | canonical aliases.
* Add `allow_departed_users` param to `check_in_room_or_world_readable`Richard van der Hoff2020-02-191-3/+13
| | | | | | | ... and set it everywhere it's called. while we're here, rename it for consistency with `check_user_in_room` (and to help check that I haven't missed any instances)
* Refactor the membership check methods in AuthRichard van der Hoff2020-02-181-43/+37
| | | | | these were getting a bit unwieldy, so let's combine `check_joined_room` and `check_user_was_in_room` into a single `check_user_in_room`.
* Fix detecting unknown devices from remote encrypted events. (#6848)Erik Johnston2020-02-041-2/+1
| | | | | | | | We were looking at the wrong event type (`m.room.encryption` vs `m.room.encrypted`). Also fixup the duplicate `EvenTypes` entries. Introduced in #6776.
* Add `get_room_version` methodRichard van der Hoff2020-01-311-4/+2
| | | | So that we can start factoring out some of this boilerplatey boilerplate.
* Implement updated auth rules from MSC2260Richard van der Hoff2020-01-281-0/+16
|
* Pass room version object into event_auth.check and check_redaction (#6788)Richard van der Hoff2020-01-281-2/+5
| | | | | | | These are easier to work with than the strings and we normally have one around. This fixes `FederationHander._persist_auth_tree` which was passing a RoomVersion object into event_auth.check instead of a string.
* Fixup synapse.api to pass mypy (#6733)Erik Johnston2020-01-202-3/+8
|
* Add StateMap type alias (#6715)Erik Johnston2020-01-161-6/+2
|
* Implement RedirectException (#6687)Richard van der Hoff2020-01-151-1/+26
| | | | | Allow REST endpoint implemnentations to raise a RedirectException, which will redirect the user's browser to a given location.
* Kill off RegistrationError (#6691)Richard van der Hoff2020-01-131-6/+0
| | | This is pretty pointless. Let's just use SynapseError.
* Remove unused, undocumented "content repo" resource (#6628)Richard van der Hoff2020-01-031-1/+0
| | | | | | This looks like it got half-killed back in #888. Fixes #6567.
* Change EventContext to use the Storage class (#6564)Erik Johnston2019-12-201-1/+1
|
* Add auth events as per spec. (#6556)Erik Johnston2019-12-161-67/+34
| | | | | Previously we tried to be clever and filter out some unnecessary event IDs to keep the auth chain small, but that had some annoying interactions with state res v2 so we stop doing that for now.
* Merge pull request #6329 from matrix-org/babolivier/context_filtersBrendan Abolivier2019-12-042-1/+5
|\ | | | | Filter state, events_before and events_after in /context requests
| * Merge branch 'develop' into babolivier/context_filtersBrendan Abolivier2019-12-042-1/+3
| |\
| * | Update copyrightsBrendan Abolivier2019-11-052-1/+5
| | |
* | | Add ephemeral messages support (MSC2228) (#6409)Brendan Abolivier2019-12-031-0/+4
| |/ |/| | | | | | | | | | | | | Implement part [MSC2228](https://github.com/matrix-org/matrix-doc/pull/2228). The parts that differ are: * the feature is hidden behind a configuration flag (`enable_ephemeral_messages`) * self-destruction doesn't happen for state events * only implement support for the `m.self_destruct_after` field (not the `m.self_destruct` one) * doesn't send synthetic redactions to clients because for this specific case we consider the clients to be able to destroy an event themselves, instead we just censor it (by pruning its JSON) in the database
* | Merge branch 'develop' into babolivier/message_retentionBrendan Abolivier2019-11-261-1/+1
|\ \
| * | Replace instance variations of homeserver with correct case/spacingAndrew Morgan2019-11-121-1/+1
| |/
* / Implement per-room message retention policiesBrendan Abolivier2019-11-041-0/+2
|/
* Merge pull request #6301 from matrix-org/babolivier/msc2326Brendan Abolivier2019-11-012-2/+20
|\ | | | | Implement MSC2326 (label based filtering)
| * Incorporate reviewBrendan Abolivier2019-11-012-2/+2
| |
| * LintBrendan Abolivier2019-11-011-0/+1
| |
| * Incorporate reviewBrendan Abolivier2019-11-012-3/+8
| |
| * Add unit testsBrendan Abolivier2019-10-301-1/+1
| |
| * Implement filteringBrendan Abolivier2019-10-301-2/+11
| |
| * Store labels for new eventsBrendan Abolivier2019-10-301-0/+3
| |
* | Remove usage of deprecated logger.warn method from codebase (#6271)Andrew Morgan2019-10-311-1/+1
|/ | | Replace every instance of `logger.warn` with `logger.warning` as the former is deprecated.
* Option to suppress resource exceeded alerting (#6173)Neil Johnson2019-10-242-3/+16
| | | | The expected use case is to suppress MAU limiting on small instances
* Remove Auth.check method (#6217)Richard van der Hoff2019-10-181-18/+1
| | | This method was somewhat redundant, and confusing.
* Merge branch 'uhoreg/e2e_cross-signing_merged' into developHubert Chathi2019-10-181-0/+1
|\
| * Merge branch 'develop' into uhoreg/e2e_cross-signing_mergedHubert Chathi2019-10-183-5/+18
| |\
| * \ Merge branch 'develop' into cross-signing_keysHubert Chathi2019-09-041-8/+7
| |\ \
| * \ \ Merge branch 'uhoreg/e2e_cross-signing_merged' into cross-signing_keysHubert Chathi2019-08-283-2/+8
| |\ \ \
| * \ \ \ Merge branch 'cross-signing_hidden' into cross-signing_keysHubert Chathi2019-08-012-48/+26
| |\ \ \ \
| * | | | | allow uploading keys for cross-signingHubert Chathi2019-07-251-0/+1
| | | | | |
* | | | | | rip out some unreachable codeRichard van der Hoff2019-10-171-2/+0
| |_|_|_|/ |/| | | | | | | | | | | | | | The only possible rejection reason is AUTH_ERROR, so all of this is unreachable.
* | | | | Fix up some typechecking (#6150)Amber Brown2019-10-022-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * type checking fixes * changelog
* | | | | Add device and appservice tagsErik Johnston2019-09-251-0/+3
| | | | |
* | | | | Don't create new span for get_user_by_reqErik Johnston2019-09-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't actually care about what happens in `get_user_by_req` and having it as a separate span means that the entity tag isn't added to the servlet spans, making it harder to search.
* | | | | Ensure support users can be registered even if MAU limit is reachedJason Robinson2019-09-111-2/+9
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows support users to be created even on MAU limits via the admin API. Support users are excluded from MAU after creation, so it makes sense to exclude them in creation - except if the whole host is in disabled state. Signed-off-by: Jason Robinson <jasonr@matrix.org>
* | | | Remove double return statements (#5962)Andrew Morgan2019-09-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove all the "double return" statements which were a result of us removing all the instances of ``` defer.returnValue(...) return ``` statements when we switched to python3 fully.
* | | | Remove unnecessary parentheses around return statements (#5931)Andrew Morgan2019-08-301-7/+7
| |_|/ |/| | | | | | | | | | | Python will return a tuple whether there are parentheses around the returned values or not. I'm just sick of my editor complaining about this all over the place :)
* | | Add bot typeHalf-Shot2019-08-231-1/+2
| | |
* | | Opentracing misc (#5856)Jorik Schellekens2019-08-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add authenticated_entity and servlet_names tags. Functionally: - Add a tag for authenticated_entity - Add a tag for servlet_names Stylistically: Moved to importing methods directly from opentracing.
* | | Change user deactivated errcode to USER_DEACTIVATED and use it (#5686)Andrew Morgan2019-07-311-1/+2
| |/ |/| | | | | | | This is intended as an amendment to #5674 as using M_UNKNOWN as the errcode makes it hard for clients to differentiate between an invalid password and a deactivated user (the problem we were trying to solve in the first place). M_UNKNOWN was originally chosen as it was presumed than an MSC would have to be carried out to add a new code, but as Synapse often is the testing bed for new MSC implementations, it makes sense to try it out first in the wild and then add it into the spec if it is successful. Thus this PR return a new M_USER_DEACTIVATED code when a deactivated user attempts to login.
* | Remove non-functional 'expire_access_token' setting (#5782)Richard van der Hoff2019-07-301-23/+5
| | | | | | | | | | | | | | | | The `expire_access_token` didn't do what it sounded like it should do. What it actually did was make Synapse enforce the 'time' caveat on macaroons used as access tokens, but since our access token macaroons never contained such a caveat, it was always a no-op. (The code to add 'time' caveats was removed back in v0.18.5, in #1656)
* | Replace returnValue with return (#5736)Amber Brown2019-07-232-25/+21
|/
* Ignore redactions of m.room.create events (#5701)Richard van der Hoff2019-07-171-15/+0
|
* Return a different error from Invalid Password when a user is deactivated ↵Andrew Morgan2019-07-151-0/+16
| | | | | (#5674) Return `This account has been deactivated` instead of `Invalid password` when a user is deactivated.
* Implement access token expiry (#5660)Richard van der Hoff2019-07-122-1/+19
| | | | Record how long an access token is valid for, and raise a soft-logout once it expires.
* Clean up exception handling for access_tokens (#5656)Richard van der Hoff2019-07-112-89/+71
| | | | | | | | | | | | | | | | First of all, let's get rid of `TOKEN_NOT_FOUND_HTTP_STATUS`. It was a hack we did at one point when it was possible to return either a 403 or a 401 if the creds were missing. We always return a 401 in these cases now (thankfully), so it's not needed. Let's also stop abusing `AuthError` for these cases. Honestly they have nothing that relates them to the other places that `AuthError` is used, other than the fact that they are loosely under the 'Auth' banner. It makes no sense for them to share exception classes. Instead, let's add a couple of new exception classes: `InvalidClientTokenError` and `MissingClientTokenError`, for the `M_UNKNOWN_TOKEN` and `M_MISSING_TOKEN` cases respectively - and an `InvalidClientCredentialsError` base class for the two of them.
* Run Black. (#5482)Amber Brown2019-06-207-337/+231
|
* Merge pull request #5363 from ↵Brendan Abolivier2019-06-101-2/+13
|\ | | | | | | | | matrix-org/babolivier/account_validity_send_mail_auth Don't check whether the user's account is expired on /send_mail requests
| * Better wordingBrendan Abolivier2019-06-101-1/+1
| |
| * DocBrendan Abolivier2019-06-101-0/+5
| |
| * Don't check whether the user's account is expired on /send_mail requestsBrendan Abolivier2019-06-051-2/+8
| |
* | Add ability to perform password reset via email without trusting the ↵Andrew Morgan2019-06-061-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | identity server (#5377) Sends password reset emails from the homeserver instead of proxying to the identity server. This is now the default behaviour for security reasons. If you wish to continue proxying password reset requests to the identity server you must now enable the email.trust_identity_server_for_password_resets option. This PR is a culmination of 3 smaller PRs which have each been separately reviewed: * #5308 * #5345 * #5368
* | Implement room v5 which enforces signing key validityRichard van der Hoff2019-06-051-5/+5
| | | | | | | | | | Implements [MSC2077](https://github.com/matrix-org/matrix-doc/pull/2077) and fixes #5247 and #4364.
* | Add a test room version where we enforce key validity (#5348)Richard van der Hoff2019-06-051-7/+13
| |
* | Implement the SHHS complexity API (#5216)Amber Brown2019-05-301-0/+1
| |
* | Add config option for setting homeserver's default room version (#5223)Andrew Morgan2019-05-231-4/+0
| | | | | | | | | | Replaces DEFAULT_ROOM_VERSION constant with a method that first checks the config, then returns a hardcoded value if the option is not present. That hardcoded value is now located in the server.py config file.
* | Room Statistics (#4338)Amber Brown2019-05-211-0/+1
| |
* | Introduce room v4 which updates event ID format. (#5217)Richard van der Hoff2019-05-211-4/+4
| | | | | | Implements https://github.com/matrix-org/matrix-doc/pull/2002.
* | Fix error handling for rooms whose versions are unknown. (#5219)Richard van der Hoff2019-05-211-1/+15
| | | | | | | | | | | | | | If we remove support for a particular room version, we should behave more gracefully. This should make client requests fail with a 400 rather than a 500, and will ignore individiual PDUs in a federation transaction, rather than the whole transaction.
* | Add a test room version which updates event ID format (#5210)Richard van der Hoff2019-05-201-2/+11
| | | | | | Implements MSC1884
* | Rename relation types to match MSCErik Johnston2019-05-201-2/+2
| |
* | Merge pull request #5209 from matrix-org/erikj/reactions_baseErik Johnston2019-05-201-0/+8
|\ \ | | | | | | Land basic reaction and edit support.
| * | Add simple send_relation API and track in DBErik Johnston2019-05-151-0/+8
| | |
* | | Limit UserIds to a length that fits in a state key (#5198)ReidAnderson2019-05-201-0/+3
| |/ |/|
* | Drop support for v2_alpha API prefix (#5190)Richard van der Hoff2019-05-151-2/+1
|/
* Do checks on aliases for incoming m.room.aliases events (#5128)Brendan Abolivier2019-05-081-0/+3
| | | | | Follow-up to #5124 Also added a bunch of checks to make sure everything (both the stuff added on #5124 and this PR) works as intended.
* Factor out an "assert_requester_is_admin" function (#5120)Richard van der Hoff2019-05-021-1/+1
| | | | Rather than copying-and-pasting the same four lines hundreds of times
* Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2019-04-174-43/+95
|\ | | | | | | babolivier/account_expiration
| * Merge pull request #5047 from matrix-org/babolivier/account_expirationBrendan Abolivier2019-04-171-2/+3
| |\ | | | | | | Send out emails with links to extend an account's validity period
| * | Remove periods from copyright headers (#5046)Andrew Morgan2019-04-113-3/+3
| | |
| * | Merge pull request #5027 from matrix-org/babolivier/account_expirationBrendan Abolivier2019-04-092-0/+13
| |\ \ | | | | | | | | Add time-based account expiration
| * | | Transfer related groups on room upgrade (#4990)Andrew Morgan2019-04-021-0/+1
| | | | | | | | | | | | Transfers the m.room.related_groups state event on room upgrade.
| * | | Collect room-version variations into one place (#4969)Richard van der Hoff2019-04-012-40/+91
| | | | | | | | | | | | | | | | Collect all the things that make room-versions different to one another into one place, so that it's easier to define new room versions.
* | | | Add management endpoints for account validityBrendan Abolivier2019-04-171-1/+1
| |_|/ |/| |
* | | Send out emails with links to extend an account's validity periodBrendan Abolivier2019-04-171-2/+3
| |/ |/|
* | Add account expiration featureBrendan Abolivier2019-04-092-0/+13
|/
* Support 3PID login in password providers (#4931)Andrew Morgan2019-03-261-11/+11
| | | | | Adds a new method, check_3pid_auth, which gives password providers the chance to allow authentication with third-party identifiers such as email or msisdn.
* Enforce hs_disabled_message correctlyRichard van der Hoff2019-03-191-3/+5
| | | | | Fixes a bug where hs_disabled_message was not enforced for 3pid-based requests if there was no server_notices_mxid configured.
* Add ratelimiting on login (#4821)Brendan Abolivier2019-03-151-0/+12
| | | Add two ratelimiters on login (per-IP address and per-userID).
* Add rate-limiting on registration (#4735)Brendan Abolivier2019-03-051-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rate-limiting for registration * Add unit test for registration rate limiting * Add config parameters for rate limiting on auth endpoints * Doc * Fix doc of rate limiting function Co-Authored-By: babolivier <contact@brendanabolivier.com> * Incorporate review * Fix config parsing * Fix linting errors * Set default config for auth rate limiting * Fix tests * Add changelog * Advance reactor instead of mocked clock * Move parameters to registration specific config and give them more sensible default values * Remove unused config options * Don't mock the rate limiter un MAU tests * Rename _register_with_store into register_with_store * Make CI happy * Remove unused import * Update sample config * Fix ratelimiting test for py2 * Add non-guest test
* Merge remote-tracking branch 'origin/release-v0.99.0' into developRichard van der Hoff2019-01-301-1/+1
|\
| * Update constants.pyNeil Johnson2019-01-301-1/+1
| | | | | | remove trailing ,
* | by default include m.room.encryption on invites (#3902)Matthew Hodgson2019-01-301-0/+1
|/ | | | | | | | * by default include m.room.encryption on invites * fix constant * changelog
* Merge branch 'develop' into neilj/room_capabilitiesNeil Johnson2019-01-303-20/+43
|\
| * Enable room version v3Erik Johnston2019-01-291-1/+2
| |
| * Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2019-01-292-12/+3
| |\ | | | | | | | | | erikj/redactions_eiah
| | * Implement event format v2Erik Johnston2019-01-291-0/+2
| | |
| | * Remove dead functionErik Johnston2019-01-291-11/+0
| | |
| | * Replace usage of builder.user_id with builder.senderErik Johnston2019-01-291-1/+1
| | | | | | | | | | | | | | | `.user_id` is proxed to `.sender` in FrozenEvent, so this has no functional change
| * | Drop vdh supportErik Johnston2019-01-291-2/+0
| | |
| * | Finish comment...Erik Johnston2019-01-291-1/+1
| | |
| * | Implement rechecking of redactionsErik Johnston2019-01-291-2/+2
| | |
| * | Add RoomVersions.V3 constant, without enabling itErik Johnston2019-01-291-0/+1
| |/ | | | | | | | | | | We add the constant, but don't add it to the known room versions. This lets us start adding V3 logic, but the servers will never join or create V3 rooms
| * Pass through room version to event authErik Johnston2019-01-251-4/+10
| |
| * Merge pull request #4415 from matrix-org/anoa/full_search_upgraded_roomsAndrew Morgan2019-01-251-0/+14
| |\ | | | | | | Ability to search entire room history after upgrading room
| | * Update synapse/api/filtering.pyRichard van der Hoff2019-01-241-1/+1
| | | | | | | | | Co-Authored-By: anoadragon453 <1342360+anoadragon453@users.noreply.github.com>
| | * Ensure new filter is actually createdAndrew Morgan2019-01-221-1/+1
| | |
| | * Fix a bug with single-room search searching all roomsAndrew Morgan2019-01-221-2/+13
| | | | | | | | | | | | | | | * Create a new method for getting predecessor rooms * Remove formatting change
| | * Search for messages across predecessor roomsAndrew Morgan2019-01-181-0/+3
| | | | | | | | | | | | Signed-off-by: Andrew Morgan <andrew@amorgan.xyz>
| * | Merge pull request #4437 from matrix-org/erikj/event_format_version_v2Erik Johnston2019-01-241-0/+13
| |\ \ | | | | | | | | Add support for persisting event format versions
| | * | Add support for persisting event format versionsErik Johnston2019-01-231-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we only have the one event format version defined, but this adds the necessary infrastructure to persist and fetch the format versions alongside the events. We specify the format version rather than the room version as: 1. We don't necessarily know the room version, existing events may be either v1 or v2. 2. We'd need to be careful to prevent/handle correctly if different events in the same room reported to be of different versions, which sounds annoying.
* | | | define room dispositions for use in exposing room capabilitiesNeil Johnson2019-01-301-0/+5
| | | |
* | | | reflect that rooms v3 is a stable room versionNeil Johnson2019-01-301-0/+1
| | | |
* | | | backout v3Neil Johnson2019-01-251-1/+0
| | | |
* | | | track unstable room v3Neil Johnson2019-01-251-0/+2
|/ / /
* / / Fix None guard in config.server.is_threepid_reservedNeil Johnson2019-01-221-1/+3
|/ /
* | Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2019-01-211-1/+2
|\ \ | | | | | | | | | erikj/fed_v2_invite_server
| * \ Merge pull request #4390 from matrix-org/erikj/versioned_fed_apisErik Johnston2019-01-211-1/+2
| |\ \ | | | | | | | | Add groundwork for new versions of federation APIs
| * | | Migrate encryption state on room upgrade (#4411)Andrew Morgan2019-01-211-0/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | * Migrate encryption state on room upgrade Signed-off-by: Andrew Morgan <andrew@amorgan.xyz> * Add changelog file
| * | ALL_USER_TYPES should be a tupleNeil Johnson2019-01-151-1/+1
| | |
* | | Add /v2/invite federation APIErik Johnston2019-01-151-0/+1
| |/ |/|
* | Add groundwork for new versions of federation APIsErik Johnston2019-01-151-1/+2
|/
* Merge branch rav/macaroon_key_fix_0.34 into rav/macaroon_key_fix_0.34.1Richard van der Hoff2019-01-101-38/+27
|\ | | | | | | Fixes #4371
| * Merge branch 'rav/macaroon_key_fix' into rav/macaroon_key_fix_0.34Richard van der Hoff2019-01-101-38/+27
| |\
| | * Skip macaroon check for access tokens in the dbRichard van der Hoff2019-01-101-38/+27
| | |
* | | Refactor request sending to have better excpetions (#4358)Erik Johnston2019-01-081-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Correctly retry and back off if we get a HTTPerror response * Refactor request sending to have better excpetions MatrixFederationHttpClient blindly reraised exceptions to the caller without differentiating "expected" failures (e.g. connection timeouts etc) versus more severe problems (e.g. programming errors). This commit adds a RequestSendFailed exception that is raised when "expected" failures happen, allowing the TransactionQueue to log them as warnings while allowing us to log other exceptions as actual exceptions.
* | | fix the check for whether `is_url` to match all the other ones in codebase ↵Michael Telatynski2019-01-061-3/+8
| | | | | | | | | | | | | | | | | | (#3405) Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* | | Merge pull request #4307 from matrix-org/erikj/v2_roomsRichard van der Hoff2018-12-241-0/+2
|\ \ \ | | | | | | | | Add v2 room version
| * | | Add v2 room versionErik Johnston2018-12-181-0/+2
| | | |
* | | | create support user (#4141)Neil Johnson2018-12-142-2/+11
| |/ / |/| | | | | | | | | | | | | | Allow for the creation of a support user. A support user can access the server, join rooms, interact with other users, but does not appear in the user directory nor does it contribute to monthly active user limits.
* | | Add an option to enable recording IPs for appservice users (#3831)Travis Ralston2018-12-041-9/+20
|/ /
* | Merge pull request #4004 from matrix-org/travis/login-termsTravis Ralston2018-11-011-0/+1
|\ \ | | | | | | Add m.login.terms to the registration flow
| * \ Merge branch 'develop' into travis/login-termsTravis Ralston2018-10-312-1/+1
| |\ \
| * \ \ Merge branch 'develop' into travis/login-termsTravis Ralston2018-10-241-1/+4
| |\ \ \
| * \ \ \ Merge branch 'develop' into travis/login-termsTravis Ralston2018-10-151-0/+15
| |\ \ \ \
| * | | | | Incorporate Dave's work for GDPR login flowsTravis Ralston2018-10-031-0/+1
| | | | | | | | | | | | | | | | | | As per https://github.com/vector-im/riot-web/issues/7168#issuecomment-419996117
* | | | | | Add STATE_V2_TEST room versionErik Johnston2018-11-011-1/+6
| |_|_|/ / |/| | | |
* | | | | Remove deprecated v1 key exchange endpoint (#4119)Amber Brown2018-10-311-1/+0
| | | | |
* | | | | Basic initial support for room upgradesRichard van der Hoff2018-10-251-0/+1
| |_|/ / |/| | | | | | | | | | | | | | | Currently just creates a new, empty, room, and sends a tombstone in the old room.
* | | | Allow backslashes in event field filtersRichard van der Hoff2018-10-241-1/+4
| |/ / |/| | | | | | | | | | | | | | | | | | | | Fixes a bug introduced in https://github.com/matrix-org/synapse/pull/1783 which meant that single backslashes were not allowed in event field filters. The intention here is to allow single-backslashes, but disallow double-backslashes.
* | | PR feedback pt. 1David Baker2018-10-121-8/+0
| | |
* | | Fix mergefailDavid Baker2018-10-091-1/+1
| | |
* | | Merge remote-tracking branch 'origin/develop' into dbkr/e2e_backupsDavid Baker2018-10-094-9/+23
|\| |
| * | Fix userconsent on Python 3 (#3938)Amber Brown2018-10-021-1/+1
| | |
| * | Replaced all occurences of e.message with str(e)Schnuffle2018-09-271-1/+1
| | | | | | | | | | | | Signed-off-by: Schnuffle <schnuffle@github.com>
| * | Implement 'event_format' filter param in /syncRichard van der Hoff2018-09-041-0/+1
| | | | | | | | | | | | | | | This has been specced and part-implemented; let's implement it for /sync (but no other endpoints yet :/).
| * | assert rather than warn hhs-4Neil Johnson2018-08-311-3/+2
| | |
| * | move threepid checker to config, add missing yieldsNeil Johnson2018-08-311-2/+11
| | |
| * | fix reference to is_threepid_reservedNeil Johnson2018-08-311-1/+1
| | |
| * | ensure post registration auth checks do not fail erroneouslyNeil Johnson2018-08-311-5/+2
| | |
| * | fix bug where preserved threepid user comes to sign up and server is mau blockedNeil Johnson2018-08-311-1/+9
| | |
| * | Change admin_uri to admin_contact in config and errorsErik Johnston2018-08-242-5/+5
| | |
* | | try to make flake8 and isort happyHubert Chathi2018-09-061-0/+1
| | |
* | | Merge branch 'develop' into e2e_backupsHubert Chathi2018-08-244-12/+113
|\| |
| * | Implement trail usersErik Johnston2018-08-231-1/+5
| | |
| * | Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2018-08-223-11/+15
| |\ \ | | | | | | | | | | | | neilj/server_notices_on_blocking
| | * \ Merge pull request #3673 from matrix-org/erikj/refactor_state_handlerErik Johnston2018-08-221-2/+7
| | |\ \ | | | | | | | | | | Refactor state module to support multiple room versions
| | | * \ Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2018-08-202-8/+48
| | | |\ \ | | | | | | | | | | | | | | | | | | erikj/refactor_state_handler
| | | * | | Add constants for room versionsErik Johnston2018-08-091-2/+7
| | | | | |
| | * | | | Port over enough to get some sytests running on Python 3 (#3668)Amber Brown2018-08-202-8/+8
| | | |/ / | | |/| |
| * | | | Update notice formatErik Johnston2018-08-221-2/+4
| | | | |
| * | | | rename error codeNeil Johnson2018-08-182-4/+4
| | | | |
| * | | | special case server_notices_mxidNeil Johnson2018-08-181-0/+6
| | | | |