summary refs log tree commit diff
path: root/synapse/rest/client/v1/room.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Flatten the synapse.rest.client package (#10600)reivilibre2021-08-171-1152/+0
|
* Validate the max_rooms_per_space parameter to ensure it is non-negative. ↵Patrick Cloke2021-08-161-5/+20
| | | | (#10611)
* Experimental support for MSC3266 Room Summary API. (#10394)Michael Telatynski2021-08-161-33/+57
|
* Move /batch_send to /v2_alpha directory (MSC2716) (#10576)Eric Eastwood2021-08-131-409/+1
| | | | | | | * Move /batch_send to /v2_alpha directory As pointed out by @erikjohnston, https://github.com/matrix-org/synapse/pull/10552#discussion_r685836624
* Only return state events that the AS passed in via `state_events_at_start` ↵Eric Eastwood2021-08-101-1/+3
| | | | | | | | | | | | | | (MSC2716) (#10552) * Only return state events that the AS passed in via state_events_at_start As discovered by @Half-Shot in https://github.com/matrix-org/matrix-doc/pull/2716#discussion_r684158448 Part of MSC2716 * Add changelog * Fix changelog extension
* Add local support for the new spaces summary endpoint (MSC2946) (#10549)Patrick Cloke2021-08-101-0/+41
| | | | | This adds support for the /hierarchy endpoint, which is an update to MSC2946. Currently this only supports rooms known locally to the homeserver.
* Fix exceptions in logs when failing to get remote room list (#10541)Erik Johnston2021-08-061-18/+12
|
* Mark all MSC2716 events as historical (#10537)Eric Eastwood2021-08-051-5/+10
| | | * Mark all MSC2716 events as historical
* Make historical events discoverable from backfill for servers without any ↵Eric Eastwood2021-07-281-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scrollback history (MSC2716) (#10245) * Make historical messages available to federated servers Part of MSC2716: https://github.com/matrix-org/matrix-doc/pull/2716 Follow-up to https://github.com/matrix-org/synapse/pull/9247 * Debug message not available on federation * Add base starting insertion point when no chunk ID is provided * Fix messages from multiple senders in historical chunk Follow-up to https://github.com/matrix-org/synapse/pull/9247 Part of MSC2716: https://github.com/matrix-org/matrix-doc/pull/2716 --- Previously, Synapse would throw a 403, `Cannot force another user to join.`, because we were trying to use `?user_id` from a single virtual user which did not match with messages from other users in the chunk. * Remove debug lines * Messing with selecting insertion event extremeties * Move db schema change to new version * Add more better comments * Make a fake requester with just what we need See https://github.com/matrix-org/synapse/pull/10276#discussion_r660999080 * Store insertion events in table * Make base insertion event float off on its own See https://github.com/matrix-org/synapse/pull/10250#issuecomment-875711889 Conflicts: synapse/rest/client/v1/room.py * Validate that the app service can actually control the given user See https://github.com/matrix-org/synapse/pull/10276#issuecomment-876316455 Conflicts: synapse/rest/client/v1/room.py * Add some better comments on what we're trying to check for * Continue debugging * Share validation logic * Add inserted historical messages to /backfill response * Remove debug sql queries * Some marker event implemntation trials * Clean up PR * Rename insertion_event_id to just event_id * Add some better sql comments * More accurate description * Add changelog * Make it clear what MSC the change is part of * Add more detail on which insertion event came through * Address review and improve sql queries * Only use event_id as unique constraint * Fix test case where insertion event is already in the normal DAG * Remove debug changes * Switch to chunk events so we can auth via power_levels Previously, we were using `content.chunk_id` to connect one chunk to another. But these events can be from any `sender` and we can't tell who should be able to send historical events. We know we only want the application service to do it but these events have the sender of a real historical message, not the application service user ID as the sender. Other federated homeservers also have no indicator which senders are an application service on the originating homeserver. So we want to auth all of the MSC2716 events via power_levels and have them be sent by the application service with proper PL levels in the room. * Switch to chunk events for federation * Add unstable room version to support new historical PL * Fix federated events being rejected for no state_groups Add fix from https://github.com/matrix-org/synapse/pull/10439 until it merges. * Only connect base insertion event to prev_event_ids Per discussion with @erikjohnston, https://matrix.to/#/!UytJQHLQYfvYWsGrGY:jki.re/$12bTUiObDFdHLAYtT7E-BvYRp3k_xv8w0dUQHibasJk?via=jki.re&via=matrix.org * Make it possible to get the room_version with txn * Allow but ignore historical events in unsupported room version See https://github.com/matrix-org/synapse/pull/10245#discussion_r675592489 We can't reject historical events on unsupported room versions because homeservers without knowledge of MSC2716 or the new room version don't reject historical events either. Since we can't rely on the auth check here to stop historical events on unsupported room versions, I've added some additional checks in the processing/persisting code (`synapse/storage/databases/main/events.py` -> `_handle_insertion_event` and `_handle_chunk_event`). I've had to do some refactoring so there is method to fetch the room version by `txn`. * Move to unique index syntax See https://github.com/matrix-org/synapse/pull/10245#discussion_r675638509 * High-level document how the insertion->chunk lookup works * Remove create_event fallback for room_versions See https://github.com/matrix-org/synapse/pull/10245/files#r677641879 * Use updated method name
* Add type hints to additional servlet functions (#10437)Patrick Cloke2021-07-211-1/+1
| | | | | | | | | Improves type hints for: * parse_{boolean,integer} * parse_{boolean,integer}_from_args * parse_json_{value,object}_from_request And fixes any incorrect calls that resulted from unknown types.
* Add a return type to parse_string. (#10438)Patrick Cloke2021-07-211-4/+4
| | | | And set the required attribute in a few places which will error if a parameter is not provided.
* Switch to `chunk` events so we can auth via power_levels (MSC2716) (#10432)Eric Eastwood2021-07-211-4/+13
| | | | | | | | | | | | | | Previously, we were using `content.chunk_id` to connect one chunk to another. But these events can be from any `sender` and we can't tell who should be able to send historical events. We know we only want the application service to do it but these events have the sender of a real historical message, not the application service user ID as the sender. Other federated homeservers also have no indicator which senders are an application service on the originating homeserver. So we want to auth all of the MSC2716 events via power_levels and have them be sent by the application service with proper PL levels in the room.
* Use inline type hints in `handlers/` and `rest/`. (#10382)Jonathan de Jong2021-07-161-7/+3
|
* Fix messages from multiple senders in historical chunk (MSC2716) (#10276)Eric Eastwood2021-07-131-7/+42
| | | | | | | Fix messages from multiple senders in historical chunk. This also means that an app service does not need to define `?user_id` when using this endpoint. Follow-up to https://github.com/matrix-org/synapse/pull/9247 Part of MSC2716: https://github.com/matrix-org/matrix-doc/pull/2716
* Add base starting insertion event when no chunk ID is provided (MSC2716) ↵Eric Eastwood2021-07-081-23/+89
| | | | | | | | | (#10250) * Add base starting insertion point when no chunk ID is provided This is so we can have the marker event point to this initial insertion event and be able to traverse the events in the first chunk.
* Add endpoints for backfilling history (MSC2716) (#9247)Eric Eastwood2021-06-221-1/+287
| | | Work on https://github.com/matrix-org/matrix-doc/pull/2716
* Implement knock feature (#6739)Sorunome2021-06-091-11/+17
| | | | | | 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
* Correct type hints for parse_string(s)_from_args. (#10137)Patrick Cloke2021-06-081-2/+2
|
* r0.6.1 support: /rooms/:roomId/aliases endpoint (#9224)Travis Ralston2021-06-031-1/+1
| | | | | | [MSC2432](https://github.com/matrix-org/matrix-doc/pull/2432) added this endpoint originally but it has since been included in the spec for nearly a year. This is progress towards https://github.com/matrix-org/synapse/issues/8334
* Move some more endpoints off master (#10084)Erik Johnston2021-05-271-4/+4
|
* Remove the experimental spaces enabled flag. (#10063)Patrick Cloke2021-05-261-3/+1
| | | | In lieu of just always enabling the unstable spaces endpoint and unstable room version.
* Support fetching the spaces summary via GET over federation. (#9947)Patrick Cloke2021-05-111-0/+1
| | | | | | | | | | | Per changes in MSC2946, the C-S and S-S APIs for spaces summary should use GET requests. Until this is stable, the POST endpoints still exist. This does not switch federation requests to use the GET version yet since it is newly added and already deployed servers might not support it. When switching to the stable endpoint we should switch to GET requests.
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+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>`
* Import HomeServer from the proper module. (#9665)Patrick Cloke2021-03-231-1/+1
|
* fix mypyRichard van der Hoff2021-03-191-4/+7
|
* Fix type-hints from bad merge.Patrick Cloke2021-03-181-2/+2
|
* Initial spaces summary API (#9643)Richard van der Hoff2021-03-181-3/+63
| | | This is very bare-bones for now: federation will come soon, while pagination is descoped for now but will come later.
* Fix up types for the typing handler. (#9638)Patrick Cloke2021-03-171-6/+9
| | | | By splitting this to two separate methods the callers know what methods they can expect on the handler.
* Prevent bundling aggregations for state events (#9619)Andrew Morgan2021-03-161-1/+4
| | | There's no need to do aggregation bundling for state events. Doing so can cause performance issues.
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-2/+6
| | | | | | | - 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
* FIXUP: Making get_event_context a bit more paranoidDavid Teller2021-01-281-1/+1
|
* Support icons for Identity Providers (#9154)Richard van der Hoff2021-01-201-2/+1
|
* Validate the server name for the /publicRooms endpoint. (#9161)Patrick Cloke2021-01-191-2/+17
| | | | If a remote server name is provided, ensure it is something reasonable before making remote connections to it.
* Allow redacting events on workers (#8994)Patrick Cloke2020-12-291-7/+10
| | | Adds the redacts endpoint to workers that have the client listener.
* Use TYPE_CHECKING instead of magic MYPY variable. (#8770)Patrick Cloke2020-11-171-3/+2
|
* Remove unused OPTIONS handlers. (#8621)Patrick Cloke2020-10-221-17/+0
| | | | The handling of OPTIONS requests was consolidated in #7534, but the endpoint specific handlers were not removed.
* Remove the deprecated Handlers object (#8494)Patrick Cloke2020-10-091-7/+3
| | | All handlers now available via get_*_handler() methods on the HomeServer.
* Make token serializing/deserializing async (#8427)Erik Johnston2020-09-301-3/+8
| | | The idea is that in future tokens will encode a mapping of instance to position. However, we don't want to include the full instance name in the string representation, so instead we'll have a mapping between instance name and an immutable integer ID in the DB that we can use instead. We'll then do the lookup when we serialize/deserialize the token (we could alternatively pass around an `Instance` type that includes both the name and ID, but that turns out to be a lot more invasive).
* Simplify super() calls to Python 3 syntax. (#8344)Patrick Cloke2020-09-181-19/+19
| | | | | | | This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
* Do not propagate typing notifications from shadow-banned users. (#8176)Patrick Cloke2020-08-261-11/+15
|
* Remove unused parameter from, and add safeguard in, get_room_data (#8174)Andrew Morgan2020-08-261-1/+0
| | | | | | Small cleanup PR. * Removed the unused `is_guest` argument * Added a safeguard to a (currently) impossible code path, fixing static checking at the same time.
* Stop shadow-banned users from sending non-member events. (#8142)Patrick Cloke2020-08-241-30/+44
|
* Stop shadow-banned users from sending invites. (#8095)Patrick Cloke2020-08-201-27/+40
|
* Be stricter about JSON that is accepted by Synapse (#8106)Patrick Cloke2020-08-191-4/+7
|
* Allow guests to operate in encrypted rooms (#7314)Michael Albert2020-08-031-1/+1
| | | Signed-off-by: Michael Albert <michael.albert@awesome-technologies.de>
* Allow moving typing off master (#7869)Erik Johnston2020-07-161-0/+9
|
* Ensure that calls to `json.dumps` are compatible with the standard library ↵Patrick Cloke2020-07-151-6/+7
| | | | json. (#7836)
* `update_membership` declaration: now always returns an event id. (#7809)Richard van der Hoff2020-07-091-4/+2
|
* Replace all remaining six usage with native Python 3 equivalents (#7704)Dagfinn Ilmari Mannsåker2020-06-161-2/+1
|
* Add ability to wait for replication streams (#7542)Erik Johnston2020-05-221-8/+12
| | | | | | | The idea here is that if an instance persists an event via the replication HTTP API it can return before we receive that event over replication, which can lead to races where code assumes that persisting an event immediately updates various caches (e.g. current state of the room). Most of Synapse doesn't hit such races, so we don't do the waiting automagically, instead we do so where necessary to avoid unnecessary delays. We may decide to change our minds here if it turns out there are a lot of subtle races going on. People probably want to look at this commit by commit.
* Improve error responses when a remote server doesn't allow you to access its ↵Andrew Morgan2020-04-061-13/+20
| | | | public rooms list (#6899)
* Remove special casing of `m.room.aliases` events (#7034)Patrick Cloke2020-03-171-12/+0
|
* Move MSC2432 stuff onto unstable prefix (#6948)Richard van der Hoff2020-02-191-1/+7
| | | it's not in the spec yet, so needs to be unstable. Also add a feature flag for it. Also add a test for admin users.
* Implement GET /_matrix/client/r0/rooms/{roomId}/aliases (#6939)Richard van der Hoff2020-02-181-0/+23
| | | | | per matrix-org/matrix-doc#2432
* MSC2260: Block direct sends of m.room.aliases events (#6794)Richard van der Hoff2020-01-301-0/+12
| | | | | as per MSC2260
* Fixup synapse.rest to pass mypy (#6732)Erik Johnston2020-01-201-6/+12
|
* MSC2367 Allow reason field on all member eventsErik Johnston2019-11-281-1/+1
|
* Port room rest handlers to async/awaitErik Johnston2019-10-291-94/+72
|
* Land improved room list based on room stats (#6019)Erik Johnston2019-10-021-0/+8
| | | | Use room_stats and room_state for room directory search
* isortErik Johnston2019-09-251-1/+1
|
* Add tags for event_id and txn_id in event sendingErik Johnston2019-09-251-0/+18
| | | | This will make it easier to search for sending event requests.
* Use the v2 Identity Service API for lookups (MSC2134 + MSC2140) (#5976)Andrew Morgan2019-09-111-0/+1
| | | | | | | This is a redo of https://github.com/matrix-org/synapse/pull/5897 but with `id_access_token` accepted. Implements [MSC2134](https://github.com/matrix-org/matrix-doc/pull/2134) plus Identity Service v2 authentication ala [MSC2140](https://github.com/matrix-org/matrix-doc/pull/2140). Identity lookup-related functions were also moved from `RoomMemberHandler` to `IdentityHandler`.
* 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-24/+24
| | | | | 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 :)
* Return 404 instead of 403 when retrieving an event without perms (#5798)Andrew Morgan2019-08-061-3/+11
| | | | | Part of fixing matrix-org/sytest#652 Sytest PR: matrix-org/sytest#667
* Merge tag 'v1.2.0rc2' into developAndrew Morgan2019-07-241-7/+30
|\ | | | | | | | | | | | | Bugfixes -------- - Fix a regression introduced in v1.2.0rc1 which led to incorrect labels on some prometheus metrics. ([\#5734](https://github.com/matrix-org/synapse/issues/5734))
| * Fix servlet metric names (#5734)Jorik Schellekens2019-07-241-7/+30
| | | | | | | | | | | | | | | | | | | | * Fix servlet metric names Co-Authored-By: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Remove redundant check * Cover all return paths
* | Replace returnValue with return (#5736)Amber Brown2019-07-231-23/+23
|/
* Clean up exception handling for access_tokens (#5656)Richard van der Hoff2019-07-111-2/+7
| | | | | | | | | | | | | | | | 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.
* Split public rooms directory auth config in twoBrendan Abolivier2019-06-241-1/+1
|
* Run Black. (#5482)Amber Brown2019-06-201-113/+72
|
* Unify v1 and v2 REST client APIs (#5226)Amber Brown2019-06-031-55/+82
|
* Fix ignored filter field in `/messages` endpointEisha Chen-yen-su2019-05-301-0/+2
| | | | | | | | This fixes a bug which were causing the "event_format" field to be ignored in the filter of requests to the `/messages` endpoint of the CS API. Signed-off-by: Eisha Chen-yen-su <chenyensu0@gmail.com>
* Allow client event serialization to be asyncErik Johnston2019-05-141-12/+17
|
* add options to require an access_token to GET /profile and /publicRooms on ↵Matthew Hodgson2019-05-081-0/+6
| | | | | | | | | | | | | | | | | CS API (#5083) This commit adds two config options: * `restrict_public_rooms_to_local_users` Requires auth to fetch the public rooms directory through the CS API and disables fetching it through the federation API. * `require_auth_for_profile_requests` When set to `true`, requires that requests to `/profile` over the CS API are authenticated, and only returns the user's profile if the requester shares a room with the profile's owner, as per MSC1301. MSC1301 also specifies a behaviour for federation (only returning the profile if the server asking for it shares a room with the profile's owner), but that's currently really non-trivial to do in a not too expensive way. Next step is writing down a MSC that allows a HS to specify which user sent the profile query. In this implementation, Synapse won't send a profile query over federation if it doesn't believe it already shares a room with the profile's owner, though. Groups have been intentionally omitted from this commit.
* Fix typosAndrew Morgan2019-01-221-4/+4
|
* Refactor state group lookup to reduce DB hits (#4011)Erik Johnston2018-10-251-1/+2
| | | | | | | | Currently when fetching state groups from the data store we make two hits two the database: once for members and once for non-members (unless request is filtered to one or the other). This adds needless load to the datbase, so this PR refactors the lookup to make only a single database hit.
* Port rest/ to Python 3 (#3823)Amber Brown2018-09-121-6/+8
|
* Allow guests to access /rooms/:roomId/event/:eventIdWill Hunt2018-08-201-1/+1
|
* speed up /members and add at= and membership params (#3568)Matthew Hodgson2018-08-151-3/+29
|
* Merge branch 'master' into developRichard van der Hoff2018-08-021-1/+1
|\
| * Check room visibility for /event/ requestsRichard van der Hoff2018-08-021-1/+1
| | | | | | | | | | | | | | | | Make sure that the user has permission to view the requeseted event for /event/{eventId} and /room/{roomId}/event/{eventId} requests. Also check that the event is in the given room for /room/{roomId}/event/{eventId}, for sanity.
* | make /context lazyload & filter aware (#3567)Matthew Hodgson2018-07-271-0/+9
| | | | | | make /context lazyload & filter aware.
* | Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2018-07-231-1/+4
|\ \ | | | | | | | | | erikj/client_apis_move
| * | Move v1-only APIs into their own module & isolate deprecated ones (#3460)Amber Brown2018-07-191-1/+4
| |/
* | Move RoomContextHandler out of HandlersErik Johnston2018-07-181-2/+2
| | | | | | | | This is in preparation for moving GET /context/ to a worker
* | Split MessageHandler into read only and writersErik Johnston2018-07-181-11/+9
|/ | | | | This will let us call the read only parts from workers, and so be able to move some APIs off of master, e.g. the `/state` API.
* fix sytestsAmber Brown2018-07-141-1/+1
|
* rename assert_params_in_request to assert_params_in_dictKrombel2018-07-131-2/+2
| | | | | | the method "assert_params_in_request" does handle dicts and not requests. A request body has to be parsed to json before this method can be used
* Use parse_{int,str} and assert from http.servletKrombel2018-07-131-5/+5
| | | | | | | parse_integer and parse_string can take a request and raise errors in case we have wrong or missing params. This PR tries to use them more to deduplicate some code and make it better readable
* run isortAmber Brown2018-07-091-10/+14
|
* Attempt to be more performant on PyPy (#3462)Amber Brown2018-06-281-1/+1
|
* Move RoomCreationHandler out of synapse.handlers.HandlersRichard van der Hoff2018-05-171-3/+2
| | | | | | | Handlers is deprecated nowadays, so let's move this out before I add a new dependency on it. Also fix the docstrings on create_room.
* Use six.moves.urlparseAdrian Tschira2018-04-151-4/+5
| | | | | | The imports were shuffled around a bunch in py3 Signed-off-by: Adrian Tschira <nota@notafile.com>
* Use create_and_send_nonmember_event everywhereErik Johnston2018-04-091-6/+1
|
* Merge pull request #2986 from jplatte/join_reponse_room_idRichard van der Hoff2018-04-051-1/+6
|\ | | | | Add room_id to the response of `rooms/{roomId}/join`
| * Add room_id to the response of `rooms/{roomId}/join`Jonas Platte2018-03-131-1/+6
| | | | | | | | Fixes #2349
* | Merge branch 'master' of github.com:matrix-org/synapse into developErik Johnston2018-03-191-1/+1
|\ \ | |/ |/|
| * Replace ujson with simplejsonErik Johnston2018-03-151-1/+1
| |
* | RoomMembershipRestServlet doesn't handle /forgetErik Johnston2018-03-131-1/+1
| | | | | | | | | | Due to the order we register the REST handlers `/forget` was handled by the correct handler.
* | Move RoomMemberHandler out of HandlersErik Johnston2018-03-011-9/+10
| |
* | Add event_creator workerErik Johnston2018-02-071-1/+0
| |
* | Update copyrightErik Johnston2018-02-061-0/+1
| |
* | Update places where we create eventsErik Johnston2018-02-051-7/+9
| |
* | add ?ts massaging for ASes (#2754)Matthew Hodgson2018-01-231-6/+11
| | | | | | blindly implement ?ts for AS. untested
* | Add /room/{id}/event/{id} to synapseRichard van der Hoff2018-01-091-3/+26
|/ | | | | | Turns out that there is a valid usecase for retrieving event by id (notably having received a push), but event ids should be scoped to room, so /event/{id} is wrong.
* replace 'except:' with 'except Exception:'Richard van der Hoff2017-10-231-3/+3
| | | | what could possibly go wrong
* Fix /joined_members to work with AS usersErik Johnston2017-09-281-2/+1
|
* Fix bug where /joined_members didn't check user was in roomErik Johnston2017-09-271-10/+7
|
* Add more granular event send metricsErik Johnston2017-05-021-0/+1
|
* Reduce size of joined_user cacheErik Johnston2017-04-251-1/+7
| | | | | | | | The _get_joined_users_from_context cache stores a mapping from user_id to avatar_url and display_name. Instead of storing those in a dict, store them in a namedtuple as that uses much less memory. We also try converting the string to ascii to further reduce the size.
* Don't recreate so many setsErik Johnston2017-03-161-2/+1
|
* Remove unused paramErik Johnston2017-02-201-1/+0
|
* Make kick & ban reasons workDavid Baker2017-02-141-0/+5
| | | | | | We somehow specced APIs with reason strings, preserve the content in the events and even have the clients display them, but failed to actually pass the parameter through to the event content.
* Linearize updates to membership via PUT /state/Erik Johnston2017-01-091-11/+17
|
* Merge pull request #1676 from matrix-org/erikj/room_listErik Johnston2016-12-121-1/+18
|\ | | | | Add new API appservice specific public room list
| * Add new API appservice specific public room listErik Johnston2016-12-061-1/+18
| |
* | Add /room/<room_id>/joined_members APIErik Johnston2016-12-081-0/+19
| | | | | | | | | | | | This returns the currently joined members in the room with their display names and avatar urls. This is more efficient than /members for large rooms where you don't need the full events.
* | Add joined_rooms servletErik Johnston2016-12-081-0/+17
|/
* Move .observe() up to the cache to make things neaterKegan Dougal2016-11-141-24/+6
|
* Review commentsKegan Dougal2016-11-111-70/+27
|
* More flake8Kegan Dougal2016-11-111-1/+3
|
* Flake8 and fix whoopsieKegan Dougal2016-11-111-4/+8
|
* Use ObservableDeferreds instead of Deferreds as they behave as intendedKegan Dougal2016-11-111-19/+20
|
* Flake8Kegan Dougal2016-11-101-3/+3
|
* Store Promise<Response> instead of Response for HTTP API transactionsKegan Dougal2016-11-101-43/+39
| | | | | | | | | | | | | | | | | | This fixes a race whereby: - User hits an endpoint. - No cached transaction so executes main code. - User hits same endpoint. - No cache transaction so executes main code. - Main code finishes executing and caches response and returns. - Main code finishes executing and caches response and returns. This race is common in the wild when Synapse is struggling under load. This commit fixes the race by: - User hits an endpoint. - Caches the promise to execute the main code and executes main code. - User hits same endpoint. - Yields on the same promise as the first request. - Main code finishes executing and returns, unblocking both requests.
* Time out typing over federationErik Johnston2016-09-231-1/+4
|
* Support /initialSync in synchrotron workerErik Johnston2016-09-211-2/+2
|
* Enable guest access to POST /publicRoomsErik Johnston2016-09-171-2/+2
|
* Make POST /publicRooms require authErik Johnston2016-09-161-2/+1
|
* Change the way we calculate new_limit in /publicRooms and add POST APIErik Johnston2016-09-151-0/+29
|
* Remove default public rooms limitErik Johnston2016-09-151-1/+1
|
* By default limit /publicRooms to 100 entriesErik Johnston2016-09-151-1/+1
|
* Pass since/from parameters over federationErik Johnston2016-09-151-3/+3
|
* Allow paginating both forwards and backwardsErik Johnston2016-09-151-3/+15
|
* Remove support for aggregate room listsErik Johnston2016-09-151-1/+1
|
* Filter returned events for client-facing formatPaul "LeoNerd" Evans2016-09-091-2/+3
|
* Allow clients to specify the format a room state event is returned inPaul "LeoNerd" Evans2016-09-091-1/+7
|
* Use parse_stringErik Johnston2016-09-081-2/+2
|
* Add server param to /publicRoomsErik Johnston2016-09-081-5/+16
|
* Pass through user-supplied content in /join/$room_idKegan Dougal2016-08-231-0/+1
| | | | | | | It was always intended to allow custom keys on the join event, but this has at some point been lost. Restore it. If the user specifies keys like "avatar_url" then they will be clobbered.
* Dont invoke get_handlers fromClientV1RestServletErik Johnston2016-08-121-0/+48
| | | | | | hs.get_handlers() can not be invoked from split out processes. Moving the invocations down a level means that we can slowly split out individual servlets.
* Add filter param to /messages APIErik Johnston2016-07-141-1/+10
|
* Don't make rooms visibile by defaultErik Johnston2016-06-081-2/+0
|
* Log user that is making /publicRooms callsErik Johnston2016-06-081-0/+7
|
* Basic, un-cached support for secondary_directory_serversDavid Baker2016-05-311-1/+2
|
* Split out the room list handlerDavid Baker2016-05-311-1/+1
| | | | So I can use it from federation bits without pulling in all the handlers.
* Allow clients to specify a server_name to avoid 'No known servers'Kegan Dougal2016-05-191-1/+4
| | | | Multiple server_names are supported via ?server_name=foo&server_name=bar
* Move typing handler out of the Handlers objectMark Haines2016-05-171-4/+3
|
* Move the presence handler out of the Handlers objectMark Haines2016-05-161-1/+1
|
* Remove spurious commentErik Johnston2016-03-301-1/+0
|
* Require user to have left room to forget roomErik Johnston2016-03-301-0/+38
| | | | | This dramatically simplifies the forget API code - in particular it no longer generates a leave event.
* Use parse_json_object_from_request to parse JSON out of request bodiesMark Haines2016-03-111-10/+4
|
* Add a parse_json_object functionMark Haines2016-03-091-18/+8
| | | | | to deduplicate all the copy+pasted _parse_json functions. Also document the parse_.* functions.
* Fix relative imports so they work in both py3 and py27Mark Haines2016-03-081-1/+1
|
* Pass whole requester to ratelimitingDaniel Wagner-Hall2016-03-031-4/+4
| | | | This will enable more detailed decisions
* Ignore invalid POST bodies when joining roomsDaniel Wagner-Hall2016-02-241-2/+12
|
* Allow third_party_signed to be specified on /joinDaniel Wagner-Hall2016-02-231-0/+4
|
* Merge pull request #582 from matrix-org/erikj/presenceErik Johnston2016-02-191-12/+6
|\ | | | | Rewrite presence for performance.
| * Initial cutErik Johnston2016-02-171-12/+6
| |
* | Merge branch 'develop' into daniel/roomcleanupincrementalDaniel Wagner-Hall2016-02-171-1/+1
|\| | | | | | | | | Conflicts: synapse/rest/client/v1/room.py
| * client/v1/room: include event_id in response to state event PUT, in ↵Patrik Oldsberg2016-02-171-2/+2
| | | | | | | | | | | | accordance with the spec Signed-off-by: Patrik Oldsberg <patrik.oldsberg@ericsson.com>
| * Simplify room creation codeDaniel Wagner-Hall2016-02-151-15/+3
| |
* | Some cleanupDaniel Wagner-Hall2016-02-171-3/+3
| | | | | | | | | | I'm not particularly happy with the "action" switching, but there's no convenient way to defer the work that needs to happen after it, so... :(
* | Branch off member and non member sendsDaniel Wagner-Hall2016-02-151-5/+16
| | | | | | | | Unclean, needs tidy-up, but works
* | Simplify room creation codeDaniel Wagner-Hall2016-02-151-15/+3
| |
* | Reuse update_membership from /joinDaniel Wagner-Hall2016-02-151-16/+5
| |
* | Merge implementation of /join by alias or IDDaniel Wagner-Hall2016-02-151-37/+31
| | | | | | | | | | This code is kind of rough (passing the remote servers down a long chain), but is a step towards improvement.
* | Merge some room joining codepathsDaniel Wagner-Hall2016-02-151-1/+1
|/ | | | | | Force joining by alias to go through the send_membership_event checks, rather than bypassing them straight into _do_join. This is the first of many stages of cleanup.
* Revert "Merge two of the room join codepaths"Daniel Wagner-Hall2016-02-121-13/+55
| | | | | | This reverts commit cf81375b94c4763766440471e632fc4b103450ab. It subtly violates a guest joining auth check
* Merge two of the room join codepathsDaniel Wagner-Hall2016-02-121-55/+13
| | | | | | | | | | | | | There's at least one more to merge in. Side-effects: * Stop reporting None as displayname and avatar_url in some cases * Joining a room by alias populates guest-ness in join event * Remove unspec'd PUT version of /join/<room_id_or_alias> which has not been called on matrix.org according to logs * Stop recording access_token_id on /join/room_id - currently we don't record it on /join/room_alias; I can try to thread it through at some point.
* Remove old log lineErik Johnston2016-02-031-2/+0
|
* Allow non-guests to peek on rooms using /eventsDaniel Wagner-Hall2016-01-201-4/+2
|
* Require unbanning before other membership changesDaniel Wagner-Hall2016-01-151-39/+12
|
* Merge branch 'release-v0.12.1' into developRichard van der Hoff2016-01-141-0/+6
|\
| * Add 'event' result to 'context' endpointRichard van der Hoff2016-01-131-0/+6
| | | | | | | | ... because the context isn't much use without the event.
* | Introduce a Requester objectDaniel Wagner-Hall2016-01-111-48/+68
| | | | | | | | | | | | | | | | | | This tracks data about the entity which made the request. This is instead of passing around a tuple, which requires call-site modifications every time a new piece of optional context is passed around. I tried to introduce a User object. I gave up.
* | copyrightsMatthew Hodgson2016-01-071-1/+1
|/
* Missing yieldMark Haines2015-12-101-1/+1
|
* Update endpoints to reflect current specDaniel Wagner-Hall2015-12-021-27/+2
|
* Host /unstable and /r0 versions of r0 APIsDaniel Wagner-Hall2015-12-011-45/+45
|
* Allow users to forget roomsDaniel Wagner-Hall2015-11-171-3/+10
|
* Allow guests to /room/:room_id/{join,leave}Daniel Wagner-Hall2015-11-131-3/+14
|
* Merge pull request #360 from matrix-org/daniel/guestroominitialsyncDaniel Wagner-Hall2015-11-121-1/+2
|\ | | | | | | | | Merge pull request #360 from matrix-org/daniel/guestroominitialsync Allow guest access to room initialSync
| * Allow guest access to room initialSyncDaniel Wagner-Hall2015-11-111-1/+2
| |
* | Allow guests to access room context APIDaniel Wagner-Hall2015-11-111-2/+2
|/
* Allow guest users to join and message roomsDaniel Wagner-Hall2015-11-101-3/+10
|
* Merge pull request #356 from matrix-org/daniel/3pidyetagainDaniel Wagner-Hall2015-11-101-2/+1
|\ | | | | Get display name from identity server, not client
| * Get display name from identity server, not clientDaniel Wagner-Hall2015-11-091-2/+1
| |
* | Add a couple of unit tests for room/<x>/messagesRichard van der Hoff2015-11-091-1/+1
|/ | | | ... merely because I was trying to figure out how it worked, and couldn't.
* Merge pull request #350 from matrix-org/erikj/searchErik Johnston2015-11-051-1/+2
|\ | | | | Implement pagination, order by and groups in search
| * Merge branch 'develop' of github.com:matrix-org/synapse into erikj/searchErik Johnston2015-11-051-13/+16
| |\
| * | Implement basic pagination for search resultsErik Johnston2015-11-051-1/+2
| | |
* | | Exchange 3pid invites for m.room.member invitesDaniel Wagner-Hall2015-11-051-12/+8
| |/ |/|
* | Open up /events to anonymous users for room events onlyDaniel Wagner-Hall2015-11-051-2/+4
| | | | | | | | Squash-merge of PR #345 from daniel/anonymousevents
* | Allow guests to register and call /events?room_id=Daniel Wagner-Hall2015-11-041-13/+14
|/ | | | | | | This follows the same flows-based flow as regular registration, but as the only implemented flow has no requirements, it auto-succeeds. In the future, other flows (e.g. captcha) may be required, so clients should treat this like the regular registration flow choices.
* Add room context apiErik Johnston2015-10-281-0/+36
|
* Merge branch 'develop' of github.com:matrix-org/synapse into erikj/searchErik Johnston2015-10-161-5/+31
|\
| * Remove unnecessary class-wrappingDaniel Wagner-Hall2015-10-131-5/+6
| |
| * Move logic into handlerDaniel Wagner-Hall2015-10-131-115/+18
| |
| * Add loggingDaniel Wagner-Hall2015-10-131-2/+2
| |
| * Move event contents into third_party_layout fieldDaniel Wagner-Hall2015-10-131-1/+2
| |
| * Fix lint errorsDaniel Wagner-Hall2015-10-061-3/+4
| |
| * Implement third party identifier invitesDaniel Wagner-Hall2015-10-011-6/+126
| |
* | Keep FTS indexes up to date. Only search through rooms currently joinedErik Johnston2015-10-121-1/+1
| |
* | Add basic full text search impl.Erik Johnston2015-10-091-0/+17
|/
* Remove undocumented and unimplemented 'feedback' parameter from the ↵Mark Haines2015-09-091-2/+0
| | | | Client-Server API
* Allow users that have left the room to view the member list from the point ↵Mark Haines2015-09-091-5/+13
| | | | they left
* Remove completely unused concepts from codebaseDaniel Wagner-Hall2015-08-251-17/+17
| | | | | | | | | | Removes device_id and ClientInfo device_id is never actually written, and the matrix.org DB has no non-null entries for it. Right now, it's just cluttering up code. This doesn't remove the columns from the database, because that's fiddly.
* Remove semicolon.Kegan Dougal2015-07-201-1/+1
|
* Parse the ID given to /invite|ban|kick to make sure it looks like a user ID.Kegan Dougal2015-07-201-0/+2
|
* Blunty replace json with simplejsonErik Johnston2015-02-111-1/+1
|
* Extract the id token of the token when authing users, include the token and ↵Mark Haines2015-01-281-26/+38
| | | | device_id in the internal meta data for the event along with the transaction id when sending events
* Return the device_id from get_auth_by_reqMark Haines2015-01-281-12/+12
|
* Pass the current time to serialize event, rather than passing anMark Haines2015-01-261-1/+8
| | | | | | HS and getting a clock from it and calling time_msec on the clock. Remove the serialize_event method from the HS since it is no longer needed.
* Extract the client v1 base RestServlet to a separate classMark Haines2015-01-231-14/+14
|
* Replace hs.parse_roomalias with RoomAlias.from_stringMark Haines2015-01-231-2/+2
|
* Replace hs.parse_roomid with RoomID.from_stringMark Haines2015-01-231-2/+2
|
* Replace hs.parse_userid with UserID.from_stringMark Haines2015-01-231-2/+3
|
* Move rest APIs back under the rest directoryMark Haines2015-01-221-0/+559