Package com.atlassian.secrets.api
Interface SecretService
public interface SecretService
An API for managing secrets.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidDeletes the secret data associated with a unique identifier.Retrieves the secret data associated with a unique identifier.Returns a record describing the current configuration of the SecretService which can be used for analytics within a product.static SecretServiceStategetState()Retrieves the current state of the Secret Service based on a system property.voidStores a secret associated with a unique identifier.
-
Field Details
-
SECRET_SERVICE_STATE_SYSTEM_PROP
- See Also:
-
-
Method Details
-
put
Stores a secret associated with a unique identifier.- Parameters:
identifier- The unique identifier for the secret data.secretData- The secret data to be stored.- Throws:
SecretServiceException- If an error occurs
-
get
Retrieves the secret data associated with a unique identifier.- Parameters:
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:
SecretServiceException- If an error occurs
-
delete
Deletes the secret data associated with a unique identifier.- Parameters:
identifier- The unique identifier for the secret data to be deleted.- Throws:
SecretServiceException- If an error occurs
-
getConfiguration
Returns a record describing the current configuration of the SecretService which can be used for analytics within a product.- Returns:
- An
SecretServiceConfigurationrecord - Throws:
SecretServiceDisabledException- If SecretService is disabled
-
getState
Retrieves the current state of the Secret Service based on a system property.This method checks the value of a system property defined by
SECRET_SERVICE_STATE_SYSTEM_PROP. The method attempts to obtain a correspondingSecretServiceState. If the property is not set or is empty, the method defaults to returningSecretServiceState.ENABLED.- Returns:
- the current
SecretServiceStateas determined by the system property orSecretServiceState.ENABLEDif the property is not set or empty. - Throws:
SecretServiceException
-