summary refs log tree commit diff
path: root/synapse/handlers (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| | * Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2019-07-0513-36/+168
| | |\ | | | | | | | | | | | | erikj/admin_exfiltrate_data
| | * | Assume key existence. Update docstringsErik Johnston2019-07-051-3/+1
| | | |
| | * | Fixup from review comments.Erik Johnston2019-07-041-17/+22
| | | |
| | * | Apply comment fixups from code reviewErik Johnston2019-07-031-6/+6
| | | | | | | | | | | | Co-Authored-By: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
| | * | Add basic function to get all data for a user out of synapseErik Johnston2019-07-021-0/+247
| | | |
* | | | Implement access token expiry (#5660)Andrew Morgan2020-02-172-14/+38
|\| | |
| * | | Implement access token expiry (#5660)Richard van der Hoff2019-07-122-14/+38
| | | | | | | | | | | | | | | | Record how long an access token is valid for, and raise a soft-logout once it expires.
* | | | Inline issue_access_token (#5659)Andrew Morgan2020-02-171-7/+3
|\| | |
| * | | Inline issue_access_token (#5659)Richard van der Hoff2019-07-111-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this is only used in one place, so it's clearer if we inline it and reduce the API surface. Also, fixes a buglet where we would create an access token even if we were about to block the user (we would never return the AT, so the user could never use it, but it was still created and added to the db.)
* | | | Merge pull request #5658 from matrix-org/babolivier/is-jsonAndrew Morgan2020-02-171-1/+1
|\| | |
| * | | Merge pull request #5658 from matrix-org/babolivier/is-jsonBrendan Abolivier2019-07-101-1/+1
| |\ \ \ | | | | | | | | | | Send 3PID bind requests as JSON data
| | * | | TypoBrendan Abolivier2019-07-101-1/+1
| | | | |
| | * | | Send 3PID bind requests as JSON dataBrendan Abolivier2019-07-101-1/+1
| | | | |
* | | | | Remove access-token support from RegistrationStore.register (#5642)Andrew Morgan2020-02-171-1/+1
|\| | | |
| * | | | Remove access-token support from RegistrationStore.register (#5642)Richard van der Hoff2019-07-101-1/+1
| |/ / / | | | | | | | | | | | | | | | | The 'token' param is no longer used anywhere except the tests, so let's kill that off too.
* | | | Merge pull request #5638 from matrix-org/babolivier/invite-jsonAndrew Morgan2020-02-171-4/+24
|\| | |
| * | | Merge pull request #5638 from matrix-org/babolivier/invite-jsonBrendan Abolivier2019-07-091-4/+18
| |\ \ \ | | | | | | | | | | Use JSON when querying the IS's /store-invite endpoint
| | * \ \ Merge branch 'develop' into babolivier/invite-jsonBrendan Abolivier2019-07-0818-196/+251
| | |\ \ \
| | * | | | LintBrendan Abolivier2019-07-081-1/+2
| | | | | |
| | * | | | Use application/json when querying the IS's /store-invite endpointBrendan Abolivier2019-07-081-4/+17
| | | | | |
* | | | | | remove unused and unnecessary check for FederationDeniedError (#5645)Andrew Morgan2020-02-171-4/+1
|\| | | | |
| * | | | | remove unused and unnecessary check for FederationDeniedError (#5645)Hubert Chathi2019-07-091-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FederationDeniedError is a subclass of SynapseError, which is a subclass of CodeMessageException, so if e is a FederationDeniedError, then this check for FederationDeniedError will never be reached since it will be caught by the check for CodeMessageException above. The check for CodeMessageException does almost the same thing as this check (since FederationDeniedError initialises with code=403 and msg="Federation denied with %s."), so may as well just keep allowing it to handle this case.
* | | | | | Merge pull request #5644 from matrix-org/babolivier/profile-allow-selfAndrew Morgan2020-02-171-0/+4
|\| | | | |
| * | | | | Merge pull request #5644 from matrix-org/babolivier/profile-allow-selfBrendan Abolivier2019-07-091-0/+4
| |\ \ \ \ \ | | | | | | | | | | | | | | Allow newly-registered users to lookup their own profiles
| | * | | | | Allow newly-registered users to lookup their own profilesBrendan Abolivier2019-07-081-0/+4
| | | |/ / / | | |/| | | | | | | | | | | | | | | When a user creates an account and the 'require_auth_for_profile_requests' config flag is set, and a client that performed the registration wants to lookup the newly-created profile, the request will be denied because the user doesn't share a room with themselves yet.
* | | | | | Remove access-token support from RegistrationHandler.register (#5641)Andrew Morgan2020-02-171-24/+3
|\| | | | |
| * | | | | Remove access-token support from RegistrationHandler.register (#5641)Richard van der Hoff2019-07-081-24/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nothing uses this now, so we can remove the dead code, and clean up the API. Since we're changing the shape of the return value anyway, we take the opportunity to give the method a better name.
* | | | | | Better logging for auto-join. (#5643)Andrew Morgan2020-02-171-0/+7
|\| | | | |
| * | | | | Better logging for auto-join. (#5643)Richard van der Hoff2019-07-081-0/+7
| |/ / / / | | | | | | | | | | It was pretty unclear what was going on, so I've added a couple of log lines.
| * | | | Move get_or_create_user to test code (#5628)Richard van der Hoff2019-07-081-51/+0
| | | | | | | | | | | | | | | This is only used in tests, so...
* | | | | Remove support for invite_3pid_guest. (#5625)Andrew Morgan2020-02-173-81/+0
|\| | | |
| * | | | Remove support for invite_3pid_guest. (#5625)Richard van der Hoff2019-07-053-81/+0
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has never been documented, and I'm not sure it's ever been used outside sytest. It's quite a lot of poorly-maintained code, so I'd like to get rid of it. For now I haven't removed the database table; I suggest we leave that for a future clearout.
* | | | Fix with isort==4.3.21 and black==19.3b0Andrew Morgan2020-02-143-6/+5
| | | |
* | | | Delete duplicate user deactivationAndrew Morgan2020-02-141-7/+0
| | | |
* | | | Fix incorrect run_in_background import statementAndrew Morgan2020-02-141-1/+1
| | | |
* | | | Move logging utilities out of the side drawer of util/ and into logging/ (#5606)Andrew Morgan2020-02-1412-35/+36
|\| | |
| * | | Move logging utilities out of the side drawer of util/ and into logging/ (#5606)Amber Brown2019-07-0412-35/+36
| | | |
* | | | Fix a number of "Starting txn from sentinel context" warnings (#5605)Andrew Morgan2020-02-141-1/+9
|\| | |
| * | | Fix a number of "Starting txn from sentinel context" warnings (#5605)Richard van der Hoff2019-07-031-1/+9
| | | | | | | | | | | | | | | | Fixes #5602, #5603
* | | | Complete the SAML2 implementation (#5422)Andrew Morgan2020-02-141-0/+123
|\| | |
| * | | Complete the SAML2 implementation (#5422)Richard van der Hoff2019-07-021-0/+123
| |\ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * SAML2 Improvements and redirect stuff Signed-off-by: Alexander Trost <galexrt@googlemail.com> * Code cleanups and simplifications. Also: share the saml client between redirect and response handlers. * changelog * Revert redundant changes to static js * Move all the saml stuff out to a centralised handler * Add support for tracking SAML2 sessions. This allows us to correctly handle `allow_unsolicited: False`. * update sample config * cleanups * update sample config * rename BaseSSORedirectServlet for consistency * Address review comments
| | * | Merge branch 'develop' into rav/saml2_clientRichard van der Hoff2019-07-015-26/+64
| | |\ \
| | * | | Address review commentsRichard van der Hoff2019-07-011-5/+7
| | | | |
| | * | | cleanupsRichard van der Hoff2019-06-271-1/+1
| | | | |
| | * | | Add support for tracking SAML2 sessions.Richard van der Hoff2019-06-261-2/+37
| | | | | | | | | | | | | | | | | | | | This allows us to correctly handle `allow_unsolicited: False`.
| | * | | Move all the saml stuff out to a centralised handlerRichard van der Hoff2019-06-261-0/+86
| | | |/ | | |/|
* | | | Merge pull request #5507 from matrix-org/erikj/presence_sync_tighloopAndrew Morgan2020-02-141-2/+19
|\| | |
| * | | Merge pull request #5507 from matrix-org/erikj/presence_sync_tighloopErik Johnston2019-07-011-2/+19
| |\ \ \ | | |_|/ | |/| | Fix sync tightloop bug.
| | * | Fixup commentErik Johnston2019-07-011-6/+13
| | | |
| | * | Fix sync tightloop bug.Erik Johnston2019-06-211-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If, for some reason, presence updates take a while to persist then it can trigger clients to tightloop calling `/sync` due to the presence handler returning updates but not advancing the stream token. Fixes #5503.
| * | | Merge pull request #5576 from matrix-org/babolivier/3pid-invite-ratelimitBrendan Abolivier2019-06-281-0/+1
| |\ \ \ | | | | | | | | | | Don't update the ratelimiter before sending a 3PID invite
| | * | | Only ratelimit when sending the emailBrendan Abolivier2019-06-281-1/+2
| | | | | | | | | | | | | | | | | | | | If we do the opposite, an event can arrive after or while sending the email and the 3PID invite event will get ratelimited.
| | * | | Don't update the ratelimiter before sending a 3PID inviteBrendan Abolivier2019-06-281-1/+1
| | | |/ | | |/| | | | | | | | | This would cause emails being sent, but Synapse responding with a 429 when creating the event. The client would then retry, and with bad timing the same scenario would happen again. Some testing I did ended up sending me 10 emails for one single invite because of this.
* | | | Added possibilty to disable local password authentication (#5092)Andrew Morgan2020-02-142-1/+4
|\| | |
| * | | Added possibilty to disable local password authentication (#5092)Daniel Hoffend2019-06-272-1/+4
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Daniel Hoffend <dh@dotlan.net>
* | | | Merge pull request #5559 from matrix-org/erikj/refactor_changed_devicesAndrew Morgan2020-02-142-25/+59
|\| | |
| * | | Review commentsErik Johnston2019-06-271-4/+4
| | | |
| * | | Refactor and comment sync device list codeErik Johnston2019-06-261-17/+53
| | | |
| * | | Rename get_users_whose_devices_changedErik Johnston2019-06-262-2/+2
| | | |
| * | | Refactor get_user_ids_changed to pull less from DBErik Johnston2019-06-262-18/+16
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Prevent multiple upgrades on the same room at once (#5051)Andrew Morgan2020-02-141-51/+89
|\| |
| * | Prevent multiple upgrades on the same room at once (#5051)Andrew Morgan2019-06-251-51/+89
| | | | | | | | | | | | | | | | | | | | | Closes #4583 Does slightly less than #5045, which prevented a room from being upgraded multiple times, one after another. This PR still allows that, but just prevents two from happening at the same time. Mostly just to mitigate the fact that servers are slow and it can take a moment for the room upgrade to actually complete. We don't want people sending another request to upgrade the room when really they just thought the first didn't go through.
* | | Merge pull request #5531 from matrix-org/erikj/workers_pagination_tokenAndrew Morgan2020-02-131-3/+1
|\| |
| * | Merge pull request #5531 from matrix-org/erikj/workers_pagination_tokenErik Johnston2019-06-241-3/+1
| |\ \ | | | | | | | | Fix /messages on workers when no from param specified.
| | * | Fix /messages on workers when no from param specified.Erik Johnston2019-06-241-3/+1
| | |/ | | | | | | | | | | | | | | | | | | If no `from` param is specified we calculate and use the "current token" that inlcuded typing, presence, etc. These are unused during pagination and are not available on workers, so we simply don't calculate them.
* | | Merge pull request #5516 from matrix-org/rav/acme_key_pathAndrew Morgan2020-02-132-5/+38
|\| |
| * | Allow configuration of the path used for ACME account keys.Richard van der Hoff2019-06-242-5/+38
| | | | | | | | | | | | | | | Because sticking it in the same place as the config isn't necessarily the right thing to do.
* | | Factor acme bits out to a separate file (#5521)Andrew Morgan2020-02-132-53/+93
|\| |
| * | Factor acme bits out to a separate file (#5521)Richard van der Hoff2019-06-242-53/+93
| |/ | | | | This makes some of the conditional-import hoop-jumping easier.
* | Run Black. (#5482)Andrew Morgan2020-02-133-7/+3
|\|
| * Run Black. (#5482)Amber Brown2019-06-2035-2765/+2187
| |
| * Merge pull request #5042 from matrix-org/erikj/fix_get_missing_events_errorErik Johnston2019-06-191-9/+19
| |\ | | | | | | Handle the case of `get_missing_events` failing
* | | Dinsic Blacking with black==18.6b2Andrew Morgan2020-02-1136-2867/+2296
| | |
* | | Merge pull request #5480 from matrix-org/erikj/extremities_dummy_eventsAndrew Morgan2020-02-101-2/+5
|\| |
| * | Merge pull request #5480 from matrix-org/erikj/extremities_dummy_eventsErik Johnston2019-06-191-1/+74
| |\ \ | | | | | | | | Add experimental option to reduce extremities.
| | * | Run as background process and fix commentsErik Johnston2019-06-191-2/+5
| | | |
* | | | Add some logging to 3pid invite sig verification (#5015)Andrew Morgan2020-02-101-8/+38
|\| | |
| * | | Add some logging to 3pid invite sig verification (#5015)David Baker2019-06-181-8/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I had to add quite a lot of logging to diagnose a problem with 3pid invites - we only logged the one failure which isn't all that informative. NB. I'm not convinced the logic of this loop is right: I think it should just accept a single valid signature from a trusted source rather than fail if *any* signature is invalid. Also it should probably not skip the rest of middle loop if a check fails? However, I'm deliberately not changing the logic here.
* | | | Fix loglineAndrew Morgan2020-02-101-1/+1
|\ \ \ \ | | |_|/ | |/| |
| * | | Fix loglineErik Johnston2019-06-181-1/+1
| | | |
* | | | Merge branch 'develop' of github.com:matrix-org/synapse into ↵Andrew Morgan2020-02-101-9/+19
|\| | | | | | | | | | | | | | | erikj/fix_get_missing_events_error
| * | | Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2019-06-1820-323/+1372
| |\| | | | | | | | | | | | | | erikj/fix_get_missing_events_error
| * | | Handle the case of `get_missing_events` failingErik Johnston2019-04-101-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently if a call to `/get_missing_events` fails we log an exception and stop processing the top level event we received over federation. Instead let's try and handle it sensibly given it is a somewhat expected failure mode.
* | | | Add experimental option to reduce extremities.Andrew Morgan2020-02-101-1/+71
|\ \ \ \ | | |_|/ | |/| |
| * | | Add experimental option to reduce extremities.Erik Johnston2019-06-181-1/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds new config option `cleanup_extremities_with_dummy_events` which periodically sends dummy events to rooms with more than 10 extremities. THIS IS REALLY EXPERIMENTAL.
* | | | Merge pull request #5477 from matrix-org/babolivier/third_party_rules_3pidAndrew Morgan2020-02-101-0/+9
|\ \ \ \ | | |_|/ | |/| |
| * | | Add third party rules hook for 3PID invitesBrendan Abolivier2019-06-171-0/+10
| | | |
| * | | Add third party rules hook into create roomErik Johnston2019-06-171-1/+24
| |/ /
* | | Merge pull request #5385 from matrix-org/erikj/reduce_http_exceptionsAndrew Morgan2020-02-102-16/+17
|\| |
| * | Merge pull request #5385 from matrix-org/erikj/reduce_http_exceptionsErik Johnston2019-06-172-16/+17
| |\ \ | | | | | | | | Handle HttpResponseException when using federation client.
| | * | Handle HttpResponseException when using federation client.Erik Johnston2019-06-072-16/+17
| | | | | | | | | | | | | | | | Otherwise we just log exceptions everywhere.
| * | | Merge pull request #5464 from matrix-org/erikj/3pid_remote_invite_stateErik Johnston2019-06-171-6/+0
| |\ \ \ | | | | | | | | | | Fix 3PID invite room state over federation.
| * \ \ \ Merge pull request #5440 from matrix-org/babolivier/third_party_event_rulesBrendan Abolivier2019-06-142-4/+78
| |\ \ \ \ | | | | | | | | | | | | Allow server admins to define implementations of extra rules for allowing or denying incoming events
* | \ \ \ \ Merge remote-tracking branch 'dinsic/dinsic' into dinsic-release-v1.1.0Andrew Morgan2020-02-107-14/+134
|\ \ \ \ \ \
| * | | | | | Add the ability to restrict max avatar filesize and content-type (#19)Andrew Morgan2019-12-121-0/+46
| | | | | | |
| * | | | | | Add limit_profile_requests_to_known_users option (#18)Andrew Morgan2019-12-051-2/+2
| | | | | | |
| * | | | | | Discard retention policies when retrieving stateBrendan Abolivier2019-11-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Purge jobs don't delete the latest event in a room in order to keep the forward extremity and not break the room. On the other hand, get_state_events, when given an at_token argument calls filter_events_for_client to know if the user can see the event that matches that (sync) token. That function uses the retention policies of the events it's given to filter out those that are too old from a client's view. Some clients, such as Riot, when loading a room, request the list of members for the latest sync token it knows about, and get confused to the point of refusing to send any message if the server tells it that it can't get that information. This can happen very easily with the message retention feature turned on and a room with low activity so that the last event sent becomes too old according to the room's retention policy. An easy and clean fix for that issue is to discard the room's retention policies when retrieving state.
| * | | | | | Hide expired users from user directory, optionally show on renewal (#13)Andrew Morgan2019-11-141-0/+32
| | | | | | |
| * | | | | | Create configurable ratelimiter for 3pid invites (#11)Andrew Morgan2019-11-121-8/+8
| | | | | | |
| * | | | | | Support for routing outbound HTTP requests via a proxy (#6239)Richard van der Hoff2019-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `http_proxy` and `HTTPS_PROXY` env vars can be set to a `host[:port]` value which should point to a proxy. The address of the proxy should be excluded from IP blacklists such as the `url_preview_ip_range_blacklist`. The proxy will then be used for * push * url previews * phone-home stats * recaptcha validation * CAS auth validation It will *not* be used for: * Application Services * Identity servers * Outbound federation * In worker configurations, connections from workers to masters Fixes #4198.
| * | | | | | TypoBrendan Abolivier2019-10-041-1/+1
| | | | | | |
| * | | | | | LintBrendan Abolivier2019-10-041-3/+1
| | | | | | |
| * | | | | | Incorporate reviewBrendan Abolivier2019-10-041-14/+8
| | | | | | |
| * | | | | | Add test caseBrendan Abolivier2019-10-041-1/+1
| | | | | | |
| * | | | | | LintBrendan Abolivier2019-10-041-1/+3
| | | | | | |
| * | | | | | Don't 500 code when trying to exchange a revoked 3PID inviteBrendan Abolivier2019-10-041-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While this is not documented in the spec (but should be), Riot (and other clients) revoke 3PID invites by sending a m.room.third_party_invite event with an empty ({}) content to the room's state. When the invited 3PID gets associated with a MXID, the identity server (which doesn't know about revocations) sends down to the MXID's homeserver all of the undelivered invites it has for this 3PID. The homeserver then tries to talk to the inviting homeserver in order to exchange these invite for m.room.member events. When one of the invite is revoked, the inviting homeserver responds with a 500 error because it tries to extract a 'display_name' property from the content, which is empty. This might cause the invited server to consider that the server is down and not try to exchange other, valid invites (or at least delay it). This fix handles the case of revoked invites by avoiding trying to fetch a 'display_name' from the original invite's content, and letting the m.room.member event fail the auth rules (because, since the original invite's content is empty, it doesn't have public keys), which results in sending a 403 with the correct error message to the invited server.
| * | | | | | s/return/defer.returnValue/Brendan Abolivier2019-09-271-1/+1
| | | | | | |
| * | | | | | Incorporate reviewBrendan Abolivier2019-09-271-4/+2
| | | | | | |
| * | | | | | Update synapse/handlers/deactivate_account.pyBrendan Abolivier2019-09-271-1/+3
| | | | | | | | | | | | | | | | | | | | | Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
| * | | | | | Update synapse/handlers/deactivate_account.pyBrendan Abolivier2019-09-271-0/+4
| | | | | | | | | | | | | | | | | | | | | Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
| * | | | | | LintBrendan Abolivier2019-09-271-1/+34
| | | | | | |
* | | | | | | Don't send renewal emails to deactivated usersAndrew Morgan2020-02-101-0/+4
|\ \ \ \ \ \ \ | | |/ / / / / | |/| | | | |
| * | | | | | Don't send renewal emails to deactivated usersBrendan Abolivier2019-06-142-0/+9
| | | | | | |
* | | | | | | Track deactivated accounts in the database (#5378)Andrew Morgan2020-02-101-0/+3
|\| | | | | | | |/ / / / / |/| | | | |
| * | | | | Track deactivated accounts in the database (#5378)Brendan Abolivier2019-06-141-0/+4
| | | | | |
* | | | | | Merge branch 'dinsic' into babolivier/dinsic-message-retentionBrendan Abolivier2019-08-281-1/+9
|\ \ \ \ \ \
| * | | | | | Allow defining HTML templates to serve the user on account renewalBrendan Abolivier2019-08-011-1/+9
| | | | | | |
* | | | | | | Implement per-room message retention policiesBrendan Abolivier2019-08-283-4/+115
|/ / / / / /
* | | | | | Merge pull request #5646 from matrix-org/babolivier/profile-allow-self dinsic_2019-07-09Brendan Abolivier2019-07-091-0/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | Port #5644 to dinsic
| * | | | | | Allow newly-registered users to lookup their own profilesBrendan Abolivier2019-07-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When a user creates an account and the 'require_auth_for_profile_requests' config flag is set, and a client that performed the registration wants to lookup the newly-created profile, the request will be denied because the user doesn't share a room with themselves yet.
* | | | | | | Only ratelimit when sending the emailBrendan Abolivier2019-06-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If we do the opposite, an event can arrive after or while sending the email and the 3PID invite event will get ratelimited.
* | | | | | | Don't update the ratelimiter before sending a 3PID inviteBrendan Abolivier2019-06-281-1/+1
|/ / / / / / | | | | | | | | | | | | | | | | | | This would cause emails being sent, but Synapse responding with a 429 when creating the event. The client would then retry, and with bad timing the same scenario would happen again. Some testing I did ended up sending me 10 emails for one single invite because of this.
* | | | | | Merge pull request #5574 from matrix-org/babolivier/fix-3pid-bind dinsic_2019-06-27Brendan Abolivier2019-06-271-3/+8
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix new 3PID bindings being associated with rewritten IS's server names instead of the original one
| * | | | | | Fix new 3PID bindings being associated with rewritten IS's server names ↵Brendan Abolivier2019-06-271-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of the original one This would make unbind requests fail because Synapse is using the server name it has in DB as destination_is to generate signature, and Sydent uses its own server name there when verifying it, so if a mismatch happens, which is the case if the name gets rewritten for routing purposes, the unbind requests fail on the signature verification.
* | | | | | | Add third party rules hook for 3PID invitesBrendan Abolivier2019-06-171-0/+10
| | | | | | |
* | | | | | | Add third party rules hook into create roomErik Johnston2019-06-171-3/+13
| | | | | | |
* | | | | | | Merge pull request #5471 from matrix-org/erikj/3pid_remote_invite_stateBrendan Abolivier2019-06-171-6/+0
|\ \ \ \ \ \ \ | | |_|_|/ / / | |/| | | | | Port "Fix 3PID invite room state over federation" to dinsic
| * | | | | | Fix 3PID invite room state over federation.Erik Johnston2019-06-141-6/+0
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes that when a user exchanges a 3PID invite for a proper invite over federation it does not include the `invite_room_state` key. This was due to synapse incorrectly sending out two invite requests.
* | | | | | Merge branch 'babolivier/third_party_event_rules' into dinsicBrendan Abolivier2019-06-142-4/+78
|\ \ \ \ \ \ | | |_|/ / / | |/| | | |
| * | | | | Add plugin APIs for implementations of custom event rules.Brendan Abolivier2019-06-142-4/+78
| |/ / / /
* | | | | Don't send renewal emails to deactivated usersBrendan Abolivier2019-06-142-0/+9
| | | | |
* | | | | Track deactivated accounts in the database (#5378)Brendan Abolivier2019-06-141-0/+4
| | | | |
* | | | | Merge branch 'dinsic' into babolivier/userdir_hide_usersBrendan Abolivier2019-06-1212-220/+761
|\ \ \ \ \
| * | | | | Merge branch 'master' into dinsicBrendan Abolivier2019-06-1211-216/+729
| |\| | | |
| | * | | | Fix defaults on checking threepidsErik Johnston2019-06-101-0/+1
| | | |/ / | | |/| |
| | * | | Add ability to perform password reset via email without trusting the ↵Andrew Morgan2019-06-062-14/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | | Fix missing logcontext for PresenceHandler.on_shutdown. (#5369)Richard van der Hoff2019-06-061-1/+7
| | | | | | | | | | | | | | | | | | | | Fixes some warnings, and a scary-looking stacktrace when sytest kills the process.
| | * | | Merge pull request #5089 from dnaf/m-heroes-empty-room-nameBrendan Abolivier2019-06-061-5/+4
| | |\ \ \ | | | | | | | | | | | | Make /sync return heroes if room name or canonical alias are empty
| | | * | | Simplify conditionBrendan Abolivier2019-06-061-2/+2
| | | | | |
| | | * | | Simplify conditionBrendan Abolivier2019-06-051-3/+2
| | | | | |
| | | * | | Merge branch 'develop' into m-heroes-empty-room-nameBrendan Abolivier2019-06-0515-254/+832
| | | |\ \ \
| | | * | | | LintKatie Wolfe2019-04-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I probably should've just run autopep8 in the first place... Signed-off-by: Katie Wolfe <katie@dnaf.moe>
| | | * | | | Clean up codeKatie Wolfe2019-04-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Katie Wolfe <katie@dnaf.moe>
| | | * | | | Show heroes if room name or canonical alias are emptyKatie Wolfe2019-04-241-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #4194 Signed-off-by: Katie Wolfe <katie@dnaf.moe>
| | | * | | | Show heroes if room name or canonical alias are emptyKatie Wolfe2019-04-241-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #4194 Signed-off-by: Katie Wolfe <katie@dnaf.moe>
| | * | | | | Merge pull request #5355 from matrix-org/babolivier/heroes_left_membersBrendan Abolivier2019-06-061-15/+19
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | Include left members in room summaries' heroes
| | | * | | | | Do user_id != me checks before deciding whether we should pick heroes from ↵Brendan Abolivier2019-06-051-15/+19
| | | | |/ / / | | | |/| | | | | | | | | | | | | | | | | the joined members or the parted ones
| | * | | | | Fix background updates to handle redactions/rejections (#5352)Erik Johnston2019-06-062-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix background updates to handle redactions/rejections In background updates based on current state delta stream we need to handle that we may not have all the events (or at least that `get_events` may raise an exception).
| | * | | | | Add logging when request fails and clarify we ignore errors.Erik Johnston2019-06-051-4/+12
| | | | | | |
| | * | | | | Fix handling of failures when calling /event_auth.Erik Johnston2019-06-031-12/+38
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When processing an incoming event over federation, we may try and resolve any unexpected differences in auth events. This is a non-essential process and so should not stop the processing of the event if it fails (e.g. due to the remote disappearing or not implementing the necessary endpoints). Fixes #3330
| | * | | | Merge pull request #5309 from matrix-org/rav/limit_displayname_lengthRichard van der Hoff2019-06-012-0/+15
| | |\ \ \ \ | | | | | | | | | | | | | | Limit displaynames and avatar URLs
| | | * | | | Limit displaynames and avatar URLsRichard van der Hoff2019-06-012-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These end up in join events everywhere, so let's limit them. Fixes #5079
| | * | | | | Fix "db txn 'update_presence' from sentinel context" log messages (#5275)Richard van der Hoff2019-05-281-52/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #4414.
| | * | | | | Merge pull request #5220 from matrix-org/erikj/dont_bundle_live_eventsErik Johnston2019-05-242-0/+6
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | Don't bundle aggregations with events in /sync or /events or state queries
| | | * | | | | Don't bundle aggs for /state and /members etc APIsErik Johnston2019-05-241-0/+3
| | | | | | | |
| | | * | | | | Don't bundle events in /sync or /eventsErik Johnston2019-05-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we'll send down the annotations too anyway, so this just ends up confusing clients.
| | * | | | | | Add config option for setting homeserver's default room version (#5223)Andrew Morgan2019-05-231-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | | | | Simplifications and comments in do_auth (#5227)Richard van der Hoff2019-05-231-120/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was staring at this function trying to figure out wtf it was actually doing. This is (hopefully) a non-functional refactor which makes it a bit clearer.
| | * | | | | | Room Statistics (#4338)Amber Brown2019-05-211-0/+325
| | | |/ / / / | | |/| | | |
| * | | | | | Merge branch 'master' into dinsicBrendan Abolivier2019-06-114-4/+32
| |\| | | | | | | |_|_|/ / | |/| | | |
| | * | | | Merge pull request #5212 from matrix-org/erikj/deny_multiple_reactionsErik Johnston2019-05-211-1/+15
| | |\ \ \ \ | | | | | | | | | | | | | | Block attempts to annotate the same event twice
| | | * | | | Fix wordsErik Johnston2019-05-211-3/+3
| | | | | | |
| | | * | | | Block attempts to annotate the same event twiceErik Johnston2019-05-201-1/+15
| | | |/ / /
| | * / / / Exclude soft-failed events from fwd-extremity candidates. (#5146)Richard van der Hoff2019-05-211-1/+6
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When considering the candidates to be forward-extremities, we must exclude soft failures. Hopefully fixes #5090.
| | * | | Limit UserIds to a length that fits in a state key (#5198)ReidAnderson2019-05-201-1/+10
| | | | |
| | * | | fix mapping of return values for get_or_register_3pid_guest (#5177)bytepoets-blo2019-05-171-1/+1
| | | | | | | | | | | | | | | * fix mapping of return values for get_or_register_3pid_guest
* | | | | Fix variable definitionBrendan Abolivier2019-06-101-1/+1
| | | | |
* | | | | Fix conditionBrendan Abolivier2019-06-101-1/+1
| | | | |
* | | | | Hide new users from the user directory if enabled in the server config.Brendan Abolivier2019-06-101-0/+10
|/ / / /
* | | | Merge pull request #5214 from matrix-org/babolivier/password-policyBrendan Abolivier2019-05-222-1/+98
|\ \ \ \ | | | | | | | | | | Allow server admins to define and enforce a password policy (MSC2000)
| * | | | Make error messages more explicitBrendan Abolivier2019-05-211-6/+25
| | | | |
| * | | | First implementation of MSC2000Brendan Abolivier2019-05-202-1/+79
| |/ / /
* | | | Merge branch 'babolivier/per_room_profiles' into dinsic dinsic_2019-05-17Brendan Abolivier2019-05-177-54/+83
|\| | |
| * | | Add option to disable per-room profilesBrendan Abolivier2019-05-161-0/+9
| | | |
| * | | Make /sync attempt to return device updates for both joined and invited ↵Matthew Hodgson2019-05-161-19/+25
| | | | | | | | | | | | | | | | users (#3484)
| * | | Make all the rate limiting options more consistent (#5181)Amber Brown2019-05-151-2/+2
| | | |
| * | | Allow client event serialization to be asyncErik Johnston2019-05-145-52/+71
| | | |
* | | | Merge branch 'release-v0.99.4' into dinsic dinsic_2019-05-14Brendan Abolivier2019-05-147-3/+365
|\| | |
| * | | add options to require an access_token to GET /profile and /publicRooms on ↵Matthew Hodgson2019-05-081-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | Do checks on aliases for incoming m.room.aliases events (#5128)Brendan Abolivier2019-05-082-4/+33
| | | | | | | | | | | | | | | | | | | | 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.
| * | | Merge pull request #5104 from matrix-org/erikj/ratelimit_3pid_inviteErik Johnston2019-05-071-0/+11
| |\ \ \ | | | | | | | | | | Ratelimit 3pid invites
| | * | | Rate limit earlyErik Johnston2019-05-021-2/+3
| | | | |
| | * | | Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2019-04-263-0/+263
| | |\ \ \ | | | | | | | | | | | | | | | | | | erikj/ratelimit_3pid_invite
| | * | | | Ratelimit 3pid invitesErik Johnston2019-04-261-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do ratelimit sending the 3PID invite events, but that happens after spamming the identity server.
| * | | | | Add some limitations to alias creationBrendan Abolivier2019-05-022-2/+23
| | |/ / / | |/| | |
| * | | | Fix infinite loop in presence handlerRichard van der Hoff2019-04-261-0/+5
| | |/ / | |/| | | | | | | | | | Fixes #5102
| * | | Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2019-04-1715-237/+275
| |\ \ \ | | | | | | | | | | | | | | | babolivier/account_expiration
| | * \ \ Merge pull request #5047 from matrix-org/babolivier/account_expirationBrendan Abolivier2019-04-171-0/+228
| | |\ \ \ | | | |_|/ | | |/| | Send out emails with links to extend an account's validity period
| * | | | Add management endpoints for account validityBrendan Abolivier2019-04-171-4/+29
| | |/ / | |/| |
| * | | Send out emails with links to extend an account's validity periodBrendan Abolivier2019-04-171-0/+228
| | | |
* | | | Incorporate reviewBrendan Abolivier2019-05-091-1/+1
| | | |
* | | | Check if Synapse should check given ISsBrendan Abolivier2019-05-091-0/+12
| | | |
* | | | /bulk_lookup doesn't return a signatureBrendan Abolivier2019-05-071-5/+0
| | | |
* | | | Fix expected key in bulk lookup responseBrendan Abolivier2019-05-071-1/+1
| | | |
* | | | Incorporate reviewBrendan Abolivier2019-05-071-1/+1
| | | |
* | | | Fix error messageBrendan Abolivier2019-05-011-1/+1
| | | |
* | | | Update synapse/handlers/identity.pyAndrew Morgan2019-05-011-1/+1
| | | | | | | | | | | | Co-Authored-By: babolivier <contact@brendanabolivier.com>
* | | | Fix url and methodBrendan Abolivier2019-04-301-2/+2
| | | |
* | | | Add bulk lookupBrendan Abolivier2019-04-301-1/+45
| | | |
* | | | [DINSIC] Add ability to proxy identity lookups (#5048)Andrew Morgan2019-04-162-47/+83
| | | |
* | | | [DINSIC] Block internal users from inviting external users to a public room ↵Andrew Morgan2019-04-162-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | (#5061) Co-Authored-By: babolivier <contact@brendanabolivier.com>
* | | | Merge branch 'develop' into dinsicAndrew Morgan2019-04-1515-237/+271
|\ \ \ \ | | |/ / | |/| |
| * | | Add config option to block users from looking up 3PIDs (#5010)Brendan Abolivier2019-04-041-0/+5
| | |/ | |/|
| * | Prevent kicking users who aren't in the room (#4999)Andrew Morgan2019-04-041-0/+9
| | | | | | | | | Prevent kick events from succeeding if the user is not currently in the room.
| * | Fix grammar and document get_current_users_in_room (#4998)Andrew Morgan2019-04-038-14/+14
| | |
| * | Remove presence lists (#4989)Neil Johnson2019-04-031-165/+2
| | | | | | | | | Remove presence list support as per MSC 1819
| * | Merge pull request #4982 from matrix-org/erikj/msc1915Erik Johnston2019-04-033-15/+71
| |\ \ | | | | | | | | Implement MSC1915 - 3PID unbind APIs
| | * | Correctly handle id_server paramErik Johnston2019-04-021-0/+1
| | | |
| | * | Remove threepid binding if id server returns 400/404/501Erik Johnston2019-04-021-9/+10
| | | |
| | * | Fixup docstringsErik Johnston2019-04-021-2/+4
| | | |
| | * | Allowing specifying IS to use in unbind API.Erik Johnston2019-04-013-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default the homeserver will use the identity server used during the binding of the 3PID to unbind the 3PID. However, we need to allow clients to explicitly ask the homeserver to unbind via a particular identity server, for the case where the 3PID was bound out of band from the homeserver. Implements MSC915.
| | * | For unbind poke IS used during binding of 3PIDErik Johnston2019-04-011-9/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the behaviour from using the server specified trusted identity server to using the IS that used during the binding of the 3PID, if known. This is the behaviour specified by MSC1915.
| | * | Track IS used to bind 3PIDsErik Johnston2019-04-011-0/+15
| | | | | | | | | | | | | | | | | | | | This will then be used to know which IS to default to when unbinding the threepid.
| * | | 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-013-18/+13
| |/ / | | | | | | | | | 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.
| * | Allow password providers to bind emails (#4947)Andrew Morgan2019-03-281-0/+17
| | | | | | | | | This PR allows password provider modules to bind email addresses when a user is registering and is motivated by matrix-org/matrix-synapse-ldap3#58
| * | Use an assertErik Johnston2019-03-281-2/+1
| | |
| * | Review commentsErik Johnston2019-03-281-44/+62
| | |
| * | Use event streams to calculate presenceErik Johnston2019-03-271-29/+130
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Primarily this fixes a bug in the handling of remote users joining a room where the server sent out the presence for all local users in the room to all servers in the room. We also change to using the state delta stream, rather than the distributor, as it will make it easier to split processing out of the master process (as well as being more flexible). Finally, when sending presence states to newly joined servers we filter out old presence states to reduce the number sent. Initially we filter out states that are offline and have a last active more than a week ago, though this can be changed down the line. Fixes #3962
* | Add config option to block users from looking up 3PIDs (#5010) dinsic_2019-04-05Brendan Abolivier2019-04-051-0/+5
| |
* | Merge branch 'master' of github.com:matrix-org/synapse into dinsicErik Johnston2019-04-057-56/+137
|\|
| * Support 3PID login in password providers (#4931)Andrew Morgan2019-03-263-8/+51
| | | | | | | | | | 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.
| * Refactor out state delta handling into its own class (#4917)Amber Brown2019-03-252-46/+75
| |
| * Merge pull request #4908 from matrix-org/erikj/block_peek_on_blocked_roomsErik Johnston2019-03-212-2/+11
| |\ | | | | | | Deny peeking into rooms that have been blocked
| | * Deny peeking into rooms that have been blockedErik Johnston2019-03-212-2/+11
| | |
* | | Rewrite more internal IS urls. (#5006) dinsic_2019-04-04Michael Kaye2019-04-041-4/+22
| | | | | | | | | * Rewrite more internal IS urls.
* | | Add 3PID invite support to spam checkerErik Johnston2019-03-213-3/+22
| | |
* | | Correctly handle 3PID invites in create room spam checkErik Johnston2019-03-211-2/+3
| | | | | | | | | | | | We also add an option to outright deny third party invites
* | | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/dinsic-mergedErik Johnston2019-03-2115-611/+638
|\| |
| * | Merge pull request #4904 from matrix-org/erikj/fix_shutdownErik Johnston2019-03-214-2/+13
| |\| | | | | | | Fixup shutdown room API
| | * Revert spurious deleteErik Johnston2019-03-201-0/+4
| | |
| | * Use flagsErik Johnston2019-03-204-13/+13
| | |
| | * Move requester check into assert_accepted_privacy_policyErik Johnston2019-03-201-5/+8
| | |
| | * Only require consent for events with an associated requestErik Johnston2019-03-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are a number of instances where a server or admin may puppet a user to join/leave rooms, which we don't want to fail if the user has not consented to the privacy policy. We fix this by adding a check to test if the requester has an associated access_token, which is used as a proxy to answer the question of whether the action is being done on behalf of a real request from the user.
| * | Merge pull request #4896 from matrix-org/erikj/disable_room_directoryErik Johnston2019-03-212-0/+22
| |\ \ | | |/ | |/| Add option to disable search room lists
| | * Disable publishing to room list when its disabledErik Johnston2019-03-201-0/+8
| | |
| | * Pull out config optionErik Johnston2019-03-201-3/+3
| | |
| | * Return before we logErik Johnston2019-03-201-4/+5
| | |
| | * Add option to disable search room listsErik Johnston2019-03-191-0/+13
| | | | | | | | | | | | This disables both local and remote room list searching.
| * | Batch up outgoing read-receipts to reduce federation traffic. (#4890)Richard van der Hoff2019-03-201-1/+1
| |/ | | | | | | Rate-limit outgoing read-receipts as per #4730.
| * fix test_auto_create_auto_join_where_no_consent (#4886)Neil Johnson2019-03-192-3/+15
| |
| * Migrate the user directory initial population to a background task (#4864)Amber Brown2019-03-191-160/+13
| |
| * Add ratelimiting on failed login attempts (#4865)Brendan Abolivier2019-03-181-5/+23
| |
| * Add ratelimiting on login (#4821)Brendan Abolivier2019-03-152-2/+38
| | | | | | Add two ratelimiters on login (per-IP address and per-userID).
| * Merge pull request #4852 from matrix-org/rav/move_rr_sending_to_workerRichard van der Hoff2019-03-151-55/+24
| |\ | | | | | | Move client receipt processing to federation sender worker.
| | * Move client receipt processing to federation sender worker.Richard van der Hoff2019-03-131-33/+4
| | | | | | | | | | | | | | | This is mostly a prerequisite for #4730, but also fits with the general theme of "move everything off the master that we possibly can".
| | * declare a ReadReceipt classRichard van der Hoff2019-03-131-24/+22
| | | | | | | | | | | | | | | I'm going to use this in queues and things, so it'll be useful to give it more of a structure.
| * | Merge pull request #4846 from matrix-org/hawkowl/userdir-searchErik Johnston2019-03-141-48/+77
| |\ \ | | |/ | |/| Improve searching in the userdir
| | * fixupAmber Brown2019-03-131-1/+1
| | |
| | * fixupAmber Brown2019-03-121-47/+70
| | |