fix: off rate-limiting
This commit is contained in:
@@ -31,8 +31,8 @@ auth_router = APIRouter(prefix='/auth', tags=['auth'])
|
||||
response_class=ORJSONResponse,
|
||||
status_code=status.HTTP_200_OK,
|
||||
)
|
||||
@rate_limit(limit=5, window_seconds=60, scope='ip')
|
||||
@rate_limit(limit=3, window_seconds=600, scope='key', key_prefix='rl:reg_start', key_builder=email_rl_key)
|
||||
#@rate_limit(limit=5, window_seconds=60, scope='ip')
|
||||
#@rate_limit(limit=3, window_seconds=600, scope='key', key_prefix='rl:reg_start', key_builder=email_rl_key)
|
||||
@csrf_protect()
|
||||
async def registration_start(
|
||||
request: Request,
|
||||
@@ -44,7 +44,7 @@ async def registration_start(
|
||||
return {'success': result}
|
||||
|
||||
@auth_router.post(path='/registration/complete', response_class=ORJSONResponse, status_code=status.HTTP_201_CREATED)
|
||||
@rate_limit(limit=10, window_seconds=300, scope='ip')
|
||||
#@rate_limit(limit=10, window_seconds=300, scope='ip')
|
||||
@csrf_protect()
|
||||
async def registration(
|
||||
request: Request,
|
||||
@@ -105,8 +105,8 @@ async def registration(
|
||||
return response
|
||||
|
||||
@auth_router.post(path='/login/start', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
||||
@rate_limit(limit=5, window_seconds=60, scope='ip')
|
||||
@rate_limit(limit=3, window_seconds=600, scope='key', key_prefix='rl:login_start', key_builder=email_rl_key)
|
||||
#@rate_limit(limit=5, window_seconds=60, scope='ip')
|
||||
#@rate_limit(limit=3, window_seconds=600, scope='key', key_prefix='rl:login_start', key_builder=email_rl_key)
|
||||
@csrf_protect()
|
||||
async def login_start(
|
||||
request: Request,
|
||||
@@ -118,7 +118,7 @@ async def login_start(
|
||||
return {'success': result}
|
||||
|
||||
@auth_router.post(path='/login/compete', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
||||
@rate_limit(limit=10, window_seconds=300, scope='ip')
|
||||
#@rate_limit(limit=10, window_seconds=300, scope='ip')
|
||||
@csrf_protect()
|
||||
async def login(
|
||||
request: Request,
|
||||
@@ -200,7 +200,7 @@ async def login(
|
||||
return response
|
||||
|
||||
@auth_router.post(path='/logout', response_class=ORJSONResponse, status_code=status.HTTP_200_OK)
|
||||
@rate_limit(limit=settings.RATE_LIMIT_REQUESTS, window_seconds=settings.RATE_LIMIT_WINDOW, scope='ip')
|
||||
#@rate_limit(limit=settings.RATE_LIMIT_REQUESTS, window_seconds=settings.RATE_LIMIT_WINDOW, scope='ip')
|
||||
@csrf_protect()
|
||||
async def logout_current(
|
||||
request: Request,
|
||||
|
||||
Reference in New Issue
Block a user