Configurable ratelimit key
This commit is contained in:
parent
05c3440a33
commit
3dfea0f8a0
@ -128,6 +128,8 @@ SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = None # FIXME
|
|||||||
GOOGLE_API_KEY = None # FIXME
|
GOOGLE_API_KEY = None # FIXME
|
||||||
GOOGLE_CALENDAR_ID = None # FIXME
|
GOOGLE_CALENDAR_ID = None # FIXME
|
||||||
|
|
||||||
|
RATELIMIT_KEY = 'ip' # https://django-ratelimit.readthedocs.io/en/stable/keys.html#common-keys e.g. 'header:CF-Connecting-IP'
|
||||||
|
|
||||||
SOCIAL_AUTH_PIPELINE = (
|
SOCIAL_AUTH_PIPELINE = (
|
||||||
'social_core.pipeline.social_auth.social_details',
|
'social_core.pipeline.social_auth.social_details',
|
||||||
'social_core.pipeline.social_auth.social_uid',
|
'social_core.pipeline.social_auth.social_uid',
|
||||||
|
@ -92,7 +92,7 @@ def import_signed(request):
|
|||||||
'sig': sig_expected
|
'sig': sig_expected
|
||||||
})
|
})
|
||||||
|
|
||||||
@ratelimit(key='ip', rate='100/h')
|
@ratelimit(key=settings.RATELIMIT_KEY, rate='100/h')
|
||||||
def import_search(request):
|
def import_search(request):
|
||||||
if request.method != 'POST':
|
if request.method != 'POST':
|
||||||
return redirect(reverse('import_index'))
|
return redirect(reverse('import_index'))
|
||||||
|
Loading…
Reference in New Issue
Block a user