Giter Site home page Giter Site logo

kivoli / hvac Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hvac/hvac

0.0 2.0 0.0 863 KB

:lock: Python 2.7/3.X client for HashiCorp Vault

Home Page: https://hvac.network

License: Apache License 2.0

Makefile 0.03% Python 99.78% Shell 0.17% HCL 0.03%

hvac's Introduction

hvac

HashiCorp Vault API client for Python 2.7/3.x

Travis CI codecov Documentation Status PyPI version

Tested against the latest release, HEAD ref, and 3 previous major versions (counting back from the latest release) of Vault. Currently supports Vault v0.8.3 or later.

Documentation

Documentation for this module is hosted on readthedocs.io.

Getting started

Installation

pip install hvac

or

pip install "hvac[parser]"

if you would like to be able to return parsed HCL data as a Python dict for methods that support it.

Initialize the client

import os

import hvac

# Using plaintext
client = hvac.Client()
client = hvac.Client(url='http://localhost:8200')
client = hvac.Client(url='http://localhost:8200', token=os.environ['VAULT_TOKEN'])

# Using TLS
client = hvac.Client(url='https://localhost:8200')

# Using TLS with client-side certificate authentication
client = hvac.Client(url='https://localhost:8200', cert=('path/to/cert.pem', 'path/to/key.pem'))

# Using Namespace
client = hvac.Client(url='http://localhost:8200', token=os.environ['VAULT_TOKEN'], namespace=os.environ['VAULT_NAMESPACE'])

Read and write to secret backends

client.write('secret/foo', baz='bar', lease='1h')

print(client.read('secret/foo'))

client.delete('secret/foo')

Authenticate using token auth backend

# Token
client.token = 'MY_TOKEN'
assert client.is_authenticated() # => True

hvac's People

Contributors

alexandernst avatar bfeeser avatar blarghmatey avatar cburroughs avatar cetex avatar crmullineravsec avatar hobbeswalsh avatar ianunruh avatar ianwestcott avatar jacquat avatar jeffwecan avatar jnaulty avatar lhdumittan avatar ltm avatar mracter avatar mtougeron-gpsw avatar mwielgoszewski avatar myles-steinhauser-bose avatar nicr9 avatar otakup0pe avatar pschmitt avatar rabraham avatar ramiamar avatar seanmalloy avatar seuf avatar sijis avatar stevenmanton avatar tiny-dancer avatar visheyra avatar zerosignal0 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.