Skip to content
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

How to load client rules on execution, not startup #469

Open
bugnuker opened this issue Oct 21, 2023 · 1 comment
Open

How to load client rules on execution, not startup #469

bugnuker opened this issue Oct 21, 2023 · 1 comment

Comments

@bugnuker
Copy link

Hello,

I have a need to use a rate limiting middleware or some other solution that can limit by client id (or the client id is whitelisted).

This solution seems to fit the bill, however, I can only find methods to load the configuration from appsettings.json OR from a database, but only at startup.

I have a need to be able to add rules at anytime (for example, a new client signed up) - not just startup of the application.

It seems like it would have to be something along the lines of:

try to find the client id in the existing rule list that is cached
if found, execute rules
if not found, try to find a new set of rules

OR

find rule by client id and have a SeedRuleByClientId() method that can pass the client id and the rules can be dynamically loaded for that client. Again, cache should be used to avoid multiple database calls.

How could this be accomplished?

@dario-apaleo
Copy link

dario-apaleo commented Oct 27, 2023

This might work
Update rate limits at runtime

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

No branches or pull requests

2 participants