Skip to main content

dbwarden-sandbox

Sandboxed config and model loading for DBWarden.

DBWarden discovers configuration by scanning your project for database_config() calls. Files found at the project root are isolated: they are not part of any package, so importing them normally would execute arbitrary code found by a filesystem scan. This plugin loads them under a restricted importer instead.

Hooks

Hook Behavior
load_config_module Rejects path traversal and paths outside the project tree, then executes the file with a meta-path finder that permits only dbwarden imports.
load_model_module Rejects path traversal. Model paths are user-declared in database_config(), so they import normally otherwise.

An isolated config file that imports anything but dbwarden raises SecurityError. Config files that live inside your application package are imported normally, since they are already part of code you ship. Set DBWARDEN_DISABLE_SANDBOX=1 to fall back to a plain import when debugging.

Installation

dbwarden plugin add dbwarden-sandbox

Trust tier

This is an official DBWarden plugin. Its distribution name is classified before any of its code is imported, and dbwarden plugin add verifies the PyPI Trusted-Publishing attestation (PEP 740) against dbwarden-org/dbwarden-sandbox before installing. It loads automatically once installed, with no dbwarden plugin trust step.

Development

uv venv && uv pip install -e . -e ../dbwarden pytest
pytest -q

The tests/test_conformance.py suite runs DBWarden's shared conformance harness (dbwarden.plugin_conformance): entry point resolution, no import-time side effects, hook signatures, public-API-only imports, and idempotent setup().

License

MIT

Download files

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

Source Distribution

dbwarden_sandbox-0.1.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

dbwarden_sandbox-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file dbwarden_sandbox-0.1.0.tar.gz.

File metadata

  • Download URL: dbwarden_sandbox-0.1.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for dbwarden_sandbox-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1190cf63e8529caa89924e75bebd3b8a6b663a9c19e7b8d0d4636311c0e039dc
MD5 7242cd7a14e3a25cb0df788b85c1f4f4
BLAKE2b-256 b057325839875edb514a7ec387f458b56534da0b0a3ad2944135d2551132fa55

See more details on using hashes here.

File details

Details for the file dbwarden_sandbox-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dbwarden_sandbox-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c022f9fa1b8dd2db5d10c74a0a794ebac92623303a43a48f0c880909f73bc1a
MD5 58a8bc3a83b1aa6a07b9c560b870e2d3
BLAKE2b-256 57b9422caa314ed2c8357d3f0a63c5f9f2fbfdebbf94656a6f87336de58f539b

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