Commit graph

68 commits

Author SHA1 Message Date
Tomoya Amachi e29a4fdc2e Fix GCR errors (#182)
* change accepts header

* change accepts header

* skip gcr ping check

* update go.sum

* fix lint errors

* fix lint errors

* update go.mod
2019-06-11 00:57:48 +08:00
Jess Frazelle 2bd71359e7 fix tests
Signed-off-by: Jess Frazelle <acidburn@jessfraz.com>
2019-05-25 18:01:15 -04:00
Jess Frazelle d959057b30
fix staticcheck
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2019-01-02 11:55:23 -05:00
Jess Frazelle 067711f90e
fix getting official registry manifest
closes #164

Signed-off-by: Jess Frazelle <acidburn@github.com>
2019-01-02 11:19:56 -05:00
Jessica Tracy 32589e90be Passing context (#163)
* passing context in layer calls

* more contexting

* clair folder and context in handlers

* fixed token transport to reuse request context

* tests

* taking out context pass in server handlers
2018-12-29 12:09:10 -05:00
Pirmin Tapken 56104f3f9b Fix token transport memory leak (#165)
* Test for TokenTransport proving memory leak

* Fix memory leak on wrong auth challenge header

* Add test for memory leak during authentication

The body of the first request must be closed before doing the request to
the authentication service

* Fix memory leak during authentication
2018-12-11 15:12:21 -05:00
Jess Frazelle 4a4d0e5d10
fix api;
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-11-14 10:18:18 -05:00
Jess Frazelle 3b848ce686
updates and fixes
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-11-14 10:09:47 -05:00
alexander zillion db513b737e add --auth-url parameter (#90) (#105)
Signed-off-by: Alex Zillion <alex@alexzillion.com>
2018-11-14 10:06:30 -05:00
Julien 383e4f7d48 Add force-non-ssl to registry operations (#102) 2018-11-14 10:02:41 -05:00
Jamie 83c621c4a7 support 'access_token' for compatibility with OAuth 2.0 https://docs.docker.com/registry/spec/auth/token/#requesting-a-token (#124) 2018-11-14 10:01:36 -05:00
Darrian 478c4dadc6 confirm the requested schema version matches the returned (#148) 2018-11-14 09:51:57 -05:00
Darrian 67d1af130d instead of using a bool to check for v2, just test the type of the response interface. fixes #132 (#156) 2018-10-29 08:32:59 -07:00
Knut Ahlers eb4e1cc686 Fix vuln scanning on GCR (#152)
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-10-17 00:53:20 -07:00
Jess Frazelle 73fdd32040
remove manifest list from Manifest function
fixes #132

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-09-10 11:19:51 -04:00
Knut Ahlers 6aceb5ae40 Fix digest resolution for GCR (#135)
fixes #134

Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-09-09 09:32:26 -04:00
Adrian Gaciąg dcdae21713 Fix: digest (#123)
* Fix getting digest from Docker-Content-Digest header

* Fix remove_test
2018-09-05 12:04:55 -07:00
Jimmy Zelinskie 5ff93f005b registry: format accept headers (#130)
Multiple calls to request.Header.Add() will overwrite the last value.
This formats the value of the Accept headers correctly so that a
registry can perform content-type negotiation.
2018-09-05 12:03:18 -07:00
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
Jan-Otto Kröpke 74603b6d47 Add custom http header (#104) 2018-07-08 09:43:09 -04:00
Jan-Otto Kröpke a8549a2c40 when uploading layers reuse token so reader isn't closed premature. (#103) 2018-07-08 09:42:04 -04:00
Jess Frazelle f14de4c039
two small cleanups
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-06-17 15:55:31 -04:00
Jess Frazelle f3a9b00ec8
refactor how the domain for the images is used
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-06-17 15:50:30 -04:00
Jess Frazelle 246604b921
make naming consistent
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-06-17 13:36:52 -04:00
Jess Frazelle 285085cc56
fix gofmt
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-06-17 13:34:19 -04:00
Vadim Bauer 720e7deac5 put manifest
Signed-off-by: Vadim Bauer <bauer.vadim@gmail.com>
2018-06-14 13:47:05 +02:00
Jess Frazelle 73712bf067
add clair integration tests
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-06-12 10:04:35 -04:00
Jess Frazelle 5f1abe4779
cleanup
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-06-11 13:33:09 -04:00
Jess Frazelle 294bae7b50
fix token
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-06-06 15:47:08 -04:00
Jess Frazelle 6dbec6401b
clean up client opt
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-06-06 13:00:42 -04:00
Jess Frazelle 48a99e9644
Merge branch 'pr-56'
* pr-56:
  Add option to skip ping on creating registry client
2018-06-06 12:49:29 -04: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
Michal Gebauer dfb6ef23f5 Do not resolve digest on delete (#79) 2018-03-12 14:34:13 -04:00
Casey Lee 17625873c8 use the http transport on the registry to support -k (#77) 2018-03-06 11:53:19 -05:00
Jess Frazelle 0cb8777fb1
lint and cleanup
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-03-06 09:19:55 -05:00
Jess Frazelle a3b459b1a5
refactor client
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-03-06 09:12:29 -05:00
Daniel Garcia 5088b3b142 fixes #72, suppose challege headers that don not quote fields (#73) 2018-03-01 12:50:59 -05:00
Paweł Prażak f29941a2ba add more debugging information (#65)
- makes debugging configuration issues easier by adding more context
  instead of misleading "missing signature key" and similar
2018-02-18 11:17:29 -05:00
Simon Ferquel 1efaa929fc Add option to skip ping on creating registry client
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2018-01-17 17:52:39 +01:00
Jess Frazelle d57e019b47
update delete
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2017-12-18 15:17:27 -05:00
Jess Frazelle 758d45bea2
update api
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2017-12-11 17:33:26 -05:00
Jess Frazelle e3777763fb
cleanup staticcheck errors
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2017-12-11 13:39:02 -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
mrfly 3bc47ed926 fix registry remove image (#50) 2017-12-09 11:36:02 -05:00
Jess Frazelle 83ba4b225a
add versions and binaries
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-06-05 17:46:12 -04:00
Jess Frazelle 0dbc9338a6
auth service fix for token
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-06-05 15:08:35 -04:00
Hynek Schlawack 11a291f744 Fix http basic auth if protocol is missing (#22)
Basic auth only worked if a full url was supplied.  The reason is that
BasicTransport.RoundTrip checked if the resulting request URL has a the
transport's URL as a prefix.

This is fixed by setting the transport's URL to the canonical URL that is
computed a few lines earlier.
2017-04-18 13:32:28 -04:00
Chris Murphy a02ddc8cd4 Allow for non-SSL access (#15)
* Allow for non-SSL access

* Reuqire --insecure option to use http protocol

* Fixed lint error

* Added --force-non-ssl option. Also moved check to allow handling of docker config
2017-04-04 10:12:36 -04:00