Interface RuleSecretService
- All Known Implementing Classes:
RuleSecretServiceImpl
public interface RuleSecretService
-
Method Summary
Modifier and TypeMethodDescriptioncreateExposedSecret(TenantContext tenant, String value) Generates exposed secret where key = valueio.atlassian.fugue.Either<ErrorCollection, RuleSecretBean> createSecret(RemoteConnectUser remoteUser, TenantContext context, RuleSecretBean secret) Creates secret if it passes validationio.atlassian.fugue.Either<ErrorCollection, RuleSecretBean> createSecretAssignedToProject(RemoteConnectUser remoteUser, TenantContext context, RuleSecretBean secret, String projectId) Creates secret if it passes validation and assigns it ONLY to the passed project, ignoring values in the beancreateUniquelyNamedGlobalSecret(TenantContext tenant, String prefix, String value) Generates a secret with UUID based key with optional prefix, can be used e.g.voiddeleteAssociatedRuleSecrets(TenantContext globalTenant, String projectId) Deletes secret association to the project, or the whole secret if assigned only to this projectdeleteSecret(RemoteConnectUser remoteUser, TenantContext context, Long secretId) Deletes secret if it passes validationgetAllSecrets(TenantContext context) Retrieves all the rule secrets for a tenantgetSecretById(TenantContext context, long secretId) Gets a single rule secret by idgetSecretByKey(TenantContext context, String secretKey) getSecretsByProject(TenantContext context, String projectId) Retrieves all secrets associated to the project and all global secrets.io.atlassian.fugue.Either<ErrorCollection, RuleSecretUsageBean> getSecretUsageData(RemoteConnectUser remoteUser, TenantContext context, Long secretId) Get secrets usage data, used to determine which projects can be removed from secret, or if the global secret can be restricted.io.atlassian.fugue.Either<ErrorCollection, RuleSecretBean> updateSecret(RemoteConnectUser remoteUser, TenantContext context, RuleSecretBean secret) Updates given secret if it passes validation
-
Method Details
-
getAllSecrets
Retrieves all the rule secrets for a tenant- Parameters:
context- The database tenant context- Returns:
- the complete list or rule secrets for the tenant
-
getSecretById
Gets a single rule secret by id- Parameters:
context- The database tenant contextsecretId- The id of the secret- Returns:
- an optional of the secret
-
getSecretByKey
-
updateSecret
io.atlassian.fugue.Either<ErrorCollection,RuleSecretBean> updateSecret(RemoteConnectUser remoteUser, TenantContext context, RuleSecretBean secret) Updates given secret if it passes validation- Parameters:
remoteUser- the user requesting the secretscontext- The database tenant contextsecret- The secret with the updates to apply- Returns:
- The updated secret or validation errors
-
createSecret
io.atlassian.fugue.Either<ErrorCollection,RuleSecretBean> createSecret(RemoteConnectUser remoteUser, TenantContext context, RuleSecretBean secret) Creates secret if it passes validation- Parameters:
remoteUser- the user requesting the secretscontext- The database tenant contextsecret- The secret to create- Returns:
- The created secret or validation errors
-
createSecretAssignedToProject
io.atlassian.fugue.Either<ErrorCollection,RuleSecretBean> createSecretAssignedToProject(RemoteConnectUser remoteUser, TenantContext context, RuleSecretBean secret, String projectId) Creates secret if it passes validation and assigns it ONLY to the passed project, ignoring values in the bean- Parameters:
remoteUser- the user requesting the secretscontext- The database tenant contextsecret- The secret to createprojectId- The project ID to assign secret to- Returns:
- The created secret or validation errors
-
deleteSecret
Deletes secret if it passes validation- Parameters:
context- The database tenant contextsecretId- The id of secret to delete- Returns:
- ErrorCollection containing errors when the deletion fails, and empty if the deletion succeeded
-
getSecretsByProject
Retrieves all secrets associated to the project and all global secrets.- Parameters:
context- The db tenant contextprojectId- The ID of a project to retrieve secrets for.- Returns:
- list of secrets with loaded projects.
-
getSecretUsageData
io.atlassian.fugue.Either<ErrorCollection,RuleSecretUsageBean> getSecretUsageData(RemoteConnectUser remoteUser, TenantContext context, Long secretId) Get secrets usage data, used to determine which projects can be removed from secret, or if the global secret can be restricted.- Parameters:
remoteUser- the user requesting the secretscontext- The db tenant contextsecretId- ID of the secret to retrieve usage data for- Returns:
- Secrets usage or errors if the secret doesn't exist
-
deleteAssociatedRuleSecrets
Deletes secret association to the project, or the whole secret if assigned only to this project- Parameters:
globalTenant- The db tenant contextprojectId- The ID of a project to delete associated secrets for.
-
createUniquelyNamedGlobalSecret
Generates a secret with UUID based key with optional prefix, can be used e.g. in component transformation -
createExposedSecret
Generates exposed secret where key = value
-