A module to handle secrets outside of projects
Project description
Stored Secrets handling module in Python
storedsecrets is a module implementing a simple approach to keep
your secrets (API keys, passwords, ...) outside of your project files,
so that you can protect them better (e.g. in an encrypted archive, or
any form of external volume), and you don't leak them accidentally
through your favorite versioning tool and platform.
storedsecrets exposes a StoredSecrets class to handle your secrets.
Typical usage:
>>> import storedsecrets
>>> my_secrets = storedsecrets.StoredSecrets("mysecretfile.json")
>>> API_KEY = my_secrets.get('API_KEY')
If the path of the file is not absolute, it will be searched for in
the directory named in env var SECRETS, or in ~/etc/secrets by
default.
This is minimalist work for the moment.
Ideas for the future
-
make sure all aspects of list / dict are implemented (iterables)
-
could be interesting to implement a kind of path (à la XPath) search for secrets -
secrets['a/sub/secret']instead of inelegantsecrets['a']['sub']['secret']. -
get ready for Docker? Allow the use of Docker Secrets?
-
manage the "set" operations ? Might not be a good idea, though.
Track changes
Changes in 0.1.3
-
the
loadfunction no longer fails silently, but raises the caught exception again. This is more pythonic. -
a
__getitem__function has been added, allowing the use of[]notation to get an element.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file storedsecrets-0.1.3.tar.gz.
File metadata
- Download URL: storedsecrets-0.1.3.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01d1b1bf3b31408db59cd8603ef9324c8a16213cdd617fcbbf4b68111a21a6db
|
|
| MD5 |
95f1ec9f4d03b7c04d4c053233f199f3
|
|
| BLAKE2b-256 |
b2152ee7b5bc6dfff0a203d8abe816fd5e345ca2229820b0bea566ee93d053a7
|
File details
Details for the file storedsecrets-0.1.3-py3-none-any.whl.
File metadata
- Download URL: storedsecrets-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
043b1878312a5058072b9fe7474b71e865df6044b80e25084c01ec466b377791
|
|
| MD5 |
e4eff834de2d3b463130b456ac669013
|
|
| BLAKE2b-256 |
9663de81b18b90eef16f44163003deca1107de973370cebe5b4e4d9a5b31d8fa
|