diff --git a/src/porchlight/app.py b/src/porchlight/app.py index 91bb490..d399923 100644 --- a/src/porchlight/app.py +++ b/src/porchlight/app.py @@ -128,6 +128,7 @@ def create_app(settings: Settings | None = None) -> FastAPI: ) # Rate limiting + limiter.enabled = settings.rate_limit_enabled app.state.limiter = limiter @app.exception_handler(RateLimitExceeded) diff --git a/src/porchlight/config.py b/src/porchlight/config.py index 90e036e..38fb597 100644 --- a/src/porchlight/config.py +++ b/src/porchlight/config.py @@ -52,6 +52,9 @@ class Settings(BaseSettings): # Magic links invite_ttl: int = 86400 # seconds + # Rate limiting (disable for e2e/load tests that authenticate repeatedly) + rate_limit_enabled: bool = True + # Signing keys signing_key_path: str = "data/keys" diff --git a/src/porchlight/templates/manage/credentials.html b/src/porchlight/templates/manage/credentials.html index 6d4c269..a37221e 100644 --- a/src/porchlight/templates/manage/credentials.html +++ b/src/porchlight/templates/manage/credentials.html @@ -38,7 +38,8 @@ {% else %}
No password set.
{% endif %} -