Middleware is instantiated once per route

Hi,
while developing a traefik plugin we're facing an unexpected behavior.
I've a single named middleware but when using this middleware on multiple routes, it will be instantiated once per route.
So the New()-function is called multiple times.

Here is the full example config: feat: rework secret entirely by cdanis · Pull Request #72 · sevensolutions/traefik-oidc-auth · GitHub

Does anyone know if this is intended or a bug?
Because it seems that this only happens when using YAML for configuration.

Because i've just defined the middleware once i would expect it to be only instantiated once.

Thank you.