Package org.springframework.vault.core
Interface VaultVersionedKeyValueOperations
- All Superinterfaces:
VaultKeyValueOperationsSupport
- All Known Implementing Classes:
VaultVersionedKeyValueTemplate
Interface that specifies a basic set of Vault operations using Vault's versioned
Key/Value (kv version 2) secret backend. Paths used in this operations interface are
relative and outgoing requests prepend paths with the according operation-specific
prefix.
Clients using versioned Key/Value must be aware they are reading from a versioned
backend as the versioned Key/Value API (kv version 2) is different from the unversioned
Key/Value API (kv version 1).
- Since:
- 2.1
- Author:
- Mark Paluch
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.vault.core.VaultKeyValueOperationsSupport
VaultKeyValueOperationsSupport.KeyValueBackend
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(String path, Versioned.Version... versionsToDelete) Delete one or moreversions
of the secret atpath
.void
destroy
(String path, Versioned.Version... versionsToDelete) Permanently remove the specifiedversions
of the secret atpath
.Read the most recent secret atpath
.default <T> Versioned<T>
Read the most recent secret atpath
and deserialize the secret to the givenresponseType
.<T> Versioned<T>
get
(String path, Versioned.Version version) Read the requestedVersioned.Version
of the secret atpath
.<T> Versioned<T>
get
(String path, Versioned.Version version, Class<T> responseType) Read the requestedVersioned.Version
of the secret atpath
and deserialize the secret to the givenresponseType
.Write theversioned secret
atpath
.void
undelete
(String path, Versioned.Version... versionsToDelete) Undelete (restore) one or moreversions
of the secret atpath
.Methods inherited from interface org.springframework.vault.core.VaultKeyValueOperationsSupport
delete, getApiVersion, list
-
Method Details
-
get
Read the most recent secret atpath
.- Specified by:
get
in interfaceVaultKeyValueOperationsSupport
- Parameters:
path
- must not be null.- Returns:
- the data. May be null if the path does not exist.
-
get
Read the requestedVersioned.Version
of the secret atpath
.- Parameters:
path
- must not be null.version
- must not be null.- Returns:
- the data. May be null if the path does not exist.
-
get
Read the most recent secret atpath
and deserialize the secret to the givenresponseType
.- Parameters:
path
- must not be null.responseType
- must not be null.- Returns:
- the data. May be null if the path does not exist.
-
get
Read the requestedVersioned.Version
of the secret atpath
and deserialize the secret to the givenresponseType
.- Parameters:
path
- must not be null.version
- must not be null.responseType
- must not be null.- Returns:
- the data. May be null if the path does not exist.
-
put
Write theversioned secret
atpath
.body
may be either plain secrets (e.g. map) orVersioned
objects. UsingVersioned
will apply versioning for Compare-and-Set (CAS).- Parameters:
path
- must not be null.body
- must not be null.- Returns:
- the resulting
Versioned.Metadata
.
-
delete
Delete one or moreversions
of the secret atpath
.- Parameters:
path
- must not be null.versionsToDelete
- must not be null or empty.
-
undelete
Undelete (restore) one or moreversions
of the secret atpath
.- Parameters:
path
- must not be null.versionsToDelete
- must not be null or empty.
-
destroy
Permanently remove the specifiedversions
of the secret atpath
.- Parameters:
path
- must not be null.versionsToDelete
- must not be null or empty.
-
opsForKeyValueMetadata
VaultKeyValueMetadataOperations opsForKeyValueMetadata()- Returns:
- the operations interface to interact with the Vault Key/Value metadata backend
-