Python client for the Topicus KeyHub Vault API
Project description
keyhub-python-sdk
SDK for KeyHub written in Python
Python client for the Topicus KeyHub Vault API, supported under python 3 (only tested with 3.6).
Basic usage:
import keyhub
keyhub_client = keyhub.client(uri='<your KeyHub uri>', client_id='<KeyHub application id>', client_secret='<KeyHub application secret>')
keyhub_vault = keyhub.vault(authentication=keyhub_client_auth)
print(keyhub_client.info())
keyhub_client.get_group('<group uuid>')
keyhub_client.get_vault_records('<group uuid>')
keyhub_client.get_vault_record('<group uuid>', '<vault record uuid>')
keyhub_client.get_account_record(account_uuid='<useraccount uuid>')
keyhub_client.get_account_record(account_username='<useraccount username>')
payload = {
'items': [
{
"$type": "vault.VaultRecord",
'additionalObjects': {
'secret': {
'$type': 'vault.VaultRecordSecrets',
'password': 'super-secure-password123',
"comment": "This is an example record, nothing special"
}
},
'name': 'KeyHub example record',
'username': 'my-username',
'color': 'PINK_LAVENDER', # PINK_LAVENDER, RED, ANDROID_GREEN, DARK, NONE, BLUE, SAGE, ARTICHOKE, CRIMSON_RED, GREEN, MIDDLE_YELLOW
'url': 'https://topicus-keyhub.com',
'endDate': '2023-05-25',
'warningPeriod': 'ONE_MONTH' # AT_EXPIRATION, TWO_WEEKS, ONE_MONTH, TWO_MONTHS, THREE_MONTHS, SIX_MONTHS, NEVER
}
]
}
post_vault_record = keyhub_vault.post_vault_record(group_uuid=settings['vault_uuid'], payload=payload)
This repository is a cherry pick from the original authors repo and modified to fit some more specific needs.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
keyhub-0.5.0.tar.gz
(10.1 kB
view details)
File details
Details for the file keyhub-0.5.0.tar.gz.
File metadata
- Download URL: keyhub-0.5.0.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3307b8666b43f85968ccfdb5bf75901c11e3422cb8c6e4089d83d8ea8321f529
|
|
| MD5 |
a52d96e2adc073850f80bb497dbb8ddf
|
|
| BLAKE2b-256 |
0cce5f62d9380cc86f31039c56f1183ad3b296c681a9fe5d7f01f2afbcf58d99
|