Client library for Barbican API.
Go to file
Monty Taylor ac30643631 Update tox.ini to match rest of project
There's a few things - most notably the missing venv env,
but also getting tox to skip the sdist step in builds that
will align python-barbicanclient with the rest of the project.

Change-Id: I7b3c8f992040c0a7f0cace1452a93f4958d0cd2a
2014-07-15 11:11:38 -07:00
barbicanclient Fix Testing Failure due to Argparse 2014-07-07 16:33:18 -05:00
etc Make create_secret() and create_order() return objects rather than dicts 2013-06-07 14:24:26 -05:00
examples Fixed typos in the example files 2014-06-11 07:10:23 -07:00
tools Migrate to pbr 2014-01-03 11:42:56 -05:00
.coveragerc port tests to testtools, add branch coverage, omit openstack common 2014-03-20 09:30:12 -04:00
.gitignore port tests to testtools, add branch coverage, omit openstack common 2014-03-20 09:30:12 -04:00
.gitreview Fix the gitreview 2014-05-31 23:42:42 -07:00
.mailmap Add mailmap file. 2013-12-03 22:34:13 -06:00
.testr.conf port tests to testtools, add branch coverage, omit openstack common 2014-03-20 09:30:12 -04:00
LICENSE Adding Apache license 2013-05-09 08:42:55 -05:00
MANIFEST.in First stab at packaging 2013-05-30 09:42:04 -05:00
README.rst Updating documentation from stackforge to openstack 2014-06-02 16:58:39 -04:00
clientrc Remove payload_content_encoding from orders 2013-08-14 17:37:43 -05:00
openstack-common.conf Remove OpenStack log in favor of native logging 2014-03-14 14:58:41 -07:00
requirements.txt Add Keystone V3 compliant session/auth plugin support 2014-06-09 13:09:47 -06:00
setup.cfg Add version to setup.cfg 2014-03-06 15:14:35 -06:00
setup.py Remove unnecessary coding line 2014-05-28 11:39:24 +02:00
test-requirements.txt Add Keystone V3 compliant session/auth plugin support 2014-06-09 13:09:47 -06:00
tox.ini Update tox.ini to match rest of project 2014-07-15 11:11:38 -07:00

README.rst

python-barbicanclient

This is a client for the Barbican Key Management API. There is a Python library for accessing the API (barbicanclient module), and a command-line script (barbican).

Installation

The client is pip installable as follows:

pip install python-barbicanclient

barbicanclient - Python Library

The full api is documented in the wiki.

Here's an example of storing a secret in barbican using the python library with keystone authentication:

>>> from barbicanclient.common import auth
>>> from barbicanclient import client
>>> # We'll use keystone for authentication
>>> keystone = auth.KeystoneAuthV2(auth_url='http://keystone-int.cloudkeep.io:5000/v2.0',
...                                username='USER', password='PASSWORD', tenant_name='TENANT')
>>> barbican = client.Client(auth_plugin=keystone)
>>> # Let's store some sensitive data, Barbican encrypts it and stores it securely in the cloud
>>> secret_uri = barbican.secrets.store(name='Self destruction sequence',
...                                     payload='the magic words are squeamish ossifrage',
...                                     payload_content_type='text/plain')
>>> # Let's look at some properties of a barbican Secret
>>> secret = barbican.secrets.get(secret_uri)
>>> print(secret.secret_ref)
u'http://api-01-int.cloudkeep.io:9311/v1/test_tenant/secrets/49496a6d-c674-4384-b208-7cf4988f84ee'
>>> print(secret.name)
Self destruction sequence
>>> # Now let's retrieve the secret payload.  Barbican decrypts it and sends it back.
>>> print(barbican.secrets.decrypt(secret.secret_ref))
the magic words are squeamish ossifrage

barbican - Command Line Client

Command line client configuration and usage is documented in the wiki.

$ barbican
usage: barbican [-h] [--no-auth | --os-auth-url <auth-url>]
            [--os-username <auth-user-name>] [--os-password <auth-password>]
            [--os-tenant-name <auth-tenant-name>] [--os-tenant-id <tenant-id>]
            [--endpoint <barbican-url>]
            <entity> <action> ...

Command-line interface to the Barbican API.

positional arguments:
  <entity>              Entity used for command, e.g., order, secret or verification.

optional arguments:
  -h, --help            show this help message and exit
  --no-auth, -N         Do not use authentication.
  --os-auth-url <auth-url>, -A <auth-url>
                        Defaults to env[OS_AUTH_URL].
  --os-username <auth-user-name>, -U <auth-user-name>
                        Defaults to env[OS_USERNAME].
  --os-password <auth-password>, -P <auth-password>
                        Defaults to env[OS_PASSWORD].
  --os-tenant-name <auth-tenant-name>, -T <auth-tenant-name>
                        Defaults to env[OS_TENANT_NAME].
  --os-tenant-id <tenant-id>, -I <tenant-id>
                        Defaults to env[OS_TENANT_ID].
  --endpoint <barbican-url>, -E <barbican-url>
                        Defaults to env[BARBICAN_ENDPOINT].

subcommands:
  Action to perform

  <action>
    create              Create a new order.
    store               Store a secret in barbican.
    verify              Begin a verification process in barbican.
    get                 Retrieve a secret, an order or a verification result by providing its URI.
    list                List secrets, orders or verifications.
    delete              Delete a secret, order or verification by providing its href.