Skip to content

[RateLimiter] Add CompoundRateLimiterFactory #59929

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 our 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
Mar 21, 2025

Conversation

kbond
Copy link
Member

@kbond kbond commented Mar 6, 2025

Q A
Branch? 7.3
Bug fix? no
New feature? yes
Deprecations? no
Issues #59925
License MIT

First step for #59925.

Copy link
Contributor

@mtarld mtarld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With minor suggestion 🙂

@kbond kbond force-pushed the rate-limiter-compound-factory branch from 9dac513 to aae5b46 Compare March 12, 2025 17:05
@OskarStark OskarStark changed the title [RateLimiter] add CompoundRateLimiterFactory [RateLimiter] Add CompoundRateLimiterFactory Mar 13, 2025
@fabpot
Copy link
Member

fabpot commented Mar 21, 2025

Thank you @kbond.

@fabpot fabpot merged commit 3fd7ea8 into symfony:7.3 Mar 21, 2025
10 of 11 checks passed
nicolas-grekas added a commit that referenced this pull request Apr 8, 2025
…onfig (kbond)

This PR was squashed before being merged into the 7.3 branch.

Discussion
----------

[FrameworkBundle][RateLimiter] compound rate limiter config

| Q             | A
| ------------- | ---
| Branch?       | 7.3
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| Issues        | Fix #59925
| License       | MIT

Follow-up to #59929.

Example:

```yaml
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]
```

```php
public function contactAction(RateLimiterFactoryInterface $contactFormLimiter)
{
    // $contactFormLimiter is a CompoundRateLimiterFactory containing
    // "two_per_minute" & "five_per_hour"
}
```

Commits
-------

ee2a127 [FrameworkBundle][RateLimiter] compound rate limiter config
@fabpot fabpot mentioned this pull request May 2, 2025
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.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy