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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file vvault-0.0.4.tar.gz.

File metadata

  • Download URL: vvault-0.0.4.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for vvault-0.0.4.tar.gz
Algorithm Hash digest
SHA256 f5261eae856556cd04febc96cc34ab479a3d60abdb3159979efffea6de58b498
MD5 7b61699b802bb4cdd96f28990ed6234c
BLAKE2b-256 bb7f5421accfa4fe0cf962a9167585ab8bd920b48d86e57ea475c48133d47ab2

See more details on using hashes here.

File details

Details for the file vvault-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: vvault-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for vvault-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c1ecaacb52c7c54e0ed9f7e9efa67f0cfa1a2080cff28bfecea326b58660413f
MD5 3b2e531722e42d0ec01e4012d54c99be
BLAKE2b-256 ec576971223d9c15808af3e55d08d92163cf9d4c9c2855a840f532c0f87a3ec7

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