Package com.atlassian.secrets.api
Interface SecretService
public interface SecretService
An API for managing secrets.
- Since:
- 5.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAn API for managing the SecretService. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidDeletes the secret data associated with a unique identifier.default voidDeletes multiple secrets associated with their unique identifiers.Retrieves the secret data associated with a unique identifier.Retrieves multiple secrets associated with their unique identifiers.Returns a record describing the current configuration of the SecretService which can be used for analytics within a product.Returns an API for managing the configuration of this SecretService.static SecretServiceStategetState()Retrieves the current state of the Secret Service based on a system property.voidStores a secret associated with a unique identifier.default voidStores multiple secrets associated with their unique identifiers.
-
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
-
put
Stores multiple secrets associated with their unique identifiers.- Parameters:
secrets- A map of unique identifiers to their corresponding secret data.- 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
-
get
Retrieves multiple secrets associated with their unique identifiers.- Parameters:
identifiers- A set of unique identifiers for the secret data.- Returns:
- A map where each key is a unique identifier and the corresponding value is an
Optionalcontaining the secret data if found, or an emptyOptionalif no secret data is associated with that 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
-
delete
Deletes multiple secrets associated with their unique identifiers.- Parameters:
identifiers- A set of unique identifiers for the secret data to be deleted.- Throws:
SecretServiceException- If an error occurs
-
getManagement
Returns an API for managing the configuration of this SecretService. A default implementation is included so the interface is API compatible with existing implementations. The default implementation will throw an UnsupportedOperationException.- Returns:
- The
SecretService.SecretServiceManagementinstance which can be used to manage this SecretService
-
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
-