Git Product home page Git Product logo

Comments (6)

hypervtechnics avatar hypervtechnics commented on May 1, 2024 1

Any progress on this?

from aspnetcoreratelimit.

 avatar commented on May 1, 2024 1

Too bad, but I understand. Thanks for the effort 👍

I personally don't need to update this real-time for my solution, I would just favor something like this:
[HttpThrottle(["1m", "5m"], [2, 100])]
over a long list of appsettings policies. The HttpThrottle being the pseudo code here of course.

Anyway, great project and I think I'll manage without it haha.

Cheers!

from aspnetcoreratelimit.

BarsikV avatar BarsikV commented on May 1, 2024 1

Another way of implementing this is creating plain attributes, which do nothing. And use reflection to get all the endpoints configured this way. Then just pass it as the configuration class.

Yes, this is worse than implementing the code directly in an action filter attribute, yet it does the job as good as the current implementation, while not requiring too much effort. And if you configure it once per app life, we don't care about reflection being slow here.

I am most likely will be going with this approach for my scenario, can do a PR here if it works.

from aspnetcoreratelimit.

 avatar commented on May 1, 2024

Any progress on this?

I second that. This feature would be much appreciated.

from aspnetcoreratelimit.

cristipufu avatar cristipufu commented on May 1, 2024

I tried to implement this some time ago (https://github.com/stefanprodan/AspNetCoreRateLimit/tree/feature/inline_attributes), but I couldn't easily make it work, it needed too much refactoring, maybe some breaking changes - so I abandoned it.

In the same time, I'm not sure of the actual value of this feature - having to re-deploy the code to change the limits doesn't sound so "maintainable".

from aspnetcoreratelimit.

BarsikV avatar BarsikV commented on May 1, 2024

In the same time, I'm not sure of the actual value of this feature - having to re-deploy the code to change the limits doesn't sound so "maintainable".

I think both types of configuration are very valid. I see how changing the configuration on the fly without redeploying could be valuable.
However, having all the endpoint configurations at the Controller level is much easier to read and maintain at the code level. Redeploying is very easy in a modern CI/CD scenario, unless you need to do it a lot, which is not always the case.

Would like very much to see this feature.
Looking at the code, I understand your concern about needing a major refactor. On the other hand, all the code is already there, the attribute is the same as the middleware, but with the rules passed to them directly and per endpoint.

from aspnetcoreratelimit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.