Update docs for auth_token middleware config options

The documentation for the auth_token middleware config options
was out of date.

Change-Id: I8d03d77c58c714375e1e5174962991aa3adc61af
Add new error for invalid response

There are a number of places where we expect a certain format of
response. If it's not found we often end up raising a KeyError when
accessing data.

Create a new Exception type that is raised when a HTTP response is not
appropriate for parsing and use it within authentication calls.

Closes-Bug: #1307306
Change-Id: I3cf2db07a8e76ee17702130e9efb0edf640d293a
Create a V3 Token Generator

A token generator that can be used by other clients to generate
consistent tokens in there test code.

Change-Id: I05d2632b4c8290c2b1015996769340f0bea16f93
blueprint: share-tokens
CLI always configures logging

When the keystone CLI wound up logging something and --debug
wasn't set, a message was printed that 'No handlers could be
found for logger <whatever>'. This is because Python logging
was only configured when the --debug option was set.

This change makes it so that logging is always configured. If
--debug is used then the level is DEBUG and if it's not used
then the level is WARNING.

Change-Id: Ib01d1072acff0d6ede468b0ecab4f871459014ee
Closes-Bug: #936404
Merge "CLI always configures logging"
Merge "Create a V3 Token Generator"
Deprecate admin_token option in auth_token

The admin_token option shouldn't be used with the auth_token
middleware. It's used to specify a token to be used to perform
operations on the identity server, so would typically be set
to the admin token. The admin token should only be used to
initially set up the Keystone server, and then the admin token
functionality should be disabled. If this recommended setup is
used then the auth_token middleware shouldn't be using the
admin token / auth_token.

In preparing for removal of the admin_token option, the option
is now deprecated. A warning will be logged if it's set.

DocImpact

Change-Id: I5bc4f4a6ad7984892151c8011ccd92f166aba4c2
Closes-Bug: #1306981
Merge "Update docs for auth_token middleware config options"
replace double quotes with single.

Change-Id: Ib2c828525fe3bafac8ed2f402a477ba62bbf6471
remove universal_newlines

Need to make sure that binary and text are both handled correctly for cms calls.

Blueprint: compress-tokens

Change-Id: If3ed5f339b53942d4ed6d6b2d9fc4eebd7180b0a
Fix the catalog format of a sample token

This token is used for auth_token testing and is a valid v3 token other
than the catalog which is in v2 format.

Convert the catalog to V3 format. Whilst there pretty print the token so
we can more easily see what's happening.

Change-Id: I893ea6e76f3fcc20b13b331911d7b8288b98991d
Merge "replace double quotes with single."
Ensure that cached token is not revoked

We need to ensure that tokens won't stay in cache after they have been
revoked.

Changed default revocation_cache_time 300 -> 10 seconds.
revocation_cache_time has to be << than token_cache_time to make token
cache efficient.

Fixes bug #1287301

Change-Id: I14c0eacac3b431c06e40385c891a6636736e5b4a
Debug log when token found in revocation list

The auth_token middleware didn't log when a token is rejected
because it's in the revocation list. This adds a log message so
that it's easier to debug problems.

Change-Id: I1388ed04641d209ba2083a1096488edc22267ebe
Merge "remove universal_newlines"
Limited use trusts

Trusts now have a "remaining_uses" field that tracks how many times
a trust can still issue a token. It is decremented by 1 each time a
trust related authentication occurs (call to /auth/tokens), until it
reaches 0 and no token can be issued through this trust anymore. If
set to null (default value), trusts can be used indefinitely to
authenticate.
This is the client side of the implementation.

Closes-Bug: #1250617
Implements: bp trusts-chained-delegation

Change-Id: Ib035a9772b7f035c3a9af102e8e15a860a96a96d
Merge "Add new error for invalid response"
Merge "Fix the catalog format of a sample token"
Merge "Limited use trusts"
Merge "Ensure that cached token is not revoked"