1075 Commits

Author SHA1 Message Date
Morgan Fainberg
c94f1c0a19 Add mailmap entry
Add mailmap entry for my email address

Change-Id: Ia46c28c86ef3f440556b1b027d2bf0a7f3e721c5
2014-05-07 12:12:43 -07:00
Jenkins
7432db16b3 Merge "Discovery URL querying functions" 2014-05-06 22:45:44 +00:00
Jenkins
0781c3ca27 Merge "Synced jsonutils from oslo-incubator" 2014-05-06 10:03:02 +00:00
Jamie Lennox
1ccefad0c6 Discovery URL querying functions
The existing discovery mechanism is geared around allowing users to
create appropriate client objects. It does not provide any means to
query version responses to determine the URLs of available versions.
This patch adds url_for (similar to the functions available on service
catalog) and data_for functions that can do lower level queries for
URLs and version response data.

Because of the client creation functionality the existing discover.py
cannot be imported from within keystoneclient due to cyclical dependency
resolution. The querying functions are therefore added to a private
keystoneclient file and exposed to the original Discover object via
inheritance. This private object can then be used within the
keystoneclient library.

Blueprint: endpoint-version-query
Change-Id: I7e1891536289c57ad3fbe8ef1c6e50b7344d83d5
2014-05-06 10:21:30 +10:00
Brant Knudson
f2adf271e7 Fix client fixtures
Some of the client fixtures used for testing were invalid. v2
tokens must have 'access'/'token'/'expires', and v3 tokens must
have 'token'/'expires_at'.

Change-Id: I2614c7deed47c9758c2031418110108308634296
Related-Bug: #1174499
2014-05-04 14:56:23 -05:00
Jenkins
570a9dc22d Merge "fixed typos found by RETF rules" 2014-05-03 21:42:31 +00:00
Christian Berendt
b530800649 fixed typos found by RETF rules
rules are avaialble at https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos

Change-Id: I67fb3e0d02c931cb7e605ac74ea8272956afa8e1
2014-05-03 09:54:39 +02:00
Jenkins
f050dd9448 Merge "Fix docstrings in keystoneclient" 2014-05-03 00:25:59 +00:00
Steve Martinelli
8cf2829d53 Fix docstrings in keystoneclient
Trusts and service catalog had a few malformed docstrings
that caused warnings when building docs.

Change-Id: Iea8612c3aaebea54c00b02c73c77f0c9e79f86bc
Partial-Bug: #1315523
2014-05-02 15:38:49 -05:00
Brant Knudson
a03c6b9f34 auth_token configurable check of revocations for cached
The auth_token middleware would fail if it couldn't fetch the
revocation list. If the system is configured for UUID tokens then
the revocation list may not be available.

With this fix, the revocation list will only be checked for
cached tokens if the new check_revocations_for_cached option
is set to True.

Also, this change prevents the revocation list from being
checked twice for a PKI token that's validate off-line.

Change-Id: I5408bbe12aefda608ebcb81cf3c7ef068b2bf2f6
Closes-Bug: #1312858
2014-05-01 18:55:27 -05:00
Brant Knudson
9b1feca895 Remove unused AdjustedBaseAuthTokenMiddlewareTest
assertDictEqual isn't used, and the assertIsInstance message
should be consistent across versions. This leaves nothing in
AdjustedBaseAuthTokenMiddlewareTest so remove it.

Change-Id: I7d338c9b66c77ff81a79d1a1d5c8ebcc3dd300a2
2014-04-30 17:15:12 -05:00
Ihar Hrachyshka
6cda4e4602 Synced jsonutils from oslo-incubator
The sync includes change that drastically enhances performance on Python
2.6 with fresh simplejson library installed.

The latest commit in oslo-incubator:
- 732bdb6297eb9de81667f7713ebcb1ccc2ee45a7

Change-Id: Ib3dc0b713ed90396919feba018772243b3b9c90f
Closes-Bug: 1314129
2014-04-29 17:36:35 +02:00
Brant Knudson
c00ef0e751 auth_token test remove unused fake_app parameter
set_middleware is never called with fake_app, so remove it.

Change-Id: Id4541f77a12a9d43f2761f8d1fd14d633f6944ac
2014-04-27 16:59:58 -05:00
Brant Knudson
cb2045e134 Fix typo in BaseAuthTokenMiddlewareTest
Setup was used where setUp is the name of the function.

Change-Id: Ie8aef4e128a443ddec48fc82cb7314081ee5bfd2
2014-04-27 16:58:14 -05:00
Jenkins
6be38bb8f5 Merge "Deprecate admin_token option in auth_token" 2014-04-26 20:37:15 +00:00
OpenStack Proposal Bot
5dd9017616 Updated from global requirements
Change-Id: I274214f7924fc2edddfc54a81147a3b17123238f
2014-04-25 11:23:07 +00:00
Jenkins
c53c68cb51 Merge "Debug log when token found in revocation list" 2014-04-25 09:29:13 +00:00
Brant Knudson
bef7f497f0 Enhance tests for auth_token middleware
There was code in _verify_uuid_token that was not covered by unit
tests. This change increases the coverage.

