0

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?

Pete Whitehead
  • 178
  • 2
  • 11

1 Answers1

0

The docs were missing on the VaultSharp methods that allow this. VaultSharp supports 2 ways to find TTL of a token.

  1. A LookupToken api where you can explicitly pass in any Vault-Token.
  2. Or a LookupSelf API, where the implicit current vault token info will be returned.

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

Raja Nadar
  • 9,409
  • 2
  • 32
  • 41