fairdm.contrib.autocomplete.throttling#
The limits on how often one caller may use the autocomplete addresses.
They count callers the way the API’s limits do, and each has a scope of its own, so a person
typing into a search box does not use up an API allowance. Every rate is read from
REST_FRAMEWORK["DEFAULT_THROTTLE_RATES"] under the scope named on its class. A portal that
replaced that dictionary without these scopes is limited at the class’s default_rate.
Module Contents#
Classes#
Fall back to the class’s |
|
Limit a visitor over a short window. |
|
Limit a visitor over a day. |
|
Limit a signed-in caller over a short window. |
|
Limit a signed-in caller over a day. |
API#
- class DefaultRateMixin[source]#
Fall back to the class’s
default_ratewhen the settings lack its scope.Attributes: default_rate: The rate used when the settings do not give one for the scope.
- default_rate = <Multiline-String>#
- class AutocompleteAnonBurstThrottle[source]#
Bases:
fairdm.contrib.autocomplete.throttling.DefaultRateMixin,fairdm.api.throttling.AnonBurstThrottleLimit a visitor over a short window.
Initialization
- scope#
‘autocomplete_anon_burst’
- default_rate#
‘60/minute’
- class AutocompleteAnonDailyThrottle[source]#
Bases:
fairdm.contrib.autocomplete.throttling.DefaultRateMixin,fairdm.api.throttling.AnonDailyThrottleLimit a visitor over a day.
Initialization
- scope#
‘autocomplete_anon_day’
- default_rate#
‘5000/day’
- class AutocompleteUserBurstThrottle[source]#
Bases:
fairdm.contrib.autocomplete.throttling.DefaultRateMixin,fairdm.api.throttling.UserBurstThrottleLimit a signed-in caller over a short window.
Initialization
- scope#
‘autocomplete_user_burst’
- default_rate#
‘240/minute’
- class AutocompleteUserDailyThrottle[source]#
Bases:
fairdm.contrib.autocomplete.throttling.DefaultRateMixin,fairdm.api.throttling.UserDailyThrottleLimit a signed-in caller over a day.
Initialization
- scope#
‘autocomplete_user_day’
- default_rate#
‘50000/day’