MatrixSynapse/synapse/rest/client/v1
Richard van der Hoff 0a4001eba1
Clean up exception handling for access_tokens (#5656)
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-11 11:06:23 +01:00
..
__init__.py copyrights 2016-01-07 04:26:29 +00:00
directory.py Clean up exception handling for access_tokens (#5656) 2019-07-11 11:06:23 +01:00
events.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00
initial_sync.py Unify v1 and v2 REST client APIs (#5226) 2019-06-03 21:28:59 +10:00
login.py Remove access-token support from RegistrationHandler.register (#5641) 2019-07-08 19:01:08 +01:00
logout.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00
presence.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00
profile.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00
push_rule.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00
pusher.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00
room.py Clean up exception handling for access_tokens (#5656) 2019-07-11 11:06:23 +01:00
voip.py Run Black. (#5482) 2019-06-20 19:32:02 +10:00