Reputation: 178
I'm currently handling the TTL expiring like this:
Secret v2Secret;
try
{
v2Secret = await this.vaultClient.V1.Secrets.KeyValue.V2.ReadSecretAsync(vaultPath).ConfigureAwait(false);
}
catch (VaultApiException e)
{
this.vaultClient.V1.Auth.ResetVaultToken();
v2Secret = await this.vaultClient.V1.Secrets.KeyValue.V2.ReadSecretAsync(vaultPath).ConfigureAwait(false);
}
Is there a way for me to check the TTL the vaultClient has before I make the first ReadSecretAsync call?
Upvotes: 0
Views: 591
Reputation: 9499
The docs were missing on the VaultSharp methods that allow this. VaultSharp supports 2 ways to find TTL of a token.
I have added the docs for it. Please refer to
https://github.com/rajanadar/VaultSharp/blob/master/README.md#token-lookup-any-token
and
https://github.com/rajanadar/VaultSharp/blob/master/README.md#token-lookup-calling-token
Upvotes: 0