Skip to main content

Unified credentials framework — encrypted config, OS keystore, Vaultwarden integration

Project description

Locke — Python

Unified credentials framework — encrypted config, OS keystore, Vaultwarden integration.

Install

For local development from this repository:

cd python
pip install -e ".[dev]"

From the repository root on macOS, install the public Locke CLI/package locally:

python3 -m pip install -e ./python
locke --version

The locke executable is installed into the active Python environment's bin directory, so make sure that directory is on your PATH.

Usage

Library

import locke

# Load and decrypt config → flat env vars
env = locke.load_config(".locke/config.encrypted.json")
# env["MONGO_URI"], env["SENTRY_DSN"], etc.

# Resolve a single credential
cred = locke.resolve_credential("LOCKE_ENCRYPTION_KEY")

# Get a vault secret
secret = locke.get_vault_secret("myproject/staging/api_key")

CLI

# Decrypt + flatten → shell exports
eval $(locke env)

# Decrypt to stdout
locke decrypt

# Encrypt plaintext config
locke encrypt

# Manage OS keystore
locke keystore set LOCKE_ENCRYPTION_KEY --prompt
locke keystore get LOCKE_ENCRYPTION_KEY

# Get vault secret
locke vault get myproject/staging/api_key

# Initialize project
locke init --project myproject --tenant staging

Environment Variables

Variable Purpose
LOCKE_ENV Override environment detection
LOCKE_ENCRYPTION_KEY Encryption key (if not in keystore)
LOCKE_USE_BIOMETRIC Set false to disable biometric gating
LOCKE_VAULT_URL Vaultwarden server URL
LOCKE_VAULT_USERNAME Vaultwarden username

Testing

cd python
pip install -e ".[dev]"
pytest

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

locke-0.5.2.tar.gz (82.0 kB view details)

Uploaded Source

Built Distribution

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

locke-0.5.2-py3-none-any.whl (50.6 kB view details)

Uploaded Python 3

File details

Details for the file locke-0.5.2.tar.gz.

File metadata

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

File hashes

Hashes for locke-0.5.2.tar.gz
Algorithm Hash digest
SHA256 0ca915e11f2402130b82dec5d548f5f002e5be11e50ce9f6b5eb148f6b361d98
MD5 07f2f72bef580c9015d2d3d24e40e31d
BLAKE2b-256 d975fa8eec93a92f0ba7d05e5ab4cf552776051c87189f1545bf7977e3a5bc8a

See more details on using hashes here.

File details

Details for the file locke-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: locke-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 50.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for locke-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 198042713553c69aa036f56e2008bd83ab6d397fbdcd9235e94b4a1112c51adb
MD5 be76217543a27fb0dde2eadbad091077
BLAKE2b-256 1ad43c6c2a030dc68fbeb13a41c2aac542797bb7e0790a9734b0e3acaa56a5e1

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