Closed stephdep closed 2 years ago
Hey @stephdep,
Have you tried the ReadSecretPathsAsync
API from IKeyValueSecretsEngineV2
.
/// <summary>
/// Retrieves the secret location path entries at the specified location.
/// Folders are suffixed with /. The input must be a folder; list on a file will not return a value.
/// The values themselves are not accessible via this API.
/// </summary>
/// <param name="path"><para>[required]</para>
/// The location path where the secret needs to be read from.</param>
/// <param name="mountPoint"><para>[optional]</para>
/// The mount point for the Generic backend. Defaults to <see cref="SecretsEngineMountPoints.KeyValueV2" />
/// Provide a value only if you have customized the mount point.</param>
/// <param name="wrapTimeToLive">
/// <para>[required]</para>
/// The TTL for the token and can be either an integer number of seconds or a string duration of seconds.
/// </param>
/// <returns>
/// The secret list with the data.
/// </returns>
Task<Secret<ListInfo>> ReadSecretPathsAsync(string path, string mountPoint = null, string wrapTimeToLive = null);
I believe this API is also available in IKeyValueSecretsEngineV1
.
Let me know if this was your requirement.
Thanks & Regards, @konidev20
@stephdep I think I got what your requirement is after reading the Vault documentation.
This is the API you want in the library right? https://www.vaultproject.io/api-docs/secret/kv/kv-v2#read-secret-subkeys
Exactly ! Retrieving the keys without the secrets.
Hey @stephdep,
You can review the pull request I've raised for this request. I have followed the API documentation. You can pull the branch and test out the API to see if it satisfies your request.
thanks @konidev20 for the PR. Made some subtle changes. Also, this is a Vault 1.10.0 feature. So, i'll release it after a 1.7 version sweep.
Thanks !
Available here: https://www.nuget.org/packages/VaultSharp/1.7.2
Due to security rights, we would need a method that can read the present secret keys without retrieving the actual secret content. We have currently implemented this functionality outside the library, but would prefer to have it in the library.
Hereby our code ` public const string VaultSubKeysPath = "/v1/secret/subkeys/";
`