Change-Id: I63e171a0a8e63ae599c967adc9ff09670063b807
Related-Bug: #1174499
2014-04-24 18:38:31 -05:00
Jenkins
f1ace5c418 Merge "Ensure that cached token is not revoked" 2014-04-24 07:53:05 +00:00
Jenkins
507af4c0f4 Merge "Limited use trusts" 2014-04-24 06:48:55 +00:00
Jenkins
ed3060573b Merge "Fix the catalog format of a sample token" 2014-04-24 02:13:04 +00:00
Jenkins
6df8511d90 Merge "Add new error for invalid response" 2014-04-24 01:57:12 +00:00
Matthieu Huin
5528f1a5be 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
2014-04-23 10:43:20 +02:00
Jenkins
4481b65ac3 Merge "remove universal_newlines" 2014-04-23 02:46:52 +00:00
Brant Knudson
96829d1601 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
2014-04-22 16:08:19 -05:00
Alexei Kornienko
8574256f93 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
2014-04-22 22:36:07 +03:00
Jenkins
0fe55094c4 Merge "replace double quotes with single." 2014-04-22 02:57:26 +00:00
Jamie Lennox
daf0b2f409 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
2014-04-22 11:44:45 +10:00
Adam Young
6c3cbab1a8 remove universal_newlines
Need to make sure that binary and text are both handled correctly for cms calls.

Blueprint: compress-tokens

Change-Id: If3ed5f339b53942d4ed6d6b2d9fc4eebd7180b0a
2014-04-21 21:36:59 -04:00
Adam Young
7e1700c565 replace double quotes with single.
Change-Id: Ib2c828525fe3bafac8ed2f402a477ba62bbf6471
2014-04-21 16:55:20 -04:00
Jenkins
3fd8e8f6d0 Merge "Update docs for auth_token middleware config options" 2014-04-21 07:37:26 +00:00
Brant Knudson
d6f9f2a860 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
2014-04-17 11:20:32 -05:00
Jenkins
02572377fa Merge "Create a V3 Token Generator" 2014-04-17 06:27:35 +00:00
Jenkins
bc1677ea1f Merge "CLI always configures logging" 2014-04-17 06:27:32 +00:00
Jenkins
db8da0de2e Merge "Implement endpoint filtering functionality on the client side." 2014-04-17 02:41:38 +00:00
Jenkins
b333d66da8 Merge "Allow session to return an error response object" 2014-04-17 02:35:04 +00:00
Brant Knudson
59daf4bf02 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
2014-04-16 20:05:02 -05:00
Jamie Lennox
ee49824fe7 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
2014-04-17 07:11:34 +10:00
Jenkins
474c110f62 Merge "Add service name to catalog" 2014-04-16 06:39:33 +00:00
guang-yee
eff1960daf Implement endpoint filtering functionality on the client side.
bp/endpoint-filtering

Change-Id: I48cb8dbd2720bb0c5777712b68a8a5b8f3bf7f60
2014-04-15 18:00:16 -07:00
Jenkins
6d70bad3d9 Merge "Rename HTTPError -> HttpError" 2014-04-15 22:22:25 +00:00
Jenkins
6395a5a5f3 Merge "Prefer () to continue line per PEP8" 2014-04-15 21:42:54 +00:00
Jenkins
ca88561b09 Merge "Fix typo of ANS1 to ASN1" 2014-04-15 19:40:39 +00:00
mathrock
bc12305ca1 Fix typo of ANS1 to ASN1
Replace all occurrences of 'ANS1|ans1' with 'ASN1|asn1'.  Keep
cms.is_ans1_token() around for backwards compatibility.

Change-Id: I89da78b89aa9daf2637754dc93031d7ca81e85cb
Closes-bug: 1306874
2014-04-14 22:22:30 -04:00
Jenkins
db5c88af00 Merge "Add CRUD operations for Federation Mapping Rules." 2014-04-15 01:57:38 +00:00
Jamie Lennox
4a81a14685 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
2014-04-15 09:41:33 +10:00
Jamie Lennox
ce92f37f0b 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
2014-04-15 09:38:20 +10:00
Marek Denis
91914c79be 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
2014-04-14 09:31:55 +02:00
Jamie Lennox
e7b5120e76 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
2014-04-14 13:17:51 +10:00
OpenStack Jenkins
f89787f46c Merge "Updated from global requirements" 2014-04-14 02:05:35 +00:00