public interface CredentialsManager extends CredentialsAccessor
CredentialsAccessor.IsCredentialsOfType
Modifier and Type | Method and Description |
---|---|
@NotNull Long |
countAllGlobalCredentials()
Count all global credentials.
|
@NotNull Long |
countAllProjectsCredentials()
Count all project credentials.
|
@NotNull CredentialsData |
createCredentials(@NotNull CredentialTypeModuleDescriptor credentialDescriptor,
@NotNull String credentialsName,
@NotNull Map<String,String> credentialsConfig)
Creates Credentials from the configuration map and stores them in the database.
|
@NotNull CredentialsData |
createOrUpdateCredentials(@NotNull CredentialsData credentials)
Creates credentials based on the object representation.
|
@NotNull CredentialsData |
createProjectCredentials(@NotNull CredentialTypeModuleDescriptor credentialDescriptor,
@NotNull String credentialsName,
@NotNull Map<String,String> credentialsConfig,
@NotNull Long projectId)
Creates Credentials from the configuration map and stores them in the database.
|
void |
deleteCredentials(long id)
Deletes credentials based on Id
|
@NotNull CredentialsData |
editCredentials(long credentialsId,
@NotNull String credentialsName,
@NotNull Map<String,String> credentialsConfig)
Updates Credentials with values in the configuration map.
|
@NotNull CredentialsData |
editProjectCredentials(long credentialsId,
@NotNull String credentialsName,
@NotNull Map<String,String> credentialsConfig,
long projectId)
Updates Credentials with values in the configuration map.
|
@NotNull List<Long> |
findAllProjectsIdsUsingProjectSharedCredentials() |
@Nullable CredentialTypeModuleDescriptor |
getCredentialTypeDescriptor(@Nullable String pluginKey) |
@NotNull List<CredentialTypeModuleDescriptor> |
getCredentialTypeDescriptors() |
@NotNull PaginatedProjectSharedCredentials |
getPaginatedSharedCredentials(@Nullable Long projectId,
int start,
int limit,
@Nullable String filter)
Get paginated shared credentials for a project.
|
@NotNull CredentialsData |
mergeImportedEntity(@NotNull CredentialsData importedEntity)
Merges the state of the given imported entity into the database.
|
@NotNull CredentialTypeExporter |
retrieveCredentialTypeExporter(@Nullable String pluginKey)
Find credential type exporter for given plugin key.
|
@Nullable CredentialsData |
updateCredentialsName(long id,
@NotNull String name)
Updates shared credentials name
|
void |
validate(@NotNull CredentialsData importedEntity)
Validate entity before saving it in database.
|
getAllCredentials, getAllCredentials, getAllCredentialsByPluginKey, getCredentials, getCredentialsByName, getCredentialsByNameAndProjectId, getCredentialsByOid, getGlobalCredentials, getGlobalCredentials, getProjectCredentials, getProjectCredentials, getProjectCredentialsByPluginKey, hasAnyCredentials
@NotNull @NotNull List<CredentialTypeModuleDescriptor> getCredentialTypeDescriptors()
@Nullable @Nullable CredentialTypeModuleDescriptor getCredentialTypeDescriptor(@Nullable @Nullable String pluginKey)
@NotNull @NotNull PaginatedProjectSharedCredentials getPaginatedSharedCredentials(@Nullable @Nullable Long projectId, int start, int limit, @Nullable @Nullable String filter)
projectId
- of the project to get shared credentials forstart
- start by indexlimit
- return no more entries than limitfilter
- filter@Nullable @Nullable CredentialsData updateCredentialsName(long id, @NotNull @NotNull String name) throws WebValidationException
id
- The id of the object to updatename
- The new name to identify the credentialsWebValidationException
@NotNull @NotNull CredentialsData createOrUpdateCredentials(@NotNull @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 @NotNull CredentialsData createCredentials(@NotNull @NotNull CredentialTypeModuleDescriptor credentialDescriptor, @NotNull @NotNull String credentialsName, @NotNull @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 @NotNull CredentialsData createProjectCredentials(@NotNull @NotNull CredentialTypeModuleDescriptor credentialDescriptor, @NotNull @NotNull String credentialsName, @NotNull @NotNull Map<String,String> credentialsConfig, @NotNull @NotNull Long projectId)
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.projectId
- Project id@NotNull @NotNull CredentialsData editCredentials(long credentialsId, @NotNull @NotNull String credentialsName, @NotNull @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.@NotNull @NotNull CredentialsData editProjectCredentials(long credentialsId, @NotNull @NotNull String credentialsName, @NotNull @NotNull Map<String,String> credentialsConfig, long projectId)
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.projectId
- The ID of the Projectvoid deleteCredentials(long id)
id
- id of the object to deletevoid validate(@NotNull @NotNull CredentialsData importedEntity) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
importedEntity
- imported entitycom.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
@NotNull @NotNull CredentialTypeExporter retrieveCredentialTypeExporter(@Nullable @Nullable String pluginKey)
@NotNull @NotNull CredentialsData mergeImportedEntity(@NotNull @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 entity@NotNull @NotNull Long countAllGlobalCredentials()
@NotNull @NotNull Long countAllProjectsCredentials()
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.