Closed allerter closed 3 years ago
I didn't know where it would be appropriate to add more tests, so I just added one to test_redis to keep coverage happy. But I don't think that's the right place for that test.
You can add a file test_core.py
in tests
.
Thank you for your contribution! After fixing another issue, I will release a new version.
This PR adds handling exceptions raised by
RateLimitMiddleware.authenticate
. All exceptions are caught and sent toRateLimitMiddleware .on_auth_error
so that the appropriate response can be returned.A few notes:
except Exception as exc
to catch all exceptions and not justEmptyInformation
. This is because the authentication function might raise other exceptions. For example, theauths.jwt.create_jwt_auth
can raise the following exceptions:EmptyInformation
,ValueError
,AssertionError
,KeyError
andjwt.exceptions.DecodeError
.test_redis
to keep coverage happy. But I don't think that's the right place for that test.Closed #12