Skip to main content

Pydaconf Plugic for Hashicorp Vault and OpenBao

Project description

Pydaconf Plugin for Hashicorp Vault and OpenBao

Currently, the plugin supports only the KV (v1 and v2) secrets engines. The supported authentication methods are userpass, approle and token.

Note If you need additional engines or authentication methods, please open a Feature Request ISSUE

GitHub Workflow Status GitHub last commit GitHub downloads PyPI - Version PyPI - Python Version

Pydaconf

For more information about Pydaconf see the Docs.

Installation

Install using pip install pydaconf-plugins-vault

A Simple Example

  • Create config file in toml, yaml or json
secret: VAULT:///server=https://myvault.mydomain.com,auth_method=userpass,path=application/,key=password,kv_version=2,mount_point=kv_v2
  • Create Pydantic Model and load the configuration
from pydaconf import PydaConf
from pydantic import BaseModel


class Config(BaseModel):
    secret: str

provider = PydaConf[Config]()
provider.from_file("config.yaml")
print(provider.config.secret)
  • Provide environment variables and run the app
export VAULT_USERNAME=myusername
export VAULT_PASSWORD=mypassword
python main.py

Supported parameters

Parameters can be passed in the configuration value in the following format:

VAULT:///param1=value1,param2=value2
Parameter Description
server URL to the vault or openbao instance
auth_method Currently the plugin supprot userpass, approle and token authentication
path path to the secret in KV store
key key of the secret that contains the specific credential
kv_version Supports version 1 or 2 of the KV secrets engine. If not provided, it will use version 2 by default
mount_point Mount point of the KV secrets engine (e.g. kv/)

Authentication environment variables

Based on the provided authentication method, the plugin will use the following environment variables:

  • userpass - VAULT_USERNAME and VAULT_PASSWORD
  • approle - VAULT_APPROLE_ID and VAULT_APPROLE_SECRET
  • token - VAULT_TOKEN

Note You will need to provide the required variables before you start the application.

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

pydaconf_plugins_vault-0.1.0.tar.gz (52.4 kB view details)

Uploaded Source

Built Distribution

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

pydaconf_plugins_vault-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file pydaconf_plugins_vault-0.1.0.tar.gz.

File metadata

  • Download URL: pydaconf_plugins_vault-0.1.0.tar.gz
  • Upload date:
  • Size: 52.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for pydaconf_plugins_vault-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5517b8b723df14c64032331f67c8bf621aa53e2aad1f2ac367b92fb2cd6f5a6f
MD5 85866db1d75ca240499443011fb1256a
BLAKE2b-256 b3bf301ff1626783bf92349810afd468a3a15cd85028539de2cee3ed9cad7c2b

See more details on using hashes here.

File details

Details for the file pydaconf_plugins_vault-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pydaconf_plugins_vault-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f15caf7057e6adb7e1a10327a4173346a19513c4850f45b9a07e2a7578a25e5
MD5 af463d63024bbe7b4044f69017bf1a90
BLAKE2b-256 7268cae5a594e8cfd00557e290fb09c7947797492c5c6ba507ff5972c448c6bf

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