Package com.atlassian.bamboo.credentials
Class UsernamePasswordCredentialType
- java.lang.Object
-
- com.atlassian.bamboo.credentials.AbstractCredentialType
-
- com.atlassian.bamboo.credentials.UsernamePasswordCredentialType
-
- All Implemented Interfaces:
CredentialType,InitablePluginModule<CredentialTypeModuleDescriptor>,BambooPluginModule
public class UsernamePasswordCredentialType extends AbstractCredentialType
-
-
Field Summary
Fields Modifier and Type Field Description static StringCFG_PASSWORDstatic StringCFG_USERNAMEstatic StringPLUGIN_KEY-
Fields inherited from class com.atlassian.bamboo.credentials.AbstractCredentialType
CFG_CREDENTIALS_NAME, textProvider
-
-
Constructor Summary
Constructors Constructor Description UsernamePasswordCredentialType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Map<String,String>generateCredentialsConfigMap(@NotNull ActionParametersMap params, @Nullable CredentialsData previousCredentialsData)Convert the params from the ui into a config map to be stored in the database.@NotNull Map<String,String>generateCredentialsConfigMap(@NotNull Map<String,String> params)Convert the given map into a config map of the shared credential to be stored in the database.@NotNull Map<String,String>getCredentialsConfigurationMap(@NotNull CredentialsData credentialsData)Convert an existingCredentialsDatato a map.voidpopulateContextForEdit(@NotNull Map<String,Object> context, @NotNull CredentialsData previousCredentialsData)Provide any required context to be used when rendering the freemarker template for editing credentials.voidvalidate(@NotNull ActionParametersMap params, @Nullable CredentialsData previousCredentialsData, @NotNull ErrorCollection errorCollection)Validate configuration.-
Methods inherited from class com.atlassian.bamboo.credentials.AbstractCredentialType
init, populateContextForCreate, setTextProvider
-
-
-
-
Field Detail
-
PLUGIN_KEY
public static final String PLUGIN_KEY
- See Also:
- Constant Field Values
-
CFG_USERNAME
public static final String CFG_USERNAME
- See Also:
- Constant Field Values
-
CFG_PASSWORD
public static final String CFG_PASSWORD
- See Also:
- Constant Field Values
-
-
Method Detail
-
validate
public void validate(@NotNull @NotNull ActionParametersMap params, @Nullable @Nullable CredentialsData previousCredentialsData, @NotNull @NotNull ErrorCollection errorCollection)Description copied from interface:CredentialTypeValidate configuration.- Specified by:
validatein interfaceCredentialType- Overrides:
validatein classAbstractCredentialType- Parameters:
params- configuration to be validatedpreviousCredentialsData- the previous immutableCredentialsDatabefore saving or null if credentials are being created.errorCollection- error collection to be set on validation failure
-
generateCredentialsConfigMap
@NotNull public @NotNull Map<String,String> generateCredentialsConfigMap(@NotNull @NotNull ActionParametersMap params, @Nullable @Nullable CredentialsData previousCredentialsData)
Description copied from interface:CredentialTypeConvert the params from the ui into a config map to be stored in the database. Can assume validation has occurred in the #validate method.Sensitive parameters such as passwords do not have to be encrypted, as they will be secured before being stored in the database.
- Parameters:
params- request parameters.previousCredentialsData- the previous immutableCredentialsDatabefore saving or null if credentials are being created.- Returns:
- the configuration map to be stored in the database.
-
getCredentialsConfigurationMap
@NotNull public @NotNull Map<String,String> getCredentialsConfigurationMap(@NotNull @NotNull CredentialsData credentialsData)
Description copied from interface:CredentialTypeConvert an existingCredentialsDatato a map. So that configuration of the credential can used by other component, e.g. the rest plugin. Each implementation ofCredentialTypeshould populate different data to the map and encrypt them if necessary.- Specified by:
getCredentialsConfigurationMapin interfaceCredentialType- Overrides:
getCredentialsConfigurationMapin classAbstractCredentialType- Parameters:
credentialsData- an existing credential- Returns:
- Map that stores the credential's configuration
-
generateCredentialsConfigMap
@NotNull public @NotNull Map<String,String> generateCredentialsConfigMap(@NotNull @NotNull Map<String,String> params) throws WebValidationException
Description copied from interface:CredentialTypeConvert the given map into a config map of the shared credential to be stored in the database.Sensitive parameters such as passwords do not have to be encrypted, as they will be secured before being stored in the database.
- Specified by:
generateCredentialsConfigMapin interfaceCredentialType- Overrides:
generateCredentialsConfigMapin classAbstractCredentialType- Parameters:
params- original map to be converted- Returns:
- the configuration map to be stored in the database.
- Throws:
WebValidationException- if params contains invalid configuration
-
populateContextForEdit
public void populateContextForEdit(@NotNull @NotNull Map<String,Object> context, @NotNull @NotNull CredentialsData previousCredentialsData)Description copied from interface:CredentialTypeProvide any required context to be used when rendering the freemarker template for editing credentials.- Specified by:
populateContextForEditin interfaceCredentialType- Overrides:
populateContextForEditin classAbstractCredentialType- Parameters:
context- map to put your context in.previousCredentialsData- existing credentials
-
-