865 Commits

Author SHA1 Message Date
Jenkins
645df083ed Merge "Identity plugin thread safety" 2015-09-15 08:37:44 +00:00
Jamie Lennox
a79f550dfc Move session loading tests into loading section
Session loading is being tested as part of the base session testing
file. It should be moved into the loading folder with other loading
specific tests.

Change-Id: I42ac48553ecd7fdda0357938387e17bdaf5e80a9
2015-09-10 12:37:20 +10:00
Jamie Lennox
c8d7506ce6 Identity plugin thread safety
A common case is for Nova (or other service) to create an admin
authentication from a CONF file and then have many greenlet threads that
want to reuse that authentication. If a token expires then many threads
all try and fetch a new token to use and can step over each other.

I was hoping for a way to put a lock in so that all plugins were thread
safe however fixing it for identity plugins solves almost all real world
situations and anyone doing non-identity plugins will have to manage
threads themselves.

Closes-Bug: #1493835
Change-Id: Ie478499a086a4b0db4fb9e5b820f6f5cd4074763
2015-09-09 12:52:14 +00:00
Jenkins
88a69ea9da Merge "Move around the tests so they can be found easier" 2015-09-07 20:24:24 +00:00
Mathieu Gagné
fac161a44a Fix typo in Python package summary in setup.cfg
Change-Id: Ic26d92a00059385644ae3db1eb204bcb64b391bf
Closes-bug: #1492431
2015-09-04 15:13:11 -04:00
Jenkins
4818e2db70 Merge "Change the README to remove the warning for 1.0.0 release" 1.0.0 2015-09-03 09:06:45 +00:00
Jenkins
97f0258345 Merge "Add accessor method for raw catalog content" 2015-09-03 08:00:26 +00:00
Morgan Fainberg
163f3ec520 Change the README to remove the warning for 1.0.0 release
Change the README since the next release will be 1.0.0 and interfaces
will be considered stable.

Change-Id: I9d76e3f337985fec47943c984abd7f9efd0b06f3
2015-09-03 00:11:16 -07:00
Jenkins
49f3f60f8f Merge "Change auth plugin help text to auth type" 2015-09-03 06:16:42 +00:00
Monty Taylor
78c7d6448c Add accessor method for raw catalog content
There are cases, such as os_auth in ansible, where a user wants to
be able to get at the raw catalog content. This is often extremely
useful when debugging cloud applications.

Change-Id: Ibe51b5f1a4b1d93efb6076b5f97b0fd10376cd16
2015-09-03 12:26:53 +10:00
TerryHowe
961809e2dc Move around the tests so they can be found easier
I noticed a lot of tests were still in directories from
the past and things were not as easy as you might hope to find.

Change-Id: Iae3d75cee9f48a09d2c9aa2a5b18301b4832bef0
2015-09-02 19:24:34 -06:00
Jenkins
35113c7854 Merge "Raise exception for v2 with domain scope" 2015-09-03 00:45:14 +00:00
TerryHowe
4a97ce81e6 Raise exception for v2 with domain scope
Raise meaningful discovery exception for v2 with domain scope.
Previously, the exception reported the vague message:

    Exception raised: Could not determine a suitable URL for the plugin

Now:

    Exception raised: Cannot use v2 authentication with domain scope

Change-Id: I5cf509c24863b35deca8d13fa5655f3665c3b29a
2015-09-02 14:28:55 -06:00
TerryHowe
2e572f7138 Change auth plugin help text to auth type
Change-Id: Iaeaea769c778aefee72427eeae8f3e953c0f327d
2015-09-02 12:53:47 -06:00
Jamie Lennox
a56ed4218a Use auth_type instead of auth_plugin by default
This was something that OSC has pushed for a long time now, and it's
better to be consistent than worry about wording.

Change --os-auth-plugin and auth_plugin= in CONF to be --os-auth-type
and auth_type= by default. We deprecated (but will probably keep for a
long time) the auth_plugin name.

Change-Id: I9748aeb4a490f88c73ef22ebe49e9b4ac6af78cd
2015-09-02 14:29:49 -04:00
Jamie Lennox
4c65944c7b Add session and auth loading to loading.__init__
Now we have loading functions for both auth and session we want to mix
them into the same loading namespace so that users only have to import
one thing. To do this we need to disambiguate the names as they are
purposefully similar.

