Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Create function to check for long names in devices (#8364) | Dionysis Grigoropoulos | 2020-09-22 | 1 | -6/+24 |
| | | | | | | | | | * Create a new function to verify that the length of a device name is under a certain threshold. * Refactor old code and tests to use said function. * Verify device name length during registration of device * Add a test for the above Signed-off-by: Dionysis Grigoropoulos <dgrig@erethon.com> | ||||
* | Simplify super() calls to Python 3 syntax. (#8344) | Patrick Cloke | 2020-09-18 | 1 | -2/+2 |
| | | | | | | | This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py | ||||
* | Make `StreamToken.room_key` be a `RoomStreamToken` instance. (#8281) | Erik Johnston | 2020-09-11 | 1 | -7/+5 |
| | |||||
* | Stop sub-classing object (#8249) | Patrick Cloke | 2020-09-04 | 1 | -1/+1 |
| | |||||
* | Move and rename `get_devices_with_keys_by_user` (#8204) | Richard van der Hoff | 2020-09-01 | 1 | -1/+3 |
| | | | | | | | | | | | | | | | | | | * Move `get_devices_with_keys_by_user` to `EndToEndKeyWorkerStore` this seems a better fit for it. This commit simply moves the existing code: no other changes at all. * Rename `get_devices_with_keys_by_user` to better reflect what it does. * get_device_stream_token abstract method To avoid referencing fields which are declared in the derived classes, make `get_device_stream_token` abstract, and define that in the classes which define `_device_list_id_gen`. | ||||
* | Fix TypeError in synapse.notifier (#7880) | Erik Johnston | 2020-07-17 | 1 | -0/+8 |
| | | | Fixes #7774 | ||||
* | Convert device handler to async/await (#7871) | Patrick Cloke | 2020-07-17 | 1 | -136/+105 |
| | |||||
* | Fix "There was no active span when trying to log." error (#7698) | Erik Johnston | 2020-06-15 | 1 | -0/+1 |
| | |||||
* | Replace iteritems/itervalues/iterkeys with native versions. (#7692) | Patrick Cloke | 2020-06-15 | 1 | -8/+6 |
| | |||||
* | Process cross-signing keys when resyncing device lists (#7594) | Brendan Abolivier | 2020-06-01 | 1 | -1/+57 |
| | | | It looks like `user_device_resync` was ignoring cross-signing keys from the results received from the remote server. This patch fixes this, by processing these keys using the same process `_handle_signing_key_updates` does (and effectively factor that part out of that function). | ||||
* | Don't fail all of an iteration of the device list retry loop on error (#7609) | Brendan Abolivier | 2020-06-01 | 1 | -15/+21 |
| | | | Without this patch, if an error happens which isn't caught by `user_device_resync`, then `_maybe_retry_device_resync` would fail, without retrying the next users in the iteration. This patch fixes this so that it now only logs an error in this case. | ||||
* | Retry to sync out of sync device lists (#7453) | Brendan Abolivier | 2020-05-21 | 1 | -7/+73 |
| | | | | | | | | | | | When a call to `user_device_resync` fails, we don't currently mark the remote user's device list as out of sync, nor do we retry to sync it. https://github.com/matrix-org/synapse/pull/6776 introduced some code infrastructure to mark device lists as stale/out of sync. This commit uses that code infrastructure to mark device lists as out of sync if processing an incoming device list update makes the device handler realise that the device list is out of sync, but we can't resync right now. It also adds a looping call to retry all failed resync every 30s. This shouldn't cause too much spam in the logs as this commit also removes the "Failed to handle device list update for..." warning logs when catching `NotRetryingDestination`. Fixes #7418 | ||||
* | Convert auth handler to async/await (#7261) | Patrick Cloke | 2020-04-15 | 1 | -4/+8 |
| | |||||
* | Add explanatory comment | Andrew Morgan | 2020-03-30 | 1 | -1/+2 |
| | |||||
* | black | David Baker | 2020-03-30 | 1 | -1/+3 |
| | |||||
* | Just add own user ID to the list we track device changes for | David Baker | 2020-03-30 | 1 | -3/+5 |
| | |||||
* | Fix undefined variable & remove debug logging | David Baker | 2020-03-27 | 1 | -10/+2 |
| | |||||
* | black | David Baker | 2020-03-27 | 1 | -4/+4 |
| | |||||
* | Always send the user updates to their own device list | David Baker | 2020-03-27 | 1 | -3/+16 |
| | | | | | This will allow clients to notify users about new devices even if the user isn't in any rooms (yet). | ||||
* | Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957) | Patrick Cloke | 2020-02-21 | 1 | -1/+1 |
| | | | | Ensure good comprehension hygiene using flake8-comprehensions. | ||||
* | Reject device display names that are too long (#6882) | Patrick Cloke | 2020-02-10 | 1 | -1/+13 |
| | | | | | | | | * Reject device display names that are too long. Too long is currently defined as 100 characters in length. * Add a regression test for rejecting a too long device display name. | ||||
* | Add support for putting fed user query API on workers (#6873) | Erik Johnston | 2020-02-07 | 1 | -19/+16 |
| | |||||
* | Check sender_key matches on inbound encrypted events. (#6850) | Erik Johnston | 2020-02-05 | 1 | -1/+7 |
| | | | If they don't then the device lists are probably out of sync. | ||||
* | Merge branch 'develop' into cross-signing_federation | Hubert Chathi | 2019-10-31 | 1 | -3/+4 |
|\ | |||||
| * | Merge pull request #6294 from matrix-org/erikj/add_state_storage | Erik Johnston | 2019-10-31 | 1 | -1/+2 |
| |\ | | | | | | | Add StateGroupStorage interface | ||||
| | * | Port to use state storage | Erik Johnston | 2019-10-30 | 1 | -1/+2 |
| | | | |||||
| * | | Remove usage of deprecated logger.warn method from codebase (#6271) | Andrew Morgan | 2019-10-31 | 1 | -2/+2 |
| |/ | | | | | Replace every instance of `logger.warn` with `logger.warning` as the former is deprecated. | ||||
* | | update to work with newer code, and fix formatting | Hubert Chathi | 2019-10-22 | 1 | -1/+1 |
| | | |||||
* | | implement federation parts of cross-signing | Hubert Chathi | 2019-10-22 | 1 | -1/+12 |
|/ | |||||
* | Merge branch 'develop' into cross-signing_keys | Hubert Chathi | 2019-09-04 | 1 | -2/+63 |
|\ | |||||
| * | Opentrace device lists (#5853) | Jorik Schellekens | 2019-09-03 | 1 | -2/+63 |
| | | | | | | Trace device list changes. | ||||
* | | Merge branch 'cross-signing_hidden' into cross-signing_keys | Hubert Chathi | 2019-08-01 | 1 | -85/+87 |
|\| | |||||
| * | Update the device list cache when keys/query is called (#5693) | Jorik Schellekens | 2019-07-29 | 1 | -72/+78 |
| | | |||||
| * | Replace returnValue with return (#5736) | Amber Brown | 2019-07-23 | 1 | -13/+9 |
| | | |||||
* | | allow uploading keys for cross-signing | Hubert Chathi | 2019-07-25 | 1 | -0/+17 |
|/ | |||||
* | Rename get_users_whose_devices_changed | Erik Johnston | 2019-06-26 | 1 | -1/+1 |
| | |||||
* | Refactor get_user_ids_changed to pull less from DB | Erik Johnston | 2019-06-26 | 1 | -6/+6 |
| | | | | | | | | | | | When a client asks for users whose devices have changed since a token we used to pull *all* users from the database since the token, which could easily be thousands of rows for old tokens. This PR changes this to only check for changes for users the client is actually interested in. Fixes #5553 | ||||
* | Run Black. (#5482) | Amber Brown | 2019-06-20 | 1 | -63/+49 |
| | |||||
* | Merge pull request #4829 from matrix-org/erikj/device_list_seen_updates | Erik Johnston | 2019-03-08 | 1 | -3/+7 |
|\ | | | | | When re-syncing device lists reset the state | ||||
| * | When re-syncing device lists reset the state | Erik Johnston | 2019-03-07 | 1 | -3/+7 |
| | | | | | | | | | | | | | | We keep track of what stream IDs we've seen so that we know what updates we've handled or missed. If we re-sync we don't know if the updates we've seen are included in the re-sync (there may be a race), so we should reset the seen updates. | ||||
* | | Add some debug logging for device list handling | Erik Johnston | 2019-03-07 | 1 | -2/+38 |
|/ | |||||
* | Allow /keys/{changes,query} API to run on worker | Erik Johnston | 2019-03-04 | 1 | -2/+2 |
| | |||||
* | Split DeviceHandler into master and worker | Erik Johnston | 2019-03-04 | 1 | -168/+174 |
| | |||||
* | pep8 | Erik Johnston | 2019-02-18 | 1 | -1/+5 |
| | |||||
* | Correctly handle HttpResponseException | Erik Johnston | 2019-02-18 | 1 | -4/+4 |
| | |||||
* | Correctly handle RequestSendFailed exceptions | Erik Johnston | 2019-02-14 | 1 | -2/+2 |
| | | | | This mainly reduces the number of exceptions we log. | ||||
* | don't store more remote device lists if they have more than 1K devices (#4397) | Richard van der Hoff | 2019-01-16 | 1 | -0/+19 |
| | |||||
* | Rename async to async_helpers because `async` is a keyword on Python 3.7 (#3678) | Amber Brown | 2018-08-10 | 1 | -1/+1 |
| | |||||
* | s/becuase/because/g | Matthew Hodgson | 2018-07-10 | 1 | -1/+1 |
| | |||||
* | run isort | Amber Brown | 2018-07-09 | 1 | -7/+9 |
| | |||||
* | Consistently use six's iteritems and wrap lazy keys/values in list() if ↵ | Amber Brown | 2018-05-31 | 1 | -2/+2 |
| | | | | they're not meant to be lazy (#3307) | ||||
* | replace some iteritems with six | Adrian Tschira | 2018-05-19 | 1 | -6/+8 |
| | | | | Signed-off-by: Adrian Tschira <nota@notafile.com> | ||||
* | replace old style error catching with 'as' keyword | NotAFile | 2018-03-15 | 1 | -3/+3 |
| | | | | | | | This is both easier to read and compatible with python3 (not that that matters) Signed-off-by: Adrian Tschira <nota@notafile.com> | ||||
* | s/replication_client/federation_client/ | Erik Johnston | 2018-03-13 | 1 | -1/+1 |
| | |||||
* | Split replication layer into two | Erik Johnston | 2018-03-13 | 1 | -2/+1 |
| | |||||
* | Split out edu/query registration to a separate class | Erik Johnston | 2018-03-13 | 1 | -2/+4 |
| | |||||
* | Add federation_domain_whitelist option (#2820) | Matthew Hodgson | 2018-01-22 | 1 | -0/+4 |
| | | | | | | Add federation_domain_whitelist gives a way to restrict which domains your HS is allowed to federate with. useful mainly for gracefully preventing a private but internet-connected HS from trying to federate to the wider public Matrix network | ||||
* | Delete devices in various logout situations | Richard van der Hoff | 2017-11-29 | 1 | -1/+19 |
| | | | | | | | | | | | | | Make sure that we delete devices whenever a user is logged out due to any of the following situations: * /logout * /logout_all * change password * deactivate account (by the user or by an admin) * invalidate access token from a dynamic module Fixes #2672. | ||||
* | Merge remote-tracking branch 'origin/develop' into ↵ | David Baker | 2017-11-01 | 1 | -2/+0 |
|\ | | | | | | | rav/refactor_accesstoken_delete | ||||
| * | Remove the last vestiges of refresh_tokens | Richard van der Hoff | 2017-10-31 | 1 | -2/+0 |
| | | |||||
* | | Move access token deletion into auth handler | Richard van der Hoff | 2017-11-01 | 1 | -2/+3 |
|/ | | | | | | | Also move duplicated deactivation code into the auth handler. I want to add some hooks when we deactivate an access token, so let's bring it all in here so that there's somewhere to put it. | ||||
* | Correctly handle leaving room in /key/changes | Erik Johnston | 2017-09-18 | 1 | -13/+12 |
| | |||||
* | Fix typo | Erik Johnston | 2017-09-15 | 1 | -1/+1 |
| | |||||
* | Handle joining/leaving rooms in /keys/changes | Erik Johnston | 2017-09-13 | 1 | -1/+38 |
| | |||||
* | Add left section to /keys/changes | Erik Johnston | 2017-09-08 | 1 | -6/+16 |
| | |||||
* | Send down device list change notif when member leaves/rejoins room | Erik Johnston | 2017-09-07 | 1 | -1/+1 |
| | |||||
* | Fix up client ips to read from pending data | Erik Johnston | 2017-06-27 | 1 | -2/+2 |
| | |||||
* | Comment | Erik Johnston | 2017-05-05 | 1 | -0/+6 |
| | |||||
* | Add comment and TODO | Erik Johnston | 2017-05-05 | 1 | -0/+6 |
| | |||||
* | Handle exceptions thrown in handling remote device list updates | Erik Johnston | 2017-05-05 | 1 | -1/+16 |
| | |||||
* | Don't recreate so many sets | Erik Johnston | 2017-03-16 | 1 | -8/+6 |
| | |||||
* | Merge branch 'develop' of github.com:matrix-org/synapse into ↵ | Erik Johnston | 2017-03-14 | 1 | -0/+34 |
|\ | | | | | | | erikj/public_list_speed | ||||
| * | Implement _simple_delete_many_txn, use it to delete devices | Luke Barnard | 2017-03-13 | 1 | -0/+34 |
| | | | | | | | | | | | | (But this doesn't implement the same for deleting access tokens or e2e keys. Also respond to code review. | ||||
* | | Get current state by using current_state_events table | Erik Johnston | 2017-03-10 | 1 | -1/+1 |
|/ | |||||
* | Don't keep around old stream IDs forever | Erik Johnston | 2017-03-03 | 1 | -2/+9 |
| | |||||
* | Spelling | Erik Johnston | 2017-03-03 | 1 | -2/+2 |
| | |||||
* | Fix device list update to not constantly resync | Erik Johnston | 2017-03-01 | 1 | -46/+115 |
| | |||||
* | Fix bugs in the /keys/changes api | Richard van der Hoff | 2017-02-14 | 1 | -9/+29 |
| | | | | | | | | | | | | | | | * `get_forward_extremeties_for_room` takes a numeric `stream_ordering`. We were passing a `RoomStreamToken`, which meant that it returned the *current* extremities, rather than those corresponding to the `from_token`. However: * `get_state_ids_for_events` required a second ('types') parameter; this meant that a `TypeError` was thrown and we ended up acting as though there was *no* prev state. * `get_state_ids_for_events` actually returns a map from event_id to state dictionary - just looking up the state keys in it again meant that we acted as though there was no prev state. We now check if each member's state has changed since *any* of the extremities. Also add/fix some comments. | ||||
* | Measure new device list stuff | Erik Johnston | 2017-02-02 | 1 | -0/+4 |
| | |||||
* | Use new get_users_who_share_room_with_user | Erik Johnston | 2017-02-02 | 1 | -11/+13 |
| | |||||
* | Use stream_ordering_to_exterm for /keys/changes | Erik Johnston | 2017-02-02 | 1 | -9/+9 |
| | |||||
* | Doc args | Erik Johnston | 2017-02-01 | 1 | -0/+7 |
| | |||||
* | Include newly joined users in /keys/changes API | Erik Johnston | 2017-02-01 | 1 | -4/+35 |
| | |||||
* | Implement /keys/changes | Erik Johnston | 2017-02-01 | 1 | -0/+16 |
| | |||||
* | Use get_users_in_room and declare it iterable | Erik Johnston | 2017-01-30 | 1 | -1/+1 |
| | |||||
* | Hook device list updates to replication | Erik Johnston | 2017-01-27 | 1 | -16/+0 |
| | |||||
* | Better name | Erik Johnston | 2017-01-27 | 1 | -1/+3 |
| | |||||
* | Handle users leaving rooms | Erik Johnston | 2017-01-26 | 1 | -1/+16 |
| | |||||
* | Add comments | Erik Johnston | 2017-01-26 | 1 | -3/+16 |
| | |||||
* | Implement device key caching over federation | Erik Johnston | 2017-01-26 | 1 | -12/+73 |
| | |||||
* | Fix up sending of m.device_list_update edus | Erik Johnston | 2017-01-25 | 1 | -0/+1 |
| | |||||
* | Add basic implementation of local device list changes | Erik Johnston | 2017-01-25 | 1 | -12/+53 |
| | |||||
* | make device IDs more useful for human disambiguation | Matthew Hodgson | 2016-09-13 | 1 | -1/+1 |
| | |||||
* | PEP8 | Richard van der Hoff | 2016-08-03 | 1 | -1/+1 |
| | |||||
* | Default device_display_name to null | Richard van der Hoff | 2016-08-03 | 1 | -1/+1 |
| | | | | | | It turns out that it's more useful to return a null device display name (and let clients decide how to handle it: eg, falling back to device_id) than using a constant string like "unknown device". | ||||
* | Delete e2e keys on device delete | Richard van der Hoff | 2016-07-27 | 1 | -0/+4 |
| | |||||
* | Delete refresh tokens when deleting devices | Richard van der Hoff | 2016-07-26 | 1 | -2/+4 |
| | |||||
* | Implement updating devices | Richard van der Hoff | 2016-07-26 | 1 | -0/+24 |
| | | | | You can update the displayname of devices now. | ||||
* | Implement deleting devices | Richard van der Hoff | 2016-07-26 | 1 | -1/+26 |
| | |||||
* | make /devices return a list | Richard van der Hoff | 2016-07-21 | 1 | -5/+5 |
| | | | | Turns out I specced this to return a list of devices rather than a dict of them | ||||
* | Fix PEP8 errors | Richard van der Hoff | 2016-07-21 | 1 | -1/+1 |
| | |||||
* | Implement GET /device/{deviceId} | Richard van der Hoff | 2016-07-21 | 1 | -9/+37 |
| | |||||
* | GET /devices endpoint | Richard van der Hoff | 2016-07-20 | 1 | -0/+27 |
| | | | | | | | implement a GET /devices endpoint which lists all of the user's devices. It also returns the last IP where we saw that device, so there is some dancing to fish that out of the user_ips table. | ||||
* | Add device_id support to /login | Richard van der Hoff | 2016-07-18 | 1 | -0/+71 |
Add a 'devices' table to the storage, as well as a 'device_id' column to refresh_tokens. Allow the client to pass a device_id, and initial_device_display_name, to /login. If login is successful, then register the device in the devices table if it wasn't known already. If no device_id was supplied, make one up. Associate the device_id with the access token and refresh token, so that we can get at it again later. Ensure that the device_id is copied from the refresh token to the access_token when the token is refreshed. |