Class RegistryAuth
java.lang.Object
com.spotify.docker.client.messages.RegistryAuth
- Direct Known Subclasses:
AutoValue_RegistryAuth
,RegistryAuthV2
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
Construct a Builder based upon the "auth" field of the docker client config file.static RegistryAuth.Builder
Deprecated.in favor of registryAuthSupplierstatic RegistryAuth.Builder
fromDockerConfig
(String serverAddress) This function looks for and parses credentials for logging into the Docker registry specified by serverAddress.(package private) static RegistryAuth.Builder
fromDockerConfig
(Path configPath) Returns the first credential from the specified path to the docker file.(package private) static RegistryAuth.Builder
fromDockerConfig
(Path configPath, String serverAddress) Returns the specified credential from the specified path to the docker file.abstract String
abstract String
password()
abstract String
abstract RegistryAuth.Builder
final String
toString()
abstract String
username()
-
Constructor Details
-
RegistryAuth
public RegistryAuth()
-
-
Method Details
-
username
-
password
-
email
Unused but must be a well-formed email address (e.g. 1234@5678.com). -
serverAddress
-
identityToken
-
toString
-
toBuilder
-
fromDockerConfig
Deprecated.in favor of registryAuthSupplierThis function looks for and parses credentials for logging into Docker registries. We first look in ~/.docker/config.json and fallback to ~/.dockercfg. We use the first credential in the config file. These files are created from running `docker login`.- Returns:
- a
RegistryAuth.Builder
- Throws:
IOException
- when we can't parse the docker config file
-
fromDockerConfig
This function looks for and parses credentials for logging into the Docker registry specified by serverAddress. We first look in ~/.docker/config.json and fallback to ~/.dockercfg. These files are created from running `docker login`.- Parameters:
serverAddress
- A string representing the server address- Returns:
- a
RegistryAuth.Builder
- Throws:
IOException
- when we can't parse the docker config file
-
fromDockerConfig
Returns the first credential from the specified path to the docker file. This method is package-local so we can test it.- Parameters:
configPath
- The path to the config file- Returns:
- a
RegistryAuth.Builder
- Throws:
IOException
- when we can't parse the docker config file
-
fromDockerConfig
static RegistryAuth.Builder fromDockerConfig(Path configPath, String serverAddress) throws IOException Returns the specified credential from the specified path to the docker file. This method is package-local so we can test it.- Parameters:
configPath
- The path to the config fileserverAddress
- A string representing the server address- Returns:
- a
RegistryAuth.Builder
- Throws:
IOException
- If an IOException occurred
-
create
-
forAuth
Construct a Builder based upon the "auth" field of the docker client config file. -
builder
-