Class RegistryAuth

java.lang.Object
com.spotify.docker.client.messages.RegistryAuth
Direct Known Subclasses:
AutoValue_RegistryAuth, RegistryAuthV2

public abstract class RegistryAuth extends Object
  • Constructor Details

    • RegistryAuth

      public RegistryAuth()
  • Method Details

    • username

      @Nullable public abstract String username()
    • password

      @Nullable public abstract String password()
    • email

      @Nullable public abstract String email()
      Unused but must be a well-formed email address (e.g. 1234@5678.com).
    • serverAddress

      @Nullable public abstract String serverAddress()
    • identityToken

      @Nullable public abstract String identityToken()
    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • toBuilder

      public abstract RegistryAuth.Builder toBuilder()
    • fromDockerConfig

      @Deprecated public static RegistryAuth.Builder fromDockerConfig() throws IOException
      Deprecated.
      in favor of registryAuthSupplier
      This 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

      public static RegistryAuth.Builder fromDockerConfig(String serverAddress) throws 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:
      IOException - when we can't parse the docker config file
    • fromDockerConfig

      static RegistryAuth.Builder fromDockerConfig(Path configPath) throws 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:
      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 file
      serverAddress - A string representing the server address
      Returns:
      a RegistryAuth.Builder
      Throws:
      IOException - If an IOException occurred
    • create

      public static RegistryAuth create(String username, String password, String email, String serveraddress, String identitytoken, String auth)
    • forAuth

      public static RegistryAuth.Builder forAuth(String auth)
      Construct a Builder based upon the "auth" field of the docker client config file.
    • builder

      public static RegistryAuth.Builder builder()