(client, registry)
| 35 | |
| 36 | |
| 37 | def 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 | |
| 59 | def split_repo_name(repo_name): |
nothing calls this directly
no test coverage detected