secretconf
Manage your secret configurations easily
Installation
pip3 install secretconf --user
Usage
secretconf is a library to manage (encrypt/decrypt) your credentials on demand using public key encryption.
Hush
hush is a commandline utility installed with secretconf to make your life easier to store and update credentials
hush --section twittermain --fields 'user,__token' --privatekey ~/.ssh/id_rsa
hush --help
Usage: hush [OPTIONS]
Options:
--section TEXT Section (Appname)
--privatekey TEXT Privatekey path
--configpath TEXT Secret configuration path
--fields TEXT quoted comma separated fields; secret fields are prefixed with __
--help Show this message and exit.
Data storage
You can configure where to save the data using --configpath which is set to /tmp/secrets.conf by default.
[twittermain]
user = ahmed
__token = eYCWre9l7IauoHs6K3D5J2wkgnQQBtFV4CoZE3W4tpbxa7Z7Qt+c/LnQhSI=
Please notice that you can't use multiple keys on the same
configpathfile
API usage
secretconf documentation
make_config
def test_make_config_creates_file_with_encrypted_data():
make_config(APPNAME, {'user': USER, '__password': PASSWORD},
config_path=TEST_CONFIG_PATH, private_key=hashedsk)
assert os.path.exists(TEST_CONFIG_PATH)
with open(TEST_CONFIG_PATH, 'r') as f:
content = f.read()
assert "user" in content
assert USER in content
assert "__password" in content
assert PASSWORD not in content
read_config
conf = read_config(APPNAME, config_path=TEST_CONFIG_PATH,
private_key=hashedsk)
assert APPNAME in conf
assert 'user' in conf[APPNAME]
assert '__password' in conf[APPNAME]
assert conf[APPNAME]['user'] == USER
assert conf[APPNAME]['__password'] == PASSWORD
Testing
secretconf tests exists in tests directory
- basic tests
test_basic.py: encryption/decryption and usage ofmake_configandread_config - property based tests
test_properties.py
You can use pytest tests or just tox make sure to install requirements-test.txt or make test
Generating Docs
make gendocs
Requirements
- setuptools==38.5.0
- click==6.7
- PyNaCl==1.2.1
- npyscreen==4.10.5
License
Software is provided as is under BSD 3-Clause License
Authors
secretconf was written by Ahmed Youssef <xmonader@gmail.com>_.
Metadata
Release files for secretconf 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| secretconf-0.1.2.tar.gz | 5.1 kB | Without provenance | Details for secretconf-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| secretconf-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for secretconf-0.1.2-py3-none-any.whl |
Total release size: 12.6 kB
Release files / secretconf-0.1.2.tar.gz
| Download URL | secretconf-0.1.2.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
89aa68c7bcd995aad277a0dadaaf9f92c2e22d56a17bc4f923a01077e097eb47
|
|
BLAKE2b-256 checksum How to use checksums |
47f91be6f60067709d34af73e9177f9abea227ec76873d8e7dcd50ec8bc11e69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
|
Release files / secretconf-0.1.2-py3-none-any.whl
| Download URL | secretconf-0.1.2-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e1b556b3de83852b9ae97a85b0041987968689efd6673f2cfbb5d5808c968e02
|
|
BLAKE2b-256 checksum How to use checksums |
c1fdf08ccc9792e027a7b2d1b376568310bfd487d260123ca1bd628517029ecd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
|
Security for secretconf 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.