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 TypeMethodDescriptionvoiddelete(String path, Versioned.Version... versionsToDelete) Delete one or moreversionsof the secret atpath.voiddestroy(String path, Versioned.Version... versionsToDelete) Permanently remove the specifiedversionsof the secret atpath.Read the most recent secret atpath.default <T> Versioned<T>Read the most recent secret atpathand deserialize the secret to the givenresponseType.<T> Versioned<T>get(String path, Versioned.Version version) Read the requestedVersioned.Versionof the secret atpath.<T> Versioned<T>get(String path, Versioned.Version version, Class<T> responseType) Read the requestedVersioned.Versionof the secret atpathand deserialize the secret to the givenresponseType.Write theversioned secretatpath.voidundelete(String path, Versioned.Version... versionsToDelete) Undelete (restore) one or moreversionsof 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:
getin interfaceVaultKeyValueOperationsSupport- Parameters:
path- must not be null.- Returns:
- the data. May be null if the path does not exist.
-
get
Read the requestedVersioned.Versionof 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 atpathand 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.Versionof the secret atpathand 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 secretatpath.bodymay be either plain secrets (e.g. map) orVersionedobjects. UsingVersionedwill 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 moreversionsof the secret atpath.- Parameters:
path- must not be null.versionsToDelete- must not be null or empty.
-
undelete
Undelete (restore) one or moreversionsof the secret atpath.- Parameters:
path- must not be null.versionsToDelete- must not be null or empty.
-
destroy
Permanently remove the specifiedversionsof 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
-