public class SshCredentialType extends AbstractCredentialType
Modifier and Type | Field and Description |
---|---|
static String |
CFG_SSH_KEY |
static String |
CFG_SSH_PASSPHRASE |
static String |
SSH_CREDENTIALS_PLUGIN_KEY |
CFG_CREDENTIALS_NAME, textProvider
Constructor and Description |
---|
SshCredentialType() |
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
generateCredentialsConfigMap(ActionParametersMap params,
CredentialsData previousCredentialsData)
Convert the params from the ui into a config map to be stored in the database.
|
Map<String,String> |
generateCredentialsConfigMap(Map<String,String> params)
Convert the given map into a config map of the shared credential to be stored in the database.
|
Map<String,String> |
getCredentialsConfigurationMap(CredentialsData credentialsData)
Convert an existing
CredentialsData to a map. |
void |
validate(ActionParametersMap params,
CredentialsData previousCredentialsData,
ErrorCollection errorCollection)
Validate configuration.
|
init, populateContextForCreate, populateContextForEdit, setTextProvider
public static final String SSH_CREDENTIALS_PLUGIN_KEY
public static final String CFG_SSH_KEY
public static final String CFG_SSH_PASSPHRASE
public void validate(@NotNull ActionParametersMap params, @Nullable CredentialsData previousCredentialsData, @NotNull ErrorCollection errorCollection)
CredentialType
validate
in interface CredentialType
validate
in class AbstractCredentialType
params
- configuration to be validatedpreviousCredentialsData
- the previous immutable CredentialsData
before saving or null if
credentials are being created.errorCollection
- error collection to be set on validation failure@NotNull public Map<String,String> generateCredentialsConfigMap(@NotNull ActionParametersMap params, @Nullable CredentialsData previousCredentialsData)
CredentialType
Sensitive parameters such as passwords do not have to be encrypted, as they will be secured before being stored in the database.
params
- request parameters.previousCredentialsData
- the previous immutable CredentialsData
before saving or null if
credentials are being created.@NotNull public Map<String,String> getCredentialsConfigurationMap(@NotNull CredentialsData credentialsData)
CredentialType
CredentialsData
to a map. So that configuration of the credential can used by other
component, e.g. the rest plugin. Each implementation of CredentialType
should populate different data to
the map and encrypt them if necessary.getCredentialsConfigurationMap
in interface CredentialType
getCredentialsConfigurationMap
in class AbstractCredentialType
credentialsData
- an existing credential@NotNull public Map<String,String> generateCredentialsConfigMap(@NotNull Map<String,String> params) throws WebValidationException
CredentialType
Sensitive parameters such as passwords do not have to be encrypted, as they will be secured before being stored in the database.
generateCredentialsConfigMap
in interface CredentialType
generateCredentialsConfigMap
in class AbstractCredentialType
params
- original map to be convertedWebValidationException
- if params contains invalid configurationCopyright © 2018 Atlassian Software Systems Pty Ltd. All rights reserved.