feat: Add rate limiting middleware with SlowAPI
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -27,6 +27,13 @@ logger = logging.getLogger(__name__)
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
def get_limiter():
|
||||
"""Get the limiter from app state."""
|
||||
from app.main import app
|
||||
|
||||
return app.state.limiter
|
||||
|
||||
|
||||
@router.get("/files")
|
||||
@require_login
|
||||
def list_files_api(
|
||||
|
||||
Reference in New Issue
Block a user