Skip to content

Latest commit

 

History

History
42 lines (25 loc) · 1.16 KB

kv.rst

File metadata and controls

42 lines (25 loc) · 1.16 KB

KV Secrets Engines

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

Setting the Default KV Version

:pyhvac.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

:pyhvac.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')

Specific KV Version Usage

../secrets_engines/kv_v1 ../secrets_engines/kv_v2