public class RegistryCredentials extends Object
The credentials are referred to by the registry they are used for.
| Modifier and Type | Method and Description |
|---|---|
static RegistryCredentials |
from(List<String> credentialHelperSuffixes,
List<String> registries)
Retrieves credentials for
registries using the credential helpers referred to by credentialHelperSuffixes. |
static RegistryCredentials |
from(String credentialSource,
Map<String,Authorization> registryCredentialMap)
Instantiates from a credential source and a map of registry credentials.
|
Authorization |
getAuthorization(String registry) |
String |
getCredentialSource(String registry) |
boolean |
has(String registry) |
static RegistryCredentials |
none()
Instantiates with no credentials.
|
static RegistryCredentials |
of(String registry,
String credentialSource,
Authorization authorization)
Instantiates with credentials for a single registry.
|
public static RegistryCredentials none()
public static RegistryCredentials of(String registry, String credentialSource, Authorization authorization)
public static RegistryCredentials from(List<String> credentialHelperSuffixes, List<String> registries) throws IOException, NonexistentDockerCredentialHelperException
registries using the credential helpers referred to by credentialHelperSuffixes.
This obtains the registry credentials, not the Docker authentication token.
public static RegistryCredentials from(String credentialSource, Map<String,Authorization> registryCredentialMap)
credentialSource - the source of the credentials, useful for informing users where the
credentials came fromregistryCredentialMap - a map from registries to their respective credentialspublic boolean has(String registry)
true if there are credentials for registry; false otherwise@Nullable public Authorization getAuthorization(String registry)
Authorization retrieved for the registry, or null if none
existsCopyright © 2018. All rights reserved.