Commit graph

8 commits

Author SHA1 Message Date
Pat Gavlin 65b2c0329d Use a distinguished error value for basic auth. (#120)
Rather than returning an error that requires pattern-matching from
`parseChallenge` when the challenge header requires basic
authentication, return a distinguished error value. This makes checking
for this error a bit easier.

This commit also updates the check in `r.Headers` to use the new error
value and adds a couple of regression tests.
2018-07-26 14:13:58 -07:00
Knut Ahlers f7bf33b7a6 Re-visit basic auth protected registry (#53)
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>
2018-06-06 12:38:23 -04:00
Jess Frazelle eaf071b3ef
run gofmt
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-06-06 12:04:28 -04:00
Vadim Bauer 22f6936237 don't fail if scope container more the one grand. (#92) 2018-06-04 16:42:58 -04:00
Daniel Garcia 5088b3b142 fixes #72, suppose challege headers that don not quote fields (#73) 2018-03-01 12:50:59 -05:00
Chris Smith 0ff43808ca Add more useful error for bad credentials. (#51)
* 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.
2017-12-11 10:42:19 -05:00
Jess Frazelle 1af74c42c2
fixes
Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-09-05 19:44:19 -07:00
Jess Frazelle b5406104f2
prepare reg for junk
Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-08-12 22:23:13 -07:00