Skip to content

Getting Started

Explicit Initialization

from vault_kv_client import VaultAuth, VaultManager, VaultSettings

settings = VaultSettings(
    addr="https://vault.example.com",
    verify=True,
    namespace=None,
)

auth = VaultAuth(token="s.xxxxx")
client = VaultManager(settings=settings, auth=auth)

secret = client.get_secret("kv", "apps/my-service")

Environment-Driven Bootstrap

from vault_kv_client import get_default_manager

client = get_default_manager()
secret = client.get_secret("kv", "apps/my-service")

This mode is convenient when Vault configuration already exists in environment variables or Airflow Variables.

First Calls to Know

  • get_secret() reads a secret payload.
  • upsert_secret() writes a secret payload.
  • list_secrets() lists direct child keys.
  • list_all_secrets() recursively lists all paths below a prefix.
  • copy_secret() copies one path between mounts.
  • clear_cache() invalidates the optional in-memory read cache.