Class RegistryAuth
- java.lang.Object
-
- com.spotify.docker.client.messages.RegistryAuth
-
- Direct Known Subclasses:
AutoValue_RegistryAuth
,RegistryAuthV2
public abstract class RegistryAuth extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RegistryAuth.Builder
-
Constructor Summary
Constructors Constructor Description RegistryAuth()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static RegistryAuth.Builder
builder()
static RegistryAuth
create(java.lang.String username, java.lang.String password, java.lang.String email, java.lang.String serveraddress, java.lang.String identitytoken, java.lang.String auth)
abstract java.lang.String
email()
Unused but must be a well-formed email address (e.g.static RegistryAuth.Builder
forAuth(java.lang.String auth)
Construct a Builder based upon the "auth" field of the docker client config file.static RegistryAuth.Builder
fromDockerConfig()
Deprecated.in favor of registryAuthSupplierstatic RegistryAuth.Builder
fromDockerConfig(java.lang.String serverAddress)
This function looks for and parses credentials for logging into the Docker registry specified by serverAddress.(package private) static RegistryAuth.Builder
fromDockerConfig(java.nio.file.Path configPath)
Returns the first credential from the specified path to the docker file.(package private) static RegistryAuth.Builder
fromDockerConfig(java.nio.file.Path configPath, java.lang.String serverAddress)
Returns the specified credential from the specified path to the docker file.abstract java.lang.String
identityToken()
abstract java.lang.String
password()
abstract java.lang.String
serverAddress()
abstract RegistryAuth.Builder
toBuilder()
java.lang.String
toString()
abstract java.lang.String
username()
-
-
-
Method Detail
-
username
@Nullable public abstract java.lang.String username()
-
password
@Nullable public abstract java.lang.String password()
-
email
@Nullable public abstract java.lang.String email()
Unused but must be a well-formed email address (e.g. 1234@5678.com).
-
serverAddress
@Nullable public abstract java.lang.String serverAddress()
-
identityToken
@Nullable public abstract java.lang.String identityToken()
-
toString
public final java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toBuilder
public abstract RegistryAuth.Builder toBuilder()
-
fromDockerConfig
@Deprecated public static RegistryAuth.Builder fromDockerConfig() throws java.io.IOException
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:
java.io.IOException
- when we can't parse the docker config file
-
fromDockerConfig
public static RegistryAuth.Builder fromDockerConfig(java.lang.String serverAddress) throws java.io.IOException
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:
java.io.IOException
- when we can't parse the docker config file
-
fromDockerConfig
static RegistryAuth.Builder fromDockerConfig(java.nio.file.Path configPath) throws java.io.IOException
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:
java.io.IOException
- when we can't parse the docker config file
-
fromDockerConfig
static RegistryAuth.Builder fromDockerConfig(java.nio.file.Path configPath, java.lang.String serverAddress) throws java.io.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:
java.io.IOException
- If an IOException occurred
-
create
public static RegistryAuth create(java.lang.String username, java.lang.String password, java.lang.String email, java.lang.String serveraddress, java.lang.String identitytoken, java.lang.String auth)
-
forAuth
public static RegistryAuth.Builder forAuth(java.lang.String auth)
Construct a Builder based upon the "auth" field of the docker client config file.
-
builder
public static RegistryAuth.Builder builder()
-
-