Skip to main content

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: https://github.com/topicusonderwijs/keyhub-sdk 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.4.2.tar.gz (10.3 kB view details)

Uploaded Source

File details

Details for the file keyhub-0.4.2.tar.gz.

File metadata

  • Download URL: keyhub-0.4.2.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for keyhub-0.4.2.tar.gz
Algorithm Hash digest
SHA256 b66457c6a895167b1a970dc6e0c85169bc60ab5b04bc7ad03b221f1345396d59
MD5 7698b986ac5d9c7deb6a45b19aa34ef2
BLAKE2b-256 02506d4fe80d507bc79483eeb015712725606fcc52623d0424e1bad24c07b93b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page