Commit graph

59 commits

Author SHA1 Message Date
Guillaume J. Charmes
8d88ea0c15
Merge auth package within registry
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
2014-03-10 17:16:58 -07:00
Jake Moshenko
90b0cce07b Fix registry auth by storing the string passed on the command line, and allowing for credential selection by normalizing on hostname. Also, remove remote ping calls from CmdPush and CmdPull.
Docker-DCO-1.1-Signed-off-by: Jake Moshenko <jake@devtable.com> (github: jakedt)
2014-02-20 18:32:33 -05:00
Michael Crosby
e2eace9715 Do not ping registry from the cli
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-05 16:49:43 -08:00
Ben Wiklund
0fccf0f686 small batch of edits/corrections to comments 2013-12-24 16:40:14 -08:00
Josh Hawn
6720bfb243 Adjusted handling of inactive user login
The return status for inactive users was being checked
too early in the process, so I moved it from just after
the handling of POST /v1/users/ to after getting the
response from GET /v1/users/
2013-12-06 11:57:05 -08:00
shin-
9be5db8704 Handle 401 response in auth.Login() for authed private registries 2013-12-03 16:32:13 +01:00
Michael Crosby
a37b155384 Split auth on first colon 2013-11-29 15:14:36 -08:00
Guillaume J. Charmes
5e941f1ca0
Lintify code with confidence=1 2013-11-18 16:24:11 -08:00
Victor Vieux
6496059154 fix panic with wrong dockercfg file 2013-09-30 11:07:32 +00:00
Dan Buch
a7db125480 Minor spelling correction of protocoll -> protocol 2013-09-23 23:14:42 -04:00
Marco Hennings
fcee6056dc Login against private registry
To improve the use of docker with a private registry the login
command is extended with a parameter for the server address.

While implementing i noticed that two problems hindered authentication to a
private registry:

1. the resolve of the authentication did not match during push
   because the looked up key was for example localhost:8080 but
   the stored one would have been https://localhost:8080

   Besides The lookup needs to still work if the https->http fallback
   is used

2. During pull of an image no authentication is sent, which
   means all repositories are expected to be private.

These points are fixed now. The changes are implemented in
a way to be compatible to existing behavior both in the
API as also with the private registry.

Update:

- login does not require the full url any more, you can login
  to the repository prefix:

  example:
  docker logon localhost:8080

Fixed corner corner cases:

- When login is done during pull and push the registry endpoint is used and
  not the central index

- When Remote sends a 401 during pull, it is now correctly delegating to
  CmdLogin

- After a Login is done pull and push are using the newly entered login data,
  and not the previous ones. This one seems to be also broken in master, too.

- Auth config is now transfered in a parameter instead of the body when
  /images/create is called.
2013-09-03 20:45:49 +02:00
Victor Vieux
18962d0ff3 load authConfig only when needed and fix useless WARNING 2013-08-19 11:42:38 +00:00
Victor Vieux
3c9f9945c9 prevent crash when .dockercfg not readable 2013-08-14 10:26:18 +00:00
Nan Monnand Deng
4bd287e107 auth with user agent 2013-08-02 03:30:45 -04:00
Guillaume J. Charmes
394941b6b0 Switch json/payload order 2013-07-29 11:30:17 -07:00
Guillaume J. Charmes
8ca7b0646e Refactor checksum 2013-07-29 11:30:17 -07:00
Michael Crosby
9332c00ca5 Copy authConfigs on save so data is not modified
SaveConfig sets the Username and Password to an empty string
on save.  A copy of the authConfigs need to be made so that the
in memory data is not modified.
2013-07-25 00:35:52 +00:00
Victor Vieux
f4b41e1a6c fix tests 2013-07-24 12:28:22 +00:00
Victor Vieux
3bae188b8d change dockercfg to json and support multiple auth remote 2013-07-23 15:07:18 +00:00
Sam Alba
33d97e81eb Removed DOCKER_INDEX_URL 2013-07-09 08:10:43 -07:00
Sam Alba
66a9d06d9f Adding support for nicer URLs to support standalone registry (+ some registry code cleaning) 2013-07-05 12:20:58 -07:00
Sam Alba
3175e56ad0 URL schemes of both Registry and Index are now consistent 2013-06-27 17:55:17 -07:00
Victor Vieux
8f2a80804c Merge branch 'master' into fix-auth 2013-06-21 09:18:03 +00:00
Victor Vieux
5dcab2d361 gofmt and test sub directories in makefile 2013-06-19 14:50:58 +00:00
Victor Vieux
90f6bdd6e4 update docs, remove config file on 401 2013-06-14 13:38:51 +00:00
Victor Vieux
c906239220 bump to master 2013-06-05 10:23:45 +00:00
Victor Vieux
fd224ee590 linted names 2013-06-04 18:00:22 +00:00
Victor Vieux
86ada2fa5d drop/omit 2013-06-04 13:51:12 +00:00
Victor Vieux
3dd1e4d58c added docs and moved to api version 1.2 2013-06-03 12:09:16 +00:00
Victor Vieux
49e656839f move auth to the client WIP 2013-05-30 15:39:43 +00:00
Guillaume J. Charmes
b76d6120ac Update tests with new cookies for registry 2013-05-28 17:35:10 -07:00
Guillaume J. Charmes
fef816163c Merge pull request #618 from titanous/cleanup
Misc. cleanup
2013-05-15 18:05:31 -07:00
Jonathan Rudenberg
aa0d40747c Remove broken, redundant struct tag 2013-05-15 16:02:24 -04:00
shin-
2b620efffd Allow index server address to vary during execution 2013-05-14 22:00:24 +00:00
shin-
fc1d1d871b Find docker index URL in ENV before using default value. Unit tests for docker pull 2013-05-14 22:00:24 +00:00
Sam Alba
a372f982c1 Switching to prod index server 2013-05-06 10:57:38 -07:00
Sam Alba
0f68042053 Handled wrong user credentials by re-init the auth file (it was impossible to login after having wrong crendentials) 2013-05-06 10:57:03 -07:00
shin-
18796d55a6 Fixed some login quirks 2013-05-06 10:57:00 -07:00
shin-
594827d416 Fixed typo in 'username or email already exists' 2013-05-06 10:56:59 -07:00
shin-
84be35dce1 Fixed docker login 2013-05-06 10:54:48 -07:00
shin-
23953e7d67 Style changes in auth.Login 2013-05-06 10:54:46 -07:00
shin-
2421838b0a Support for the new registry/index API (wip) 2013-05-06 10:51:04 -07:00
shin-
8fed600077 Fix for #307 2013-04-02 03:00:21 -07:00
Caleb Spare
13d2b08638 A few spelling/grammar corrections. 2013-04-01 12:56:50 -07:00
Caleb Spare
15b3088157 Don't convert []byte to string unnecessarily. 2013-04-01 11:15:40 -07:00
Caleb Spare
7830cf9166 Don't use a strings.Reader where a bytes.Reader will do.
There are several places where a []byte is converted to a string
and then fed into strings.NewReader().
2013-04-01 11:15:10 -07:00
Jonathan Rudenberg
a6da7f138c Camelize some snake_case variable names 2013-03-28 20:12:23 -04:00
creack
e726bdcce2 Fix the rootPath for auth 2013-03-22 05:52:13 -07:00
creack
fc0eac37e4 Put back the "official" repo 2013-03-22 04:37:18 -07:00
creack
c72ff318d3 Integrate Auth in runtime and make the config file relative to runtime root 2013-03-22 02:19:39 -07:00