Coder Social home page Coder Social logo

sudhindrasajjal / hvac Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hvac/hvac

0.0 2.0 0.0 1023 KB

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

Home Page: https://python-hvac.org

License: Apache License 2.0

Makefile 0.12% Python 99.56% HCL 0.10% Shell 0.22%

hvac's Introduction

hvac

Header image

HashiCorp Vault API client for Python 2.7/3.x

Travis CI codecov Documentation Status PyPI version Twitter - @python_hvac

Tested against the latest release, HEAD ref, and 3 previous major versions (counting back from the latest release) of Vault. Currently supports Vault v0.9.6 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

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

Watchers

James Cloos avatar Sudhindra Sajjal 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.