Skip to content

Add Rate Limiting Middleware#237

Open
spjmurray wants to merge 1 commit into
mainfrom
rate_limiting
Open

Add Rate Limiting Middleware#237
spjmurray wants to merge 1 commit into
mainfrom
rate_limiting

Conversation

@spjmurray

@spjmurray spjmurray commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

Based on the ubiquitous leaky bucket algorithm, this version does synchronous leaks and is non-blocking. The middleware packages this all up into something that initially does global and per-endpoint rate limits.

@codecov

codecov Bot commented Jan 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 37.50000% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.56%. Comparing base (e47f645) to head (8eb7830).

Files with missing lines Patch % Lines
pkg/server/middleware/ratelimit/middleware.go 0.00% 38 Missing ⚠️
pkg/openapi/helpers/helpers.go 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #237      +/-   ##
==========================================
+ Coverage   28.45%   28.56%   +0.10%     
==========================================
  Files          72       74       +2     
  Lines        3795     3858      +63     
==========================================
+ Hits         1080     1102      +22     
- Misses       2615     2656      +41     
  Partials      100      100              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Based on the ubiquitous leaky bucket algorithm, this version does
synchronous leaks and is non-blocking.  The middleware packages this all
up into something that initially does global and per-endpoint rate
limits.
// via a leak at a fixed period that is defined by the requests per second. If the
// bucket ever becomes full, then requests are rejected with a 429. This algorithm
// allows for bursty workloads.
// NOTE: Uber do have an implmentation, but it's blocking. Where as this fails

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

2 participants