Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Help : Rate Limiting by api key values #785

Open
mucahitdurmaz opened this issue Sep 29, 2022 · 3 comments
Open

Help : Rate Limiting by api key values #785

mucahitdurmaz opened this issue Sep 29, 2022 · 3 comments

Comments

@mucahitdurmaz
Copy link

mucahitdurmaz commented Sep 29, 2022

Hello,

I want to limit requests by rate limiting with api key identifier.
I have like 100+ apikeys and i can limit them by creating individual consumer and adding key auth , rate limit plugin.

I want to rate limit only 5-6 apikeys. All other api keys should work with same rate limit scenario.
I couldn't make this scenario because of key auth plugin.

For more understanding please look at this example :

apikey : abc123 -> rate limit ( 5 per minute) ---> OK
apikey : abc124 -> rate limit (10 per minute) --> OK
apikey : all others -> rate limit ( 100 per minute ) --> NOK . How can i achive that ?

Thanks
BR.

@mucahitdurmaz
Copy link
Author

mucahitdurmaz commented Oct 4, 2022

Hello, how to set the access frequency per minute through key, I want to learn, can you give some pictures to learn @mucahitdurmaz

Hello,
I want use rate limiting with different api keys. I managed the use rate limit with only 1 apikey. But i need to use with multiple apikeys.
Example : apikey : abc123 -> rate limit ( 5 per minute) apikey : abc124 -> rate limit (10 per minute) apikey : all others -> rate limit ( 100 per minute)
How can i achive that ?
Thanks BR.

Hello,

I don't know its right way to do but here how i did it.

Created Service, Routes.
I have created consumer and clicked "create api key" button on credentials->api key section. I gave my apikey on this tab and saved it. Clicked on plugin and created rate limit plugin.
You will see second, minutes,hour etc. if you give 3 on minute section. it means allow 3 request for minute. other request will be blocked for a minute. limit by : header, header : your api key name (not api key value)
After that clicked on accessible routes and click again add plugin button on your route.
Go to your route and click on plugin. Add plugin-key auth, give your api key name(default value:apikey, if your api key name different than "apikey" you should change it and press enter) on key names section.
Thats it.

I need to remind you. After this configuration if you request with another api key. It will get "Invalid authentication credentials" error. Thats where i stuck. I want all other api key request pass through with same rule (like 5 per minute) .

@mucahitdurmaz mucahitdurmaz changed the title Rate Limiting by api key values Help : Rate Limiting by api key values Oct 4, 2022
@mucahitdurmaz
Copy link
Author

@pantsel any advice ?

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

No branches or pull requests

2 participants
@mucahitdurmaz and others