Skip to content
Snippets Groups Projects
  1. Jul 19, 2019
  2. Jul 18, 2019
  3. Jul 17, 2019
    • Richard van der Hoff's avatar
    • Richard van der Hoff's avatar
      Improve `Depends` specs in debian package. (#5675) · 1def2981
      Richard van der Hoff authored
      This is basically a contrived way of adding a `Recommends` on `libpq5`, to fix #5653.
      
      The way this is supposed to happen in debhelper is to run
      `dh_shlibdeps`, which in turn runs `dpkg-shlibdeps`, which spits things out
      into `debian/<package>.substvars` whence they can later be included by
      `control`.
      
      Previously, we had disabled `dh_shlibdeps`, mostly because `dpkg-shlibdeps`
      gets confused about PIL's interdependent objects, but that's not really the
      right thing to do and there is another way to work around that.
      
      Since we don't always use postgres, we don't necessarily want a hard Depends on
      libpq5, so I've actually ended up adding an explicit invocation of
      `dpkg-shlibdeps` for `psycopg2`.
      
      I've also updated the build-depends list for the package, which was missing a
      couple of entries.
      Unverified
      1def2981
    • Richard van der Hoff's avatar
      More refactoring in `get_events_as_list` (#5707) · 2091c91f
      Richard van der Hoff authored
      We can now use `_get_events_from_cache_or_db` rather than going right back to
      the database, which means that (a) we can benefit from caching, and (b) it
      opens the way forward to more extensive checks on the original event.
      
      We now always require the original event to exist before we will serve up a
      redaction.
      Unverified
      2091c91f
    • Richard van der Hoff's avatar
      Fix redaction authentication (#5700) · 375162b3
      Richard van der Hoff authored
      Ensures that redactions are correctly authenticated for recent room versions.
      
      There are a few things going on here:
      
       * `_fetch_event_rows` is updated to return a dict rather than a list of rows.
      
       * Rather than returning multiple copies of an event which was redacted
         multiple times, it returns the redactions as a list within the dict.
      
       * It also returns the actual rejection reason, rather than merely the fact
         that it was rejected, so that we don't have to query the table again in
         `_get_event_from_row`.
      
       * The redaction handling is factored out of `_get_event_from_row`, and now
         checks if any of the redactions are valid.
      Unverified
      375162b3
    • Richard van der Hoff's avatar
      Refactor `get_events_as_list` (#5699) · 65c5592b
      Richard van der Hoff authored
      A couple of changes here:
      
      * get rid of a redundant `allow_rejected` condition - we should already have filtered out any rejected
        events before we get to that point in the code, and the redundancy is confusing. Instead, let's stick in
        an assertion just to make double-sure we aren't leaking rejected events by mistake.
      
      * factor out a `_get_events_from_cache_or_db` method, which is going to be important for a 
        forthcoming fix to redactions.
      Unverified
      65c5592b
  4. Jul 15, 2019
  5. Jul 12, 2019
  6. Jul 11, 2019
    • Amber Brown's avatar
    • Lrizika's avatar
      Improved docs on setting up Postgresql (#5661) · 39e9839a
      Lrizika authored
      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
      39e9839a
    • Andrew Morgan's avatar
      small typo fix (#5655) · 78a1cd36
      Andrew Morgan authored
      78a1cd36
    • Richard van der Hoff's avatar
      Clean up exception handling for access_tokens (#5656) · 0a4001eb
      Richard van der Hoff authored
      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.
      Unverified
      0a4001eb
    • Jorik Schellekens's avatar
      Add basic opentracing support (#5544) · 38a6d3ee
      Jorik Schellekens authored
      
      * 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: default avatarErik 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
      Unverified
      38a6d3ee
  7. Jul 10, 2019
  8. Jul 09, 2019
    • Hubert Chathi's avatar
      remove unused and unnecessary check for FederationDeniedError (#5645) · 7b3bc755
      Hubert Chathi authored
      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.
      7b3bc755
    • Andrew Morgan's avatar
      Include the original event in /relations (#5626) · d88421ab
      Andrew Morgan authored
      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.
      Unverified
      d88421ab
  9. Jul 08, 2019
Loading