Skip to main content

vault_secrets

Overview

Make API calls to Vault Secrets to retrieve secrets.

Prerequisites

Required:

  • Python requests module

  • Secrets Vault Organization ID

  • Secrets Vault Project ID

  • Secrets Vault Application Name

  • Secrets Vault Organization Client ID

  • Secrets Vault Organization Client Secret

Optional:

  • Secret Name (to return the latest value of a specific secret)

Organization and Project IDs can be retrieved using the vlt CLI: https://developer.hashicorp.com/vault/tutorials/hcp-vault-secrets-get-started/hcp-vault-secrets-retrieve-secret

Usage

Installation:

pip3 install vault_secrets
python3 -m pip install vault_secrets

Execution:

In Python3, to get all secrets in an application:

import vault_secrets

# Get access token.
token = vault_secrets.get_token(
   ORGANIZATION_CLIENT_ID,
   ORGANIZATION_CLIENT_SECRET
)

# Get secrets.
secrets = vault_secrets.get_secrets(
   token,
   ORGANICATION_ID,
   PROJECT_ID,
   APPLICATION_NAME
)

In Bash, to get a specific secret value:

secret_value="$(python3 </path/to/>vault_secrets -o ORGANICATION_ID -p PROJECT_ID -a APPLICATION_NAME -c ORGANIZATION_CLIENT_ID -s ORGANIZATION_CLIENT_SECRET -n SECRET_NAME)"

Release files for vault_secrets 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vault_secrets 1.0.4
File Size Uploaded
vault_secrets-1.0.4.tar.gz 2.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vault_secrets 1.0.4
File Interpreter ABI Platform
vault_secrets-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 6.0 kB

Release files / vault_secrets-1.0.4.tar.gz

Download URL vault_secrets-1.0.4.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4ffae87f9f172351abeeed28e6cefbb8c80eb976662bcab798d1d5b15064fd03
BLAKE2b-256 checksum
How to use checksums
bf6a3f03bd009203260025bbaf5ab33411dd6faa684db8467e3b12151667fcdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/5.4.109+

Release files / vault_secrets-1.0.4-py3-none-any.whl

Download URL vault_secrets-1.0.4-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4639fe819d095712d0a905b718f1848808e79016d0211c5091e01e29a6493271
BLAKE2b-256 checksum
How to use checksums
bc5145e353b53905b7f04b25df0ccec98f873730708fb3344b2c170a89c202de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/5.4.109+

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page