Skip to content

feat: implement centralized rate limiters and structured 429 response handler#2550

Closed
Babin123456 wants to merge 2 commits into
janavipandole:mainfrom
Babin123456:enhancement/api-rate-limit-config
Closed

feat: implement centralized rate limiters and structured 429 response handler#2550
Babin123456 wants to merge 2 commits into
janavipandole:mainfrom
Babin123456:enhancement/api-rate-limit-config

Conversation

@Babin123456

Copy link
Copy Markdown
Contributor

Closes #2549

Summary

Implements multi-tiered, environment-configurable rate limiters for authentication and order endpoints, featuring structured JSON outputs for HTTP 429 exceptions to allow cleaner frontend error display.

Changes Made

  • Rate Limit Config: Rewrote app/limiter.py to create auth_limiter, order_limiter, wishlist_limiter and custom exception handlers.
  • Main Registration: Updated app/main.py to register rate_limit_exceeded_handler to capture RateLimitExceeded exceptions.
  • Endpoint Protection: Applied limit decorators on /api/auth/register, /api/auth/login, and /api/orders/ endpoints.
  • Tests: Created tests/test_rate_limits.py to verify that hitting limits yields a structured 429 error format.

Verification Plan

Automated Tests

  • Run: pytest backend/tests/test_rate_limits.py

@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the janavipandole's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Babin123456

Copy link
Copy Markdown
Contributor Author

@janavipandole Check it once...

@janavipandole

Copy link
Copy Markdown
Owner

rise new on pls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] ELUSoC_2026: Implement Configurable Rate Limiters and Custom 429 JSON Response Handler

2 participants