public class DockerConfigJsonSecretToRegistryConfigurationConverter extends Object implements org.springframework.core.convert.converter.Converter<String,Map<String,RegistryConfiguration>>
| Modifier and Type | Field and Description |
|---|---|
static String |
BEARER_REALM_ATTRIBUTE |
static String |
SERVICE_ATTRIBUTE |
| Constructor and Description |
|---|
DockerConfigJsonSecretToRegistryConfigurationConverter(org.springframework.web.client.RestTemplate restTemplate) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,RegistryConfiguration> |
convert(String dockerconfigjson)
The .dockerconfigjson value hast the following format:
{"auths":{"demo.goharbor.io":{"username":"admin","password":"Harbor12345","auth":"YWRtaW46SGFyYm9yMTIzNDU="}}}
The map key is the registry host name and the value contains the username and password to access this registry. |
Optional<String> |
getDockerTokenServiceUri(String registryHost)
Best effort to construct a valid Docker OAuth2 token authorization uri from the HTTP 401 Error response.
|
public static final String BEARER_REALM_ATTRIBUTE
public static final String SERVICE_ATTRIBUTE
public DockerConfigJsonSecretToRegistryConfigurationConverter(org.springframework.web.client.RestTemplate restTemplate)
public Map<String,RegistryConfiguration> convert(String dockerconfigjson)
{"auths":{"demo.goharbor.io":{"username":"admin","password":"Harbor12345","auth":"YWRtaW46SGFyYm9yMTIzNDU="}}}
The map key is the registry host name and the value contains the username and password to access this registry.convert in interface org.springframework.core.convert.converter.Converter<String,Map<String,RegistryConfiguration>>dockerconfigjson - to convert into RegistryConfiguration map.public Optional<String> getDockerTokenServiceUri(String registryHost)
registryHost - Container Registry host to retrieve the tokenServiceUri for.Copyright © 2021 Pivotal Software, Inc.. All rights reserved.