Package com.atlassian.crowd.secret
Class CrowdSecretService
java.lang.Object
com.atlassian.crowd.secret.CrowdSecretService
- All Implemented Interfaces:
SecretServiceInternal,com.atlassian.secrets.api.SecretService
A delegating implementation of
SecretService. Available in public API under SecretService which
only allows access to SecretNamespace.EXTERNAL. Available internally as
SecretServiceInternal which allows access to all available SecretNamespaces.- Since:
- 6.3
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.secrets.api.SecretService
com.atlassian.secrets.api.SecretService.SecretServiceManagement -
Field Summary
Fields inherited from interface com.atlassian.secrets.api.SecretService
SECRET_SERVICE_STATE_SYSTEM_PROPFields inherited from interface com.atlassian.crowd.secret.SecretServiceInternal
SECRET_SERVICE_MARKER -
Constructor Summary
ConstructorsConstructorDescriptionCrowdSecretService(com.atlassian.secrets.api.SecretDao secretDao, HomeDirectoryService homeDirectoryService, com.atlassian.beehive.ClusterLockService clusterLockService) -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(SecretNamespace secretNamespace, String identifier) Deletes the secret data associated with a unique identifier and a secret namespace.voidget(SecretNamespace secretNamespace, String identifier) Retrieves the secret data associated with a unique identifier and secret namespace.com.atlassian.secrets.api.SecretServiceConfigurationcom.atlassian.secrets.api.SecretService.SecretServiceManagementvoidput(SecretNamespace secretNamespace, String identifier, String secretData) Stores a secret associated with a unique identifier and secret namespace.void
-
Constructor Details
-
CrowdSecretService
public CrowdSecretService(com.atlassian.secrets.api.SecretDao secretDao, HomeDirectoryService homeDirectoryService, com.atlassian.beehive.ClusterLockService clusterLockService)
-
-
Method Details
-
put
@Transactional public void put(String identifier, String secretData) throws com.atlassian.secrets.api.SecretServiceException - Specified by:
putin interfacecom.atlassian.secrets.api.SecretService- Throws:
com.atlassian.secrets.api.SecretServiceException
-
put
@Transactional public void put(SecretNamespace secretNamespace, String identifier, String secretData) throws com.atlassian.secrets.api.SecretServiceException Description copied from interface:SecretServiceInternalStores a secret associated with a unique identifier and secret namespace.- Specified by:
putin interfaceSecretServiceInternal- Parameters:
secretNamespace- The secret namespace associated with the secret.identifier- The unique identifier for the secret data.secretData- The secret data to be stored.- Throws:
com.atlassian.secrets.api.SecretServiceException- If an error occurs
-
get
@Transactional(readOnly=true) public Optional<String> get(String identifier) throws com.atlassian.secrets.api.SecretServiceException - Specified by:
getin interfacecom.atlassian.secrets.api.SecretService- Throws:
com.atlassian.secrets.api.SecretServiceException
-
get
public Optional<String> get(SecretNamespace secretNamespace, String identifier) throws com.atlassian.secrets.api.SecretServiceException Description copied from interface:SecretServiceInternalRetrieves the secret data associated with a unique identifier and secret namespace.- Specified by:
getin interfaceSecretServiceInternal- Parameters:
secretNamespace- The secret namespace associated with the secret.identifier- The unique identifier for the secret data.- Returns:
- An
Optionalcontaining the secret data if found, or an emptyOptionalif no secret data is associated with the identifier. - Throws:
com.atlassian.secrets.api.SecretServiceException- If an error occurs
-
delete
@Transactional public void delete(String identifier) throws com.atlassian.secrets.api.SecretServiceException - Specified by:
deletein interfacecom.atlassian.secrets.api.SecretService- Throws:
com.atlassian.secrets.api.SecretServiceException
-
delete
@Transactional public void delete(SecretNamespace secretNamespace, String identifier) throws com.atlassian.secrets.api.SecretServiceException Description copied from interface:SecretServiceInternalDeletes the secret data associated with a unique identifier and a secret namespace.- Specified by:
deletein interfaceSecretServiceInternal- Parameters:
secretNamespace- The secret namespace associated with the secret.identifier- The unique identifier for the secret data to be deleted.- Throws:
com.atlassian.secrets.api.SecretServiceException- If an error occurs
-
getConfiguration
@Nonnull public com.atlassian.secrets.api.SecretServiceConfiguration getConfiguration() throws com.atlassian.secrets.api.SecretServiceDisabledException- Specified by:
getConfigurationin interfacecom.atlassian.secrets.api.SecretService- Throws:
com.atlassian.secrets.api.SecretServiceDisabledException
-
getManagement
@Nonnull public com.atlassian.secrets.api.SecretService.SecretServiceManagement getManagement()- Specified by:
getManagementin interfacecom.atlassian.secrets.api.SecretService
-