summary refs log tree commit diff
path: root/synapse/handlers/_base.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-1/+1
|
* Convert _base, profile, and _receipts handlers to async/await (#7860)Patrick Cloke2020-07-171-5/+2
|
* Add some tiny type annotations (#7870)Richard van der Hoff2020-07-161-6/+4
| | | I found these made pycharm have more of a clue as to what was going on in other places.
* Performance improvements and refactor of Ratelimiter (#7595)Andrew Morgan2020-06-051-31/+29
| | | | | | | | | | While working on https://github.com/matrix-org/synapse/issues/5665 I found myself digging into the `Ratelimiter` class and seeing that it was both: * Rather undocumented, and * causing a *lot* of config checks This PR attempts to refactor and comment the `Ratelimiter` class, as well as encourage config file accesses to only be done at instantiation. Best to be reviewed commit-by-commit.
* async/await is_server_admin (#7363)Andrew Morgan2020-05-011-9/+7
|
* Change EventContext to use the Storage class (#6564)Erik Johnston2019-12-201-1/+1
|
* Fix commentsErik Johnston2019-09-111-1/+1
| | | Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Allow use of different ratelimits for admin redactions.Erik Johnston2019-09-111-11/+32
| | | | | This is useful to allow room admins to quickly deal with a large number of abusive messages.
* Run Black. (#5482)Amber Brown2019-06-201-5/+5
|
* Make all the rate limiting options more consistent (#5181)Amber Brown2019-05-151-2/+2
|
* Use flagsErik Johnston2019-03-201-0/+1
|
* Add rate-limiting on registration (#4735)Brendan Abolivier2019-03-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rate-limiting for registration * Add unit test for registration rate limiting * Add config parameters for rate limiting on auth endpoints * Doc * Fix doc of rate limiting function Co-Authored-By: babolivier <contact@brendanabolivier.com> * Incorporate review * Fix config parsing * Fix linting errors * Set default config for auth rate limiting * Fix tests * Add changelog * Advance reactor instead of mocked clock * Move parameters to registration specific config and give them more sensible default values * Remove unused config options * Don't mock the rate limiter un MAU tests * Rename _register_with_store into register_with_store * Make CI happy * Remove unused import * Update sample config * Fix ratelimiting test for py2 * Add non-guest test
* Fix kicking guest users in worker modeErik Johnston2019-02-181-1/+1
| | | | | | | | When guest_access changes from allowed to forbidden all local guest users should be kicked from the room. This did not happen when revocation was received from federation on a worker. Presumably broken in #4141
* Use new gettersErik Johnston2018-07-231-1/+2
|
* run isortAmber Brown2018-07-091-2/+1
|
* Consistently use six's iteritems and wrap lazy keys/values in list() if ↵Amber Brown2018-05-311-2/+2
| | | | they're not meant to be lazy (#3307)
* Move RoomMemberHandler out of HandlersErik Johnston2018-03-011-1/+1
|
* Add per user ratelimiting overridesErik Johnston2017-05-101-3/+31
|
* Insert delta of current_state_events to be more efficientErik Johnston2017-01-201-2/+6
|
* as_user->app_service, less redundant comments, better positioned commentsLuke Barnard2016-10-201-6/+3
|
* Use real AS object by passing it through the requesterLuke Barnard2016-10-201-8/+3
| | | | This means synapse does not have to check if the AS is interested, but instead it effectively re-uses what it already knew about the requesting user
* Allow Configurable Rate Limiting Per ASLuke Barnard2016-10-181-0/+14
| | | | This adds a flag loaded from the registration file of an AS that will determine whether or not its users are rate limited (by ratelimit in _base.py). Needed for IRC bridge reasons - see https://github.com/matrix-org/matrix-appservice-irc/issues/240.
* handers: do not ratelimit app service sendersPatrik Oldsberg2016-10-061-1/+7
| | | | Signed-off-by: Patrik Oldsberg <patrik.oldsberg@ericsson.com>
* Replace context.current_state with context.current_state_idsErik Johnston2016-08-251-21/+9
|
* Add `create_requester` functionRichard van der Hoff2016-07-261-6/+7
| | | | | Wrap the `Requester` constructor with a function which provides sensible defaults, and use it throughout
* Type annotationsRichard van der Hoff2016-07-191-0/+4
| | | | | Add some type annotations to help PyCharm (in particular) to figure out the types of a bunch of things.
* Fix a doc-commentRichard van der Hoff2016-07-181-1/+1
| | | | The `store` in a handler is a generic DataStore, not just an events.StateStore.
* move filter_events_for_client out of base handlerMark Haines2016-05-111-184/+0
|
* Move _create_new_client_event and handle_new_client_event out of base handlerMark Haines2016-05-111-195/+3
|
* Merge pull request #759 from matrix-org/dbkr/email_notifsMatthew Hodgson2016-05-101-1/+1
|\ | | | | Send email notifications for missed messages
| * Merge remote-tracking branch 'origin/develop' into dbkr/email_notifsDavid Baker2016-05-101-5/+3
| |\
| * | Run filter_events_for_clientDavid Baker2016-04-271-1/+1
| | | | | | | | | | | | so we don't accidentally mail out events people shouldn't see
* | | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/ignore_userErik Johnston2016-05-091-5/+3
|\ \ \ | | |/ | |/|
| * | Add and use get_domian_from_idErik Johnston2016-05-091-5/+3
| |/
* | Add bulk fetch storage APIErik Johnston2016-05-051-7/+3
| |
* | Implement basic ignore userErik Johnston2016-05-041-3/+23
|/
* Don't auto log failed auth checksErik Johnston2016-04-131-1/+5
|
* Merge remote-tracking branch 'origin/develop' into ↵David Baker2016-04-071-11/+40
|\ | | | | | | dbkr/pushers_use_event_actions
| * Let users see their own leave eventsRichard van der Hoff2016-04-061-11/+40
| | | | | | | | | | | | | | ... otherwise clients get confused. Fixes https://matrix.org/jira/browse/SYN-662, https://github.com/vector-im/vector-web/issues/368
* | Make pushers use the event_push_actions table instead of listening on an ↵David Baker2016-04-061-1/+7
|/ | | | | | | event stream & running the rules again. Sytest passes, but remaining to do: * Make badges work again * Remove old, unused code
* Merge pull request #689 from matrix-org/erikj/memberErik Johnston2016-04-041-55/+17
|\ | | | | Do checks for memberships before creating events
| * Use computed prev event idsErik Johnston2016-04-011-12/+17
| |
| * Remove state hack from _create_new_client_eventErik Johnston2016-04-011-43/+0
| |
* | Merge pull request #686 from matrix-org/markjh/doc_stringsMark Haines2016-04-011-11/+16
|\ \ | |/ |/| Use google style doc strings.
| * Use google style doc strings.Mark Haines2016-04-011-11/+16
| | | | | | | | | | | | | | pycharm supports them so there is no need to use the other format. Might as well convert the existing strings to reduce the risk of people accidentally cargo culting the wrong doc string format.
* | Remove outlier parameter from compute_event_contextMark Haines2016-03-311-2/+1
|/ | | | Use event.internal_metadata.is_outlier instead.
* Send history visibility on boundary changesErik Johnston2016-03-041-0/+26
|
* Merge pull request #598 from Rugvip/invite-stateErik Johnston2016-03-041-6/+2
|\ | | | | config,handlers/_base: added homeserver config for what state is included in a room invite
| * config,handlers/_base: added homeserver config for what state is included in ↵Patrik Oldsberg2016-03-041-6/+2
| | | | | | | | | | | | a room invite Signed-off-by: Patrik Oldsberg <patrik.oldsberg@ericsson.com>
* | Merge pull request #596 from Rugvip/createErik Johnston2016-03-041-0/+6
|\ \ | |/ |/| handlers/_base: don't allow room create event to be changed
| * handlers/_base: don't allow room create event to be changedPatrik Oldsberg2016-02-231-0/+6
| | | | | | | | Signed-off-by: Patrik Oldsberg <patrik.oldsberg@ericsson.com>
* | Merge remote-tracking branch 'origin/develop' into rav/SYN-642Richard van der Hoff2016-03-031-4/+11
|\ \
| * | Pass whole requester to ratelimitingDaniel Wagner-Hall2016-03-031-4/+11
| | | | | | | | | | | | This will enable more detailed decisions
* | | fix pyflakes quibbleRichard van der Hoff2016-03-021-1/+2
| | |
* | | Address review commentsRichard van der Hoff2016-03-021-6/+14
| | |
* | | Fix pyflakes warningRichard van der Hoff2016-03-011-1/+1
| | |
* | | Handle rejections of invites from local users locallyRichard van der Hoff2016-03-011-3/+13
|/ / | | | | | | | | Slightly hacky fix to SYN-642, which avoids the federation codepath when trying to reject invites from local users.
* / Send the invier's member event in room invite state so the invitee has their ↵David Baker2016-02-251-1/+7
|/ | | | display name and avatar.
* address review commentsRichard van der Hoff2016-02-221-7/+2
| | | | drop commented-out special casing for historyvisibility event s/he/they/ for users
* Interpret unknown visibilities the same as sharedRichard van der Hoff2016-02-191-11/+13
|
* Merge branch 'develop' into rav/guest_access_after_room_joinRichard van der Hoff2016-02-191-17/+64
|\
| * Review commentsDaniel Wagner-Hall2016-02-181-1/+2
| |
| * Respond to federated invite with non-empty contextDaniel Wagner-Hall2016-02-171-2/+49
| | | | | | | | | | | | | | Currently, we magically perform an extra database hit to find the inviter, and use this to guess where we should send the event. Instead, fill in a valid context, so that other callers relying on the context actually have one.
| * Use update_membership to kick guestsDaniel Wagner-Hall2016-02-151-14/+10
| |
| * Merge implementation of /join by alias or IDDaniel Wagner-Hall2016-02-151-1/+4
| | | | | | | | | | This code is kind of rough (passing the remote servers down a long chain), but is a step towards improvement.
* | Allow guest users access to messages in rooms they have joinedRichard van der Hoff2016-02-191-11/+41
|/ | | | | | | There should be no difference between guest users and non-guest users in terms of access to messages. Define the semantics of the is_peeking argument to filter_events_for_clients (slightly) better; interpret it appropriately, and set it correctly from /sync.
* Atomically persit push actions when we persist the eventErik Johnston2016-02-091-5/+5
|
* Pass in current state to push action handlerErik Johnston2016-02-091-18/+13
|
* Fix up logcontextsErik Johnston2016-02-081-9/+1
|
* Fix flake8 warnings for new flake8Daniel Wagner-Hall2016-02-021-1/+1
|
* Allow non-guests to peek on rooms using /eventsDaniel Wagner-Hall2016-01-201-7/+7
|
* Don't use form of get_state_for_events with None state_keyErik Johnston2016-01-191-6/+13
|
* Add regex cache. Only caculate push actions for users that have sent read ↵Erik Johnston2016-01-191-1/+1
| | | | receipts, and are on that server
* Allow filtering events for multiple users at onceErik Johnston2016-01-181-39/+54
|
* Remove unused parametersDaniel Wagner-Hall2016-01-151-5/+3
|
* Add is_guest flag to users db to track whether a user is a guest user or ↵David Baker2016-01-061-5/+3
| | | | not. Use this so we can run _filter_events_for_client when calculating event_push_actions.
* Merge remote-tracking branch 'origin/develop' into store_event_actionsDavid Baker2016-01-051-14/+2
|\
| * Skip, rather than erroring, invalid guest requestsDaniel Wagner-Hall2016-01-051-14/+2
| | | | | | | | | | | | | | | | | | | | Erroring causes problems when people make illegal requests, because they don't know what limit parameter they should pass. This is definitely buggy. It leaks message counts for rooms people don't have permission to see, via tokens. But apparently we already consciously decided to allow that as a team, so this preserves that behaviour.
* | Address minor PR issuesDavid Baker2016-01-041-2/+2
| |
* | Only run pushers for users on this hs!David Baker2015-12-211-1/+1
| |
* | Very first cut of calculating actions for events as they come in. Doesn't ↵David Baker2015-12-101-0/+8
|/ | | | store them yet. Not very efficient.
* Simplify codeDaniel Wagner-Hall2015-11-191-1/+1
|
* Apply forgetting properly to historical eventsDaniel Wagner-Hall2015-11-181-1/+9
|
* Update some commentsRichard van der Hoff2015-11-131-0/+6
| | | | | | | Add a couple of type annotations, docstrings, and other comments, in the interest of keeping track of what types I have. Merged from pull request #370.
* Allow guest users to join and message roomsDaniel Wagner-Hall2015-11-101-0/+57
|
* Exchange 3pid invites for m.room.member invitesDaniel Wagner-Hall2015-11-051-11/+0
|
* Open up /events to anonymous users for room events onlyDaniel Wagner-Hall2015-11-051-2/+5
| | | | Squash-merge of PR #345 from daniel/anonymousevents
* Allow guests to register and call /events?room_id=Daniel Wagner-Hall2015-11-041-28/+47
| | | | | | | 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.
* Merge pull request #302 from matrix-org/daniel/3pidinvitesDaniel Wagner-Hall2015-10-161-0/+11
|\ | | | | Implement third party identifier invites
| * Remove unnecessary class-wrappingDaniel Wagner-Hall2015-10-131-3/+3
| |
| * Move event contents into third_party_layout fieldDaniel Wagner-Hall2015-10-131-1/+1
| |
| * Remove merge thinkoDaniel Wagner-Hall2015-10-061-4/+0
| |
| * Merge branch 'develop' into daniel/3pidinvitesDaniel Wagner-Hall2015-10-051-0/+26
| |\
| * | Implement third party identifier invitesDaniel Wagner-Hall2015-10-011-0/+11
| | |
* | | Amalgamate _filter_events_for_clientErik Johnston2015-10-161-0/+46
| |/ |/|
* | Also bundle in senderErik Johnston2015-10-021-0/+1
| |
* | Bundle in some room state in the unsigned bit of the invite when sending to ↵Erik Johnston2015-09-101-4/+25
|/ | | | invited servers
* Merge branch 'develop' into redactyoselfDaniel Wagner-Hall2015-08-281-16/+16
|\ | | | | | | | | Conflicts: synapse/handlers/_base.py
| * Do auth checks *before* persisting the eventErik Johnston2015-08-241-16/+16
| |
* | Allow users to redact their own eventsDaniel Wagner-Hall2015-08-281-2/+17
|/
* Check that the canonical room alias actually points to the roomErik Johnston2015-08-201-1/+17
|
* Don't needlessly compute prev_stateErik Johnston2015-06-031-1/+3
|
* Don't bother checking for updates if the stream token hasn't advanced for a userMark Haines2015-05-131-2/+5
|
* Fix up leak. Add warnings.Erik Johnston2015-05-081-4/+7
|
* That wasn't a deferredErik Johnston2015-05-011-3/+1
|
* PEP8Erik Johnston2015-04-161-1/+0
|
* Don't wait on federation_handler.handle_new_eventErik Johnston2015-04-151-3/+7
|
* Remove run_on_reactor()sErik Johnston2015-04-151-4/+0
|
* Merge pull request #110 from matrix-org/fix_banErik Johnston2015-03-161-3/+3
|\ | | | | Fix ban
| * Revert incorrect changes to where we send eventsErik Johnston2015-03-161-3/+4
| |
| * Remove concept of context.auth_events, instead use context.current_stateErik Johnston2015-03-161-3/+3
| |
| * Send all membership events to the remote homeserverErik Johnston2015-03-161-4/+3
| |
* | Don't block waiting on waking up all the listeners when sending an event.Erik Johnston2015-03-161-1/+10
|/
* Replace hs.parse_userid with UserID.from_stringMark Haines2015-01-231-2/+3
|
* Finish renaming "context" to "room_id" in federation codebaseMark Haines2015-01-161-3/+1
|
* Update copyright noticesMark Haines2015-01-061-1/+1
|
* Construct the EventContext in the state handler rather than constructing one ↵Mark Haines2014-12-161-9/+2
| | | | and then immediately calling state_handler.annotate_context_with_state
* clean up coding style a bitMark Haines2014-12-161-2/+2
|
* Rename MessageHandler.handle_event. Add a few comments.Erik Johnston2014-12-151-0/+5
|
* Remove dead codeErik Johnston2014-12-101-2/+0
|
* Fix bug when uploading state with empty state_keyErik Johnston2014-12-101-61/+5
|
* Make depth increase.Erik Johnston2014-12-101-1/+1
|
* Fix joining from an inviteErik Johnston2014-12-091-1/+14
|
* Remove unused importErik Johnston2014-12-091-2/+1
|
* More bug fixesErik Johnston2014-12-081-4/+0
|
* More bug fixesErik Johnston2014-12-081-1/+5
|
* Various typos and bug fixes.Erik Johnston2014-12-081-3/+5
|
* Start making more things use EventContext rather than event.*Erik Johnston2014-12-051-91/+73
|
* Convert rest and handlers to use new event structureErik Johnston2014-12-041-6/+10
|
* Begin converting things to use the new Event structureErik Johnston2014-12-041-12/+53
|
* WIP for new way of managing events.Erik Johnston2014-12-031-0/+51
|
* Fix bugs in invite/join dances.Erik Johnston2014-11-251-1/+1
| | | | | We now do more implement more of the auth on the events so that we don't reject valid events.
* Add a few missing yields, Move deferred lists inside PreserveLoggingContext ↵Mark Haines2014-11-201-1/+1
| | | | because they don't interact well with the logging contexts
* Rename annotate_state_groups to annotate_event_with_stateErik Johnston2014-11-111-1/+1
|
* Use current state to get room hosts, rather than querying the databaseErik Johnston2014-11-071-3/+15
|
* Implement invite part of invite join danceErik Johnston2014-11-071-1/+12
|
* Fix joining over federationErik Johnston2014-11-071-53/+1
|
* Start implementing auth chainsErik Johnston2014-11-071-2/+57
|
* Fix auth checks to all use the given old_event_stateErik Johnston2014-11-051-5/+14
|
* Sign events we create.Erik Johnston2014-11-031-0/+9
|
* Start filling out and using new events tablesErik Johnston2014-10-291-0/+4
|
* Begin making auth use event.old_state_eventsErik Johnston2014-10-151-1/+9
|
* Generate m.room.aliases event when the HS creates a room aliasErik Johnston2014-09-051-3/+0
|
* fix the copyright holder from matrix.org to OpenMarket Ltd, as matrix.org ↵Matthew Hodgson2014-09-031-1/+1
| | | | hasn't been incorporated in time for launch.
* Set status message for ratelimit error responsesMark Haines2014-09-031-1/+1
|
* Raise LimitExceedError when the ratelimiting is throttling requestsMark Haines2014-09-031-4/+2
|
* rate limiting for message sendingMark Haines2014-09-021-2/+2
|
* Add ratelimiting function to basehandlerMark Haines2014-09-021-0/+17
|
* Fix pyflakes warningsMark Haines2014-08-281-1/+1
|
* Merge branch 'develop' into storage_transactionsMark Haines2014-08-271-1/+1
|\ | | | | | | | | | | Conflicts: tests/handlers/test_federation.py tests/handlers/test_room.py
* | Merge branch 'develop' into storage_transactionsMark Haines2014-08-271-2/+3
|\| | | | | | | | | | | Conflicts: synapse/handlers/room.py synapse/storage/stream.py
* | Fill out prev_events before calling persist_eventMark Haines2014-08-271-0/+2
| |
* | Fold federation/handler into handlers/federationMark Haines2014-08-261-1/+2
| |
* | Move new event boilerplate in room handlers into a method on a base clase.Mark Haines2014-08-261-1/+19
|/
* Wait for getting a Join in response to an invite/join dance.Erik Johnston2014-08-211-0/+1
|
* add in whitespace after copyright statements to improve legibilityMatthew Hodgson2014-08-131-0/+1
|
* Reference Matrix Home Servermatrix.org2014-08-121-0/+26