Closed markus456 closed 2 years ago
It appears there's a missing overload of read
that should take either a specific version or a generic Parameters
. The documentation specifies the URL option you have mentioned, but that definitely isn't the intended path forward https://www.vaultproject.io/api-docs/secret/kv/kv-v2#read-secret-version. I'll get this added.
OK, thanks for confirming!
This is available as of https://github.com/abedra/libvault/commit/225f929242545a625efb029cede4cd464bb71940 and in release https://github.com/abedra/libvault/releases/tag/0.51.0
The current code appears to have an implicit method of retrieving versioned keys using the v2 key-value store: by adding
?version=<int>
to the end of theVault::Path
, an older version of the secret can be retrieved.Here's a piece of code that I used to test it:
And here's the output it produces with a local Vault server (v1.10.3) and a single secret with two versions (the key is
1
):Is there an explicit method of requesting a certain version of a secret? This doesn't seem like the intended method of using the versioning and none of the examples seem to read versioned values: they appear to only be deleted in tests.