Change-Id: Ic6b874bc878e72c0399f4ad91a8dcbe9e014576e
2015-09-02 14:29:46 -04:00
Jenkins
57174005f5 Merge "Return oslo.config opts from config loading" 2015-09-02 17:00:01 +00:00
Jenkins
9d12b2b0a4 Merge "Auth-url is required for identity plugins" 2015-09-02 16:59:54 +00:00
Jenkins
e127d46f21 Merge "Provide has_scope_parameters function on plugins" 2015-09-02 02:09:38 +00:00
Jenkins
7baa64cd8b Merge "Move admin_token to base _plugins dir" 2015-09-02 01:28:49 +00:00
Jenkins
cbc8311d21 Merge "Remove deprecated options from identity base plugin" 2015-09-02 01:08:55 +00:00
Jamie Lennox
f08447b525 Auth-url is required for identity plugins
Auth-url must always be provided for identity plugins.

Change-Id: I01b1f84d41d715c22f753cd695317962569cfb36
2015-09-02 10:31:36 +10:00
Jamie Lennox
3ca351bb5d Return oslo.config opts from config loading
The functions in loading.conf should return oslo.config options as the
descriptions say. These are often used by services to register
additional config options.

Change-Id: I9d7711b6ff2426e66e6d0c9d457dbb0029d67c12
2015-09-02 10:25:52 +10:00
Jenkins
d1542d87b0 Merge "Update k2k plugin with related code comments" 2015-09-02 00:18:54 +00:00
Jenkins
d169ed6e46 Merge "Mark tenant-name and tenant-id deprecated" 2015-09-01 22:29:12 +00:00
Jamie Lennox
0505180d1f Move admin_token to base _plugins dir
The admin_token isn't an identity plugin. Put it in base _plugins dir.
This won't affect loading.

Change-Id: I5e8935dafe3dcc01bf8f4f5cf08ab2b7404c5acc
2015-09-02 07:17:26 +10:00
Monty Taylor
f82bb669c6 Mark tenant-name and tenant-id deprecated
In the generic password loader plugin, where you don't know if it's
tenant or project - we still want to indicate that tenant and in fact v2
are the wrong way to think about things anymore.

Change-Id: I7b3d9ba7937c20aa56ba8ade4460e49cf6f8524b
2015-09-01 11:48:27 -04:00
Jamie Lennox
d652305145 Raise error if loader is provided name without id
For v3 if you provide project_name or user_name without the
corresponding id it is going to fail. To get around this OSC and OCC
have been doing pre plugin loading validation checks.

Now that loading is separate from the plugin itself it makes sense that
we can enforce certain requirements on plugin loaders such that only
valid configurations may be loaded.

Change-Id: Ife6ff07214d702d76ce8b1d0e87f60f732aa0230
2015-09-01 13:58:53 +10:00
Jamie Lennox
9a8d4abd1f Provide has_scope_parameters function on plugins
Provide a parameters for testing if scoping options were provided to a
parameter. This will allow for consumers like OSC to provide an early
earning message if the plugin they have loaded has no scoping
parameters and they are trying to make calls against non keystone
services.

Change-Id: I9c2595ac96fc320f4d41622b34f72ca11dc7efcb
2015-09-01 11:30:18 +10:00
Jamie Lennox
b88af415a6 Remove deprecated options from identity base plugin
These parameters should be handled by subclasses if required. I thought
I had fixed this already.

Change-Id: Ic4470b665e5e8b4aac944d191a81505883f3971f
2015-09-01 11:22:22 +10:00
Jamie Lennox
a6749ed5c0 get_available_loaders should return loader object
get_available_loaders is a way to fetch all loader objects on a system
so that something like OSC can enumerate them without having to copy the
stevedore entry point.

Now that loaders are objects and not the plugin classes themselves we
should return the loader objects.

Change-Id: I6592c78a80f77f307e7940c5f1b71767f7b59842
2015-09-01 11:08:24 +10:00
Jamie Lennox
5958739cb9 Change option requirement testing
Change options requirement testing so that it is performed on the base
load_from_options method. This will mean it gets shared between all
loading mechanisms.

I removed the verify_auth function because it is a bit too specific to
the OSC/OCC case. auth_type is not something that is part of
keystoneauth. I also modified the exception as it should no longer take
the plugin name as this would be knowledge any calling function has.

OSC/OCC could use this function to implement a higher level error
message, but I think it should be keystoneauth's responsibility to
validate auth plugins and they should just offload the options.

Change-Id: I1531b95562382e955fab44d01e7ba705d26d352f
2015-09-01 10:55:46 +10:00
Jamie Lennox
ae24552d41 Better isolate loading tests
The loading tests still relied upon some base classes from the auth/
test area that were no longer being used over there. Move them into
there own loading.utils file.

