Skip to content

(P4DEVOPS-9434) Wire RateLimiter middleware into API Rack stack#696

Merged
smahima27 merged 2 commits intomainfrom
fix-wire-rate-limiter-middleware
Mar 19, 2026
Merged

(P4DEVOPS-9434) Wire RateLimiter middleware into API Rack stack#696
smahima27 merged 2 commits intomainfrom
fix-wire-rate-limiter-middleware

Conversation

@smahima27
Copy link
Copy Markdown
Contributor

Problem

The RateLimiter middleware was implemented in lib/vmpooler/api/rate_limiter.rb as part of P4DEVOPS-9434 but was never wired into the Rack middleware stack in lib/vmpooler/api.rb. As a result, rate_limiting_enabled: true in the vmpooler config had no effect — all requests passed through without rate limit checks.

This was discovered during dev environment testing where 105 rapid requests returned HTTP 200 instead of HTTP 429.

Fix

  • Added rate_limiter to the list of required API components
  • Inserted use Vmpooler::API::RateLimiter, redis, config into the Rack stack when rate_limiting_enabled is true in config

Testing

Verified in dev (https://vmpooler-dev.k8s.infracore.puppet.net):

Related

@smahima27 smahima27 requested a review from a team as a code owner March 19, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants