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

Skip to content

[RateLimiter] controller attribute #52518

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

Open
kbond opened this issue Nov 9, 2023 · 8 comments · May be fixed by #59920
Open

[RateLimiter] controller attribute #52518

kbond opened this issue Nov 9, 2023 · 8 comments · May be fixed by #59920

Comments

@kbond
Copy link
Member

kbond commented Nov 9, 2023

Description

Using a controller attribute to configure a rate limit would be useful. By default, the key $request->getClientIp() but perhaps we could use the expression language for more advanced use-cases. Would require #52516.

This issue is a todo for myself to work on for 7.1.

Example

#[RateLimit('configured_rate_limiter', methods: 'POST')]
public function someAction()
{
    // ...
}
@kbond kbond added this to the 7.1 milestone Nov 9, 2023
@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@kbond kbond added Keep open and removed Stalled labels May 13, 2024
@xabbuh xabbuh removed this from the 7.1 milestone May 15, 2024
@RazielRodrigues
Copy link

Hello is this topic still available to work on?

@kbond
Copy link
Member Author

kbond commented Feb 26, 2025

@RazielRodrigues, yep, I haven't had time so if you'd like to give it a shot, go ahead!

@RazielRodrigues
Copy link

@RazielRodrigues, yep, I haven't had time so if you'd like to give it a shot, go ahead!

Oh, thanks, I will start soon as possible

@kbond
Copy link
Member Author

kbond commented Feb 28, 2025

Cool! Ping me if you need help or a PR review!

@RazielRodrigues
Copy link

Cool! Ping me if you need help or a PR review!

Hi I have started the development yesterday, I am trying to figure out how I can add this attribute and which should be the workflow, I have knowledge of attributes in raw PHP, is it the same in Symfony? Ah! I have joined the slack community maybe we can talk there if necessary, thank you so much

@RazielRodrigues
Copy link

Cool! Ping me if you need help or a PR review!

I have opened this MR , I only have created the attribute class, since I am a bit confused if we should create the event listener for that or we should use another approach thanks @kbond

#59920

@kbond
Copy link
Member Author

kbond commented Mar 6, 2025

I have opened this MR

Cool! Continuing discussion there.

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

Successfully merging a pull request may close this issue.

4 participants