summary refs log tree commit diff
path: root/synapse (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-07-15Use set_defaults(func=) styleErik Johnston1-11/+8
2019-07-15Move creation of ArgumentParser to callerErik Johnston2-11/+8
2019-07-15Fix up commentsErik Johnston2-3/+3
2019-07-15Change add_arguments to be a static methodErik Johnston5-5/+39
2019-07-15Return a different error from Invalid Password when a user is deactivated ↵Andrew Morgan3-0/+26
(#5674) Return `This account has been deactivated` instead of `Invalid password` when a user is deactivated.
2019-07-12Add a `docker` type to the towncrier configuration (#5673)Richard van der Hoff7-14/+27
... and certain other changelog-related fixes
2019-07-12Implement access token expiry (#5660)Richard van der Hoff14-31/+253
Record how long an access token is valid for, and raise a soft-logout once it expires.
2019-07-12Fixup docstringsErik Johnston1-7/+5
2019-07-12fix typo: backgroud -> backgroundAndrew Morgan2-5/+5
2019-07-12fix changelog nameRichard van der Hoff1-0/+0
2019-07-12Update reverse_proxy.rst (#5397)Ulrik Günther2-0/+3
Updates reverse_proxy.rst with information about nginx' URI normalisation.
2019-07-12Add missing space in default logging file format generated by the Docker ↵Slavi Pantaleev2-1/+2
image (#5620) This adds a missing space, without which log lines appear uglier. Signed-off-by: Slavi Pantaleev <slavi@devture.com>
2019-07-12Upgrade Alpine Linux used in the Docker image (3.8 -> 3.10) (#5619)Slavi Pantaleev2-2/+3
Alpine Linux 3.8 is still supported, but it seems like it's quite outdated now. While Python should be the same on both, all other libraries, etc., are much newer in Alpine 3.9 and 3.10. Signed-off-by: Slavi Pantaleev <slavi@devture.com>
2019-07-12Add a mechanism for per-test configs (#5657)Richard van der Hoff2-1/+55
It's useful to be able to tweak the homeserver config to be used for each test. This PR adds a mechanism to do so.
2019-07-11Use /src for checking out synapse during sytests (#5664)Amber Brown2-0/+4
2019-07-11 Improved docs on setting up Postgresql (#5661)Lrizika2-4/+16
Added that synapse_user needs a database to access before it can auth Noted you'll need to enable password auth, linked to pg_hba.conf docs
2019-07-11small typo fix (#5655)Andrew Morgan2-1/+2
2019-07-11Clean up exception handling for access_tokens (#5656)Richard van der Hoff6-100/+111
First of all, let's get rid of `TOKEN_NOT_FOUND_HTTP_STATUS`. It was a hack we did at one point when it was possible to return either a 403 or a 401 if the creds were missing. We always return a 401 in these cases now (thankfully), so it's not needed. Let's also stop abusing `AuthError` for these cases. Honestly they have nothing that relates them to the other places that `AuthError` is used, other than the fact that they are loosely under the 'Auth' banner. It makes no sense for them to share exception classes. Instead, let's add a couple of new exception classes: `InvalidClientTokenError` and `MissingClientTokenError`, for the `M_UNKNOWN_TOKEN` and `M_MISSING_TOKEN` cases respectively - and an `InvalidClientCredentialsError` base class for the two of them.
2019-07-11Add basic opentracing support (#5544)Jorik Schellekens12-12/+633
* 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
2019-07-11Inline issue_access_token (#5659)Richard van der Hoff3-8/+5
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.)
2019-07-10Remove access-token support from RegistrationStore.register (#5642)Richard van der Hoff9-79/+30
The 'token' param is no longer used anywhere except the tests, so let's kill that off too.
2019-07-10TypoBrendan Abolivier1-1/+1
2019-07-10Rename changelog fileBrendan Abolivier1-0/+0
2019-07-10Send 3PID bind requests as JSON dataBrendan Abolivier2-1/+2
2019-07-10Don't bundle aggregations when retrieving the original event (#5654)Andrew Morgan2-2/+13
A fix for PR #5626, which returned the original event content as part of a call to /relations. Only problem was that we were attempting to aggregate the relations on top of it when we did so. We now set bundle_aggregations to False in the get_event call. We also do this when pulling the relation events as well, because edits of edits are not something we'd like to support here.
2019-07-10Add a linting script (#5627)Andrew Morgan2-0/+13
Add a dev script to cover all the different linting steps.
2019-07-10Correct pep517 flag in readme (#5651)Bruno Windels2-1/+2
2019-07-09remove unused and unnecessary check for FederationDeniedError (#5645)Hubert Chathi2-4/+2
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.
2019-07-09Include the original event in /relations (#5626)Andrew Morgan4-4/+12
When asking for the relations of an event, include the original event in the response. This will mostly be used for efficiently showing edit history, but could be useful in other circumstances.
2019-07-08Remove access-token support from RegistrationHandler.register (#5641)Richard van der Hoff8-81/+44
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.
2019-07-08LintBrendan Abolivier1-2/