From 5f19769bfbd9993a586e0232be84eaf033dacfa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Douglas=20Mendiz=C3=A1bal?= Date: Fri, 6 Feb 2015 17:38:52 -0600 Subject: [PATCH] Update documentation Updated README to point to the official OpenStack docs for the client. Also fixed a typo in the authentication page. Change-Id: I81696138cfa929efd7074b52edde8d4019e2fd50 --- README.rst | 9 ++++++++- doc/source/authentication.rst | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 1509bd47..5759a4a5 100644 --- a/README.rst +++ b/README.rst @@ -18,7 +18,7 @@ The client is `pip installable `__. +The full api is `documented in the official OpenStack documentation site `__. Here's an example of storing a secret in barbican using the python library @@ -29,6 +29,7 @@ with keystone authentication: >>> from keystoneclient.auth import identity >>> from keystoneclient import session >>> from barbicanclient import client + >>> # We'll use Keystone API v3 for authentication >>> auth = identity.v3.Password(auth_url='http://localhost:5000/v3', ... username='admin_user', @@ -36,23 +37,29 @@ with keystone authentication: ... password='password', ... project_name='demo', ... project_domain_name='Default') + >>> # Next we'll create a Keystone session using the auth plugin we just created >>> sess = session.Session(auth=auth) + >>> # Now we use the session to create a Barbican client >>> barbican = client.Client(session=sess) + >>> # Let's create a Secret to store some sensitive data >>> secret = barbican.secrets.create(name='Self destruction sequence', ... payload='the magic words are squeamish ossifrage', ... payload_content_type='text/plain') + >>> # Now let's store the secret by using its store() method. This will send the secret data >>> # to Barbican, where it will be encrypted and stored securely in the cloud. >>> secret.store() u'http://localhost:9311/v1/secrets/85b220fd-f414-483f-94e4-2f422480f655' + >>> # The URI returned by store() uniquely identifies your secret in the Barbican service. >>> # After a secret is stored, the URI is also available by accessing >>> # the secret_ref attribute. >>> print(secret.secret_ref) http://localhost:9311/v1/secrets/091adb32-4050-4980-8558-90833c531413 + >>> # When we need to retrieve our secret at a later time, we can use the secret_ref >>> retrieved_secret = barbican.secrets.get(u'http://localhost:9311/v1/secrets/091adb32-4050-4980-8558-90833c531413') >>> # We can access the secret payload by using the payload attribute. diff --git a/doc/source/authentication.rst b/doc/source/authentication.rst index a0712a86..bf0c561d 100644 --- a/doc/source/authentication.rst +++ b/doc/source/authentication.rst @@ -35,7 +35,7 @@ Keystone API Version 2 Authentication ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Authentication using Keystone API Version 2 can be achieved using the -`keystoneclient.auth.identity.v3.Password` auth plugin. +`keystoneclient.auth.identity.v2.Password` auth plugin. Example::