mirror of https://github.com/docker/docker-py.git
Merge pull request #682 from docker/moutten-fix-build-auth
Switch to send full AuthConfig object for build action
This commit is contained in:
commit
f8ad2dabf2
|
|
@ -98,12 +98,6 @@ def encode_header(auth):
|
|||
return base64.b64encode(auth_json)
|
||||
|
||||
|
||||
def encode_full_header(auth):
|
||||
""" Returns the given auth block encoded for the X-Registry-Config header.
|
||||
"""
|
||||
return encode_header({'configs': auth})
|
||||
|
||||
|
||||
def parse_auth(entries):
|
||||
"""
|
||||
Parses authentication entries
|
||||
|
|
|
|||
|
|
@ -140,9 +140,14 @@ class Client(clientbase.ClientBase):
|
|||
if self._auth_configs:
|
||||
if headers is None:
|
||||
headers = {}
|
||||
headers['X-Registry-Config'] = auth.encode_full_header(
|
||||
self._auth_configs
|
||||
)
|
||||
if utils.compare_version('1.19', self._version) >= 0:
|
||||
headers['X-Registry-Config'] = auth.encode_header(
|
||||
self._auth_configs
|
||||
)
|
||||
else:
|
||||
headers['X-Registry-Config'] = auth.encode_header({
|
||||
'configs': self._auth_configs
|
||||
})
|
||||
|
||||
response = self._post(
|
||||
u,
|
||||
|
|
|
|||
Loading…
Reference in New Issue