Skip to main content

Decipher the Berglas keys

Project description

Overview

Python library help to use Berglas and to decrypt the secrets stored in a GCP storage.

See Berglas for details about bucket bootstrapping and secret creation

Library Usage

You have to get the library

pip install berglas-python

Then use it in the same way as Go library

The library berglas_python library is able to:

Here an example of usage

import os

import berglas_python as berglas

project_id = os.environ.get("MY-PROJECT")

# This higher-level API parses the secret reference at the specified
# environment variable, downloads and decrypts the secret, and replaces the
# contents of the given environment variable with the secret result.

berglas.Replace(project_id, "MY-SECRET")

# This lower-level API parses the secret reference, downloads and decrypts
# the secret, and returns the result. This is useful if you need to mutate
# the result.
my_secret = os.environ.get("MY-SECRET")
plaintext = berglas.Resolve(project_id, my_secret)
os.environ.unsetenv("MY-SECRET")
os.environ.setdefault("MY-SECRET", plaintext)

License

This library is licensed under Apache 2.0. Full license text is available in LICENSE.

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

berglas_python-0.2.5.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file berglas_python-0.2.5.tar.gz.

File metadata

  • Download URL: berglas_python-0.2.5.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for berglas_python-0.2.5.tar.gz
Algorithm Hash digest
SHA256 df8a7ce70d9fab523514ed94e98f810800aa655757a923efd61f19395133a602
MD5 497e2dd07eefda4d522ccece82f34d25
BLAKE2b-256 c99216db5b90b5e14b882ce1234437e4a41857cdbac07aec411f5fc09273eff0

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