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.
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.tar.gz
(2.7 kB
view details)
Built Distribution
File details
Details for the file secret_lib-0.1.tar.gz
.
File metadata
- Download URL: secret_lib-0.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bf681d6deb6e3518893df4163da99579caf530e2ba4dedfb839eb202ce389f8 |
|
MD5 | 9b1b4d710b231ca5b2305642739696c1 |
|
BLAKE2b-256 | b846accaef947c2c306883ce41fc8b276b0c7007ac4f41d4b74813f07800d9b3 |
Provenance
File details
Details for the file secret_lib-0.1-py3-none-any.whl
.
File metadata
- Download URL: secret_lib-0.1-py3-none-any.whl
- Upload date:
- Size: 3.8 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 | 93608ff4faa6e03997f13b1366984881cd5fdbdca689486832aaa9180a8b769c |
|
MD5 | 63e3f14f62b9a1db653acf042ab9af49 |
|
BLAKE2b-256 | 3a2642d6c8b7b27c07f83a541f06d07587a25c0693622723c823bc8c354fced9 |