Remove v1 from the falcon app route

This bug was introduced by a recent change
"Barbican should not do rbac on version api call"
Where the main barbican app was split up into two falcon apps,
one for the version resource, and another for the rest of the
calls.

In the paste file, the latter app was mounted on 'v1' but
because the routes in the falcon app also map to 'v1' this resulted
in all calls being routed to 'v1/v1/{tenant}/...'

This change removes the routes from the app, so that only the
'v1' in the paste configuration is mapped, which fixes the
double v1 route.

Change-Id: I05746f11d262ec7aa4f60aeb44e41217e8bc8a44
Closes-Bug: #1296969
Revive Alembic-based database migration logic.

Alembic migrations were introduced to Barbican a while ago but have not been
used recently. This CR revisits the migration logic and ensures that time-zero
database tables creation is distinguished from Alembic-base schema updates.
The associated database migration script is also revived, allowing for
schema migrations outside of the Barbican boot process.

Change-Id: I3e7fd7ac3f629da18329c22ad11cb9ccc1b7f9f9
Implements: blueprint db-revive-migrations
Merge "Revive Alembic-based database migration logic."
Clean up Verifications resource

The Verifications resource POC should be removed from Barbican.

Change-Id: I5823cb94314a2c2f497f045c620dde974741a004
Update crypto plugin interface to support Dogtag

The Crypto plugin interface needs to be modified to support
a Dogtag DRM plugin.  Specifically, we will replace the create()
method with a new generate() method that returns the same values
as encrypt().

The plugin interface is also modified to pass data to the decrypt(),
encrypt() and generate() calls using DTO objects.  This will allow
the interface to more easily extended to pass more data in future.

For instance, it will later be necessary to pass a wrapping key for
encrypt() and decrypt() operations in case we want the secret to be
completely encrypted from end to end.

We have chosen not to create the secret in the database earlier to
generate a UUID for the DRM to use as a client key ID.  Rather, a
random value will be generated by the dogtag DRM plugin.

Implements: blueprint update-crypto-plugin-interface
Change-Id: I508321697c8a4557d1e35cd5a9e8f0affd992cd5
Support for debug mode start in barbican

Closes-Bug: #1295903

Change-Id: I23b508a88f666009f77a3c021e2600a279068e4b
Merge "Update crypto plugin interface to support Dogtag"
correcting spelling error in README file.

Change-Id: Ib5f048caa3fef7217ecafb8a35949ec7346c9c37
Add Dogtag crypto plugin.

This patch adds an initial version of the Dogtag plugin
that implements the decrypt(), encrypt() and generate()
functions.  In this version, we will create and initialize
an NSS database on the server to do crypto operations
within the Dogtag DRM python client.  This allows us to
decrypt() and encrypt() secrets without passing in wrapping
keys.

When the barbican-client and the Barbican server API have
been changed to pass through the wrapping keys, this plugin
will need to enhanced to make the relevant DRM client calls.

This plugin has been tested by running the barbican server
within a virtual environment.  There are several steps
needed to get things configured, which are detailed in the
blueprint.

Added unit tests.  These unit tests will be skipped if the
dogtag dependencies are not present to import.

Change-Id: Ib53bf3df5a65af7ac602ec7f7895e9c723c36c06
Implements: blueprint dogtag-plugin
Merge "Add Dogtag crypto plugin."
Add Sphinx developer documentation skeleton

Add RST files to generate developer documentation using Sphinx.  Also
add document build dependencies to test-requirements.txt.

Change-Id: Ie96ad02e0e5a6a8f92059b2a649851743830519d
Add configuration items to limit secret and request sizes.

Two size attributes limit the size of secrets and requests in barbican. This CR
explicitly adds those to the Barbican configuration file.

Change-Id: I22d68cc8c9e96cf719a550b26333a845e895f178
Fix a bug with handling of binary data

When checking the length of the data in a request, Barbican assumes
that data is UTF-8 encoded strings.  Barbican then attempts to
decode all data from UTF-8 to byte strings, which results in an
exception when the data does not conform to UTF-8.

This CR also adds the six library as a dependency to add type checking
that is compatible in both Python 2 and 3.

Change-Id: I3e937998c3bd4d5fbe94c89099ba56c26dbb75b7
Closes-Bug: #1315498
Ensure uWSGI process in DevStack is actually killed

Change-Id: Id03afbeae2fd9151d2d7bcaafd3fc74204946751
Metaclass Python 3.x Compatibility

According to the OpenStack style guide (http://docs.openstack.org/developer/hacking/), for Python 3.x compatibility use "six.add_metaclass" instead of " __metaclass__."

Change-Id: Ic7733a22294ecad30d185851d4f550f1386581fc
Extend crypto plugin to support more key types

This change is part of "api-orders-add-more-types" BP phase 1 plan.
As per phase 1 we will extend the order resource to support asymmetric
and more symmetric keys.
This specific change is to address the crypto plug-in and extension
manager.

Partial-BP: api-orders-add-more-types

Change-Id: Idf0073c0703dff652e55e811538f86a8f7c7259b
Adds SecretMetadatum table

This patch is the first planned in a series to add KMIP support to Barbican.
Barbican currently returns metadata about secrets to the user, but adding
secret_metadata table will allow users to set additional metadata options
that are not supported by Barbican.

After this submission is accepted, another patch will be created to move the
current Secret attribute metadata to the new metadata table.

Change-Id: Ibc990f798b118eeda705360e40ecf439d5a1b0cd
Implements: blueprint add-metadata-to-secrets
Merge "Adds SecretMetadatum table"
change assertEquals to assertEqual

According to http://docs.python.org/2/library/unittest.html
assertEquals is a deprecated alias of assertEqual.

Change-Id: I19e492f5b97c376b062d6969cd1796e541f318de
Increase DevStack uWSGI buffer for Tempest support (Keystone Headers)

Change-Id: I597c85745f60434477886f14dd8bb7f3d5b39dd3