MCPcopy
hub / github.com/docker/docker-py / get_config_header

Function get_config_header

docker/auth.py:37–56  ·  view source on GitHub ↗
(client, registry)

Source from the content-addressed store, hash-verified

35
36
37def get_config_header(client, registry):
38 log.debug('Looking for auth config')
39 if not client._auth_configs or client._auth_configs.is_empty:
40 log.debug(
41 "No auth config in memory - loading from filesystem"
42 )
43 client._auth_configs = load_config(credstore_env=client.credstore_env)
44 authcfg = resolve_authconfig(
45 client._auth_configs, registry, credstore_env=client.credstore_env
46 )
47 # Do not fail here if no authentication exists for this
48 # specific registry as we can have a readonly pull. Just
49 # put the header if we can.
50 if authcfg:
51 log.debug('Found auth config')
52 # auth_config needs to be a dict in the format used by
53 # auth.py username , password, serveraddress, email
54 return encode_header(authcfg)
55 log.debug('No auth config found')
56 return None
57
58
59def split_repo_name(repo_name):

Callers

nothing calls this directly

Calls 3

load_configFunction · 0.85
resolve_authconfigFunction · 0.85
encode_headerFunction · 0.85

Tested by

no test coverage detected