Cleanup of test_cert_setup tests

- Removed the redundant calls to load backends and fixtures
- Only create a controller in the one test that needs it

Change-Id: I6c068452479ceb23010396f14fe6d155ac954b04
Fix assertEqual arguments order(catalog, cert_setup, etc)

assertEqual method's arguments should be in
('expected', 'actual') order.

Change-Id: Id591629a10e6e82c4eb607a9994071f16dd80d8b
Partial-Bug: #1277104
Convert test_backend_ldap to config fixture

The test_backend_ldap module wasn't using the config fixture for
setting config options.

Change-Id: I3f0e1ba13f0be3625db5a7eb275a3d7fd2bd41e5
List all forbidden attributes in the request body.

When request content is validated by applying
cls.check_immutable_params() and an exception is
raised all forbidden parameters should be listed
in one response.

Change-Id: I15b3fa979bdb33bd341b0b99c1802af46273f358
Refactor: move federation functions to federation utils

Some of the functions created in keystone.auth.plugins.saml2 can be
re-used for other federation protocols that are supported in the future.
Propose moving them to keystone.contrib.federation.utils.

Change-Id: Ifb7adcda44a0eff2650198353393aff33b3eda7a
Fixed wrong behavior in method search_s in BaseLdap class.

Variable 'py_result' can be not initialized if self.page_size > 0
because it's initialized only in the 'else' block.

Closes bug 1305056
Change-Id: Ib9cfb2c03279d97ec0c1a4f8cb45fe5b568b9d7a
Adding more descriptive error message

Keystone Trusts API sends non descriptive error message for requests with
invalid trust id.
The error message only contains invalid_trust_id  instead of printing:
"Could not find trust: invalid_trust_id"
Setting kwarg "trust_id" in the exception.

Closes-Bug: #1305272
Change-Id: I35cab35ab90cf66ce7124dea142013bec9eefda9
Adds style checks to ease reviewer burden

The following checks were added in this commit:

 - mutable default args are no longer allowed
 - block comments must begin with at least one space
 - enforce assertIsNone instead of assertEqual with a None

bp more-code-style-automation

Change-Id: I7dba0c8b45078a665d40993d751c79566aa7505f
Configurable token hash algorithm

Tokens were always hashed with MD5. This change allows tokens to
be hashed with SHA256 (or any other algorithm supported by the
keystoneclient token hash function). This is for security
hardening.

There's a new configuration option 'hash_algorithm' in the [token]
section. This is the algorithm to use for hashing PKI tokens, so is
used

a) when storing the token in the db
b) as the hash in the revocation list

hash_algorithm defaults to 'md5' for backwards compatibility.

SecurityImpact
DocImpact
Closes-Bug: #1174499

Change-Id: Iafe3c975d59818c8f362647f7ea5149a03deee47
replace word 'by' with 'be'

Closes-Bug:#1304834

Change-Id: Ida31949453c38c8eef748abe2ee8b0df92d7fb74
Merge "List all forbidden attributes in the request body."
Merge "replace word 'by' with 'be'"
Treat LDAP attribute names as case-insensitive

LDAP attribute names are case-insensitive, and different LDAP
server implementations behave differently when returning search
results.  Keystone attempts to use the attribute names as defined
in the mapping configuration when checking for values in the dict
that represents the search results.  If the case doesn't match,
we won't find the values which can lead to errors.

This patch converts the dictionary keys to lowercase to allow us
to perform a case-insensitive lookup when processing LDAP search
results.  When we create the model object, we still use the
attribute name case as defined in the mapping to allow predictable
lookups when we process the model object later.

Change-Id: Ib9a03b912bc7652dc6a61b1c97a950e263a9c6fa
Closes-bug: 1281216
Collapse SQL Migrations

SQL Migrations for Juno require the schema version to be at 036
which is the final verison for the Havana release. This limits the
change sets that could affect assumptions made in earlier migration
files. Migrating to before the Havana release migration is no longer
supported.

Change-Id: Ie58507473b92cb100a9d556985e7d7756f9649e4
bp: sql-migration-collapse-juno
Refactor: moved flatten function to utils

Previously, the keystone.common.authorization module contained the function
"flatten", which would transform a dictionary (possibly nested) into a
single level dictionary. Given that the "flattening" of a dictionary is
a more general concept, not related to authorization, I thought it would
be more intuitive to have it in the keystone.common.utils module.

Change-Id: Ic1f6fa70634ade41e392ee7c5cd8adac913fd0b8
Merge "Adds style checks to ease reviewer burden"
Updated from global requirements

Change-Id: Ib0b13ea20541614e5963e668c5261041ae6968e0
Merge "Convert test_backend_ldap to config fixture"
Merge "Treat LDAP attribute names as case-insensitive"
Merge "Fix assertEqual arguments order(catalog, cert_setup, etc)"