summary refs log tree commit diff
path: root/synapse/config/_util.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Correctly mention previous copyright (#16820)Erik Johnston2024-01-231-0/+1
| | | | | During the migration the automated script to update the copyright headers accidentally got rid of some of the existing copyright lines. Reinstate them.
* Update license headersPatrick Cloke2023-11-211-10/+16
|
* Add support for pydantic v2 via pydantic.v1 compat module (#16332)Maxwell G2023-09-251-2/+8
| | | While maintaining support with pydantic v1.
* Re-type config paths in `ConfigError`s to be `StrSequence`s (#15615)Sean Quah2023-05-181-4/+4
| | | | | | Part of #14809. Signed-off-by: Sean Quah <seanq@matrix.org>
* Switch `InstanceLocationConfig` to a pydantic `BaseModel` (#15431)Jason Little2023-04-171-1/+27
| | | | | * Switch InstanceLocationConfig to a pydantic BaseModel, apply Strict* types and add a few helper methods(that will make more sense in follow up work). Co-authored-by: David Robertson <davidr@element.io>
* Allow selecting "prejoin" events by state keys (#14642)David Robertson2022-12-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Declare new config * Parse new config * Read new config * Don't use trial/our TestCase where it's not needed Before: ``` $ time trial tests/events/test_utils.py > /dev/null real 0m2.277s user 0m2.186s sys 0m0.083s ``` After: ``` $ time trial tests/events/test_utils.py > /dev/null real 0m0.566s user 0m0.508s sys 0m0.056s ``` * Helper to upsert to event fields without exceeding size limits. * Use helper when adding invite/knock state Now that we allow admins to include events in prejoin room state with arbitrary state keys, be a good Matrix citizen and ensure they don't accidentally create an oversized event. * Changelog * Move StateFilter tests should have done this in #14668 * Add extra methods to StateFilter * Use StateFilter * Ensure test file enforces typed defs; alphabetise * Workaround surprising get_current_state_ids * Whoops, fix mypy
* 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>`
* Fix validate_config on nested objects (#9054)Richard van der Hoff2021-01-081-1/+1
|
* Better formatting for config errors from modules (#8874)Richard van der Hoff2020-12-081-11/+24
| | | | | | | | | | The idea is that the parse_config method of extension modules can raise either a ConfigError or a JsonValidationError, and it will be magically turned into a legible error message. There's a few components to it: * Separating the "path" and the "message" parts of a ConfigError, so that we can fiddle with the path bit to turn it into an absolute path. * Generally improving the way ConfigErrors get printed. * Passing in the config path to load_module so that it can wrap any exceptions that get caught appropriately.
* Add prometheus metrics to track federation delays (#8430)Richard van der Hoff2020-10-011-2/+4
| | | | | Add a pair of federation metrics to track the delays in sending PDUs to/from particular servers.
* Implement login blocking based on SAML attributes (#8052)Richard van der Hoff2020-08-111-0/+49
Hopefully this mostly speaks for itself. I also did a bit of cleaning up of the error handling. Fixes #8047