Skip to main content

Python SDK for Vibr8Vault — a self-hosted secrets manager

Project description

vibr8vault-sdk

Python SDK for Vibr8Vault — a self-hosted secrets manager.

Installation

pip install vibr8vault-sdk

Development Setup

# Clone the repo and navigate to the Python SDK
cd sdk/python

# Create and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install the SDK in editable mode with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run type checking
mypy src/

Quick Start

from vibr8vault import Vibr8Vault

vault = Vibr8Vault(address="http://localhost:8200", token="your-service-token")

# Read a secret
secret = vault.secrets.read("apps/backend/prod")
print(secret["data"]["DB_PASSWORD"])

# List secrets under a prefix
listing = vault.secrets.list("apps/")
print(listing["keys"])

# Check vault health
health = vault.sys.health()
print(health["status"])

API Reference

Secrets

vault.secrets.read(path, version=None)        # Read a secret (optionally a specific version)
vault.secrets.write(path, data)                # Write key-value pairs to a path
vault.secrets.delete(path, hard=False)         # Soft-delete (or hard-delete) a secret
vault.secrets.list(prefix)                     # List secret paths under a prefix
vault.secrets.versions(path)                   # List all versions of a secret

Namespace-scoped variants: read_ns, write_ns, delete_ns, list_ns, versions_ns — each takes ns as the first argument.

Tokens

vault.tokens.create(type=None, ttl=None, policies=None, max_uses=None)
vault.tokens.revoke(id)
vault.tokens.list()

Auth

vault.auth.login(username, password)
vault.auth.me()

Users

vault.users.create(username, password, policies=None)
vault.users.list()
vault.users.get(id)
vault.users.update(id, password=None, policies=None)
vault.users.delete(id)

System

vault.sys.health()
vault.sys.status()
vault.sys.unseal(key)
vault.sys.seal()

Namespaces

vault.namespaces.list()
vault.namespaces.get(name)
vault.namespaces.create(name)
vault.namespaces.delete(name)

Policies

vault.policies.list(ns=None)
vault.policies.get(name, ns=None)
vault.policies.create(yaml, ns=None)
vault.policies.delete(name, ns=None)

Client Management

vault.set_token(token)    # Change the auth token after construction
vault.close()             # Close the underlying HTTP connection

Use as a context manager for automatic cleanup:

with Vibr8Vault("http://localhost:8200", "your-token") as vault:
    secret = vault.secrets.read("apps/backend/prod")

Error Handling

from vibr8vault import Vibr8Vault, Vibr8VaultError

vault = Vibr8Vault("http://localhost:8200", "your-token")

try:
    secret = vault.secrets.read("nonexistent/path")
except Vibr8VaultError as e:
    print(f"Error: {e} (HTTP {e.status})")

Requirements

  • Python 3.9+
  • A running Vibr8Vault instance

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vibr8vault_sdk-0.5.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vibr8vault_sdk-0.5.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file vibr8vault_sdk-0.5.0.tar.gz.

File metadata

  • Download URL: vibr8vault_sdk-0.5.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for vibr8vault_sdk-0.5.0.tar.gz
Algorithm Hash digest
SHA256 7221ae4ad06869bfb646cc8045554d58a9e085b38de8104fa2fdd87e0c799a01
MD5 beaa6b8f45a4850fa90f7667af161915
BLAKE2b-256 1f488c5ae68d23c914f1ad9cf998d87a221eec93ea4d04ea33ceba8bb47e64a3

See more details on using hashes here.

File details

Details for the file vibr8vault_sdk-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: vibr8vault_sdk-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for vibr8vault_sdk-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 422cbe47543753d85e9223b2b470218ee27cb41e666821980977eb31838d837e
MD5 ba85ee0991ae3f65c5354a0b377588fa
BLAKE2b-256 29034c03b2f7d9300f2868375c9e56afc3b9286381abf89df37b679007ab6dba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page