Rate limiting based on key in request body

  1. For my system, client ids are present in the request body in the API and we want to check for rate limits on different clients by reading that client id from the request body. Is there an existing plugin which helps in rate limiting based on keys present in the request body.

  2. Does traefik support reading rate limit configs from a common db store. My use cases include having hundreds of clients and having different rate limit config for each client. This mapping of rate limit config and client id should reside in some database and traefik should be able to fetch the rate limit configs by reading the same datasource.

Check the list of existing Traefik plugins or build your own in Go-lang.

Instead of building a Traefik plugin you could build a web service to use with ForwardAuth, so auth every request against your custom web-service enforcing limits. (Doc)