Skip to content

limithandler: Refactor package to not use global state

Patrick Steinhardt requested to merge pks-limithandler-remove-globals into master

The limithandler package uses global variables to both track Prometheus metrics and to handle its configuration. Especially the latter is really fragile, where we need to set up state of the limithandler in various places by calling global functions.

Fix this by making the LimiterMiddleware self-contained, where it hosts all configuration as well as the Prometheus metrics.

Merge request reports