summary refs log tree commit diff
path: root/synapse/http/servlet.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add `parse_strings_from_args` to get `prev_events` array (#10048)Eric Eastwood2021-05-281-43/+153
| | | | | | | | | | | | | | | | | | | | | | Split out from https://github.com/matrix-org/synapse/pull/9247 Strings: - `parse_string` - `parse_string_from_args` - `parse_strings_from_args` For comparison with ints: - `parse_integer` - `parse_integer_from_args` Previous discussions: - https://github.com/matrix-org/synapse/pull/9247#discussion_r573195687 - https://github.com/matrix-org/synapse/pull/9247#discussion_r574214156 - https://github.com/matrix-org/synapse/pull/9247#discussion_r573264791 Signed-off-by: Eric Eastwood <erice@element.io>
* 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>`
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-1/+1
| | | | | | | - Update black version to the latest - Run black auto formatting over the codebase - Run autoformatting according to [`docs/code_style.md `](https://github.com/matrix-org/synapse/blob/80d6dc9783aa80886a133756028984dbf8920168/docs/code_style.md) - Update `code_style.md` docs around installing black to use the correct version
* Remove unused OPTIONS handlers. (#8621)Patrick Cloke2020-10-221-2/+1
| | | | The handling of OPTIONS requests was consolidated in #7534, but the endpoint specific handlers were not removed.
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-1/+1
|
* Be stricter about JSON that is accepted by Synapse (#8106)Patrick Cloke2020-08-191-3/+2
|
* Ensure that calls to `json.dumps` are compatible with the standard library ↵Patrick Cloke2020-07-151-1/+3
| | | | json. (#7836)
* Do not use canonicaljson to magically handle decoding bytes from JSON. (#7802)Patrick Cloke2020-07-101-12/+2
|
* Clean up newline quote marks around the codebase (#6362)Andrew Morgan2019-11-211-1/+1
|
* Remove usage of deprecated logger.warn method from codebase (#6271)Andrew Morgan2019-10-311-2/+2
| | | Replace every instance of `logger.warn` with `logger.warning` as the former is deprecated.
* Add opentracing to all client servlets (#5983)Jorik Schellekens2019-09-051-5/+1
|
* Opentracing across workers (#5771)Jorik Schellekens2019-08-221-1/+1
| | | | | | | | | | | | | | Propagate opentracing contexts across workers Also includes some Convenience modifications to opentracing for servlets, notably: - Add boolean to skip the whitelisting check on inject extract methods. - useful when injecting into carriers locally. Otherwise we'd always have to include our own servername and whitelist our servername - start_active_span_from_request instead of header - Add boolean to decide whether to extract context from a request to a servlet
* Handle incorrectly encoded query params correctlyErik Johnston2019-08-011-1/+6
|
* Fix servlet metric names (#5734)Jorik Schellekens2019-07-241-1/+3
| | | | | | | | | | * Fix servlet metric names Co-Authored-By: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Remove redundant check * Cover all return paths
* Add basic opentracing support (#5544)Jorik Schellekens2019-07-111-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Configure and initialise tracer Includes config options for the tracer and sets up JaegerClient. * Scope manager using LogContexts We piggy-back our tracer scopes by using log context. The current log context gives us the current scope. If new scope is created we create a stack of scopes in the context. * jaeger is a dependency now * Carrier inject and extraction for Twisted Headers * Trace federation requests on the way in and out. The span is created in _started_processing and closed in _finished_processing because we need a meaningful log context. * Create logcontext for new scope. Instead of having a stack of scopes in a logcontext we create a new context for a new scope if the current logcontext already has a scope. * Remove scope from logcontext if logcontext is top level * Disable tracer if not configured * typo * Remove dependence on jaeger internals * bools * Set service name * :Explicitely state that the tracer is disabled * Black is the new black * Newsfile * Code style * Use the new config setup. * Generate config. * Copyright * Rename config to opentracing * Remove user whitelisting * Empty whitelist by default * User ConfigError instead of RuntimeError * Use isinstance * Use tag constants for opentracing. * Remove debug comment and no need to explicitely record error * Two errors a "s(c)entry" * Docstrings! * Remove debugging brainslip * Homeserver Whitlisting * Better opentracing config comment * linting * Inclue worker name in service_name * Make opentracing an optional dependency * Neater config retreival * Clean up dummy tags * Instantiate tracing as object instead of global class * Inlcude opentracing as a homeserver member. * Thread opentracing to the request level * Reference opetnracing through hs * Instantiate dummy opentracin g for tests. * About to revert, just keeping the unfinished changes just in case * Revert back to global state, commit number: 9ce4a3d9067bf9889b86c360c05ac88618b85c4f * Use class level methods in tracerutils * Start and stop requests spans in a place where we have access to the authenticated entity * Seen it, isort it * Make sure to close the active span. * I'm getting black and blue from this. * Logger formatting Co-Authored-By: Erik Johnston <erik@matrix.org> * Outdated comment * Import opentracing at the top * Return a contextmanager * Start tracing client requests from the servlet * Return noop context manager if not tracing * Explicitely say that these are federation requests * Include servlet name in client requests * Use context manager * Move opentracing to logging/ * Seen it, isort it again! * Ignore twisted return exceptions on context exit * Escape the scope * Scopes should be entered to make them useful. * Nicer decorator names * Just one init, init? * Don't need to close something that isn't open * Docs make you smarter
* Run Black. (#5482)Amber Brown2019-06-201-18/+27
|
* Fix error code for invalid parameterAaron Raimist2019-05-241-1/+1
| | | | Signed-off-by: Aaron Raimist <aaron@raim.ist>
* fix parse_string docstringRichard van der Hoff2018-11-081-5/+4
|
* Port over enough to get some sytests running on Python 3 (#3668)Amber Brown2018-08-201-14/+42
|
* Python 3: Convert some unicode/bytes uses (#3569)Amber Brown2018-08-021-1/+9
|
* rename assert_params_in_request to assert_params_in_dictKrombel2018-07-131-1/+1
| | | | | | the method "assert_params_in_request" does handle dicts and not requests. A request body has to be parsed to json before this method can be used
* run isortAmber Brown2018-07-091-2/+1
|
* Attempt to be more performant on PyPy (#3462)Amber Brown2018-06-281-2/+4
|
* delete_local_events for purge_historyRichard van der Hoff2018-02-091-3/+15
| | | | Add a flag which makes the purger delete local events
* Fix 500 on invalid utf-8 in requestRichard van der Hoff2017-11-101-1/+2
| | | | | | | | | If somebody sends us a request where the the body is invalid utf-8, we should return a 400 rather than a 500. (json.loads throws a UnicodeError in this situation) We might as well catch all Exceptions here: it seems very unlikely that we would get a request that *isn't caused by invalid json.
* replace 'except:' with 'except Exception:'Richard van der Hoff2017-10-231-3/+3
| | | | what could possibly go wrong
* Support registration / login with phone numberDavid Baker2017-03-131-0/+10
| | | | Changes from https://github.com/matrix-org/synapse/pull/1971
* Revert "Support registration & login with phone number"Erik Johnston2017-03-131-10/+0
|
* Refector out assert_params_in_requestDavid Baker2017-03-081-0/+10
| | | | and replace requestEmailToken where we meant requestMsisdnToken
* Add new API appservice specific public room listErik Johnston2016-12-061-2/+6
|
* Pass since/from parameters over federationErik Johnston2016-09-151-4/+14
|
* Use google style doc strings.Mark Haines2016-04-011-30/+51
| | | | | | | 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.
* Fix regression where synapse checked whether push rules were valid JSON ↵Mark Haines2016-03-141-4/+17
| | | | before the compatibility hack that handled clients sending invalid JSON
* Use parse_json_object_from_request to parse JSON out of request bodiesMark Haines2016-03-111-5/+12
|
* Add a parse_json_object functionMark Haines2016-03-091-5/+65
| | | | | to deduplicate all the copy+pasted _parse_json functions. Also document the parse_.* functions.
* copyrightsMatthew Hodgson2016-01-071-1/+1
|
* Host /unstable and /r0 versions of r0 APIsDaniel Wagner-Hall2015-12-011-4/+4
|
* Combine the request wrappers in rest/media/v1 and http/server into a single ↵Mark Haines2015-04-211-55/+55
| | | | wrapper decorator
* Add missing commasErik Johnston2015-03-131-2/+2
|
* Add client v2_alpha resource to synapse server resource treeMark Haines2015-01-231-0/+57
|
* Add RestServlet base class in synapse/http/servlet.pyMark Haines2015-01-231-0/+56