A wrapper for different configuration/secret sources.
Project description
Secrets Wrapper
This is a library for wrapping up different ways of accessing secrets and configuration.
Install with pip install secret-lib
. The project is on Pipy.
Dotenv files
Gets values from .env files. Good for development purposes.
from secret_lib import EnvFileSecret
my_secrets = EnvFileSecret(file_path="/my/path/.env")
secret_one = my_secrets.get("secret_one")
Environ values
Gets values from system variables. Gets all the variables prefixed with the specified string.
from secret_lib import EnvironSecret
my_secrets = EnvironSecret(prefix="MY_APP_")
secret_one = my_secrets.get("secret_one")
HaShiCorp Vault
Uses HSC Vault with the hsc-vault python library. Needs a fully configured and authenticated hvac.Client
.
import hvac
from secret_lib.hsc_vault import HscVaultSecret
# Create a client instance
client = hvac.Client(url='https://vault.trustnet.app:8200')
client.auth.userpass.login(
username='username',
password='password'
)
secret = HscVaultSecret(client=client, paths=['secret/data/l0', 'secret/data/l1'])
first_secret = secret.get('first_secret')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
secret_lib-0.1.1.tar.gz
(2.8 kB
view details)
Built Distribution
File details
Details for the file secret_lib-0.1.1.tar.gz
.
File metadata
- Download URL: secret_lib-0.1.1.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb16fdcad20bd19cd206e5668909aeb59eaa9af7dce69c957f24d7fa1e74579c |
|
MD5 | e8bf3539a6bb886c9c6afa4760dcb19a |
|
BLAKE2b-256 | 6fd85068514316f8a997a77688125481e6f937620a73a115dab8e01f71de9b23 |
File details
Details for the file secret_lib-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: secret_lib-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80b57f7d33194f7d5436f80a71581278b3a1845d61db88f606ab28adbc3a9f41 |
|
MD5 | ea0a982c0b81a80e01684ccef193f7ec |
|
BLAKE2b-256 | 457e2fca8ca1377a857fac574e211b081e4dc99e85c52628045beb84a7a9065f |