Hi,
After a frustrating afternoon of figuring out how to get basicAuth to work, here's one thing I've noticed.
In "file" provider, when defining BasicAuth using this definition the middleware fails to load
[http.middlewares]
[http.middlewares.test-auth.basicauth]
users = [ "test:$apr1$lh09upfq$nZfVoqrKwOHV407gf4tLI0" ]
Middleware only works when [http.middlewares.test-auth.basicAuth]
is defined with a capital 'A'
Yet when defining this middleware in marathon
provider
"traefik.http.middlewares.myauth.basicauth.users": "test:$apr1$lh09upfq$nZfVoqrKwOHV407gf4tLI0"
works with lower-case 'a' in basicauth
. Indeed this also works with basicAuth
No errors logs are given to pin point the problem other than that the middleware doesn't exist when you start using the middleware in a router. I only figured out the problem by copying and pasting code example from documentation. (and am I glad that the docs are actually correct!)
Given that the middleware type itself is called BasicAuth
the case inconsistencies across different providers is confusing. It seems that also this isn't the first time that folks using v2.0 have been tripped up by casing, see - Issue triage - Documentation is wrong for ForwardedHeaders (CLI casing)
Are there going to be plans to address casing inconsistencies in config specification across providers in upcoming releases?
p.s. - this is using v2.0.2