Package org.springframework.vault.core
Interface VaultSysOperations
- All Known Implementing Classes:
VaultSysTemplate
public interface VaultSysOperations
Interface that specifies a basic set of administrative Vault operations.
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionvoid
authMount
(String path, VaultMount vaultMount) Mounts an auth backendVaultMount
topath
.void
authUnmount
(String path) Unmounts the auth backend mount atpath
.void
createOrUpdatePolicy
(String name, Policy policy) Create or update aPolicy
.void
deletePolicy
(String name) Delete aPolicy
by its name.Read aPolicy
by its name.Lists policy names stored in Vault.health()
Return the health status of Vault.initialize
(VaultInitializationRequest vaultInitializationRequest) Initialize Vault with aVaultInitializationRequest
.boolean
void
mount
(String path, VaultMount vaultMount) Mounts a secret backendVaultMount
topath
.void
seal()
Seal vault.void
Unmounts the secret backend mount atpath
.Unseal vault.
-
Method Details
-
isInitialized
- Returns:
- true if Vault is initialized.
- Throws:
VaultException
- See Also:
-
initialize
VaultInitializationResponse initialize(VaultInitializationRequest vaultInitializationRequest) throws VaultException Initialize Vault with aVaultInitializationRequest
.- Parameters:
vaultInitializationRequest
- must not be null.- Returns:
- the
VaultInitializationResponse
. - Throws:
VaultException
- See Also:
-
seal
Seal vault.- Throws:
VaultException
- See Also:
-
unseal
Unseal vault. SeeVaultUnsealStatus.getProgress()
for progress.- Parameters:
keyShare
- must not be empty and not null.- Returns:
- the
VaultUnsealStatus
. - Throws:
VaultException
- See Also:
-
getUnsealStatus
- Returns:
- the
VaultUnsealStatus
. - Throws:
VaultException
- See Also:
-
mount
Mounts a secret backendVaultMount
topath
.- Parameters:
path
- must not be empty or null.vaultMount
- must not be null.- Throws:
VaultException
- See Also:
-
getMounts
- Returns:
Map
of all secret backendmounts
.- Throws:
VaultException
- See Also:
-
unmount
Unmounts the secret backend mount atpath
.- Parameters:
path
- must not be empty or null.- Throws:
VaultException
- See Also:
-
authMount
Mounts an auth backendVaultMount
topath
.- Parameters:
path
- must not be empty or null.vaultMount
- must not be null.- Throws:
VaultException
- See Also:
-
getAuthMounts
- Returns:
Map
of all auth backendmounts
.- Throws:
VaultException
- See Also:
-
authUnmount
Unmounts the auth backend mount atpath
.- Parameters:
path
- must not be empty or null.- Throws:
VaultException
- See Also:
-
getPolicyNames
Lists policy names stored in Vault.- Returns:
- policy names.
- Throws:
VaultException
- Since:
- 2.0
- See Also:
-
getPolicy
Read aPolicy
by its name. Policies are either represented as HCL (HashiCorp configuration language) or JSON. Retrieving policies is only possible if the policy is represented as JSON.- Returns:
- the
Policy
or null, if the policy was not found. - Throws:
UnsupportedOperationException
- if the policy is represented as HCL.VaultException
- Since:
- 2.0
- See Also:
-
createOrUpdatePolicy
Create or update aPolicy
.- Parameters:
name
- the policy name, must not be null or empty.- Throws:
VaultException
- Since:
- 2.0
- See Also:
-
deletePolicy
Delete aPolicy
by its name.- Parameters:
name
- the policy name, must not be null or empty.- Throws:
VaultException
- Since:
- 2.0
- See Also:
-
health
Return the health status of Vault.- Returns:
- the
VaultHealth
. - Throws:
VaultException
- See Also:
-