public interface CredentialType extends InitablePluginModule<CredentialTypeModuleDescriptor>
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 |
populateContextForCreate(Map<String,Object> context)
Provide any required context to be used when rendering the freemarker template for creating credentials.
|
void |
populateContextForEdit(Map<String,Object> context,
CredentialsData previousCredentialsData)
Provide any required context to be used when rendering the freemarker template for editing credentials.
|
void |
validate(ActionParametersMap params,
CredentialsData previousCredentialsData,
ErrorCollection errorCollection)
Validate configuration.
|
init
void populateContextForCreate(@NotNull Map<String,Object> context)
context
- map to put your context in.void populateContextForEdit(@NotNull Map<String,Object> context, @NotNull CredentialsData previousCredentialsData)
context
- map to put your context in.previousCredentialsData
- existing credentialsvoid validate(@NotNull ActionParametersMap params, @Nullable CredentialsData previousCredentialsData, @NotNull ErrorCollection errorCollection)
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 Map<String,String> generateCredentialsConfigMap(@NotNull ActionParametersMap params, @Nullable CredentialsData previousCredentialsData)
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 Map<String,String> generateCredentialsConfigMap(@NotNull Map<String,String> params) throws WebValidationException
Sensitive parameters such as passwords do not have to be encrypted, as they will be secured before being stored in the database.
params
- original map to be convertedWebValidationException
- if params contains invalid configuration@NotNull Map<String,String> getCredentialsConfigurationMap(@NotNull CredentialsData credentialsData)
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.credentialsData
- an existing credentialCopyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.