KV Secrets Enginesยถ

The hvac.api.secrets_engines.Kv instance under the Client class's kv attribute is a wrapper to expose either version 1 (KvV1) or version 2 of the key/value secrets enginesโ€™ API methods (KvV2). At present, this class defaults to version 2 when accessing methods on the instance.

Setting the Default KV Versionยถ

hvac.api.secrets_engines.KvV1.read_secret()

import hvac
client = hvac.Client()

client.kv.default_kv_version = 1
client.kv.read_secret(path='hvac')  # => calls hvac.api.secrets_engines.KvV1.read_secret

Explicitly Calling a KV Version Methodยถ

hvac.api.secrets_engines.KvV1.list_secrets()

import hvac
client = hvac.Client()

client.kv.v1.read_secret(path='hvac')
client.kv.v2.read_secret_version(path='hvac')