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.Builderbuilder()static RegistryAuthcreate(String username, String password, String email, String serveraddress, String identitytoken, String auth) abstract Stringemail()Unused but must be a well-formed email address (e.g.static RegistryAuth.BuilderConstruct a Builder based upon the "auth" field of the docker client config file.static RegistryAuth.BuilderDeprecated.in favor of registryAuthSupplierstatic RegistryAuth.BuilderfromDockerConfig(String serverAddress) This function looks for and parses credentials for logging into the Docker registry specified by serverAddress.(package private) static RegistryAuth.BuilderfromDockerConfig(Path configPath) Returns the first credential from the specified path to the docker file.(package private) static RegistryAuth.BuilderfromDockerConfig(Path configPath, String serverAddress) Returns the specified credential from the specified path to the docker file.abstract Stringabstract Stringpassword()abstract Stringabstract RegistryAuth.Builderfinal StringtoString()abstract Stringusername()
-
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
-