winwin-vault
A read-only Python client for HashiCorp Vault, with automatic token renewal and dynamic secret caching.
Installation
pip install winwin-vault
Quick Start
from winwin_vault import VaultClient
# Uses VAULT_ADDR and auth method from environment
client = VaultClient.from_env()
# Read a KV v2 secret
secret = client.read_kv("config")
print(secret["api_key"])
# Read database credentials (cached with TTL)
creds = client.read_database_creds("my-role")
print(creds.username, creds.password)
# Read Alicloud STS credentials (cached with TTL)
alicreds = client.read_alicloud_creds("my-role")
print(alicreds.access_key, alicreds.secret_key, alicreds.security_token)
Authentication
VaultClient.from_env() auto-detects the auth method:
| Environment | Auth Method |
|---|---|
VAULT_TOKEN set |
EnvTokenAuth |
~/.vault-token present |
EnvTokenAuth |
| Kubernetes ServiceAccount | KubernetesAuth |
| Vault Agent socket | VaultAgentAuth |
TLS is enforced for all auth methods except VaultAgentAuth (which communicates over a local Unix socket).
Mount Points
Default mount points:
- KV v2:
secret - Database:
database - Alicloud:
alicloud
Change via setters:
client.set_kv_mount_point("internal")
client.set_database_mount_point("database")
client.set_alicloud_mount_point("alicloud")
Exception Handling
from winwin_vault import VaultClient, VaultClientError, VaultSecretNotFoundError
try:
secret = client.read_kv("config")
except VaultSecretNotFoundError:
print("Secret not found")
except VaultClientError as e:
print(f"Vault error: {e}")
License
MIT License — see LICENSE file to be added.
Metadata
Release files for winwin-vault 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| winwin_vault-0.1.8.tar.gz | 9.9 kB | Without provenance | Details for winwin_vault-0.1.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| winwin_vault-0.1.8-py3-none-any.whl | Python 3 | none | any | Details for winwin_vault-0.1.8-py3-none-any.whl |
Total release size: 22.3 kB
Release files / winwin_vault-0.1.8.tar.gz
| Download URL | winwin_vault-0.1.8.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21f7fb7e4d00a7436b5345a52e832a7a61e27d348d360bce9d2f97bfe7e04192
|
|
BLAKE2b-256 checksum How to use checksums |
872147390dda8f0ee257103d649bb0445e87aa94def728f1468e5dcb0245a9f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / winwin_vault-0.1.8-py3-none-any.whl
| Download URL | winwin_vault-0.1.8-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7aa7830750b19c07bf1b0450c55b1e23ad9a4e06937d73d182ba9c93650fe616
|
|
BLAKE2b-256 checksum How to use checksums |
32902fc2cc812ccd857210f334551cd944a2bed2902826accd306108b6a905e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for winwin-vault 0.1.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.