Skip to main content

Extentsion to load vault screts in jinja templates

Project description

Jinja2 library for loading Vault screts

The idea behind this project is to allow dynamically loading vault secrets in applications like cookiecutter.

Installation

To install just run pip install jinja2-vault

Usage

Add the jinja2 secret function like this:

from jinja2 import Environment, Template
env = Environment(
    extensions=['jinja2-vault.VaultExtension']
)

template = env.from_string('password={% secret "password", path="database", mount="app1/secret" %}')
result = template.render()
print(result)

This example load key password from app1/secret/database where app1/secret is the mount and database the path.

Setup for cookiecutter

TBB

Todo

[ ] Add some unit tests

Build

To build and push the package: python setup.py sdist python -m twine upload dist/*

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

jinja2-vault-0.0.2.tar.gz (2.3 kB view details)

Uploaded Source

File details

Details for the file jinja2-vault-0.0.2.tar.gz.

File metadata

  • Download URL: jinja2-vault-0.0.2.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for jinja2-vault-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a77784fc8cd0d280497fef234bb204d5abd168d34f6c9c214744259b111f6358
MD5 72d048c31212ebded930fa977a7cee77
BLAKE2b-256 2f19392658dbb9e40c4736e8f4ffe0e254a496845c7171a391604d4650236a2c

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