Ensure JSON headers in Auth Requests

The Content-Type header will be set automatically by the request call
however we should also ensure that we set the Accept header because our
auth plugins only work with JSON.

Change-Id: Ib3badd70f4fa32d400565c39a072db547d86037e
Use `HttpNotImplemented` in `tests.v3.test_trusts`

Since we are moved to usage exceptions from oslo, `HTTPNotImplemented`
was renamed to `HttpNotImplemented`, so we need to change usage of this
exception in tests.

Related to blueprint common-client-library-2

Change-Id: I51f6593ebb86267dad7086d4862a135743f2de7f
Prefer () to continue line per PEP8

There were some long lines that were split using \ rather than ().
PEP8 recommends using () --
http://legacy.python.org/dev/peps/pep-0008/#maximum-line-length

Change-Id: I8e140e507d0d9991094be13ebafa7fc700c1a02e
eliminate race condition fetching certs

There's a race between the time that a CertificateConfigError is raised,
and when we check to see what caused it. Eliminating the checks and
unconditionally fetching certificates eliminates the race.

Giant thanks to Jamie Lennox for identifying the root cause described
above!

Co-Authored-By: David Stanek <dstanek@dstanek.com>
Change-Id: I19113496ceaecdc03e209d550e0db156df95f9b8
Closes-Bug: 1285833
Add CRUD operations for Identity Providers.

Add relevant methods for adding, updating, listing, getting, and deleting
Identity Provider objects.

Change-Id: Ib77781b507d2c06c368a1877eb716ec7fe2d88e4
Implements: blueprint federation-crud-operations
Hash functions support different hash algorithms

The token hash functions always used MD5. With this change, the
hash function can be passed in to the hash functions.

SecurityImpact
Related-Bug: #1174499

Change-Id: Ia08c2d6252bb034087a244b47d5bcbea7dcfa70b
Add service name to catalog

The service catalog can contain names for the services. These names can
be filtered on by other clients and are going to be required if we
expect to use the keystoneclient service catalog in other clients.

Change-Id: Iab69d67427ed40ce2f556f9a6348f4f1d9c26b5b
Merge "Hash functions support different hash algorithms"
Merge "Add CRUD operations for Identity Providers."
Updated from global requirements

Change-Id: Icc5f3cdf0cfe9a1566ff5efafc85471381e3622d
Merge "Use `HttpNotImplemented` in `tests.v3.test_trusts`"
Allow session to return an error response object

Typically we want to have exceptions thrown when dealing with requests
that return an HTTP error. However when looking at integrating the
session object with other clients it becomes apparent that the exception
handling is sufficiently different that it is best for now to let the
existing error handling work.

Add an option to return the failed request rather than raise an
exception so existing clients can do there own error handling.

Blueprint: session-propagation
DocImpact: New session parameter.
Change-Id: I63ea034e7c6eaaf42d4329526a902677a8dd709d
Merge "Ensure JSON headers in Auth Requests"
Update docs for auth_token middleware config options

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

Change-Id: I8d03d77c58c714375e1e5174962991aa3adc61af
Merge "Updated from global requirements"
Don't use generic kwargs in v2 Token Generation

We need to allow for people adding other stuff to the tokens however it
shouldn't be available in the standard case where for example a misspelt
variable would be propagated.

This is in line with how v3 is going to handle this same scenario.

Change-Id: I1aad17893574ebc7c3a6b84f4d6ba1cd27932158
Closes-Bug: #1307278
Add CRUD operations for Federation Mapping Rules.

Add relevant methods for adding, updating, listing, getting, and deleting
Mapping objects.

Change-Id: I26a3822d9e341b9ddec10ecb8590432554837dce
Implements: blueprint federation-crud-operations
Rename HTTPError -> HttpError

With the move to the apiclient exceptions from oslo the basic HTTP error
class was renamed. This was not reflected in all places in the code.

It was also not picked up by the tests because the apiclient tests
weren't running due to a missing __init__.py file. Because this should
be backwards compatible it was added to the list in exceptions, the
check that this is available is in the (now running) apiclient tests.

Blueprint: common-client-library-2
Change-Id: I307c1083f29e3207cc86aa938043270e5c32b4bb
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
Merge "Add CRUD operations for Federation Mapping Rules."