mirror of
https://github.com/jazzband/django-defender.git
synced 2026-03-16 22:10:32 +00:00
cleaned up readme
This commit is contained in:
parent
859bc4a25d
commit
03488469f5
1 changed files with 14 additions and 8 deletions
22
README.md
22
README.md
|
|
@ -97,18 +97,23 @@ destination.
|
|||
|
||||
Cache backend:
|
||||
==============
|
||||
IP_attempts (count, TTL)
|
||||
username_attempts (count, TTL)
|
||||
ip_blocks (list) # how to expire when in a list?
|
||||
username_blocks (list) # how to expire item in the list?
|
||||
|
||||
- IP_attempts (count, TTL)
|
||||
- username_attempts (count, TTL)
|
||||
- ip_blocks (list) # how to expire when in a list?
|
||||
- username_blocks (list) # how to expire item in the list?
|
||||
|
||||
prefix:failed:ip:[ip] (count, expires)
|
||||
prefix:failed:username:[username] (count, expires)
|
||||
prefix:blocked:ip:[ip] (true, TTL)
|
||||
prefix:blocked:username:[username] (true, TTL)
|
||||
cache keys:
|
||||
-----------
|
||||
|
||||
- prefix:failed:ip:[ip] (count, expires)
|
||||
- prefix:failed:username:[username] (count, expires)
|
||||
- prefix:blocked:ip:[ip] (true, TTL)
|
||||
- prefix:blocked:username:[username] (true, TTL)
|
||||
|
||||
Rate limiting Example
|
||||
---------------------
|
||||
```
|
||||
# example of how to do rate limiting by IP
|
||||
# assuming it is 10 requests being the limit
|
||||
# this assumes there is a DECAY of DECAY_TIME
|
||||
|
|
@ -125,3 +130,4 @@ ELSE
|
|||
EXPIRE(ip, DECAY_TIME)
|
||||
EXEC
|
||||
END
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue