public abstract class RegistryAuth extends Object
These are sent to docker during authenticated registry operations
in the X-Registry-Config header (see RegistryConfigs
).
Typically these objects are built by requesting auth information from a
DockerCredentialHelper
. However, in older less-secure
docker versions, these can be written directly into the ~/.docker/config.json file,
with the username and password joined with a ":" and base-64 encoded.
Modifier and Type | Class and Description |
---|---|
static class |
RegistryAuth.Builder |
Constructor and Description |
---|
RegistryAuth() |
Modifier and Type | Method and Description |
---|---|
static RegistryAuth.Builder |
builder() |
static RegistryAuth |
create(String username,
String password,
String email,
String serveraddress,
String identitytoken,
String auth) |
abstract String |
email()
Unused but must be a well-formed email address (e.g.
|
static RegistryAuth.Builder |
forAuth(String auth)
Construct a Builder based upon the "auth" field of the docker client config file.
|
static RegistryAuth.Builder |
fromDockerConfig()
Deprecated.
in favor of
ConfigFileRegistryAuthSupplier |
static RegistryAuth.Builder |
fromDockerConfig(String serverAddress)
This function looks for and parses credentials for logging into the Docker registry specified
by serverAddress.
|
abstract String |
identityToken() |
abstract String |
password() |
abstract String |
serverAddress() |
abstract RegistryAuth.Builder |
toBuilder() |
String |
toString() |
abstract String |
username() |
@Nullable public abstract String email()
public abstract RegistryAuth.Builder toBuilder()
@Deprecated public static RegistryAuth.Builder fromDockerConfig() throws IOException
ConfigFileRegistryAuthSupplier
RegistryAuth.Builder
IOException
- when we can't parse the docker config filepublic static RegistryAuth.Builder fromDockerConfig(String serverAddress) throws IOException
serverAddress
- A string representing the server addressRegistryAuth.Builder
IOException
- when we can't parse the docker config filepublic static RegistryAuth create(String username, String password, String email, String serveraddress, String identitytoken, String auth)
public static RegistryAuth.Builder forAuth(String auth)
public static RegistryAuth.Builder builder()
Copyright © 2018. All rights reserved.