Skip to content

feat: add per-org and per-IP rate limit tiers#423

Open
smartalee wants to merge 2 commits into
Disciplr-Org:mainfrom
smartalee:feat/tiered-rate-limits
Open

feat: add per-org and per-IP rate limit tiers#423
smartalee wants to merge 2 commits into
Disciplr-Org:mainfrom
smartalee:feat/tiered-rate-limits

Conversation

@smartalee
Copy link
Copy Markdown

Summary

Adds per-org rate limiting alongside existing per-IP limits for org-scoped routes.

Changes

  • Added ORG_RATE_LIMIT_MAX and ORG_RATE_LIMIT_WINDOW_MS to env config
  • Modified orgAuth.ts to attach orgId to request object
  • Updated rate limiter key generator to include org ID in rate limit keys
  • Applied org-aware rate limiters to /org/:orgId/vaults and /org/:orgId/analytics routes
  • Added matrix tests for per-org/per-IP rate limiting
  • Added documentation in README

Testing

npm test -- rateLimiter.tiers.test.ts

Closes #341

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@smartalee Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enforce per-org and per-IP rate limit tiers in src/middleware/rateLimiter.ts

1 participant