-
- Downloads
"src/api/client/context.rs" did not exist on "7bd56765ef3f49a042ac8625163909d7ca9d5924"
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.
Showing
- changelog.d/5656.misc 1 addition, 0 deletionschangelog.d/5656.misc
- synapse/api/auth.py 39 additions, 88 deletionssynapse/api/auth.py
- synapse/api/errors.py 32 additions, 1 deletionsynapse/api/errors.py
- synapse/rest/client/v1/directory.py 8 additions, 2 deletionssynapse/rest/client/v1/directory.py
- synapse/rest/client/v1/room.py 7 additions, 2 deletionssynapse/rest/client/v1/room.py
- tests/api/test_auth.py 24 additions, 7 deletionstests/api/test_auth.py
Loading
Please register or sign in to comment