public class AuthConfigFactory extends Object
Modifier and Type | Field and Description |
---|---|
static String |
AUTH_AUTHTOKEN |
static String |
AUTH_EMAIL |
static String |
AUTH_PASSWORD |
static String |
AUTH_USERNAME |
Constructor and Description |
---|
AuthConfigFactory(org.codehaus.plexus.PlexusContainer container)
Constructor which should be used during startup phase of a plugin
|
Modifier and Type | Method and Description |
---|---|
AuthConfig |
createAuthConfig(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.
|
void |
setLog(Logger log) |
public static final String AUTH_USERNAME
public static final String AUTH_PASSWORD
public static final String AUTH_EMAIL
public static final String AUTH_AUTHTOKEN
public AuthConfigFactory(org.codehaus.plexus.PlexusContainer container)
container
- the container used for do decryption of passwordspublic void setLog(Logger log)
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
isPush
- if true this AuthConfig is created for a push, if false it's for a pullskipExtendedAuth
- if false, do not execute extended authentication methodsauthConfig
- String-String Map holding configuration info from the plugin's configuration. Can be null
in
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,null
if none could be foundorg.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
Copyright © 2019. All rights reserved.