Skip to main content

stapel-vault

CI coverage pypi downloads python license

Production secret storage for the Stapel framework. A facade over secret backends behind the stapel_core.secrets provider seam — the first backend is OpenBao / HashiCorp Vault (KV v2; their HTTP APIs are compatible, so one client speaks to both).

Local dev and the minimal preset keep reading secrets from the environment (stapel-core's default provider). In production, where env for secrets is unacceptable, point the seam at stapel-vault and the framework reads SECRET_KEY, JWT_SECRET_KEY, database passwords and LLM pool keys from Vault instead — with no change to the code that consumes them.

Install

pip install stapel-vault      # requires stapel-core with the SecretProvider seam

Wire it up

The provider is selected at settings-bootstrap time (production settings resolve SECRET_KEY before django.setup()), via environment — which is also where Vault's own connection/auth config belongs:

# control plane only — never a workload container (see MODULE.md, S1)
export STAPEL_SECRETS_PROVIDER=stapel_vault.VaultSecretProvider
export VAULT_ADDR=https://vault.internal:8200
export VAULT_K8S_ROLE=stapel-web       # Kubernetes auth (phase 2)

Then any stapel_core.secrets.get_secret("DJANGO_SECRET_KEY") — including the SECRET_KEY / JWT_SECRET_KEY reads in stapel_core.django.settings — comes from Vault. A missing secret is a hard, loud boot failure (fail_closed), not a silent None.

Secret layout (default convention)

A service's secrets are keys of one KV v2 secret (the "bundle") at secret/data/<prefix>/<app> (defaults secret/data/stapel/app):

bao kv put secret/stapel/app \
    DJANGO_SECRET_KEY=... JWT_SECRET_KEY=... POSTGRES_PASSWORD=...

DJANGO_SECRET_KEY then resolves to GET v1/secret/data/stapel/app.data.data["DJANGO_SECRET_KEY"]. Override per name with VAULT_SECRET_MAP (JSON). See MODULE.md for the full config reference, auth methods, rotation, and the deploy-mode map.

Auth methods

Method When Config
token local/dev VAULT_TOKEN
kubernetes prod on k8s (phase 2) VAULT_K8S_ROLE (+ projected SA JWT)
approle prod, non-k8s VAULT_ROLE_ID + VAULT_SECRET_ID

Auto-detected from what is present, or forced with VAULT_AUTH_METHOD.

License

MIT — see LICENSE.

Release files for stapel-vault 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stapel-vault 0.1.4
File Size Uploaded
stapel_vault-0.1.4.tar.gz 18.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stapel-vault 0.1.4
File Interpreter ABI Platform
stapel_vault-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size:34.8 kB

Release files / stapel_vault-0.1.4.tar.gz

Download URL stapel_vault-0.1.4.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6d9f67d186a3cc0d03e48ad73ffa70d59b97db1213f70d06bf7af6748895503e
BLAKE2b-256 checksum
How to use checksums
22745b91c5e0a454143b078e8e11953b7009180f3e56254de4e521f2efb15c62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.

Transparency log

Release files / stapel_vault-0.1.4-py3-none-any.whl

Download URL stapel_vault-0.1.4-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b277c8d7d4b8dd03568fd39f2976926afe1a9c73149cce2adacbac7b896b06cc
BLAKE2b-256 checksum
How to use checksums
ffbca9da090f2a494769a75620d8bab99f69a24bd995c2aea35ad9ff5c41d1bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page