Class CrowdSecretService

java.lang.Object
com.atlassian.crowd.secret.CrowdSecretService
All Implemented Interfaces:
SecretServiceInternal, com.atlassian.secrets.api.SecretService

public class CrowdSecretService extends Object implements SecretServiceInternal
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
  • 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:
      put in interface com.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: SecretServiceInternal
      Stores a secret associated with a unique identifier and secret namespace.
      Specified by:
      put in interface SecretServiceInternal
      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:
      get in interface com.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: SecretServiceInternal
      Retrieves the secret data associated with a unique identifier and secret namespace.
      Specified by:
      get in interface SecretServiceInternal
      Parameters:
      secretNamespace - The secret namespace associated with the secret.
      identifier - The unique identifier for the secret data.
      Returns:
      An Optional containing the secret data if found, or an empty Optional if 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:
      delete in interface com.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: SecretServiceInternal
      Deletes the secret data associated with a unique identifier and a secret namespace.
      Specified by:
      delete in interface SecretServiceInternal
      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:
      getConfiguration in interface com.atlassian.secrets.api.SecretService
      Throws:
      com.atlassian.secrets.api.SecretServiceDisabledException
    • getManagement

      @Nonnull public com.atlassian.secrets.api.SecretService.SecretServiceManagement getManagement()
      Specified by:
      getManagement in interface com.atlassian.secrets.api.SecretService