Change-Id: Iee31f49b292018dc0c37621aac3a267680f3e31c
2015-09-01 10:39:47 +10:00
Doug Fish
cd34246865 Update k2k plugin with related code comments
While completing review https://review.openstack.org/#/c/207585
several issues were noted that apply equally to this plugin.
It's important that the ksa and ksc versions of this plugin remain
in sync.

This patch addresses the following issues:
- don't use str()
- clarify what the sp id is
- include docstrings where appropriate
- don't define a new constant for 302

bp k2k-auth-plugin

Change-Id: Ic86d6a62af53005790f637a3b572b6a19350182b
2015-08-31 20:26:46 +00:00
Jamie Lennox
dcea6b89ee Remove plugin.load_from_conf_options and argparse
The intention with putting load_from_conf_options and
load_form_argparse_arguments on the plugin object was so that a plugin
could specify refinements for how you load from CLI or similar. This was
ok whilst keystoneauth/keystoneclient controlled all the loading
mechanisms but with openstack-client-config this scheme wouldn't work.

Remove the methods from the classes (keep the methods a user would use)
until we can figure out a more extensible way for a plugin to specify
loading refinements.

Change-Id: I13c3fc2819f95cb95de5e7e8ba9f0a055d69ebf1
2015-08-28 09:48:58 +10:00
Jamie Lennox
02786d67a0 Give easy entry points for session loading
Session loading is a bit more complicated than plugins because people
like OSC override it. We still want the loader class but for most cases
we just want to use standard methods so we provide both.

Move from passing to base load_from_argparse_arguments and
load_from_conf_options as these are going away.

Change-Id: I7fb0d4977b97b3c0c1745b634c2c8827a863a7da
2015-08-28 09:45:39 +10:00
OpenStack Proposal Bot
91add7bafd Updated from global requirements
Change-Id: I8d6655c54d9b16425976ea1a64091cc34a137e23
2015-08-27 04:14:54 +00:00
Jenkins
34368ade9b Merge "Fix plugin loading tests" 2015-08-25 21:59:46 +00:00
Jenkins
4bfed15a8b Merge "Fix v2 plugin loaders to not have V2 prefix" 2015-08-25 05:37:42 +00:00
Jamie Lennox
8863d1709b Fix plugin loading tests
The plugin loading tests weren't being run because there was no
__init__.py in the loading folder. Add the file and fix the test
breakages that we have otherwise missed.

Change-Id: If5aae690774c47794b5ba3af91878d9fcfacacb6
2015-08-25 12:17:37 +10:00
TerryHowe
36ef23591d Keep a consistent logger name for keystoneauth
As keystoneauth comes out with new releases, it would be
convenient if the logger name did not change.

Change-Id: Ica4102db27fa6cd2a3eaa1dac647abe02b4543a2
2015-08-24 18:16:33 -07:00
Jamie Lennox
d6e033d7e1 Fix v2 plugin loaders to not have V2 prefix
The v2 prefix is implied by the file they are in and this is the name
that is referenced from the setup.cfg entrypoint.

Change-Id: I40723f4639be4a14d9c72fb7e1836bcb80b9b967
2015-08-25 10:07:59 +10:00
Jenkins
f1cdb20528 Merge "Do not log binary data during debug" 2015-08-24 20:16:56 +00:00
Jenkins
505af7a61b Merge "Move session loading into loading module" 2015-08-24 18:51:22 +00:00
Jenkins
8649e298e9 Merge "Port in the argument scrubbing from OCC" 2015-08-24 18:33:33 +00:00
Jenkins
1bf0da9b3e Merge "Rename the actual plugin class to AdminToken" 2015-08-24 18:30:43 +00:00
TerryHowe
9b994205a8 Do not log binary data during debug
Do not log binary data during debug logging of a session.
Replace the binary data with the string <binary_data> instead.

Change-Id: I5184002f3a21c5e0ee510b21b9a7884c8dccd1e3
2015-08-18 17:23:16 -06:00
TerryHowe
6be3ae70cd Clean up exception messages
In https://review.openstack.org/#/c/212670/ there was some
discussion about cleaning up these exception messages.  Here
it is.

Change-Id: I6bf1d7351f5fd90451f6d0d7c7e2575e584cbc62
2015-08-18 12:18:03 -06:00
Jenkins
b27489d40b Merge "Add required property to Opt class" 2015-08-17 20:25:20 +00:00
Monty Taylor
2a80dc5f10 Port in the argument scrubbing from OCC
Processing a parameter dict and extracting the declared parameters for
the given auth plugin is clearly in the problem domain of keystoneauth.
It's also just simple data transformations. Move it here.

Change-Id: I6da32fee4061ab31207cb06503ec78bb45629fb2
2015-08-17 15:57:05 +00:00