Skip to content
Snippets Groups Projects
  1. Jan 26, 2022
    • Brendan Abolivier's avatar
      Add a module callback to set username at registration (#11790) · 2d3bd9aa
      Brendan Abolivier authored
      
      This is in the context of mainlining the Tchap fork of Synapse. Currently in Tchap usernames are derived from the user's email address (extracted from the UIA results, more specifically the m.login.email.identity step).
      This change also exports the check_username method from the registration handler as part of the module API, so that a module can check if the username it's trying to generate is correct and doesn't conflict with an existing one, and fallback gracefully if not.
      
      Co-authored-by: default avatarDavid Robertson <davidr@element.io>
      2d3bd9aa
    • Patrick Cloke's avatar
      Improvements to bundling aggregations. (#11815) · 2897fb6b
      Patrick Cloke authored
      This is some odds and ends found during the review of #11791
      and while continuing to work in this code:
      
      * Return attrs classes instead of dictionaries from some methods
        to improve type safety.
      * Call `get_bundled_aggregations` fewer times.
      * Adds a missing assertion in the tests.
      * Do not return empty bundled aggregations for an event (preferring
        to not include the bundle at all, as the docstring states).
      2897fb6b
    • David Robertson's avatar
      Don't print HTTPStatus.* in "Processed..." logs (#11827) · d8df8e6c
      David Robertson authored
      * Don't print HTTPStatus.* in "Processed..." logs
      
      Fixes #11812. See also #7118 and
      https://github.com/matrix-org/synapse/pull/7188#r401719326
      
       in
      particular.
      
      Co-authored-by: default avatarBrendan Abolivier <babolivier@matrix.org>
      d8df8e6c
    • David Robertson's avatar
    • Brendan Abolivier's avatar
      Add a config flag to inhibit `M_USER_IN_USE` during registration (#11743) · 95b3f952
      Brendan Abolivier authored
      This is mostly motivated by the tchap use case, where usernames are automatically generated from the user's email address (in a way that allows figuring out the email address from the username). Therefore, it's an issue if we respond to requests on /register and /register/available with M_USER_IN_USE, because it can potentially leak email addresses (which include the user's real name and place of work).
      
      This commit adds a flag to inhibit the M_USER_IN_USE errors that are raised both by /register/available, and when providing a username early into the registration process. This error will still be raised if the user completes the registration process but the username conflicts. This is particularly useful when using modules (https://github.com/matrix-org/synapse/pull/11790 adds a module callback to set the username of users at registration) or SSO, since they can ensure the username is unique.
      
      More context is available in the PR that introduced this behaviour to synapse-dinsic: matrix-org/synapse-dinsic#48 - as well as the issue in the matrix-dinsic repo: matrix-org/matrix-dinsic#476
      95b3f952
  2. Jan 25, 2022
  3. Jan 24, 2022
  4. Jan 21, 2022
Loading