public interface CredentialsManager extends CredentialsAccessor
CredentialsAccessor.IsCredentialsOfType
Modifier and Type | Method and Description |
---|---|
CredentialsData |
createCredentials(CredentialTypeModuleDescriptor credentialDescriptor,
String credentialsName,
Map<String,String> credentialsConfig)
Creates Credentials from the configuration map and stores them in the database.
|
CredentialsData |
createOrUpdateCredentials(CredentialsData credentials)
Creates credentials based on the object representation.
|
void |
deleteCredentials(long id)
Deletes credentials based on Id
|
CredentialsData |
editCredentials(long credentialsId,
String credentialsName,
Map<String,String> credentialsConfig)
Updates Credentials with values in the configuration map.
|
CredentialTypeModuleDescriptor |
getCredentialTypeDescriptor(String pluginKey) |
List<CredentialTypeModuleDescriptor> |
getCredentialTypeDescriptors() |
CredentialsData |
mergeImportedEntity(CredentialsData importedEntity)
Merges the state of the given imported entity into the database.
|
CredentialTypeExporter |
retrieveCredentialTypeExporter(String pluginKey)
Find credential type exporter for given plugin key.
|
CredentialsData |
updateCredentialsName(long id,
String name)
Updates shared credentials name
|
void |
validate(CredentialsData importedEntity)
Validate entity before saving it in database.
|
getAllCredentials, getAllCredentials, getCredentials, getCredentialsByName, getCredentialsByOid, hasAnyCredentials
@NotNull List<CredentialTypeModuleDescriptor> getCredentialTypeDescriptors()
@Nullable CredentialTypeModuleDescriptor getCredentialTypeDescriptor(@Nullable String pluginKey)
@Nullable CredentialsData updateCredentialsName(long id, @NotNull String name) throws WebValidationException
id
- The id of the object to updatename
- The new name to identify the credentialsWebValidationException
@NotNull CredentialsData createOrUpdateCredentials(@NotNull CredentialsData credentials)
This method encrypts the values of the credentials, for example for ssh encrypts the ssh key and ssh passphrase.
credentials
- The object representation with the data to save.@NotNull CredentialsData createCredentials(@NotNull CredentialTypeModuleDescriptor credentialDescriptor, @NotNull String credentialsName, @NotNull Map<String,String> credentialsConfig)
This method encrypts the values of the credentials, for example for ssh encrypts the ssh key and ssh passphrase.
credentialDescriptor
- The plugin module descriptor for the credential type being created.credentialsName
- The name for the credentials.credentialsConfig
- The configuration map containing the credential values as defined by the plugin for
this credential type.@NotNull CredentialsData editCredentials(long credentialsId, @NotNull String credentialsName, @NotNull Map<String,String> credentialsConfig)
This method encrypts the values of the credentials, for example for ssh encrypts the ssh key and ssh passphrase.
credentialsId
- The ID of the credentials to update.credentialsName
- The name for the credentials.credentialsConfig
- The configuration map containing the credential values as defined by the plugin for this
credential type.void deleteCredentials(long id)
id
- id of the object to deletevoid validate(@NotNull CredentialsData importedEntity) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
importedEntity
- imported entitycom.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
@NotNull CredentialTypeExporter retrieveCredentialTypeExporter(@Nullable String pluginKey)
@NotNull CredentialsData mergeImportedEntity(@NotNull CredentialsData importedEntity)
This service will attempt to merge the entity based on ImmutableEntityWithOid.getOid()
, and if there's no
match, based on CredentialsData.getName()
. If an existing entity is found, then it will be updated.
Otherwise, a new database entity will be created.
It's assumed that this method is used in specs import only as it's sending analytic event.
importedEntity
- imported entityCopyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.