Skip to main content

No project description provided

Project description

Made with pop, a Python implementation of Plugin Oriented Programming Made with Python

About

An Idem plugin to manage resources of HashiCorp’s Vault.

What is POP?

This project is built with pop, a Python-based implementation of Plugin Oriented Programming (POP). POP seeks to bring together concepts and wisdom from the history of computing in new ways to solve modern computing problems.

For more information:

Getting Started

Prerequisites

  • Python 3.7+

  • git (if installing from source, or contributing to the project)

Installation

If wanting to use idem-vault, you can do so by either installing from PyPI or from source.

Install from PyPI

pip install idem-vault

Install from source

# clone repo
git clone git@<your-project-path>/idem-vault.git
cd idem-vault

# Setup venv
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Usage

The first step is to setup the credential to Vault. Similarly to other Idem plugins, this is done via the acct tool. Create a credential.yaml file like following:

vault:
  default:
    address: http://127.0.0.1:8200
    token: Sb6lasdfsdf3ysfMNsdfd11

Encrypt the the credential file:

acct encrypt credentials.yaml

output:

-A9ZkiCSOjWYG_lbGmmkVh4jKLFDyOFH4e4S1HNtNwI=

Add the output token and the generated fernet file path to your environment:

export ACCT_KEY="-A9ZkiCSOjWYG_lbGmmkVh4jKLFDyOFH4e4S1HNtNwI="
export ACCT_FILE=$PWD/credentials.yaml.fernet

You are ready to use idem-vault to manage your Vault resources!!!

Tests

In order to run the idem-vault tests, you need a development vault environment to be running locally.

Run the vault server with docker enabling kv_v1.

$ docker run -p 8201:8201 -e VAULT_DEV_LISTEN_ADDRESS="0.0.0.0:8201" -e VAULT_DEV_ROOT_TOKEN_ID="abcdefghijk"  vault server -dev -dev-kv-v1

Start a second docker vault server enabling kv_v2

$ docker run -p 8200:8200 -e VAULT_DEV_LISTEN_ADDRESS="0.0.0.0:8200" -e VAULT_DEV_ROOT_TOKEN_ID="abcdefghijk" vault

Add the default credentials.yml to your environment.

$ export ACCT_FILE="$PWD/example/credentials.yml"

Install python test requirements and run the tests with pytest.

$ pip install -e . -r requirements/test.in
$ pytest tests

Alternatively, use nox to mimic the environment of the gitlab pipeline.

$ pip install nox
$ nox -p 3

Roadmap

Current Supported Resources states: kv_v2.secret

Acknowledgements

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

idem-vault-0.2.4.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

idem_vault-0.2.4-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file idem-vault-0.2.4.tar.gz.

File metadata

  • Download URL: idem-vault-0.2.4.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/35.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.11.4 keyring/23.5.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.13

File hashes

Hashes for idem-vault-0.2.4.tar.gz
Algorithm Hash digest
SHA256 382e229abc200ab2ae6775afee8a34bfb0d6037a612b92fc903b050f1cb4c866
MD5 8118456a43d769a07aedee4236315eef
BLAKE2b-256 c36dd8070f95d18e0c23f89779470a20e3c3aad8fe187f0627d495b87d4a7be1

See more details on using hashes here.

File details

Details for the file idem_vault-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: idem_vault-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/35.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.11.4 keyring/23.5.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.13

File hashes

Hashes for idem_vault-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5578ab590f435ba4d61e01735bda583d23b25a7d328cfe2c76e9255b7b5ddda0
MD5 5eb5f59c8da4c46319d5f616ebf13b34
BLAKE2b-256 8a4e45c96ad8826178e7b34fb607e7ab236c1c67499c74220494f2232dd9eb1d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page