abersheeran / asgi-ratelimit

A ASGI Middleware to rate limit
Apache License 2.0
294 stars 11 forks source link

Added Handling Auth Errors #13

Closed allerter closed 3 years ago

allerter commented 3 years ago

This PR adds handling exceptions raised by RateLimitMiddleware.authenticate. All exceptions are caught and sent to RateLimitMiddleware .on_auth_error so that the appropriate response can be returned.

A few notes:

Closed #12

abersheeran commented 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.

abersheeran commented 3 years ago

Thank you for your contribution! After fixing another issue, I will release a new version.