| Commit message (Collapse) | Author | Age | Files | Lines | 
| | 
| 
|  | 
Fixes #12122
 | 
| |  | 
 | 
| |  | 
 | 
| | 
| 
| 
| 
|  | 
Also tighten validation of server names by forbidding invalid characters
in IPv6 addresses and empty domain labels.
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
We can get away with just catching UnicodeError here.
    ⋮
    +-- ValueError
    |    +-- UnicodeError
    |         +-- UnicodeDecodeError
    |         +-- UnicodeEncodeError
    |         +-- UnicodeTranslateError
    ⋮
https://docs.python.org/3/library/exceptions.html#exception-hierarchy
Signed-off-by: Dan Callahan <danc@element.io>
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
Functionally identical, but more obviously cryptographically secure.
...Explicit is better than implicit?
Avoids needing to know that SystemRandom() implies a CSPRNG, and
complies with the big scary red box on the documentation for random:
> Warning:
>   The pseudo-random generators of this module should not be used for
>   security purposes. For security or cryptographic uses, see the
>   secrets module.
https://docs.python.org/3/library/random.html
Signed-off-by: Dan Callahan <danc@element.io>
 | 
| |  | 
 | 
| | 
| 
| 
|  | 
Signed-off-by: Denis Kasak <dkasak@termina.org.uk>
 | 
| | 
| 
| 
| 
| 
| 
|  | 
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>`
 | 
| | 
| 
| 
| 
|  | 
* Adds type hints to the groups servlet and stringutils code.
* Assert the maximum length of some input values for spec compliance.
 | 
| |  | 
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
|  | 
`distutils` is pretty much deprecated these days, and replaced with
`setuptools`. It's also annoying because it's you can't `pip install` it, and
it's hard to figure out which debian package we should depend on to make sure
it's there.
Since we only use it for a tiny function anyway, let's just vendor said
function into our codebase.
 | 
| | 
| 
| 
| 
| 
| 
|  | 
Closes: https://github.com/matrix-org/synapse/issues/6766
Equivalent Sydent PR: https://github.com/matrix-org/sydent/pull/309
I believe it's now time to remove the extra allowed `:` from `client_secret` parameters.
 | 
| |  | 
 | 
| |  | 
 | 
| | 
| 
| 
|  | 
this is a no-op on python 3.
 | 
| | 
| 
| 
|  | 
this is a no-op on python 3.
 | 
| | 
| 
| 
|  | 
make sure we clear out all but one update for the user
 | 
| |  | 
 | 
| |  | 
 | 
| |  | 
 | 
| | 
| 
| 
|  | 
This is a bit of a half-assed effort at fixing https://github.com/matrix-org/synapse/issues/4252. Fundamentally the right answer is to drop support for Python 2.
 | 
| |  | 
 | 
| |  | 
 | 
| | 
| 
| 
| 
| 
|  | 
plus a bonus next()
Signed-off-by: Adrian Tschira <nota@notafile.com>
 | 
| | 
| 
| 
| 
| 
| 
| 
|  | 
The _get_joined_users_from_context cache stores a mapping from user_id
to avatar_url and display_name. Instead of storing those in a dict,
store them in a namedtuple as that uses much less memory.
We also try converting the string to ascii to further reduce the size.
 | 
| | 
| 
| 
| 
| 
| 
| 
|  | 
* Remove some unused functions
* get_room_events_stream is only used in tests
* is_exclusive_room might actually be something we want
 | 
| |  | 
 | 
| |  | 
 | 
| |  | 
 | 
| |  | 
 | 
| |  | 
 | 
| | 
| 
| 
|  | 
hasn't been incorporated in time for launch.
 | 
| |  | 
 | 
|    | 
 |