8000 [FrameworkBundle][RateLimiter] compound rate limiter config by kbond · Pull Request #60155 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle][RateLimiter] compound rate limiter config #60155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to o 8000 ur terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

kbond
Copy link
Member
@kbond kbond commented Apr 5, 2025
Q A
Branch? 7.3
Bug fix? no
New feature? yes
Deprecations? yes
Issues Fix #59925
License MIT

Follow-up to #59929.

Example:

framework:
    rate_limiter:
        two_per_minute:
            policy: 'fixed_window'
            limit: 2
            interval: '1 minute'
        five_per_hour:
            policy: 'fixed_window'
            limit: 5
            interval: '1 hour'
            lock_factory: null
        contact_form:
            policy: 'compound'
            limiters: [two_per_minute, five_per_hour]
public function contactAction(RateLimiterFactoryInterface $contactFormLimiter)
{
    // $contactFormLimiter is a CompoundRateLimiterFactory containing
    // "two_per_minute" & "five_per_hour"
}

@nicolas-grekas nicolas-grekas force-pushed the rate-limiter/configure-compound branch from 815f38a to ee2a127 Compare April 8, 2025 07:09
@nicolas-grekas
Copy link
Member

Thank you @kbond.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RateLimiter][FrameworkBundle] Ability to configure CompoundLimiter
3 participants
0