summary refs log tree commit diff
path: root/synapse/handlers/directory.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Better warning in logs when we fail to fetch an alias (#15922)Eric Eastwood2023-07-111-1/+3
| | | | | | | | | | | | | **Before:** ``` Error retrieving alias ``` **After:** ``` Error retrieving alias #foo:bar -> 401 Unauthorized ``` *Spawning from creating the [manual testing strategy for the outbound federation proxy](https://github.com/matrix-org/synapse/pull/15773).*
* Move ThirdPartyEventRules into module_api/callbacks (#15535)Andrew Morgan2023-05-041-2/+4
|
* Move Spam Checker callbacks to a dedicated file (#15453)Andrew Morgan2023-04-181-5/+9
|
* Bump black from 22.12.0 to 23.1.0 (#15103)dependabot[bot]2023-02-221-3/+5
|
* Return read-only collections from `@cached` methods (#13755)Sean Quah2023-02-101-3/+3
| | | | | | | | | | | | | It's important that collections returned from `@cached` methods are not modified, otherwise future retrievals from the cache will return the modified collection. This applies to the return values from `@cached` methods and the values inside the dictionaries returned by `@cachedList` methods. It's not necessary for the dictionaries returned by `@cachedList` methods themselves to be read-only. Signed-off-by: Sean Quah <seanq@matrix.org> Co-authored-by: David Robertson <davidr@element.io>
* Avoid mutating cached room aliases. (#15038)Patrick Cloke2023-02-091-1/+2
| | | | | This might cause incorrect data in other callers which are not expecting the canonical alias to be added into the response.
* Allow PUT/GET of aliases during faster join (#14292)David Robertson2022-11-011-2/+2
| | | without blocking on full state.
* Use Pydantic when PUTting room aliases (#14179)David Robertson2022-10-171-8/+11
|
* Update `get_users_in_room` mis-use to get hosts with dedicated ↵Eric Eastwood2022-08-241-5/+7
| | | | | `get_current_hosts_in_room` (#13605) See https://github.com/matrix-org/synapse/pull/13575#discussion_r953023755
* `synapse.api.auth.Auth` cleanup: make permission-related methods use ↵Quentin Gliech2022-08-221-13/+11
| | | | | | | | | `Requester` instead of the `UserID` (#13024) Part of #13019 This changes all the permission-related methods to rely on the Requester instead of the UserID. This is a first step towards enabling scoped access tokens at some point, since I expect the Requester to have scope-related informations in it. It also changes methods which figure out the user/device/appservice out of the access token to return a Requester instead of something else. This avoids having store-related objects in the methods signatures.
* Uniformize spam-checker API, part 5: expand other spam-checker callbacks to ↵David Teller2022-07-111-2/+4
| | | | | | return `Tuple[Codes, dict]` (#13044) Signed-off-by: David Teller <davidt@element.io> Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Uniformize spam-checker API, part 4: port other spam-checker callbacks to ↵David Teller2022-06-131-5/+14
| | | | | return `Union[Allow, Codes]`. (#12857) Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Reduce the amount of state we pull from the DB (#12811)Erik Johnston2022-06-061-1/+1
|
* Wait for lazy join to complete when getting current state (#12872)Erik Johnston2022-06-011-1/+6
|
* Give a meaningful error message when a client tries to create a room with an ↵reivilibre2022-05-181-0/+3
| | | | invalid alias localpart. (#12779)
* Rename various ApplicationServices interested methods (#11915)Andrew Morgan2022-03-031-3/+3
|
* Remove `HomeServer.get_datastore()` (#12031)Richard van der Hoff2022-02-231-1/+1
| | | | | | | The presence of this method was confusing, and mostly present for backwards compatibility. Let's get rid of it. Part of #11733
* Convert all namedtuples to attrs. (#11665)Patrick Cloke2021-12-301-4/+6
| | | To improve type hints throughout the code.
* Test room alias deletion (#11327)David Robertson2021-11-121-1/+5
| | | | | | | | | | * Prefer `HTTPStatus` over plain `int` This is an Opinion that no-one has seemed to object to yet. * `--disallow-untyped-defs` for `tests.rest.client.test_directory` * Improve synapse's annotations for deleting aliases * Test case for deleting a room alias * Changelog
* Annotate `log_function` decorator (#10943)reivilibre2021-10-271-1/+1
| | | Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Don't set new room alias before potential 403 (#10930)AndrewFerr2021-10-251-2/+2
| | | | | | Fixes: #10929 Signed-off-by: Andrew Ferrazzutti <fair@miscworks.net>
* Remove the deprecated BaseHandler. (#11005)Patrick Cloke2021-10-081-5/+4
| | | | | | | | The shared ratelimit function was replaced with a dedicated RequestRatelimiter class (accessible from the HomeServer object). Other properties were copied to each sub-class that inherited from BaseHandler.
* Use direct references for configuration variables (part 6). (#10916)Patrick Cloke2021-09-291-1/+1
|
* Use direct references for configuration variables (part 5). (#10897)Patrick Cloke2021-09-241-3/+3
|
* Use inline type hints in `handlers/` and `rest/`. (#10382)Jonathan de Jong2021-07-161-3/+3
|
* Fix a number of logged errors caused by remote servers being down. (#10400)Erik Johnston2021-07-151-1/+4
|
* Use get_current_users_in_room from store and not StateHandler (#9910)Erik Johnston2021-05-051-2/+2
|
* Add missing type hints to handlers and fix a Spam Checker type hint. (#9896)Patrick Cloke2021-04-291-26/+33
| | | | | The user_may_create_room_alias method on spam checkers declared the room_alias parameter as a str when in reality it is passed a RoomAlias object.
* 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>`
* Allow spam-checker modules to be provide async methods. (#8890)David Teller2020-12-111-2/+4
| | | | Spam checker modules can now provide async methods. This is implemented in a backwards-compatible manner.
* Allow ThirdPartyEventRules modules to manipulate public room state (#8292)Andrew Morgan2020-10-051-0/+10
| | | | | This PR allows `ThirdPartyEventRules` modules to view, manipulate and block changes to the state of whether a room is published in the public rooms directory. While the idea of whether a room is in the public rooms list is not kept within an event in the room, `ThirdPartyEventRules` generally deal with controlling which modifications can happen to a room. Public rooms fits within that idea, even if its toggle state isn't controlled through a state event.
* Enable mypy checking for unreachable code and fix instances. (#8432)Patrick Cloke2020-10-011-1/+1
|
* Simplify super() calls to Python 3 syntax. (#8344)Patrick Cloke2020-09-181-1/+1
| | | | | | | This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
* Stop shadow-banned users from sending non-member events. (#8142)Patrick Cloke2020-08-241-0/+6
|
* Convert directory handler to async/await (#7727)Patrick Cloke2020-06-221-39/+29
|
* async/await is_server_admin (#7363)Andrew Morgan2020-05-011-28/+23
|
* Allow admins to create aliases when they are not in the room (#7191)Patrick Cloke2020-04-011-1/+5
|
* Allow deleting an alias if the user has sufficient power level (#6986)Patrick Cloke2020-03-041-33/+74
|
* Validate the alt_aliases property of canonical alias events (#6971)Patrick Cloke2020-03-031-7/+7
|
* Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)Patrick Cloke2020-02-211-2/+2
| | | | Ensure good comprehension hygiene using flake8-comprehensions.
* Do not send alias events when creating / upgrading a room (#6941)Patrick Cloke2020-02-201-17/+2
| | | Stop emitting room alias update events during room creation/upgrade.
* Make room alias lists peekableRichard van der Hoff2020-02-191-1/+3
| | | | | | As per https://github.com/matrix-org/matrix-doc/pull/2432#pullrequestreview-360566830, make room alias lists accessible to users outside world_readable rooms.
* Implement GET /_matrix/client/r0/rooms/{roomId}/aliases (#6939)Richard van der Hoff2020-02-181-1/+16
| | | | | per matrix-org/matrix-doc#2432
* Stop sending events when creating or deleting aliases (#6904)Patrick Cloke2020-02-181-35/+40
| | | Stop sending events when creating or deleting associations (room aliases). Send an updated canonical alias event if one of the alt_aliases is deleted.
* Make /directory/room/<alias> handle restrictive power levelsRichard van der Hoff2020-01-291-1/+6
| | | | | Fixes a bug where the alias would be added, but `PUT /directory/room/<alias>` would return a 403.
* Clean up newline quote marks around the codebase (#6362)Andrew Morgan2019-11-211-1/+1
|
* Replace instance variations of homeserver with correct case/spacingAndrew Morgan2019-11-121-1/+1
|
* Remove last usages of deprecated logging.warn method (#6314)Andrew Morgan2019-11-011-1/+1
|
* Remove duplicate return statementAndrew Morgan2019-07-311-1/+0
|
* Replace returnValue with return (#5736)Amber Brown2019-07-231-7/+7
|
* Run Black. (#5482)Amber Brown2019-06-201-87/+49
|
* Do checks on aliases for incoming m.room.aliases events (#5128)Brendan Abolivier2019-05-081-4/+3
| | | | | Follow-up to #5124 Also added a bunch of checks to make sure everything (both the stuff added on #5124 and this PR) works as intended.
* Add some limitations to alias creationBrendan Abolivier2019-05-021-1/+21
|
* Fix grammar and document get_current_users_in_room (#4998)Andrew Morgan2019-04-031-2/+2
|
* Disable publishing to room list when its disabledErik Johnston2019-03-201-0/+8
|
* Only fetch aliases when publishing roomsErik Johnston2019-02-141-15/+15
|
* Add configurable room list publishing rulesErik Johnston2019-02-141-5/+24
| | | | | This allows specifying who and what is allowed to be published onto the public room list
* Fix flake8 (#4519)Amber Brown2019-01-301-2/+2
|
* Attempt to move room aliases on room upgradesRichard van der Hoff2018-10-311-6/+28
|
* Add config option to control alias creationErik Johnston2018-10-191-0/+9
|
* Clean up room alias creationErik Johnston2018-10-191-30/+47
|
* Reinstate missing null checkRichard van der Hoff2018-09-171-1/+1
|
* Return a 404 when deleting unknown room aliasRichard van der Hoff2018-09-171-3/+16
| | | | | | As per https://github.com/matrix-org/matrix-doc/issues/1675 Fixes https://github.com/matrix-org/synapse/issues/2782
* run isortAmber Brown2018-07-091-4/+5
|
* s/replication_client/federation_client/Erik Johnston2018-03-131-1/+1
|
* Split replication layer into twoErik Johnston2018-03-131-1/+1
|
* Split out edu/query registration to a separate classErik Johnston2018-03-131-1/+1
|
* Update places where we create eventsErik Johnston2018-02-051-4/+3
|
* spam check room publishingDavid Baker2017-10-041-0/+8
|
* Add room creation checks to spam checkerDavid Baker2017-10-041-0/+7
| | | | | Lets the spam checker deny attempts to create rooms and add aliases to them.
* Ignore backoff history for invites, aliases, and roomdirsRichard van der Hoff2017-03-231-0/+1
| | | | | Add a param to the federation client which lets us ignore historical backoff data for federation queries, and set it for a handful of operations.
* CommentsErik Johnston2016-12-071-1/+8
|
* Add new API appservice specific public room listErik Johnston2016-12-061-0/+12
|
* storage/appservice: make appservice methods only relying on the cache ↵Patrik Oldsberg2016-10-061-7/+4
| | | | synchronous
* Use state handler instead of get_users_in_room/get_joined_hostsErik Johnston2016-08-261-3/+5
|
* Move the AS handler out of the Handlers object.Mark Haines2016-05-311-1/+2
| | | | | | Access it directly from the homeserver itself. It already wasn't inheriting from BaseHandler storing it on the Handlers object was already somewhat dubious.
* Doc stringErik Johnston2016-03-221-0/+6
|
* an invalide is something else...Matthew Hodgson2016-03-221-1/+1
|
* Add published room list edit APIErik Johnston2016-03-211-0/+16
|
* Check canonical alias event existsErik Johnston2016-03-171-1/+2
|
* Update aliases event after deletionErik Johnston2016-03-171-6/+46
| | | | | | | | Attempt to update the appropriate `m.room.aliases` event after deleting an alias. This may fail due to the deleter not being in the room. Will also check if the canonical alias of the event is set to the deleted alias, and if so will attempt to delete it.
* Merge pull request #614 from matrix-org/erikj/alias_deleteErik Johnston2016-03-041-6/+21
|\ | | | | Allow alias creators to delete aliases
| * Allow alias creators to delete aliasesErik Johnston2016-03-011-6/+21
| |
* | Pass whole requester to ratelimitingDaniel Wagner-Hall2016-03-031-8/+12
|/ | | | This will enable more detailed decisions
* Branch off member and non member sendsDaniel Wagner-Hall2016-02-151-1/+1
| | | | Unclean, needs tidy-up, but works
* Fix flake8 warnings for new flake8Daniel Wagner-Hall2016-02-021-2/+2
|
* copyrightsMatthew Hodgson2016-01-071-1/+1
|
* Disallow whitespace in aliases here tooDavid Baker2015-05-141-0/+5
|
* Implement exclusive namespace checks.Kegan Dougal2015-02-271-2/+12
|
* %s for strings otherwise you end up sending 'u"foo"'David Baker2015-02-241-1/+1
|
* PEP8-ifyKegan Dougal2015-02-111-3/+0
|
* Fix bugs so lazy room joining works as intended.Kegan Dougal2015-02-091-6/+17
|
* Pyflakes: unused variable.Kegan Dougal2015-02-061-1/+1
|
* Grant ASes the ability to delete aliases in their own namespace.Kegan Dougal2015-02-061-5/+23
|
* Grant ASes the ability to create alias in their own namespace.Kegan Dougal2015-02-061-12/+31
| | | | | | Add a new errcode type M_EXCLUSIVE when users try to create aliases inside AS namespaces, and when ASes try to create aliases outside their own namespace.
* Prevent aliases in AS namespaces being created/deleted by users. Check with ↵Kegan Dougal2015-02-051-9/+33
| | | | ASes when queried for room aliases via federation.
* Merge branch 'develop' into application-servicesKegan Dougal2015-02-051-1/+10
|\
| * When returning lists of servers from alias lookups, put the current server ↵Erik Johnston2015-02-041-1/+10
| | | | | | | | first in the list
* | Add unknown room alias check. Call it from directory_handler.get_associationKegan Dougal2015-02-051-0/+7
|/
* Replace hs.parse_roomalias with RoomAlias.from_stringMark Haines2015-01-231-1/+2
|
* Update copyright noticesMark Haines2015-01-061-1/+1
|
* Don't ratelimit room create eventsMark Haines2014-12-191-1/+1
|
* clean up coding style a bitMark Haines2014-12-161-1/+0
|
* Kill off synapse.api.events.*Erik Johnston2014-12-161-2/+2
|
* Rename MessageHandler.handle_event. Add a few comments.Erik Johnston2014-12-151-1/+1
|
* Convert rest and handlers to use new event structureErik Johnston2014-12-041-12/+8
|
* Change DomainSpecificString so that it doesn't use a HomeServer objectErik Johnston2014-12-021-4/+4
|
* Return 404 M_NOT_FOUND when trying to look up a room alias that doesn't existMark Haines2014-11-211-12/+24
|
* Fix pep8 codestyle warningsMark Haines2014-11-201-2/+3
|
* SYN-153: Fix formatting of federation error messageMark Haines2014-11-201-1/+1
|
* SYN-153: Raise 404 if room alias is not foundMark Haines2014-11-191-4/+8
|
* SYN-149: Send join event immediately after the room create eventMark Haines2014-11-181-2/+0
|
* Split out sending the room alias events from creating the alias so that we ↵Mark Haines2014-11-181-12/+6
| | | | can do them in the right point when creating a room
* Implement new replace_state and changed prev_stateErik Johnston2014-11-061-4/+1
| | | | | `prev_state` is now a list of previous state ids, similiar to prev_events. `replace_state` now points to what we think was replaced.
* Begin making auth use event.old_state_eventsErik Johnston2014-10-151-2/+3
|
* Add a keyword argument to get_json to avoid retrying on DNS failures. Rather ↵Mark Haines2014-10-021-3/+2
| | | | than passing MatrixHttpClient.RETRY_DNS_LOOKUP_FAILURES as a fake query string parameter
* Split PlainHttpClient into separate clients for talking to Identity servers ↵Mark Haines2014-10-021-2/+2
| | | | and talking to Capatcha servers
* SYN-2: Allow server admins to delete room aliasesErik Johnston2014-09-301-16/+29
|
* Generate m.room.aliases event when the HS creates a room aliasErik Johnston2014-09-051-5/+33
|
* 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.
* Fix up directory server to not require uploading room hosts. Update the room ↵Erik Johnston2014-09-031-1/+10
| | | | hosts table with the current room hosts (if we have them) on GET.
* Make retrying requests on DNS failures configurable, and turn off retrying ↵Kegan Dougal2014-09-031-1/+5
| | | | only in directory.get_association
* Added a urls module for keeping client and federation prefixes.Kegan Dougal2014-08-141-6/+0
|
* Implement directory service federation by Federation Queries; avoid ↵Paul "LeoNerd" Evans2014-08-131-20/+28
| | | | local_only hack; add unit tests
* add in whitespace after copyright statements to improve legibilityMatthew Hodgson2014-08-131-0/+1
|
* Reference Matrix Home Servermatrix.org2014-08-121-0/+100