Skip to content

Credential Bridge

Unified secrets management for Python — HashiCorp Vault, system keyring, and .env files through one clean API.

Why Credential Bridge?

🔌 Pluggable backends

Swap between Vault, keyring, and .env with a single constructor argument. Add custom backends in minutes.

🛡️ No silent failures

Every error raises a typed exception — VaultAuthError, EnvFileNotFoundError. Catch exactly what you need.

💻 Cross-platform

Works identically on Windows and Linux. No OS-specific code paths or environment variables.

🖥️ Modern CLI

Rich output, interactive prompts, and tab-completion via the cb unified command.

Quick example

Python
from credential_bridge import SecretsManager

# Vault
sm = SecretsManager("vault", vault_token="s.xxx")
sm.add_secret("myapp/db", {"user": "admin", "pass": "s3cr3t"})

# .env file
sm = SecretsManager("env", path=".env")
sm.add_secret("database", {"DB_HOST": "localhost", "DB_PORT": "5432"})

# System keyring
sm = SecretsManager("keyring", service_name="myapp")
sm.get_secret("api_key")
Python
from credential_bridge import VaultBackend, KeyringBackend, EnvFileBackend

vault = VaultBackend(vault_url="https://vault.example.com", vault_token="s.xxx")
vault.add_secret("myapp/db", {"user": "admin"})

env = EnvFileBackend(path=".env")
env.add_secret("API_KEY", {"API_KEY": "sk-abc123"})