release/v1.6.66 - #282
Merged
Merged
release/v1.6.66#282
Conversation
…y IP ThrottleRequests runs before API authentication, so Laravel's default signature always fell back to route domain + client IP. Behind a load balancer that IP is the balancer's, and no route has a domain, so every tenant, API key and console visitor shared one bucket: one busy integration returned 429 to the whole platform. Key the limiter on the hashed credential (API key, Sanctum token, basic auth), falling back to the user and then the IP only when none is sent, and scope it by first path segment so /v1 and /int stay separate. Also keep Retry-After and X-RateLimit-* on the 429 response so throttled clients know when to retry.
…umer metrics - ApiRateLimits: effective limits from env defaults plus a system.rate-limits setting an admin can change at runtime; per-organization overrides (custom limit or unlimited); credential -> organization lookup cached per key. - ApiConsumerMetrics: per-consumer request and 429 counts in Redis (minute buckets for 2h, hour buckets for 8 days), recorded by the throttle middleware so throttled requests are visible too. - RateLimitController + int/v1/rate-limits routes (admin only): get/save/reset settings, top consumers by window, clear a consumer's limiter window. - ThrottleRequests applies overrides and records every request.
roncodes
force-pushed
the
release/v1.6.66
branch
2 times, most recently
from
September 29, 2026 08:28
f4fc81a to
2f008a8
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #282 +/- ##
============================================
Coverage 100.00% 100.00%
- Complexity 7676 7772 +96
============================================
Files 433 436 +3
Lines 25009 25337 +328
============================================
+ Hits 25009 25337 +328
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fix(throttle): key the API rate limiter on the consumer, not the proxy IP
feat(throttle): admin-managed rate limits, org overrides and API consumer metrics
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.
Release v1.6.66: per-consumer API rate limiting, admin rate-limit controls, and API consumer metrics. The notes are in
RELEASE.md.Includes:
Retry-Afteron 429sMerge those into this branch first. Merging this branch into
maintagsv1.6.66.