24 lines
927 B
Python
24 lines
927 B
Python
with open("/app/app/api/v1/endpoints/auth.py", "r") as f:
|
|
content = f.read()
|
|
|
|
old = ''' # Rate limiting (best-effort): by (tenant,email) to slow brute force.
|
|
ident_key = None
|
|
if settings.RATE_LIMIT_ENABLED and not settings.TESTING:
|
|
email_norm = login_data.email.strip().lower()
|
|
ident_key = cache_key("rl", "login", "id", str(tenant.id), email_norm)'''
|
|
|
|
new = ''' # Rate limiting (best-effort): by (tenant,email) to slow brute force.
|
|
ident_key = None
|
|
if settings.RATE_LIMIT_ENABLED and not settings.TESTING and tenant:
|
|
email_norm = login_data.email.strip().lower()
|
|
ident_key = cache_key("rl", "login", "id", str(tenant.id), email_norm)'''
|
|
|
|
if old in content:
|
|
content = content.replace(old, new)
|
|
print("OK: rate limiting fix aplicado")
|
|
else:
|
|
print("ERROR: bloque no encontrado")
|
|
|
|
with open("/app/app/api/v1/endpoints/auth.py", "w") as f:
|
|
f.write(content)
|