Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle][RateLimiter] no_limit policy requires a limit to be configured #48268

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

Closed
MatTheCat opened this issue Nov 21, 2022 · 1 comment · Fixed by #48275
Closed

[FrameworkBundle][RateLimiter] no_limit policy requires a limit to be configured #48268

MatTheCat opened this issue Nov 21, 2022 · 1 comment · Fixed by #48275

Comments

@MatTheCat
Copy link
Contributor

MatTheCat commented Nov 21, 2022

Symfony version(s) affected

From v5.2.0-BETA3

Description

#38665 exposed the no_limit policy to the configuration without taking its singularity into account. As such it requires the lock component to be installed and enabled, but also a limit to be configured (it would be ignored).

How to reproduce

Configure a limiter with the no_limit policy:

framework:
    rate_limiter:
        no_limit:
            policy: no_limit

and you will get an InvalidConfigurationException:

The child config "limit" under "framework.rate_limiter.limiters.no_limit" must be configured: The maximum allowed hits in a fixed interval or burst

Possible Solution

Do not mark limit as required and validate it’s set only for policies other than no_limit.

Additional Context

I don’t think needing to enable the lock component to configure a no_limit limiter really is an issue, because you would not use only this policy.

@alexandre-daubois
Copy link
Member

I gave it a try! 🙂 I definitely think this is a welcome improvement for the DX.

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