Skip to main content

Robocorp Control Room Vault API integration library

Project description

Robocorp Control Room Vault API library

robocorp-vault is a library which provides read and write access to the Vault at Robocorp Control Room.

Usage

from robocorp import vault
from robocorp import log 

def reading_secrets():
    secrets_container = vault.get_secret('secret_name')
    # Shows secret keys available:
    print(f"My secrets: {secrets_container}")
    # Note: actually prints the secret value below.
    print(f"Username: {secrets_container['username']}")

def modifying_secrets():
    secret = vault.get_secret("swaglabs")
    with log.suppress_variables():
        secret_value = collect_new_secret_value()
        secret["username"] = secret_value
        vault.set_secret(secret)

Note that values set or gotten from the vault will be automatically hidden from robocorp.log logs (if robocorp.log is available in the environment), but care needs to be taken when setting it so that secrets don't become exposed before being set into the vault.

i.e.: When setting values into the vault, if such values are sensitive, use with robocorp.log.suppress_variables() so that such value doesn't become logged before it's received by the vault.

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

robocorp_vault-1.0.0.tar.gz (9.1 kB view hashes)

Uploaded Source

Built Distribution

robocorp_vault-1.0.0-py3-none-any.whl (11.0 kB view hashes)

Uploaded Python 3

Supported by

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