keystonemiddleware/keystonemiddleware/tests
Matthew Edmonds 75fbc5910a only make token invalid when it really is
The auth_token middleware was marking a token invalid in the cache
on any otherwise-uncaught exception, not only when it has really
determined that the token is invalid. This will fix that by being
better about using the InvalidToken exception only when the token is
really invalid, and only marking invalid in the cache when that
exception occurs.

This fix uncovered a bug in the auth_token unit test
test_composite_auth_delay_invalid_service_and_user_tokens, so that has
been addressed as well. It was attempting to use "invalid-user-token",
which was not initialized, where it meant to use "invalid-token". This
was leading to a NoMockAddress exception. Prior to this fix, the code
turned all unexpected exceptions into InvalidToken exceptions, masking
this issue.

It also uncovered DeprecationWarnings raised in _identity.py for usage
of logging.warn rather than logging.warning in py34. That has also
been fixed. As above, prior to this fix those would have been turned
into InvalidToken exceptions (incorrectly).

Change-Id: I2e487fb02c9171f743ecc1f4f230b29a5e96212d
Closes-Bug: #1488267
(cherry picked from commit 7dcbdf7748)
2015-09-30 21:39:35 +00:00
..
unit only make token invalid when it really is 2015-09-30 21:39:35 +00:00
__init__.py Move tests to new location 2014-06-19 15:51:52 -07:00