Skip to main content

Python SDK for DS Vault - (envelope pattern)

Project description

DS Vault Python SDK

Features

  • GetSecret
  • TTL + LRD Cache (KEK & records)
  • Psql and Memory repositories

Quickstart

Postgres - plain:

from vault import DSVaultClient
from vault.repositories.postgres import PostgresSecretRepository

repo = PostgresSecretRepository(dsn="postgresql://user:pass@host:5432/db", table="public.secrets")

client = DSVaultClient(repository=repo)

secret_bytes = client.get_secret(key=key)
print(secret_bytes.decode())

Managed KMS context:

client = DSVaultClient(
    repository=repo,
    encryption_context_defaults={"app": "payments-api", "env": "prod"},
)

Tests

Execute tests by setting environment variables to manage import paths, and call pytest.

export PYTHONPATH="src"
pipenv run pytest

Environment

Currently support dev and prod environment, defined by setting environment variable BUILDING_MODE, e.g.:

export BUILDING_MODE="dev"

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

ds_vault_py_sdk-1.0.0a1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

ds_vault_py_sdk-1.0.0a1-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file ds_vault_py_sdk-1.0.0a1.tar.gz.

File metadata

  • Download URL: ds_vault_py_sdk-1.0.0a1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ds_vault_py_sdk-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 80d06b67da7998d8c91163cc62c111335c7be3c8d5585501af91cb9de56076aa
MD5 bd67e9a61745b3fead5d232bc192c21e
BLAKE2b-256 5e6aba5632a168d0752801e2bd09971a72fcfed3845b44d3557f31e8af30a900

See more details on using hashes here.

File details

Details for the file ds_vault_py_sdk-1.0.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for ds_vault_py_sdk-1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 e21f2019313a1d832eae72a23db0847b8aa20c83ffeef62f4b94d28ada4304ab
MD5 2ec5ccdb70a0ffd2c3dd0e341ea5b0e6
BLAKE2b-256 1b2d25258d5165f7148246219b5afcd0207feca452dfbc42f2e2c40d754c298e

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