Replace thamtech/yii2-ratelimiter-advanced with built-in IP rate limiter#18510
Open
Replace thamtech/yii2-ratelimiter-advanced with built-in IP rate limiter#18510
Conversation
43daf3b to
19f8f9e
Compare
timkelty
commented
Mar 4, 2026
Introduces `craft\filters\RateLimiter` and `craft\filters\IpRateLimitIdentity` to provide IP-based rate limiting for unauthenticated requests, removing the external dependency while maintaining equivalent behavior. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use idiomatic Yii2 config array pattern - Remove unused import - Fix code style (explicit property declarations) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The custom craft\filters\RateLimiter was just a thin wrapper setting defaults and wiring up the user closure. Since Yii's RateLimiter natively supports a Closure for the user property, configure it inline in UsersController instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pass Request instance instead of null to satisfy parameter types. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PHPStan flags this as unused at level 5. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c586aea to
5aa4db3
Compare
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.
thamtech/yii2-ratelimiter-advancedis outdated and breaks with cache components defined as functions or that don't extendyii/caching/Cache. So, this PR:thamtech/yii2-ratelimiter-advanceddependency, in favor of Yii's built-inRateLimiter.craft\filters\IpRateLimitIdentityto extend IP-based rate limiting to Yii'sRateLimiter.This is intended as lateral change - the rate limiting behavior for
send-password-reset-emailremains equivalent.