fix: Implement IP-based rate limiting with Redis for DDoS protection - #571
Open
Darktan242 wants to merge 1 commit into
Open
fix: Implement IP-based rate limiting with Redis for DDoS protection#571Darktan242 wants to merge 1 commit into
Darktan242 wants to merge 1 commit into
Conversation
|
@issue-solver-bot is attempting to deploy a commit to the Abdulazeem's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Darktan242 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! 🚀 |
Darktan242
marked this pull request as ready for review
August 26, 2026 00:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implemented IP-based rate limiting with Redis for DDoS protection in the stellar-payment-platform.
Changes made:
server.js: Added a strict
authLimiterfor/authendpoints (email OTP verification / login flow). This limiter:RedisStoreas the global limiter, so limits are shared across all distributed Node instances.RATE_LIMITEDerror body and standard/legacy rate-limit headers.tests/rate-limit.test.js: Added a test verifying that the strict auth limiter rejects the 21st request to
/auth/verify-email(429) even though the global limit is 100.The global limiter already used
RedisStorewhen a Redis client is available (existing code), satisfying the "Redis store configured for rate limiting" and "Global limits applied correctly across distributed nodes" acceptance criteria. The new auth limiter satisfies the "Specific strict limits for auth/login endpoints" criterion.Changed files
stellar-payment-platform/server.jsstellar-payment-platform/tests/rate-limit.test.jsTest plan
Run the rate-limit test suite:
cd stellar-payment-platform && npm test -- --testPathPattern=rate-limit(ornpm testfor the full suite). The new test verifies the strict auth limiter returns 429 on the 21st request to /auth/verify-email. Existing tests verify the global limiter still works with the Redis-backed store.This PR was created as a draft by the issue solver bot. It will remain a
draft until repository CI passes.
Closes #492