fairdm.api.throttling#
The limits on how often a caller may use the API.
Each kind of caller has two limits, one over a short window to stop a burst and one over a
day. Every rate is read from REST_FRAMEWORK["DEFAULT_THROTTLE_RATES"] under the scope
named on its class.
Module Contents#
Classes#
Limit an anonymous caller over a short window. |
|
Limit an anonymous caller over a day. |
|
Count only callers who are signed in, by who they are. |
|
Limit a signed-in caller over a short window. |
|
Limit a signed-in caller over a day. |
API#
- class AnonBurstThrottle[source]#
Bases:
rest_framework.throttling.AnonRateThrottleLimit an anonymous caller over a short window.
Initialization
- scope#
‘anon_burst’
- class AnonDailyThrottle[source]#
Bases:
rest_framework.throttling.AnonRateThrottleLimit an anonymous caller over a day.
Initialization
- scope#
‘anon_day’
- class SignedInThrottle[source]#
Bases:
rest_framework.throttling.UserRateThrottleCount only callers who are signed in, by who they are.
Django REST framework’s own class also counts an anonymous caller, by address. The anonymous throttles count those callers, so counting them here would stop them at the signed-in rate whenever it is the lower one.
Initialization
- class UserBurstThrottle[source]#
Bases:
fairdm.api.throttling.SignedInThrottleLimit a signed-in caller over a short window.
Initialization
- scope#
‘user_burst’
- class UserDailyThrottle[source]#
Bases:
fairdm.api.throttling.SignedInThrottleLimit a signed-in caller over a day.
Initialization
- scope#
‘user_day’