A simple package to read credentials generated by systemd's LoadCredential, with a fallback on environment variables.
Project description
loadcredential
This is a simple python package for interfacing with systemd's LoadCredential
mechanism.
It allows reading secrets from the credentials directory, with a fallback on environment variables if needed.
Usage
Basic usage
from loadcredential import Credentials
credentials = Credentials()
secret1 = credentials["SECRET_1"]
Changes
v1.1 (2024-05-10)
- Added
credentials.get(key, default=None)
which returns a default value and does not raise an error when the key is absent - Added
credentials.get_json(key, default = None)
which treats the imported secret as json data
v1.0 (2024-05-09)
Initial version
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
loadcredential-1.1.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for loadcredential-1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e6710ceb44f0595184dc1437a2eb79b3757f61cf977a1d3fedb7e02d0083e1a |
|
MD5 | 16f48f9d6c09dceaff93b1e26fa33f92 |
|
BLAKE2b-256 | 4ca296f88fa449c513bbe95fb20e683ec77b60720558f50fe94a67655dad638c |