"""Shared rate limiter (slowapi) — in-memory, single-worker friendly. Login brute-force brake: the edge (Traefik) has a coarse per-IP limit for the whole API host; this adds a tight limit on the credential endpoint itself. Kept in its own module so routers can import it without a circular import on app.main. """ from slowapi import Limiter from slowapi.util import get_remote_address limiter = Limiter(key_func=get_remote_address)