Package org.mandas.docker.client.auth
Class FixedRegistryAuthSupplier
- java.lang.Object
-
- org.mandas.docker.client.auth.FixedRegistryAuthSupplier
-
- All Implemented Interfaces:
RegistryAuthSupplier
public class FixedRegistryAuthSupplier extends Object implements RegistryAuthSupplier
Wraps a RegistryAuth with the RegistryAuthSupplier interface.
-
-
Constructor Summary
Constructors Constructor Description FixedRegistryAuthSupplier()
FixedRegistryAuthSupplier(RegistryAuth registryAuth, RegistryConfigs configsForBuild)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RegistryAuth
authFor(String imageName)
Returns a RegistryAuth object that works with a given registry's API [e.g.RegistryConfigs
authForBuild()
Authentication info to pass in the X-Registry-Config header when building an image.RegistryAuth
authForSwarm()
Returns a RegistryAuth object that is valid for a Docker Swarm context [i.e.
-
-
-
Constructor Detail
-
FixedRegistryAuthSupplier
public FixedRegistryAuthSupplier(RegistryAuth registryAuth, RegistryConfigs configsForBuild)
-
FixedRegistryAuthSupplier
public FixedRegistryAuthSupplier()
-
-
Method Detail
-
authFor
public RegistryAuth authFor(String imageName) throws DockerException
Description copied from interface:RegistryAuthSupplier
Returns a RegistryAuth object that works with a given registry's API [e.g. GCR].- Specified by:
authFor
in interfaceRegistryAuthSupplier
- Returns:
- the RegistryAuth to use when working with the image, or else
null
if no authentication info applies for this image - Throws:
DockerException
-
authForSwarm
public RegistryAuth authForSwarm()
Description copied from interface:RegistryAuthSupplier
Returns a RegistryAuth object that is valid for a Docker Swarm context [i.e. not tied to specific image]. It's unnecessary if it's not planned to use this AuthSupplier to pull images for Swarm.- Specified by:
authForSwarm
in interfaceRegistryAuthSupplier
- Returns:
- the RegistryAuth to use in Swarn, or else
null
for no authentication info
-
authForBuild
public RegistryConfigs authForBuild()
Description copied from interface:RegistryAuthSupplier
Authentication info to pass in the X-Registry-Config header when building an image.- Specified by:
authForBuild
in interfaceRegistryAuthSupplier
- Returns:
- the registry configs
-
-