Package com.atlassian.bamboo.credentials
Class SshCredentialType
java.lang.Object
com.atlassian.bamboo.credentials.AbstractCredentialType
com.atlassian.bamboo.credentials.SshCredentialType
- All Implemented Interfaces:
CredentialType
,InitablePluginModule<CredentialTypeModuleDescriptor>
,BambooPluginModule
-
Field Summary
Fields inherited from class com.atlassian.bamboo.credentials.AbstractCredentialType
CFG_CREDENTIALS_NAME, textProvider
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongenerateCredentialsConfigMap
(@NotNull ActionParametersMap params, @Nullable CredentialsData previousCredentialsData) Convert the params from the ui into a config map to be stored in the database.generateCredentialsConfigMap
(@NotNull Map<String, String> params) Convert the given map into a config map of the shared credential to be stored in the database.getCredentialsConfigurationMap
(@NotNull CredentialsData credentialsData) Convert an existingCredentialsData
to a map.void
validate
(@NotNull ActionParametersMap params, @Nullable CredentialsData previousCredentialsData, @NotNull ErrorCollection errorCollection) Validate configuration.Methods inherited from class com.atlassian.bamboo.credentials.AbstractCredentialType
init, populateContextForCreate, populateContextForEdit, setTextProvider
-
Field Details
-
SSH_CREDENTIALS_PLUGIN_KEY
- See Also:
-
CFG_SSH_KEY
- See Also:
-
CFG_SSH_PASSPHRASE
- See Also:
-
-
Constructor Details
-
SshCredentialType
public SshCredentialType()
-
-
Method Details
-
validate
public void validate(@NotNull @NotNull ActionParametersMap params, @Nullable @Nullable CredentialsData previousCredentialsData, @NotNull @NotNull ErrorCollection errorCollection) Description copied from interface:CredentialType
Validate configuration.- Specified by:
validate
in interfaceCredentialType
- Overrides:
validate
in classAbstractCredentialType
- Parameters:
params
- configuration to be validatedpreviousCredentialsData
- the previous immutableCredentialsData
before 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:CredentialType
Convert 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 immutableCredentialsData
before 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:CredentialType
Convert an existingCredentialsData
to a map. So that configuration of the credential can used by other component, e.g. the rest plugin. Each implementation ofCredentialType
should populate different data to the map and encrypt them if necessary.- Specified by:
getCredentialsConfigurationMap
in interfaceCredentialType
- Overrides:
getCredentialsConfigurationMap
in 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 WebValidationExceptionDescription copied from interface:CredentialType
Convert 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:
generateCredentialsConfigMap
in interfaceCredentialType
- Overrides:
generateCredentialsConfigMap
in 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
-