Skip to main content

Get value from Google Cloud Secret Manager.

Project description

get_gcp_secret

Get value from Google Cloud Secret Manager.

Installation;

pip install get_gcp_secret google-cloud-secret-manager
pip install get_metadata  # optional

OR Write get_gcp_secret in requirements.txt.

# requirements.txt sample
get_gcp_secret
google-cloud-secret-manager  # required
get_metadata  # optional

How to use.

import get_gcp_secret

# GCP Project ID will be automatically detected("get_metadata" required).
# OR set GCP project ID manually.
get_gcp_secret.set_project_id("Project ID string")

# get secret text
secret_name = "secret name string"
secret_ver = 2 # or "2"
secret_text = get_gcp_secret.get_secret_text(secret_name, secret_ver)
# when secret_ver is omitted, 'latest' will be used.
# secret_text = get_gcp_secret.get_secret_text(secret_name)

# get secret text(secret name/version from env)
env_secret_name = "secret name env name"
env_secret_ver = "secret ver env name"
secret_text = get_gcp_secret.get_secret_text_from_env(env_secret_name, env_secret_ver)

# when secret_ver is omitted, 'latest' will be used.
# secret_text = get_gcp_secret.get_secret_text_from_env(env_secret_name)

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

get_gcp_secret-0.0.5.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

get_gcp_secret-0.0.5-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file get_gcp_secret-0.0.5.tar.gz.

File metadata

  • Download URL: get_gcp_secret-0.0.5.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for get_gcp_secret-0.0.5.tar.gz
Algorithm Hash digest
SHA256 807ea932db0c99f27611fe72f91e09f201c1ac0e4d07e317c270db3a1a184a11
MD5 45434b0876f2cb8fb6aa75590d5fb7e8
BLAKE2b-256 50df7fc0989eff7652dd2c116b0bf203fd70e3644965d08305327bc4312758c2

See more details on using hashes here.

File details

Details for the file get_gcp_secret-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: get_gcp_secret-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for get_gcp_secret-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2245cc2e5de99a547839d35c06274c32b6807729eb41a9f6959e05310548bd38
MD5 4173340aa5c3f6fff321a264f1b16fc4
BLAKE2b-256 5f3deebda166e8fa930fa6e89f2b9286c06b37003e0f26acc5d63a1d7c9e0a1d

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