Skip to main content

Python Client for vault

Project description

VVault

Stats

pypi

Based on

  • hvac
  • vault

Start

poetry

poetry add vvault

pip

pip install vvault

import

from vvault.vault import VaultMaster

Config for vault (services.yaml)

---
environments:
  dev:
    services:
      db:
        POSTGRES_USER: postgres
        POSTGRES_PASSWORD: '1'
        POSTGRES_BD: postgres
  prod:
    services:
      db:
        POSTGRES_USER: postgres
        POSTGRES_PASSWORD: '1'
        POSTGRES_BD: postgres
policy:
  dev:
    db_access:
      path:
        dev/*:
          capabilities:
            - read
            - list
        dev/db/*:
          capabilities:
            - read
            - list
        sys/mounts/:
          capabilities:
            - read
            - list
  prod:
    db_access:
      path:
        dev/*:
          capabilities:
            - read
            - list
        dev/db/*:
          capabilities:
            - read
            - list
        sys/mounts/:
          capabilities:
            - read
            - list
acl:
  dev_db_cl:
    password: adminadminadmin
    polices:
      - 'dev/db_access'
  prod_db_cl:
    password: adminadminadmin
    polices:
      - 'dev/db_access'

Examples (first start)

if __name__ == "__main__":
    vault = VaultMaster(
        url="http://localhost:8200", auth_methods=("approle", "userpass")
    )
    response = vault.start(
        root_token=None, unseal_keys=None, config_file=Path("services.yaml")
    )
    print(f"response: {response}")

Examples (ordinary start)

if __name__ == "__main__":
    vault = VaultMaster(
        url="http://localhost:8200", auth_methods=("approle", "userpass")
    )
    response = vault.start(
        root_token="you_token",
        unseal_keys=('1_key', '1_key', '3_key'),
        config_file=Path("services.yaml"),
    )
    print(f"response: {response}")

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

vvault-0.0.4.tar.gz (7.9 kB view hashes)

Uploaded Source

Built Distribution

vvault-0.0.4-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

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