Giter VIP home page Giter VIP logo

conjur-python-2-client's Introduction

conjur-python-2-client

Installing the code

From source

$ git clone https://github.com/AndrewCopeland/conjur-python-2-client.git
$ cd conjur-python-2-client; pip install . --user

Usage

Setting conjur auth files

Setting these files is optional however it may be easier for your use case to create these files.

~/.conjurrc

---
account: myorg
plugins: []
appliance_url: https://conjur.myorg.com
cert_file: "/path/to/certificate/conjur.pem"

~/.netrc

machine https://conjur.myorg.com/authn
  login conjurUsername
  password conjurApiKey

authenticate w/ auth files

This method will raise a ConjurApiError exception if it could not authenticate

>>> from conjur.client import Client
>>> client = Client()
>>> client.authenticate()

authenticate w/ inline arguments

This method will raise a ConjurApiError exception if it could not authenticate

>>> from conjur.client import Client
>>> client = Client("https://conjur.myorg.com", "/path/to/certificate/conjur.pem", "myorg", "conjurUsername", "conjurApiKey")
>>> client.authenticate()

retrieve_secret

This method will retrieve a specific variable for the conjur api and will return as a unicode string. If a 401 status code is returned it will attempt to re-authenticate once. If this re-authentication fails then a ConjurApiError exception will be raised.

>>> from conjur.client import Client
>>> client = Client()
>>> client.retrieve_secret("secrets/db/username")

list_resources

This method will return a list of all of the resources and all of the information associated with the resource. A list is returned containing a dictionary of each resource. Like the retrieve_secret() method, if a 401 is returned it will attempt to re-authenticate once. If you are just looking for the resource ids use the list_resources_simple() method.

>>> from conjur.client import Client
>>> client = Client()
>>> client.list_resources()

list_resources_simple

This method will return a list of all of the resource ids. A list with all of the resource ids are returned, if a 401 is returned it will attempt to re-authenticate once. If you are looking for more verbose information regarding the resource see the list_resources() method.

>>> from conjur.client import Client
>>> client = Client()
>>> client.list_resources_simple()

conjur-python-2-client's People

Contributors

andrewcopeland avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar

conjur-python-2-client's Issues

Failed to authenticate with host

Recieving the following error when authenticating with host

#<Errors::Authentication::Security::RoleNotFound: CONJ00007E 'host:user:hostusername' not found>

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.