Make API calls to Vault Secrets to retrieve secrets.
Project description
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 Application Client ID
Secrets Vault Application 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(
APPLICATION_CLIENT_ID,
APPLICATION_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 APPLICATION_CLIENT_ID -s APPLICATION_CLIENT_SECRET -n 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
Built Distribution
Hashes for vault_secrets-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8432a3945564517500ff35ddd60bfd43dcb6f6a340b855f9e9b5f3314ca73fd5 |
|
MD5 | b43689de89b66fe60b2be2fc37e78884 |
|
BLAKE2b-256 | c8c02609be7d370f5e696eea6135fa1dad6641bf946e2a23f3163af1de1e1c90 |