Using a registry having basic auth enabled the authentication was not
submitted to Clair. This newly introduced error fixes the missing auth
but needs testing with non-basic auth protected registries.
Also maybe the test for the "malformed auth..." string can now be
removed as it does not trigger on registries with basic auth enabled?
Signed-off-by: Knut Ahlers <knut@ahlers.me>
* Add more useful error for bad credentials.
The www-authenticate: basic response currently gets caught by
the token transport, which fails to parse it and spits out
a rather oblique "malformed auth challenge header" error.
Make the token transport ignore basic auth types, and make
the error transport handle a 401 response.
* Format authchallenge.go correctly.