Package io.fabric8.maven.docker.util
Class AuthConfigFactory
- java.lang.Object
-
- io.fabric8.maven.docker.util.AuthConfigFactory
-
public class AuthConfigFactory extends Object
Factory for creating docker specific authentication configuration- Since:
- 29.07.14
- Author:
- roland
-
-
Constructor Summary
Constructors Constructor Description AuthConfigFactory(org.codehaus.plexus.PlexusContainer container)Constructor which should be used during startup phase of a plugin
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthConfigcreateAuthConfig(boolean isPush, boolean skipExtendedAuth, Map authConfig, org.apache.maven.settings.Settings settings, String user, String registry)Create an authentication config object which can be used for communication with a Docker registry The authentication information is looked up at various places (in this order): From system properties From the provided map which can contain key-value pairs From the openshift settings in ~/.config/kube From the Maven settings stored typically in ~/.m2/settings.xml From the Docker settings stored in ~/.docker/config.json The following properties (prefix with 'docker.') and config key are evaluated: username: User to authenticate password: Password to authenticate.voidsetLog(Logger log)
-
-
-
Method Detail
-
setLog
public void setLog(Logger log)
-
createAuthConfig
public AuthConfig createAuthConfig(boolean isPush, boolean skipExtendedAuth, Map authConfig, org.apache.maven.settings.Settings settings, String user, String registry) throws org.apache.maven.plugin.MojoExecutionException
Create an authentication config object which can be used for communication with a Docker registry The authentication information is looked up at various places (in this order):- From system properties
- From the provided map which can contain key-value pairs
- From the openshift settings in ~/.config/kube
- From the Maven settings stored typically in ~/.m2/settings.xml
- From the Docker settings stored in ~/.docker/config.json
- username: User to authenticate
- password: Password to authenticate. Can be encrypted
- email: Optional EMail address which is send to the registry, too
- Parameters:
isPush- if true this AuthConfig is created for a push, if false it's for a pullskipExtendedAuth- if true, do not execute extended authentication methodsauthConfig- String-String Map holding configuration info from the plugin's configuration. Can benullin which case the settings are consulted.settings- the global Maven settings objectuser- user to check forregistry- registry to use, might be null in which case a default registry is checked,- Returns:
- the authentication configuration or
nullif none could be found - Throws:
org.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionException
-
-