Skip to main content

MeVault Python SDK — request secrets from the local MeVault broker

Reason this release was yanked:

it is missing sdk, new version has it

Project description

MeVault Python SDK

Request secrets from the MeVault broker in Python — no passwords, no env-var leakage, no subprocesses.

Requirements

  • Python 3.9+
  • Windows (the broker communicates over a Windows named pipe)
  • MeVault broker running and vault unlocked

Installation

pip install mevault

Or from source:

cd sdk/python
pip install -e .

Usage

Synchronous

from mevault import get_secret, get_optional_secret
from mevault.exceptions import VaultLocked, SecretNotFound, MeVaultUnavailable

# Raises SecretNotFound if the secret doesn't exist.
db_password = get_secret("DB_PASSWORD")

# Returns None (or a custom default) if the secret doesn't exist.
api_key = get_optional_secret("OPTIONAL_API_KEY", default="")

Asynchronous

import asyncio
from mevault import async_get_secret

async def main():
    token = await async_get_secret("AUTH_TOKEN")
    # use token ...

asyncio.run(main())

Error handling

Exception When raised
MeVaultUnavailable Broker not running / pipe not found
VaultLocked Vault is locked — user must unlock MeVault
SecretNotFound No secret with that name
AccessDenied Process not permitted to read the secret
SessionExpired Broker session expired — user must re-authenticate
ProtocolError Malformed or oversized broker response

All exceptions derive from MeVaultError.

from mevault.exceptions import MeVaultError

try:
    value = get_secret("MY_SECRET")
except MeVaultError as exc:
    # Handle any MeVault error generically.
    print(f"MeVault error: {exc}")

Security notes

  • Secret values are never logged or printed by the SDK.
  • SecretValue.__repr__ and __str__ return <redacted> to prevent accidental exposure in logs or tracebacks.
  • The SDK does not accept vault passwords and does not spawn subprocesses.
  • The SDK does not place secrets in environment variables.
  • Each request uses a fresh pipe connection, closed immediately after the response is received.

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

mevault-0.3.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

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

mevault-0.3.1-py3-none-win_amd64.whl (9.2 kB view details)

Uploaded Python 3Windows x86-64

File details

Details for the file mevault-0.3.1.tar.gz.

File metadata

  • Download URL: mevault-0.3.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for mevault-0.3.1.tar.gz
Algorithm Hash digest
SHA256 bcb50f5d82c642b18a774a016615556c250f7f013586c33e442c7e368abff514
MD5 66f86c2b7e3cec1111a6fa3f57c081a4
BLAKE2b-256 1ee6bbc35b15e3fceb6a70e1e41096ccb391258c14438109e6d9ce5837286e32

See more details on using hashes here.

File details

Details for the file mevault-0.3.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: mevault-0.3.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for mevault-0.3.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 35c7b8b17754a91bd3cbd38ffb13e90c69e94c132f17921084f6bf2c92ccf7b7
MD5 1d786ff6ab0934cfafe922f125e44a96
BLAKE2b-256 4405e048b667703786c57b3e3c1b681a61fb765e5ec356ebce45065c77d541f9

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