feat(backend): Add IP-aware rate limiting, scoped API keys, monitoring, and stream reconciliation#1193
Merged
Emmyt24 merged 1 commit intoMay 28, 2026
Conversation
… monitoring, and stream reconciliation Implements four comprehensive backend improvements: 1. IP-based rate limiting (nova-launch01#1119) - Extract real client IP respecting proxy configuration (X-Forwarded-For, X-Real-IP) - Apply per-IP rate limits for unauthenticated routes - Configurable trusted proxy list via TRUSTED_PROXY_IPS 2. Scoped API key authorization (nova-launch01#1120) - Extend api-key.guard to support scopes on keys - Require specific scopes per route via @RequireScopes decorator - Reject keys lacking required scope with 403 3. Job queue monitoring (nova-launch01#1121) - Expose queue depth, in-flight jobs, and failed job metrics - Track processing latency per job type - Register metrics with Prometheus for alerting 4. Stream settlement reconciliation (nova-launch01#1122) - Add reconciliation routine comparing projected to on-chain balances - Surface divergences for manual review - Configurable reconciliation interval (STREAM_RECONCILIATION_INTERVAL_MS) - Integrated with background job queue All implementations follow existing error handling and testing conventions. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
@ambermartin681 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! 🚀 |
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
closes #1119
closes #1120
closes #1121
closes #1122
This PR implements four critical backend improvements addressing issues #1119-#1122:
All changes follow existing patterns for error handling and code conventions.
Changes
1. IP-Based Rate Limiting (rateLimiter.ts)
extractClientIP()function respecting X-Forwarded-For and X-Real-IP headersTRUSTED_PROXY_IPSenvironment variable2. Scoped API Keys (api-key.guard.ts)
@RequireScopes()decorator for route-level scope enforcement3. Job Queue Monitoring (jobQueue.ts)
4. Stream Settlement Reconciliation (streamReconciliation.ts)
Test Plan
TRUSTED_PROXY_IPSis set🤖 Generated with Claude Code